Modify

Opened 2 weeks ago

Closed 4 days ago

#20345 closed defect (fixed)

Corrupted GeoPropertyIndex due to wrong rounding?

Reported by: anonymous Owned by: team
Priority: normal Milestone:
Component: Core Version:
Keywords: template_report geo index rounding Cc:

Description (last modified by Don-vip)

What steps will reproduce the problem?

  1. Tried to add a line and it crashed

What is the expected result?

What happens instead?

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

URL:https://josm.openstreetmap.de/svn/trunk
Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
Last:Changed Date: 2020-12-28 22:03:23 +0100 (Mon, 28 Dec 2020)
Build-Date:2020-12-30 02:30:55
Revision:17428
Relative:URL: ^/trunk

Identification: JOSM/1.5 (17428 en) Mac OS X 10.15.7
OS Build number: Mac OS X 10.15.7 (19H114)
Memory Usage: 981 MB / 3641 MB (252 MB allocated, but free)
Java version: 1.8.0_201-b09, Oracle Corporation, Java HotSpot(TM) 64-Bit Server VM
Look and Feel: javax.swing.plaf.metal.MetalLookAndFeel
Screen: Display 722471061 2560×1600 (scaling 1.00×1.00) Display 69733382 1680×1050 (scaling 1.00×1.00)
Maximum Screen Size: 2560×1600
Best cursor sizes: 16×16→16×16, 32×32→32×32
Dataset consistency test: No problems found

Plugins:
+ ImportImagePlugin (35567)
+ apache-commons (35524)
+ apache-http (35589)
+ buildings_tools (35669)
+ ejml (35458)
+ geotools (35458)
+ jna (35662)
+ jts (35458)
+ log4j (35458)
+ mapwithai-dev (1.7.1.1-14-g9942dcd)
+ measurement (35640)
+ reltoolbox (35640)
+ reverter (35640)
+ undelete (35640)
+ utilsplugin2 (35674)

Tagging presets:
+ ${HOME}/Downloads/FB_presets (1).xml

Map paint styles:
- ${HOME}/Downloads/FBedits (1).mapcss
- ${HOME}/Downloads/rainbow_roads (1).mapcss
- ${HOME}/Downloads/feature_age_style.mapcss
- ${HOME}/Downloads/feature_owner_style.mapcss
- ${HOME}/Downloads/FB_style (6).mapcss
- https://josm.openstreetmap.de/josmfile?page=Styles/MapWithAI&zip=1
- ${HOME}/Downloads/landcover_style.mapcss

Validator rules:
+ ${HOME}/Downloads/FB_rules5.14.validator.mapcss

