Modify

Opened 10 years ago

Closed 10 years ago

Last modified 5 years ago

#11593 closed defect (fixed)

NPE in mapcss.parsergen.ParseException.initialise blocks JOSM start

Reported by: geofrizz@… Owned by: team
Priority: blocker Milestone: 15.08
Component: Core Version:
Keywords: template_report mapcss npe regression javacc Cc: bastiK, simon04

Description

What steps will reproduce the problem?

  1. When start

What is the expected result?

What happens instead?

It will not start but the process remains up !!

2600 ? S 0:00 \_ /bin/sh /usr/bin/josm-latest
2615 ? Sl 0:16 \_ /usr/lib/jvm/java-7-openjdk-amd64/bin/java -Djosm.restart=true -Djosm.home=/

(from the command: ps)

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

Repository Root: http://josm.openstreetmap.de/svn
Build-Date: 2015-06-22 01:32:14
Last Changed Author: Don-vip
Revision: 8519
Repository UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
Relative URL: ^/trunk
URL: http://josm.openstreetmap.de/svn/trunk
Last Changed Date: 2015-06-21 15:39:45 +0200 (Sun, 21 Jun 2015)
Last Changed Rev: 8519

Identification: JOSM/1.5 (8519 en) Linux Ubuntu 14.04.2 LTS
Memory Usage: 1238 MB / 7282 MB (1143 MB allocated, but free)
Java version: 1.7.0_79, Oracle Corporation, OpenJDK 64-Bit Server VM
Java package: openjdk-7-jre:amd64-7u79-2.5.5-0ubuntu0.14.04.2
VM arguments: [-Djosm.restart=true, -Djosm.home=/home/geofrizz/.josm-latest, -Djava.net.useSystemProxies=true]

Plugins:
- BuildingGeneralization
- FixAddresses
- Mapillary
- buildings_tools
- commons-imaging
- imagery_offset_db
- measurement
- merge-overlap
- namemanager
- pbf
- reltoolbox
- reverter
- tageditor
- todo
- undelete
- utilsplugin2
- waydownloader

Last errors/warnings:
- E: Failed to locate image 'icons/hot_camping.n.24.png'
- W: Could not get presets icon icons/hot_camping.n.24.png
- E: Failed to locate image ''
- W: Could not get presets icon 
- E: java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.NullPointerException. Cause: java.util.concurrent.ExecutionException: java.lang.NullPointerException. Cause: java.lang.NullPointerException

java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.NullPointerException
	at org.openstreetmap.josm.Main.<init>(Main.java:632)
	at org.openstreetmap.josm.gui.MainApplication.<init>(MainApplication.java:90)
	at org.openstreetmap.josm.gui.MainApplication.main(MainApplication.java:445)
Caused by: java.util.concurrent.ExecutionException: java.lang.NullPointerException
	at java.util.concurrent.FutureTask.report(FutureTask.java:122)
	at java.util.concurrent.FutureTask.get(FutureTask.java:188)
	at org.openstreetmap.josm.Main.<init>(Main.java:629)
	... 2 more
Caused by: java.lang.NullPointerException
	at org.openstreetmap.josm.gui.mappaint.mapcss.parsergen.ParseException.initialise(ParseException.java:125)
	at org.openstreetmap.josm.gui.mappaint.mapcss.parsergen.ParseException.<init>(ParseException.java:39)
	at org.openstreetmap.josm.gui.mappaint.mapcss.parsergen.MapCSSParser.generateParseException(MapCSSParser.java:3585)
	at org.openstreetmap.josm.gui.mappaint.mapcss.parsergen.MapCSSParser.error_skipto(MapCSSParser.java:2070)
	at org.openstreetmap.josm.gui.mappaint.mapcss.parsergen.MapCSSParser.sheet(MapCSSParser.java:858)
	at org.openstreetmap.josm.gui.mappaint.mapcss.MapCSSStyleSource.loadStyleSource(MapCSSStyleSource.java:394)
	at org.openstreetmap.josm.gui.mappaint.MapPaintStyles.loadStyleForFirstTime(MapPaintStyles.java:260)
	at org.openstreetmap.josm.gui.mappaint.MapPaintStyles.readFromPreferences(MapPaintStyles.java:253)
	at org.openstreetmap.josm.gui.preferences.map.MapPaintPreference.initialize(MapPaintPreference.java:181)
	at org.openstreetmap.josm.Main$6.initialize(Main.java:614)
	at org.openstreetmap.josm.Main$InitializationTask.call(Main.java:707)
	at org.openstreetmap.josm.Main$InitializationTask.call(Main.java:691)
	at java.util.concurrent.FutureTask.run(FutureTask.java:262)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
	at java.lang.Thread.run(Thread.java:745)

