Random compiling failures

I build maps daily for some 60 countries for my web. Since a couple of months or so, almost every day there are some maps that fail to build with an ArrayIndexOutOfBoundsException. Maps that fail change from one day to the next. I have not been able to reproduce the problem, as failure seems to be random. If I later build any of the maps that failed, even using the same input file, it usually builds fine. Problem doesn't seem to be style related, as it happens (also randomly) with any of the two styles I use for my maps. Error message is as follows: Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 265 at java.lang.Integer.valueOf(Integer.java:831) at uk.me.parabola.imgfmt.app.lbl.LBLFileReader.readPoiInfo(LBLFileReader.java:422) at uk.me.parabola.imgfmt.app.lbl.LBLFileReader.<init>(LBLFileReader.java:75) at uk.me.parabola.mkgmap.combiners.FileInfo.lblInfo(FileInfo.java:326) at uk.me.parabola.mkgmap.combiners.FileInfo.lblInfo(FileInfo.java:313) at uk.me.parabola.mkgmap.combiners.FileInfo.imgInfo(FileInfo.java:259) at uk.me.parabola.mkgmap.combiners.FileInfo.getFileInfo(FileInfo.java:152) at uk.me.parabola.mkgmap.main.Main.endOptions(Main.java:575) at uk.me.parabola.mkgmap.CommandArgsReader.readArgs(CommandArgsReader.java:128) at uk.me.parabola.mkgmap.main.Main.mainStart(Main.java:135) at uk.me.parabola.mkgmap.main.Main.main(Main.java:106) I would need any hint that helps me to reproduce the problem, so that we can debug it.

Hi Carlos, IIRC Minko reported a similar problem and it turned out that he combined img files which were created with an older version of mkgmap with newer ones. Could this happen here, too? For examples img files with elevation data ? If not I think it is more likely to be an I/O problem on your machine. Gerd Carlos Dávila-2 wrote
I build maps daily for some 60 countries for my web. Since a couple of months or so, almost every day there are some maps that fail to build with an ArrayIndexOutOfBoundsException. Maps that fail change from one day to the next. I have not been able to reproduce the problem, as failure seems to be random. If I later build any of the maps that failed, even using the same input file, it usually builds fine. Problem doesn't seem to be style related, as it happens (also randomly) with any of the two styles I use for my maps. Error message is as follows:
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 265 at java.lang.Integer.valueOf(Integer.java:831) at uk.me.parabola.imgfmt.app.lbl.LBLFileReader.readPoiInfo(LBLFileReader.java:422) at uk.me.parabola.imgfmt.app.lbl.LBLFileReader. <init> (LBLFileReader.java:75) at uk.me.parabola.mkgmap.combiners.FileInfo.lblInfo(FileInfo.java:326) at uk.me.parabola.mkgmap.combiners.FileInfo.lblInfo(FileInfo.java:313) at uk.me.parabola.mkgmap.combiners.FileInfo.imgInfo(FileInfo.java:259) at uk.me.parabola.mkgmap.combiners.FileInfo.getFileInfo(FileInfo.java:152) at uk.me.parabola.mkgmap.main.Main.endOptions(Main.java:575) at uk.me.parabola.mkgmap.CommandArgsReader.readArgs(CommandArgsReader.java:128) at uk.me.parabola.mkgmap.main.Main.mainStart(Main.java:135) at uk.me.parabola.mkgmap.main.Main.main(Main.java:106)
I would need any hint that helps me to reproduce the problem, so that we can debug it.
_______________________________________________ mkgmap-dev mailing list
mkgmap-dev@.org
-- View this message in context: http://gis.19327.n8.nabble.com/Random-compiling-failures-tp5885477p5885480.h... Sent from the Mkgmap Development mailing list archive at Nabble.com.

