Modify

Opened 13 months ago

Closed 12 months ago

Last modified 12 months ago

#22839 closed defect (fixed)

NPE at AbstractDownloadStrategy.getExisting()

Reported by: gaben Owned by: team
Priority: normal Milestone:
Component: Plugin continuosDownload Version:
Keywords: template_report Cc:

Description

What steps will reproduce the problem?

:(

What is the expected result?

What happens instead?

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

I edited some Overpass output further processed in a Python script then opened in JOSM.

URL:https://josm.openstreetmap.de/svn/trunk
Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
Last:Changed Date: 2023-03-23 18:00:59 +0100 (Thu, 23 Mar 2023)
Build-Date:2023-03-24 02:30:58
Revision:18699
Relative:URL: ^/trunk

Identification: JOSM/1.5 (18699 hu) Windows 10 64-Bit
OS Build number: Windows 10 Pro for Workstations 2009 (19045)
Memory Usage: 1171 MB / 7266 MB (507 MB allocated, but free)
Java version: 1.8.0_361-b09, Oracle Corporation, Java HotSpot(TM) 64-Bit Server VM
Look and Feel: com.sun.java.swing.plaf.windows.WindowsLookAndFeel
Screen: \Display0 1920×1200 (scaling 1.00×1.00)
Maximum Screen Size: 1920×1200
Best cursor sizes: 16×16→32×32, 32×32→32×32
System property file.encoding: Cp1250
System property sun.jnu.encoding: Cp1250
Locale info: hu_HU
Numbers with default locale: 1234567890 -> 1234567890
VM arguments: [-Djava.security.manager, -Djnlp.application.href=https://josm.openstreetmap.de/download/josm-latest.jnlp, -Djava.util.Arrays.useLegacyMergeSort=true, -Djnlp.tk=awt, -Djnlpx.jvm=<java.home>\bin\javaw.exe, -Djnlpx.splashport=56957, -Djnlpx.home=<java.home>\bin, -Djnlpx.remove=false, -Djnlpx.offline=false, -Djnlpx.relaunch=true, -Djnlpx.session.data=%UserProfile%\AppData\Local\Temp\session2672114055966594230, -Djnlpx.heapsize=NULL,NULL, -Djava.security.policy=file:<java.home>\lib\security\javaws.policy, -DtrustProxy=true, -Djnlpx.origFilenameArg=%UserProfile%\AppData\LocalLow\Sun\Java\Deployment\cache\6.0\31\583aa85f-6ec62164]

Plugins:
+ AddrInterpolation (36011)
+ FastDraw (36057)
+ OpeningHoursEditor (35924)
+ apache-commons (36034)
+ buildings_tools (36011)
+ continuosDownload (105)
+ ejml (35924)
+ geotools (36028)
+ gridify (1606242219)
+ jackson (36034)
+ jaxb (35952)
+ jts (36004)
+ opendata (36025)
+ pbf (36034)
+ phonenumber (0.16.1)
+ pt_assistant (2.1.15-19-g9aeec3c-SNAPSHOT)
+ reverter (36043)
+ tageditor (36011)
+ turnlanes-tagging (v0.0.5)
+ utilsplugin2 (36011)
+ wikipedia (605)


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

Warning issued by: BugReportExceptionHandler#handleException

=== STACK TRACE ===
Thread: Timer-0 (99)
java.lang.NullPointerException
	at org.openstreetmap.josm.plugins.continuosDownload.AbstractDownloadStrategy.getExisting(AbstractDownloadStrategy.java:117)
	at org.openstreetmap.josm.plugins.continuosDownload.AbstractDownloadStrategy.fetch(AbstractDownloadStrategy.java:45)
	at org.openstreetmap.josm.plugins.continuosDownload.AbstractDownloadStrategy.fetch(AbstractDownloadStrategy.java:35)
	at org.openstreetmap.josm.plugins.continuosDownload.DownloadPlugin$Task.run(DownloadPlugin.java:221)
	at java.util.TimerThread.mainLoop(Unknown Source)
	at java.util.TimerThread.run(Unknown Source)

Attachments (0)

Change History (5)

comment:1 by taylor.smock, 13 months ago

This seems really odd -- the NPE location is in MainApplication.getMap().mapView.getLayerManager().getLayers(). We cannot be getting the NPE at MainApplication.getMap() or .mapView -- both of those are checked 4 lines above, with !MainApplication.isDisplayingMapView(), and then 2 lines previous with MainApplication.getMap().mapView.getLayerManager().getEditLayer() (which also means that the null value is not from getLayerManager()).

As such, I'm going to guess that this is a race condition, especially since this occurred in a timer thread. Fixing this might be as easy as moving the actual method calls to the worker thread.

comment:2 by gaben, 12 months ago

I received the same stack trace again. What I did is a layer deletion just milliseconds before the plugin fired the download tasks.

Cannot reproduce the bug, so I stand with the race condition suspicion as well.

comment:3 by taylor.smock, 12 months ago

Resolution: fixed
Status: newclosed

The NPE is (hopefully) fixed in 83fccdd9b056c5cfed11d4307ae08a055e0d7215.

comment:4 by gaben, 12 months ago

Thank you!

comment:5 by taylor.smock, 12 months ago

Like I said, it is hopefully fixed. I'm 90% confident it is, since I got rid of a few NPE possibilities. Please reopen this ticket if it happens again.

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. 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.