Modify

Opened 5 years ago

Closed 5 years ago

#16875 closed defect (fixed)

Crash after using fix duplicated nodes + multiple undo

Reported by: GerdP Owned by: Don-vip
Priority: major Milestone: 18.10
Component: Core Version:
Keywords: template_report undo regression command stack Cc:

Description

What steps will reproduce the problem?

  1. Start new Data Layer
  2. Draw a rectangular closed Way and tag it building=yes
  3. Press Ctrl+C to copy
  4. Press Ctrl+Alt+V (paste at source position)
  5. Press Esc
  6. Run Validator, this should report 4 errors: Building duplicated nodes (4)
  7. Click on Fix
  8. Press Ctrl+Z several times until this crash happens

What is the expected result?

No crash, an empty data layer

What happens instead?

Part of a way is still existing

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

I've noticed similar crashes and incomplete undo actions while editing real data, now I was able to reproduce it with this rather simple set of actions.

URL:https://josm.openstreetmap.de/svn/trunk
Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
Last:Changed Date: 2018-10-01 23:59:36 +0200 (Mon, 01 Oct 2018)
Build-Date:2018-10-01 22:08:47
Revision:14289
Relative:URL: ^/trunk

Identification: JOSM/1.5 (14289 en) Windows 10 64-Bit
OS Build number: Windows 10 Home 1803 (17134)
Memory Usage: 2187 MB / 5461 MB (1666 MB allocated, but free)
Java version: 1.8.0_191-b12, Oracle Corporation, Java HotSpot(TM) 64-Bit Server VM
Screen: \Display0 1920x1080
Maximum Screen Size: 1920x1080
Dataset consistency test: No problems found

Plugins:
+ OpeningHoursEditor (34535)
+ apache-commons (34506)
+ buildings_tools (34572)
+ download_along (34503)
+ ejml (34389)
+ geotools (34513)
+ jts (34524)
+ measurement (34529)
+ merge-overlap (34664)
+ o5m (34405)
+ opendata (34675)
+ pbf (34576)
+ poly (34546)
+ reverter (34552)
+ undelete (34568)
+ utilsplugin2 (34506)

Last errors/warnings:
- W: java.io.IOException: Attribution is not loaded yet
- W: java.io.IOException: Attribution is not loaded yet
- E: org.openstreetmap.josm.io.OsmApiException: ResponseCode=400, Error Header=<You requested too many nodes (limit is 50000). Either request a smaller area, or use planet.osm>
- E: Bad Request - <html>The OSM server 'api.openstreetmap.org' reported a bad request.<br><br>The area you tried to download is too big or your request was too large.<br>Either request a smaller area or use an export file provided by the OSM community.</html>
- E: org.openstreetmap.josm.io.OsmApiException: ResponseCode=400, Error Header=<You requested too many nodes (limit is 50000). Either request a smaller area, or use planet.osm>
- E: Bad Request - <html>The OSM server 'api.openstreetmap.org' reported a bad request.<br><br>The area you tried to download is too big or your request was too large.<br>Either request a smaller area or use an export file provided by the OSM community.</html>
- E: Handled by bug report queue: java.lang.ArrayIndexOutOfBoundsException: -1
- E: Handled by bug report queue: java.lang.ArrayIndexOutOfBoundsException
- E: Handled by bug report queue: java.lang.ArrayIndexOutOfBoundsException
- E: Handled by bug report queue: java.lang.ArrayIndexOutOfBoundsException


=== REPORTED CRASH DATA ===
BugReportExceptionHandler#handleException:
No data collected.

Warning issued by: BugReportExceptionHandler#handleException

=== STACK TRACE ===
Thread: AWT-EventQueue-0 (17) of main
java.lang.ArrayIndexOutOfBoundsException

Attachments (1)

dupway.osm (1.3 KB ) - added by GerdP 5 years ago.

Download all attachments as: .zip

Change History (10)

by GerdP, 5 years ago

Attachment: dupway.osm added

comment:1 by GerdP, 5 years ago

It's getting worse:
With the attached file dupway.osm I see different results:

  • Open the file and execute Validator

