#18534 closed defect (fixed)
[Patch] Some locations cause JOSM jnlp to freeze when opening the `Imagery` menu
Reported by: | taylor.smock | Owned by: | team |
---|---|---|---|
Priority: | normal | Milestone: | 20.01 |
Component: | Core imagery | Version: | latest |
Keywords: | jnlp, imagery | Cc: |
Description (last modified by )
This may be Mac OS X only. Also appears to occur on Fedora 31 (there is a pop up security warning, probably related to #18390). Same symptoms (except for the spinning pinwheel of death).
The issue appears to be on source:trunk/src/org/openstreetmap/josm/tools/ImageProvider.java#L858 -- cache remains locked by another thread indefinitely.
Is there a reason why we aren't using java.util.concurrent.ConcurrentHashMap
instead of java.util.HashMap
? Or an actual lock object? I know I've gotten warnings from some lint tools about using synchronized (map)
in the past.
Alternatively, we could just wrap it in a Collections.synchronizedMap
.
Please note that I have not tested it yet -- I need to figure out how to run a jnlp
from a local source. I may end up having to spin up a server for it.
Steps to reproduce:
1) Start josm.jnlp (josm-latest.jnlp works as well)
2) 'http://localhost:8111/load_and_zoom?left=-47.8898656&bottom=-15.8114964&right=-47.8875375&top=-15.8092976' is the test area
3) Open Imagery
menu
Attachments (2)
Change History (11)
by , 5 years ago
Attachment: | 18534.ConcurrentHashMap.patch added |
---|
comment:1 by , 5 years ago
Description: | modified (diff) |
---|
comment:2 by , 5 years ago
Well, I'm having issues with Java 8 security (whitelisting localhost url's doesn't seem to be doing anything).
I'll try again on another machine.
comment:3 by , 5 years ago
Component: | Applet → Core Webstart |
---|
comment:4 by , 5 years ago
Description: | modified (diff) |
---|---|
Summary: | [Possible Patch] Some locations cause JOSM jnlp to freeze when opening the `Imagery` menu → [Patch] Some locations cause JOSM jnlp to freeze when opening the `Imagery` menu |
Both patches fix the problem, tested using Fedora 31 (it also froze when opening the imagery menu).
So its pretty much up to personal preferences as to which patch is better.
josm.jnlp
diff, since webstart does odd things sometimes:
-
josm.jnlp
1 1 <?xml version="1.0" encoding="UTF-8"?> 2 2 <!DOCTYPE jnlp PUBLIC "-//Sun Microsystems, Inc//DTD JNLP Descriptor 6.0//EN" "http://java.sun.com/dtd/JNLP-6.0.dtd"> 3 <jnlp spec="6.0+" codebase=" https://josm.openstreetmap.de/download/" href="josm.jnlp">3 <jnlp spec="6.0+" codebase="./" href="josm.jnlp"> 4 4 <information> 5 5 <title>JOSM</title> 6 <vendor>OpenStreetMap</vendor> 7 <homepage href="https://josm.openstreetmap.de"/> 6 <vendor>OpenStreetMap</vendor> 7 <homepage href="https://josm.openstreetmap.de"/> 8 8 <description>Java OpenStreetMap editor</description> 9 9 <description kind="one-line">JOSM</description> 10 10 <description kind="tooltip">JOSM</description> 11 11 <icon href="https://josm.openstreetmap.de/logo.png" width="256" height="256"/> 12 <icon href="https://josm.openstreetmap.de/logo64.png" width="64" height="64" kind="shortcut"/> 12 <icon href="https://josm.openstreetmap.de/logo64.png" width="64" height="64" kind="shortcut"/> 13 13 <offline-allowed/> 14 <association mime-type="application/xml application/json" extensions="geojson osm"/> 14 15 <shortcut> 15 16 <desktop/> 16 17 <menu/> … … 20 21 <all-permissions/> 21 22 </security> 22 23 <resources> 23 <java version="1.8+" max-heap-size=" 2048m" java-vm-args="--add-modules=java.scripting,java.sql --add-exports=java.desktop/com.apple.eawt=ALL-UNNAMED --add-exports=java.desktop/com.sun.imageio.spi=ALL-UNNAMED --add-exports=java.desktop/com.sun.imageio.plugins.jpeg=ALL-UNNAMED --add-exports=javafx.graphics/com.sun.javafx.application=ALL-UNNAMED --add-exports=jdk.deploy/com.sun.deploy.config=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.nio=ALL-UNNAMED --add-opens=java.base/jdk.internal.loader=ALL-UNNAMED --add-opens=java.base/jdk.internal.ref=ALL-UNNAMED --add-opens=java.desktop/javax.imageio.spi=ALL-UNNAMED --add-opens=java.desktop/javax.swing.text.html=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED"/>24 <jar href="josm-tested.jar"/>24 <java version="1.8+" max-heap-size="4096m" java-vm-args="--add-modules=java.scripting,java.sql --add-exports=java.desktop/com.apple.eawt=ALL-UNNAMED --add-exports=java.desktop/com.sun.imageio.spi=ALL-UNNAMED --add-exports=java.desktop/com.sun.imageio.plugins.jpeg=ALL-UNNAMED --add-exports=javafx.graphics/com.sun.javafx.application=ALL-UNNAMED --add-exports=jdk.deploy/com.sun.deploy.config=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.nio=ALL-UNNAMED --add-opens=java.base/jdk.internal.loader=ALL-UNNAMED --add-opens=java.base/jdk.internal.ref=ALL-UNNAMED --add-opens=java.desktop/javax.imageio.spi=ALL-UNNAMED --add-opens=java.desktop/javax.swing.text.html=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED"/> 25 <jar href="dist/josm-custom.jar"/> 25 26 <property name="java.util.Arrays.useLegacyMergeSort" value="true"/> 26 27 </resources> 27 <application-desc main-class="org.openstreetmap.josm.gui.MainApplication"/> 28 <application-desc main-class="org.openstreetmap.josm.gui.MainApplication"> 29 </application-desc> 28 30 </jnlp>
comment:5 by , 5 years ago
Milestone: | → 20.01 |
---|
comment:9 by , 5 years ago
Component: | Core Webstart → Core imagery |
---|
Using a ConcurrentHashMap