Change History (19)

comment:1 by Don-vip, 10 years ago

Milestone: 15.07
Priority: majorblocker

comment:2 by Don-vip, 10 years ago

Summary: Not start !!NPE in mapcss.parsergen.ParseException.initialise blocks JOSM start

comment:3 by Don-vip, 10 years ago

Cc: bastiK simon04 added
Keywords: mapcss npe added

comment:4 by Don-vip, 10 years ago

Keywords: regression added

comment:5 by Don-vip, 10 years ago

Keywords: javacc added

It looks like JavaCC fails to produce robust code, no?

comment:6 by Don-vip, 10 years ago

In 8521/josm:

see #11593, see #11579 - MapCSS: display mapcss parsing exceptions early in case of later JavaCC exception

comment:7 by bastiK, 10 years ago

@geofrizz: Could you please attach the map style that is causing the error?

in reply to:  7 ; comment:8 by Klumbumbus, 10 years ago

Replying to bastiK:

@geofrizz: Could you please attach the map style that is causing the error?

I suppose it was the "fixme style" (#11579), which is fixed on the server meanwhile but still wrong cached on pc.

in reply to:  8 comment:9 by Don-vip, 10 years ago

Replying to Klumbumbus:

I suppose it was the "fixme style" (#11579), which is fixed on the server meanwhile but still wrong cached on pc.

Yes it's because of this style with "close" or "closes" instead of "closed".
It results in raising a parseexception with token.next == null.
I have no idea how to fix that as it is code produced by javaCC.

Last edited 10 years ago by Don-vip (previous) (diff)

comment:10 by grinapo, 10 years ago

(Just as a workaround for the less javically experienced people out there (like me): I have basically deleted $HOME/.josm/cache and plugins, started JOSM successfully, re-dowloaded plugin list, updated them again, and JOSM was able to start with plugins.)

in reply to:  10 ; comment:11 by Klumbumbus, 10 years ago

Replying to grinapo:

(Just as a workaround for the less javically experienced people out there (like me): I have basically deleted $HOME/.josm/cache and plugins, started JOSM successfully, re-dowloaded plugin list, updated them again, and JOSM was able to start with plugins.)

It should be enough to just delet the file mirror_https___josm.openstreetmap.de_josmfile_page_Styles_Fixme_style in the cache folder (atleast this worked for me)

Last edited 10 years ago by Klumbumbus (previous) (diff)

in reply to:  11 comment:12 by skorbut, 10 years ago

Replying to Klumbumbus:

It should be enough to just delet the file mirror_https___josm.openstreetmap.de_josmfile_page_Styles_Fixme_style in the cache folder (atleast this worked for me)

This worked for me as well.

comment:13 by Don-vip, 10 years ago

I have created a new JavaCC issue: https://java.net/jira/browse/JAVACC-289

comment:14 by Don-vip, 10 years ago

Resolution: fixed
Status: newclosed

In 8539/josm:

fix #11593 - patch locally ParseException.template to fix NPE until https://java.net/jira/browse/JAVACC-289 is fixed
Edit: Fixed in https://java.net/projects/javacc/sources/1357/diff//?rev1=698&rev2=699

comment:15 by Don-vip, 10 years ago

Milestone: 15.0715.08

Milestone renamed

comment:16 by simon04, 5 years ago

Our fix was:

  • TabularUnified templates/ParseException.template

    diff --git a/templates/ParseException.template b/templates/ParseException.template
    index a74185c..5877db2 100644
    a b public class ParseException extends Exception {  
    119119      tok = tok.next;
    120120    }
    121121#if KEEP_LINE_COLUMN
    122     retval += "\" at line " + currentToken.next.beginLine + ", column " + currentToken.next.beginColumn;
     122    if (currentToken.next != null) {
     123        retval += "\" at line " + currentToken.next.beginLine + ", column " + currentToken.next.beginColumn;
     124    }
    123125#fi
    124126    retval += "." + EOL;
    125127   

Problem not patched in https://github.com/javacc/javacc/blob/713f4b574a1068bb64ed0a8e3589c1aa902fc116/src/main/resources/templates/ParseException.template#L122 and resurfaced as #19685 (due to #16860).

Submitted a pull request: https://github.com/javacc/javacc/pull/182

comment:18 by simon04, 5 years ago

In 16908/josm:

fix #19685, see #11593 - Fix NPE in JavaCC ParseException

comment:19 by simon04, 5 years ago

In 16909/josm:

see #19685, see #11593 - Add non-regression test

Add Comment


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