#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 , 6 years ago
| Attachment: | 18534.ConcurrentHashMap.patch added |
|---|
comment:1 by , 6 years ago
| Description: | modified (diff) |
|---|
comment:2 by , 6 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 , 6 years ago
| Component: | Applet → Core Webstart |
|---|
comment:4 by , 6 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:
Index: josm.jnlp =================================================================== --- josm.jnlp (revision 15660) +++ josm.jnlp (working copy) @@ -1,16 +1,17 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE jnlp PUBLIC "-//Sun Microsystems, Inc//DTD JNLP Descriptor 6.0//EN" "http://java.sun.com/dtd/JNLP-6.0.dtd"> -<jnlp spec="6.0+" codebase="https://josm.openstreetmap.de/download/" href="josm.jnlp"> +<jnlp spec="6.0+" codebase="./" href="josm.jnlp"> <information> <title>JOSM</title> - <vendor>OpenStreetMap</vendor> - <homepage href="https://josm.openstreetmap.de"/> + <vendor>OpenStreetMap</vendor> + <homepage href="https://josm.openstreetmap.de"/> <description>Java OpenStreetMap editor</description> <description kind="one-line">JOSM</description> <description kind="tooltip">JOSM</description> <icon href="https://josm.openstreetmap.de/logo.png" width="256" height="256"/> - <icon href="https://josm.openstreetmap.de/logo64.png" width="64" height="64" kind="shortcut"/> + <icon href="https://josm.openstreetmap.de/logo64.png" width="64" height="64" kind="shortcut"/> <offline-allowed/> + <association mime-type="application/xml application/json" extensions="geojson osm"/> <shortcut> <desktop/> <menu/> @@ -20,9 +21,11 @@ <all-permissions/> </security> <resources> - <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"/> - <jar href="josm-tested.jar"/> + <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"/> + <jar href="dist/josm-custom.jar"/> <property name="java.util.Arrays.useLegacyMergeSort" value="true"/> </resources> - <application-desc main-class="org.openstreetmap.josm.gui.MainApplication"/> + <application-desc main-class="org.openstreetmap.josm.gui.MainApplication"> + </application-desc> </jnlp>
comment:5 by , 6 years ago
| Milestone: | → 20.01 |
|---|
comment:9 by , 6 years ago
| Component: | Core Webstart → Core imagery |
|---|



Using a ConcurrentHashMap