Opened 8 years ago

Closed 8 years ago

#13095 closed defect (fixed)

Exception on closing layers

Reported by: mdk Owned by: team
Priority: critical Milestone: 16.06
Component: Core Version: latest
Keywords: template_report regression gsoc-core autoscale Cc: michael2402


What steps will reproduce the problem?

  1. Download an area (something which cause validator warnings?)
  2. Add Bing aereal imagery layer
  3. Validate (add validation layer)
  4. Remove Bing layer
  5. Remove Data layer

What is the expected result?

All layers are closed. No Exception, just showing the start page with news.

What happens instead?


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

Afterwards the application has to be restarted, because other operations (like new download) cause other execptions in Plugins etc.

Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
Last:Changed Date: 2016-06-30 20:43:22 +0200 (Thu, 30 Jun 2016)
Build-Date:2016-07-01 01:33:37
Relative:URL: ^/trunk

Identification: JOSM/1.5 (10504 en) Linux Ubuntu 15.10
Memory Usage: 422 MB / 876 MB (106 MB allocated, but free)
Java version: 1.8.0_91-8u91-b14-0ubuntu4~15.10.1-b14, Oracle Corporation, OpenJDK Server VM
VM arguments: [-Djosm.restart=true, -Djosm.home=<josm.pref>,]
Dataset consistency test: No problems found

- ColumbusCSV (32292)
- FastDraw (32158)
- HouseNumberTaggingTool (31926)
- Mapillary (32396)
- OpeningHoursEditor (32158)
- RoadSigns (32177)
- apache-commons (32158)
- apache-http (32158)
- buildings_tools (32158)
- contourmerge (1014)
- imagery-xml-bounds (32287)
- imagery_offset_db (32158)
- pbf (32290)
- poly (32287)
- public_transport (32158)
- reltoolbox (32158)
- reverter (32158)
- terracer (32158)
- turnlanes (32158)
- turnrestrictions (32386)
- utilsplugin2 (32158)

Tagging presets:

Map paint styles:

Last errors/warnings:
- W: Attribution is not loaded yet
- W: Attribution is not loaded yet
- W: Attribution is not loaded yet
- W: Attribution is not loaded yet
- W: Attribution is not loaded yet
- W: Attribution is not loaded yet
- W: Attribution is not loaded yet
- W: Some of the key listeners forgot to remove themselves: [org.openstreetmap.josm.actions.mapmode.SelectAction@14d9fbf]
- W: Some of the key modifier listeners forgot to remove themselves: [org.openstreetmap.josm.actions.mapmode.SelectAction@14d9fbf]
- E: java.lang.IllegalStateException: Dialog not created yet. Invoke createInstance() first

java.lang.IllegalStateException: Dialog not created yet. Invoke createInstance() first
	at org.openstreetmap.josm.gui.dialogs.LayerListDialog.getInstance(
	at org.openstreetmap.josm.actions.AutoScaleAction.getFirstSelectedLayer(
	at org.openstreetmap.josm.actions.AutoScaleAction.updateEnabledState(
	at org.openstreetmap.josm.actions.AutoScaleAction$MapFrameAdapter.mapFrameInitialized(
	at org.openstreetmap.josm.gui.MainPanel.updateContent(
	at org.openstreetmap.josm.gui.MainPanel$1$
	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(

Attachments (2)

patch-mapview-add-layer-presence-event.patch (8.4 KB ) - added by michael2402 8 years ago.
patch-fix-13095.patch (9.2 KB ) - added by michael2402 8 years ago.

Download all attachments as: .zip

Change History (8)

comment:1 by mdk, 8 years ago

Perhaps an importand detail:
When I download data, I also download "Raw GPS data", but not "Notes". So I get two layers. Sometimes the GPS layer is automatically closed, when I close the data layser (as described above), and sometimes the GPS layer remains. Then the exception occurs after closing this last layer.

comment:2 by Don-vip, 8 years ago

Cc: michael2402 added
Keywords: regression gsoc-core added
Milestone: 16.06
Priority: majorcritical

comment:3 by michael2402, 8 years ago

Keywords: autoscale added

comment:4 by michael2402, 8 years ago

Ignore that patch, it does not really solve the problem, so I'd say we keep it for 16.07: #13078

Last edited 8 years ago by michael2402 (previous) (diff)

comment:5 by michael2402, 8 years ago

I traced down the problem. Steps to reproduce:

  • Add data layer
  • validate
  • Remove that data layer

The problems are:

  • The validator layer is removed twice. Once by OsmValidator and once by ValidatorLayer
  • The validation layer calls remove(layer) inside an other remove listener. So half of the layers first get the remove event of Layer 1, then Layer 2. The rest gets them the other way around. This may cause race conditions with the removal and the active layer listeners.


  • Delete the OsmValidator listener code
  • Remove the next layer after the current one was deleted.

by michael2402, 8 years ago

Attachment: patch-fix-13095.patch added

comment:6 by Don-vip, 8 years ago

Resolution: fixed
Status: newclosed

In 10507/josm:

fix #13095 - Exception on closing layers (patch by michael2402) - gsoc-core

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. Next status will be 'reopened'.

Add Comment

E-mail address and name can be saved in the Preferences .
Note: See TracTickets for help on using tickets.