Last errors/warnings:
- 00003.600 W: Update plugins - You updated your JOSM software. To prevent problems the plugins should be updated as well.  Update plugins now?
- 00013.987 E: Skipping to the next rule, because of an error:
- 00013.988 E: org.openstreetmap.josm.gui.mappaint.mapcss.parsergen.ParseException: Encountered " "{" "{ "" at line 18, column 130.
- 00015.331 E: Failed to locate image 'MapWithAI'
- 12344.008 E: Handled by bug report queue: java.lang.AssertionError. Cause: java.lang.AssertionError: Point LatLon[lat=30.751277776257815,lon=119.53124999999997] should be inside [ x: 119.53125 -> 120.9375, y: 30.234375 -> 30.9375 ]
- 12401.541 E: Handled by bug report queue: java.lang.AssertionError. Cause: java.lang.AssertionError: Point LatLon[lat=30.44820247981697,lon=119.53124999999997] should be inside [ x: 119.53125 -> 120.9375, y: 30.234375 -> 30.9375 ]
- 12401.591 E: Handled by bug report queue: java.lang.AssertionError: Point LatLon[lat=30.44820247981697,lon=119.53124999999997] should be inside [ x: 119.53125 -> 120.9375, y: 30.234375 -> 30.9375 ]
- 13940.153 E: Handled by bug report queue: java.lang.AssertionError: Point LatLon[lat=30.580878544754302,lon=119.53124999999997] should be inside [ x: 119.53125 -> 120.9375, y: 30.234375 -> 30.9375 ]
- 13940.201 E: Handled by bug report queue: java.lang.AssertionError. Cause: java.lang.AssertionError: Point LatLon[lat=30.580878544754302,lon=119.53124999999997] should be inside [ x: 119.53125 -> 120.9375, y: 30.234375 -> 30.9375 ]



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

Warning issued by: BugReportExceptionHandler#handleException

=== STACK TRACE ===
Thread: AWT-EventQueue-0 (19) of main
java.lang.AssertionError: Point LatLon[lat=30.580878544754302,lon=119.53124999999997] should be inside [ x: 119.53125 -> 120.9375, y: 30.234375 -> 30.9375 ]
	at org.openstreetmap.josm.tools.GeoPropertyIndex$GPLevel.getBounded(GeoPropertyIndex.java:102)
	at org.openstreetmap.josm.tools.GeoPropertyIndex$GPLevel.getBounded(GeoPropertyIndex.java:148)
	at org.openstreetmap.josm.tools.GeoPropertyIndex$GPLevel.get(GeoPropertyIndex.java:94)
	at org.openstreetmap.josm.tools.GeoPropertyIndex$GPLevel.get(GeoPropertyIndex.java:96)
	at org.openstreetmap.josm.tools.GeoPropertyIndex.get(GeoPropertyIndex.java:49)
	at org.openstreetmap.josm.tools.Territories.lambda$getRegionalTaginfoUrls$4(Territories.java:237)
	at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:174)
	at java.util.HashMap$EntrySpliterator.forEachRemaining(HashMap.java:1699)
	at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
	at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
	at java.util.stream.StreamSpliterators$WrappingSpliterator.forEachRemaining(StreamSpliterators.java:312)
	at java.util.stream.StreamSpliterators$DistinctSpliterator.forEachRemaining(StreamSpliterators.java:1286)
	at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
	at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
	at java.util.stream.ReduceOps$ReduceTask.doLeaf(ReduceOps.java:747)
	at java.util.stream.ReduceOps$ReduceTask.doLeaf(ReduceOps.java:721)
	at java.util.stream.AbstractTask.compute(AbstractTask.java:316)
	at java.util.concurrent.CountedCompleter.exec(CountedCompleter.java:731)
	at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
	at java.util.concurrent.ForkJoinPool.helpComplete(ForkJoinPool.java:1870)
	at java.util.concurrent.ForkJoinPool.externalHelpComplete(ForkJoinPool.java:2467)
	at java.util.concurrent.ForkJoinTask.externalAwaitDone(ForkJoinTask.java:324)
	at java.util.concurrent.ForkJoinTask.doInvoke(ForkJoinTask.java:405)
	at java.util.concurrent.ForkJoinTask.invoke(ForkJoinTask.java:734)
	at java.util.stream.ReduceOps$ReduceOp.evaluateParallel(ReduceOps.java:714)
	at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:233)
	at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499)
	at org.openstreetmap.josm.tools.Territories.getRegionalTaginfoUrls(Territories.java:242)
	at org.openstreetmap.josm.gui.dialogs.properties.PropertiesDialog.setupTaginfoNationalActions(PropertiesDialog.java:382)
	at org.openstreetmap.josm.gui.dialogs.properties.PropertiesDialog.selectionChanged(PropertiesDialog.java:729)
	at org.openstreetmap.josm.data.osm.event.SelectionEventManager$DataListenerInfo.fire(SelectionEventManager.java:57)
	at org.openstreetmap.josm.data.osm.event.SelectionEventManager.fireEvent(SelectionEventManager.java:159)
	at org.openstreetmap.josm.data.osm.event.SelectionEventManager.lambda$selectionChanged$0(SelectionEventManager.java:150)
	at org.openstreetmap.josm.gui.util.GuiHelper.runInEDTAndWaitWithException(GuiHelper.java:246)
	at org.openstreetmap.josm.data.osm.event.SelectionEventManager.selectionChanged(SelectionEventManager.java:150)
	at org.openstreetmap.josm.data.osm.DataSet.lambda$doSelectionChange$13(DataSet.java:728)
	at org.openstreetmap.josm.tools.ListenerList.fireEvent(ListenerList.java:155)
	at org.openstreetmap.josm.data.osm.DataSet.doSelectionChange(DataSet.java:728)
	at org.openstreetmap.josm.data.osm.DataSet.setSelected(DataSet.java:659)
	at org.openstreetmap.josm.data.osm.DataSet.setSelected(DataSet.java:650)
	at org.openstreetmap.josm.actions.mapmode.DrawAction.setSelection(DrawAction.java:267)
	at org.openstreetmap.josm.actions.mapmode.DrawAction.mouseReleased(DrawAction.java:656)
	at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:290)
	at java.awt.Component.processMouseEvent(Component.java:6539)
	at javax.swing.JComponent.processMouseEvent(JComponent.java:3324)
	at java.awt.Component.processEvent(Component.java:6304)
	at java.awt.Container.processEvent(Container.java:2239)
	at java.awt.Component.dispatchEventImpl(Component.java:4889)
	at java.awt.Container.dispatchEventImpl(Container.java:2297)
	at java.awt.Component.dispatchEvent(Component.java:4711)
	at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4904)
	at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4535)
	at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4476)
	at java.awt.Container.dispatchEventImpl(Container.java:2283)
	at java.awt.Window.dispatchEventImpl(Window.java:2746)
	at java.awt.Component.dispatchEvent(Component.java:4711)
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:760)
	at java.awt.EventQueue.access$500(EventQueue.java:97)
	at java.awt.EventQueue$3.run(EventQueue.java:709)
	at java.awt.EventQueue$3.run(EventQueue.java:703)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:84)
	at java.awt.EventQueue$4.run(EventQueue.java:733)
	at java.awt.EventQueue$4.run(EventQueue.java:731)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:730)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