This reports 5 errors (one more for the duplicated way). Select the entry "Building duplicated nodes (4)" and click Fix button
followed by Ctrl+Z to Undo.
This directly leads to a crash report.
I can reproduce that with r14353. Console shows:

2018-10-22 15:16:03.925 SEVERE: Handled by bug report queue: java.lang.ArrayIndexOutOfBoundsException: node has no children
java.lang.ArrayIndexOutOfBoundsException: node has no children

at javax.swing.tree.DefaultMutableTreeNode.getChildAt(Unknown Source)
at org.openstreetmap.josm.gui.dialogs.CommandStackDialog.swapNode(CommandStackDialog.java:396)
at org.openstreetmap.josm.gui.dialogs.CommandStackDialog.commandUndone(CommandStackDialog.java:383)
at org.openstreetmap.josm.data.UndoRedoHandler$CommandUndoneEvent.fire(UndoRedoHandler.java:205)
at java.lang.Iterable.forEach(Unknown Source)
at org.openstreetmap.josm.data.UndoRedoHandler.fireEvent(UndoRedoHandler.java:394)
at org.openstreetmap.josm.data.UndoRedoHandler.lambda$0(UndoRedoHandler.java:344)
at org.openstreetmap.josm.gui.util.GuiHelper.runInEDTAndWait(GuiHelper.java:215)
at org.openstreetmap.josm.data.UndoRedoHandler.undo(UndoRedoHandler.java:334)
at org.openstreetmap.josm.data.UndoRedoHandler.undo(UndoRedoHandler.java:324)
at org.openstreetmap.josm.actions.UndoAction.actionPerformed(UndoAction.java:39)
at javax.swing.SwingUtilities.notifyAction(Unknown Source)
at javax.swing.JComponent.processKeyBinding(Unknown Source)
at javax.swing.KeyboardManager.fireBinding(Unknown Source)
at javax.swing.KeyboardManager.fireKeyboardAction(Unknown Source)
at javax.swing.JComponent.processKeyBindingsForAllComponents(Unknown Source)
at javax.swing.JComponent.processKeyBindings(Unknown Source)
at javax.swing.JComponent.processKeyEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.KeyboardFocusManager.redispatchEvent(Unknown Source)
at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(Unknown Source)
at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(Unknown Source)
at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(Unknown Source)
at java.awt.DefaultKeyboardFocusManager.dispatchEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$500(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)

Version 1, edited 5 years ago by GerdP (previous) (next) (diff)

comment:2 by Don-vip, 5 years ago

Keywords: undo added
Milestone: 18.10

comment:3 by GerdP, 5 years ago

I tried older versions from https://josm.openstreetmap.de/download/Archiv/
r13722 seems to be OK
r13758 already shows this error.
Finally I found that this problem was introduced with r13729.
The problem seems to be that the undo action(s) are added to the command stack, but the corresponding command stack window is not updated. No idea where to fix that.

comment:4 by Don-vip, 5 years ago

Keywords: regression command stack added

comment:5 by Don-vip, 5 years ago

Owner: changed from team to Don-vip
Status: newassigned

comment:6 by Don-vip, 5 years ago

Resolution: fixed
Status: assignedclosed

In 14381/josm:

fix #16875 - command stack dialog was not updated after fixing errors from validator dialog

comment:7 by GerdP, 5 years ago

There is still something wrong here. Try this:
1) Open sample file dupway.osm + run validator
2) Select Building duplicated nodes (4) and click "Fix"
3) Press Ctrl+Z two times
4) Add a new node somewhere else
The new action from 4) is added to the command stack, but the previously "undoned" actions are not removed.
This seems not to depend on the fix action, it also happens during normal edits.

With r13722 I don't see this behaviour.

comment:8 by GerdP, 5 years ago

Resolution: fixed
Status: closedreopened

comment:9 by Don-vip, 5 years ago

Resolution: fixed
Status: reopenedclosed

This is a different problem and less critical, I created #16911 because I won't release a 18.10 hotfix just for this.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Don-vip.
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.