Hi Gerd, thanks for your response. In some cases error occurs while combining old elevation img files with new ones, but in many other cases only recently created img are involved, so it could be I/O problems as you suggest. I'll investigate that route. El 06/11/16 a las 20:33, Gerd Petermann escribió:
Hi Carlos,
IIRC Minko reported a similar problem and it turned out that he combined img files which were created with an older version of mkgmap with newer ones. Could this happen here, too? For examples img files with elevation data ? If not I think it is more likely to be an I/O problem on your machine.
Gerd
Carlos Dávila-2 wrote
I build maps daily for some 60 countries for my web. Since a couple of months or so, almost every day there are some maps that fail to build with an ArrayIndexOutOfBoundsException. Maps that fail change from one day to the next. I have not been able to reproduce the problem, as failure seems to be random. If I later build any of the maps that failed, even using the same input file, it usually builds fine. Problem doesn't seem to be style related, as it happens (also randomly) with any of the two styles I use for my maps. Error message is as follows:
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 265 at java.lang.Integer.valueOf(Integer.java:831) at uk.me.parabola.imgfmt.app.lbl.LBLFileReader.readPoiInfo(LBLFileReader.java:422) at uk.me.parabola.imgfmt.app.lbl.LBLFileReader. <init> (LBLFileReader.java:75) at uk.me.parabola.mkgmap.combiners.FileInfo.lblInfo(FileInfo.java:326) at uk.me.parabola.mkgmap.combiners.FileInfo.lblInfo(FileInfo.java:313) at uk.me.parabola.mkgmap.combiners.FileInfo.imgInfo(FileInfo.java:259) at uk.me.parabola.mkgmap.combiners.FileInfo.getFileInfo(FileInfo.java:152) at uk.me.parabola.mkgmap.main.Main.endOptions(Main.java:575) at uk.me.parabola.mkgmap.CommandArgsReader.readArgs(CommandArgsReader.java:128) at uk.me.parabola.mkgmap.main.Main.mainStart(Main.java:135) at uk.me.parabola.mkgmap.main.Main.main(Main.java:106)
I would need any hint that helps me to reproduce the problem, so that we can debug it.

Hi Carlos, today I noticed an ArrayIndexOutOfBoundsException with the same stacktrace while compiling a map for Japan. I was able to reproduce it, so I hope I can find out what happens. Gerd Carlos Dávila-2 wrote
Hi Gerd, thanks for your response. In some cases error occurs while combining old elevation img files with new ones, but in many other cases only recently created img are involved, so it could be I/O problems as you suggest. I'll investigate that route.
El 06/11/16 a las 20:33, Gerd Petermann escribió:
Hi Carlos,
IIRC Minko reported a similar problem and it turned out that he combined img files which were created with an older version of mkgmap with newer ones. Could this happen here, too? For examples img files with elevation data ? If not I think it is more likely to be an I/O problem on your machine.
Gerd
Carlos Dávila-2 wrote
I build maps daily for some 60 countries for my web. Since a couple of months or so, almost every day there are some maps that fail to build with an ArrayIndexOutOfBoundsException. Maps that fail change from one day to the next. I have not been able to reproduce the problem, as failure seems to be random. If I later build any of the maps that failed, even using the same input file, it usually builds fine. Problem doesn't seem to be style related, as it happens (also randomly) with any of the two styles I use for my maps. Error message is as follows:
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 265 at java.lang.Integer.valueOf(Integer.java:831) at uk.me.parabola.imgfmt.app.lbl.LBLFileReader.readPoiInfo(LBLFileReader.java:422) at uk.me.parabola.imgfmt.app.lbl.LBLFileReader.
<init>
(LBLFileReader.java:75) at uk.me.parabola.mkgmap.combiners.FileInfo.lblInfo(FileInfo.java:326) at uk.me.parabola.mkgmap.combiners.FileInfo.lblInfo(FileInfo.java:313) at uk.me.parabola.mkgmap.combiners.FileInfo.imgInfo(FileInfo.java:259) at uk.me.parabola.mkgmap.combiners.FileInfo.getFileInfo(FileInfo.java:152) at uk.me.parabola.mkgmap.main.Main.endOptions(Main.java:575) at uk.me.parabola.mkgmap.CommandArgsReader.readArgs(CommandArgsReader.java:128) at uk.me.parabola.mkgmap.main.Main.mainStart(Main.java:135) at uk.me.parabola.mkgmap.main.Main.main(Main.java:106)
I would need any hint that helps me to reproduce the problem, so that we can debug it.
_______________________________________________ mkgmap-dev mailing list
mkgmap-dev@.org
-- View this message in context: http://gis.19327.n8.nabble.com/Random-compiling-failures-tp5885477p5886434.h... Sent from the Mkgmap Development mailing list archive at Nabble.com.