Attachments (1)

20345.patch (5.0 KB) - added by GerdP 11 days ago.
possible solution, needs cleanup if OK

Download all attachments as: .zip

Change History (11)

comment:1 Changed 2 weeks ago by Don-vip

In 17442/josm:

see #20345 - add unit test

comment:2 Changed 2 weeks ago by Don-vip

Description: modified (diff)
Keywords: geo index rounding added
Summary: Tried to add a line and it crashedCorrupted GeoPropertyIndex due to wrong rounding?

comment:3 Changed 2 weeks ago by GerdP

I can reproduce this error when I try to create a node at 30.580878544754302,119.53124999999997

Changed 11 days ago by GerdP

Attachment: 20345.patch added

possible solution, needs cleanup if OK

comment:4 Changed 11 days ago by GerdP

I think you cannot use method index(), there will always be edge cases where this methd returns a value which doesn't match the calculated bbox. I've never seen a quadtree implementation without the loop to search the right child.

comment:5 Changed 7 days ago by Don-vip

Does it have a performance cost?

comment:6 Changed 7 days ago by GerdP

I didn't notice any, but maybe it depends on the area you are mapping. Anyway, as long as we deal with doubles I see no alternative to the search loop. Maybe it would be faster to allocate all children. I think the memory consumption wouldn't increase much.

comment:7 Changed 4 days ago by GerdP

Ticket #20397 has been marked as a duplicate of this ticket.

comment:8 Changed 4 days ago by GerdP

@Vincent: What do you think?

comment:9 Changed 4 days ago by Don-vip

If it solves the bug, let's go! :)

comment:10 Changed 4 days ago by GerdP

Resolution: fixed
Status: newclosed

In 17465/josm:

fix #20345: Corrupted GeoPropertyIndex due to wrong rounding?

  • remove method index(), iterate over real BBox instances instead to avoid edge cases

Modify Ticket

Change Properties
Set your email in Preferences
Action
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.