Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#15668 closed defect (fixed)

Enabling "Viewport Following" causes thread deadlock

Reported by: maripogoda Owned by: team
Priority: major Milestone: 17.12
Component: Core mappaint Version: latest
Keywords: template_report deadlock autofilter regression Cc:

Description (last modified by Don-vip)

What steps will reproduce the problem?

  1. Download map data.
  2. Enable "Viewport Following" (or set "draw.viewport.following=true" in preferences).
  3. Draw some lines. (In my environment, adding 4 to 7 lines is enough.)
  4. Then JOSM freezes. Java thread dumps show detailed report of deadlock.

To reproduce the problem, the area shouldn't be to small. Downloading "139.7730578,35.7083659,139.7770083,35.7118948" is good to reproduce it.

What is the expected result?

JOSM continues working:-)

What happens instead?

JOSM freezes silently. It doesn't accept any input.

Please provide any additional information below. Attach a screenshot if possible.

It seems that no personal configuration or plugin is related to this problem. I could reproduce it just after cleaning JOSM user directory and resetting preferences.

This is a part of the thread dumps. The full output is attached as a file.

Found one Java-level deadlock:
  waiting to lock monitor 0x00007ff75d18a358 (object 0x00000006c02485f0, a java.awt.Component$AWTTreeLock),
  which is held by "AWT-EventQueue-0"
  waiting to lock monitor 0x00007ff75d4e0688 (object 0x00000006c4f857f0, a org.openstreetmap.josm.gui.autofilter.AutoFilterManager),
  which is held by "smooth-scroller"

Java stack information for the threads listed above:
	at java.awt.Container.remove(
	- waiting to lock <0x00000006c02485f0> (a java.awt.Component$AWTTreeLock)
	at org.openstreetmap.josm.gui.autofilter.AutoFilterManager.removeAllButtons(
	at org.openstreetmap.josm.gui.autofilter.AutoFilterManager.updateButtons(
	- locked <0x00000006c4f857f0> (a org.openstreetmap.josm.gui.autofilter.AutoFilterManager)
	at org.openstreetmap.josm.gui.autofilter.AutoFilterManager.zoomChanged(
	at org.openstreetmap.josm.gui.NavigatableComponent.fireZoomChanged(
	at org.openstreetmap.josm.gui.NavigatableComponent.zoomNoUndoTo(
	at org.openstreetmap.josm.gui.NavigatableComponent.zoomTo(
	at org.openstreetmap.josm.gui.NavigatableComponent.zoomTo(
	at org.openstreetmap.josm.gui.NavigatableComponent.zoomTo(
	at org.openstreetmap.josm.gui.NavigatableComponent$
	at org.openstreetmap.josm.gui.autofilter.AutoFilterManager.getCurrentAutoFilter(
	- waiting to lock <0x00000006c4f857f0> (a org.openstreetmap.josm.gui.autofilter.AutoFilterManager)
	at org.openstreetmap.josm.gui.MapView.drawMapContent(
	at org.openstreetmap.josm.gui.MapView.paint(
	at javax.swing.JComponent.paintChildren(
	- locked <0x00000006c02485f0> (a java.awt.Component$AWTTreeLock)
	at javax.swing.JComponent.paint(
	at javax.swing.JComponent.paintToOffscreen(
	at javax.swing.RepaintManager$PaintManager.paintDoubleBuffered(
	at javax.swing.RepaintManager$PaintManager.paint(
	at javax.swing.RepaintManager.paint(
	at javax.swing.JComponent._paintImmediately(
	at javax.swing.JComponent.paintImmediately(
	at javax.swing.RepaintManager$
	at javax.swing.RepaintManager$
	at Method)
	at javax.swing.RepaintManager.paintDirtyRegions(
	at javax.swing.RepaintManager.paintDirtyRegions(
	at javax.swing.RepaintManager.prePaintDirtyRegions(
	at javax.swing.RepaintManager.access$1200(
	at javax.swing.RepaintManager$
	at java.awt.event.InvocationEvent.dispatch(
	at java.awt.EventQueue.dispatchEventImpl(
	at java.awt.EventQueue.access$500(
	at java.awt.EventQueue$
	at java.awt.EventQueue$
	at Method)
	at java.awt.EventQueue.dispatchEvent(
	at java.awt.EventDispatchThread.pumpOneEventForFilters(
	at java.awt.EventDispatchThread.pumpEventsForFilter(
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(
	at java.awt.EventDispatchThread.pumpEvents(
	at java.awt.EventDispatchThread.pumpEvents(

Found 1 deadlock.
Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
Last:Changed Date: 2017-12-12 01:11:39 +0100 (Tue, 12 Dec 2017)
Build-Date:2017-12-12 02:41:40
Relative:URL: ^/trunk

Identification: JOSM/1.5 (13199 en) Mac OS X 10.13
OS Build number: Mac OS X 10.13 (17A405)
Memory Usage: 494 MB / 3641 MB (215 MB allocated, but free)
Java version: 1.8.0_144-b01, Oracle Corporation, Java HotSpot(TM) 64-Bit Server VM
Screen: Display 69732800 1280x800
Maximum Screen Size: 1280x800

+ EasyPresets (1512175382)
+ apache-commons (33668)
+ apache-http (32699)
+ buildings_tools (33735)
+ reverter (33865)

Tagging presets:

Map paint styles:

Last errors/warnings:
- W: Update plugins - org.openstreetmap.josm.plugins.PluginHandler$UpdatePluginsMessagePanel[,0,0,0x0,invalid,layout=java.awt.GridBagLayout,alignmentX=0.0,alignmentY=0.0,border=,flags=9,maximumSize=,minimumSize=,preferredSize=]
- W: No configuration settings found.  Using hardcoded default values for all pools.

Attachments (1)

smooth-scroll-deadlock.txt (51.0 KB) - added by maripogoda 3 years ago.
Original thread dumps

Download all attachments as: .zip

Change History (6)

Changed 3 years ago by maripogoda

Attachment: smooth-scroll-deadlock.txt added

Original thread dumps

comment:1 Changed 3 years ago by Don-vip

Description: modified (diff)
Keywords: deadlock added
Priority: normalmajor

comment:2 Changed 3 years ago by Don-vip

Keywords: autofilter regression added
Milestone: 17.12

comment:3 Changed 3 years ago by Don-vip

Resolution: fixed
Status: newclosed

In 13200/josm:

fix #15668 - make sure zoom change events are always fired in EDT

comment:4 Changed 3 years ago by Don-vip

thanks for reporting the issue!

comment:5 Changed 3 years ago by maripogoda

I built rev 13200 locally and confirmed that the problem was resolved! Thank you for your quick fix!

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain team.
as The resolution will be set.
The resolution will be deleted.

Add Comment

E-mail address and name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.