Hi all, I am rather clueless here. I have a mkgmap.jar and a set of 31 input files and I can reproduce the problem with them. So I think the crash is not related to I/O errors. It happens in the Java Integer class: public static Integer valueOf(int i) { if (i >= IntegerCache.low && i <= IntegerCache.high) * return IntegerCache.cache[i + (-IntegerCache.low)];* return new Integer(i); } The parameter i is calculated "on the fly" in this line in LBLFileReader: poi.setZip(zips.get(*zipIndex-1*)); I thought the problem is caused by mkgmap code which isn't thread safe and changes the content of zipIndex, so I added some debug info. With that debug info the problem disappeared. To make sure that I did not change anything else I removed the debug info again and the problem still did not occur. So, I have now two different binaries compiled with - I hope - the same sources, one always crashing with the 31 files, the other not crashing. The only difference in the two binaries is the timestamp of the compile date. I only have one idea: The just-in-time compiler works different for the two binaries and does something wrong for one. Is that possible? Gerd Gerd Petermann wrote
Hi Carlos,
today I noticed an ArrayIndexOutOfBoundsException with the same stacktrace while compiling a map for Japan. I was able to reproduce it, so I hope I can find out what happens.
Gerd Carlos Dávila-2 wrote
Hi Gerd, thanks for your response. In some cases error occurs while combining old elevation img files with new ones, but in many other cases only recently created img are involved, so it could be I/O problems as you suggest. I'll investigate that route.
El 06/11/16 a las 20:33, Gerd Petermann escribió:
Hi Carlos,
IIRC Minko reported a similar problem and it turned out that he combined img files which were created with an older version of mkgmap with newer ones. Could this happen here, too? For examples img files with elevation data ? If not I think it is more likely to be an I/O problem on your machine.
Gerd
Carlos Dávila-2 wrote
I build maps daily for some 60 countries for my web. Since a couple of months or so, almost every day there are some maps that fail to build with an ArrayIndexOutOfBoundsException. Maps that fail change from one day to the next. I have not been able to reproduce the problem, as failure seems to be random. If I later build any of the maps that failed, even using the same input file, it usually builds fine. Problem doesn't seem to be style related, as it happens (also randomly) with any of the two styles I use for my maps. Error message is as follows:
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 265 at java.lang.Integer.valueOf(Integer.java:831) at uk.me.parabola.imgfmt.app.lbl.LBLFileReader.readPoiInfo(LBLFileReader.java:422) at uk.me.parabola.imgfmt.app.lbl.LBLFileReader.
<init>
(LBLFileReader.java:75) at uk.me.parabola.mkgmap.combiners.FileInfo.lblInfo(FileInfo.java:326) at uk.me.parabola.mkgmap.combiners.FileInfo.lblInfo(FileInfo.java:313) at uk.me.parabola.mkgmap.combiners.FileInfo.imgInfo(FileInfo.java:259) at uk.me.parabola.mkgmap.combiners.FileInfo.getFileInfo(FileInfo.java:152) at uk.me.parabola.mkgmap.main.Main.endOptions(Main.java:575) at uk.me.parabola.mkgmap.CommandArgsReader.readArgs(CommandArgsReader.java:128) at uk.me.parabola.mkgmap.main.Main.mainStart(Main.java:135) at uk.me.parabola.mkgmap.main.Main.main(Main.java:106)
I would need any hint that helps me to reproduce the problem, so that we can debug it.
_______________________________________________ mkgmap-dev mailing list
mkgmap-dev@.org
-- View this message in context: http://gis.19327.n8.nabble.com/Random-compiling-failures-tp5885477p5886479.h... Sent from the Mkgmap Development mailing list archive at Nabble.com.

Hi Gerd
and I can reproduce the problem with them. So I think the crash is not related to I/O errors. It happens in the Java Integer class: public static Integer valueOf(int i) { if (i >= IntegerCache.low && i <= IntegerCache.high) * return IntegerCache.cache[i + (-IntegerCache.low)];* return new Integer(i); }
I found two bugs with the same "impossible" exception in Integer.valueOf() https://netbeans.org/bugzilla/show_bug.cgi?id=267380 https://netbeans.org/bugzilla/show_bug.cgi?id=268301 Both are recent with java version 1.8.0_102-8u102. That was released in mid July which roughly fits with Carlos's observation of when it started happening. ..Steve
participants (4)
-
Carlos Dávila
-
Gerd Petermann
-
Jakob Mühldorfer
-
Steve Ratcliffe