Exception introduced in r1725

Hi All, I realised I was having problems with the newest stable and not with an older version, so I went back through and did some bisecting. r1725 appears to cause issues for me when generating large gmapsupp.img files (1.1G, from 293 .img tiles), where it throws Exception in thread "main" java.lang.IllegalArgumentException at java.nio.ByteBuffer.allocate(ByteBuffer.java:328) at uk.me.parabola.imgfmt.sys.Directory.sync(Directory.java:176) at uk.me.parabola.imgfmt.sys.ImgFS.sync(ImgFS.java:230) at uk.me.parabola.imgfmt.sys.ImgFS.close(ImgFS.java:240) at uk.me.parabola.mkgmap.combiners.GmapsuppBuilder.onFinish(GmapsuppBuilder.java:119) at uk.me.parabola.mkgmap.main.Main.endOptions(Main.java:413) at uk.me.parabola.mkgmap.CommandArgsReader.readArgs(CommandArgsReader.java:126) at uk.me.parabola.mkgmap.main.Main.main(Main.java:127) r1724 and earlier works fine. Any thoughts? I've seen earlier threads with the same error, but hopefully narrowing it down to the specific commit helps. I've also tested my r1724 image on my eTrex and everything works fine, so the suggestion in one of the earlier threads that the file format only supports 256 sub-images isn't watertight. Cheers, Andy

Hi Andy
I realised I was having problems with the newest stable and not with an older version, so I went back through and did some bisecting. r1725 appears to cause issues for me when generating large gmapsupp.img
Well that is very interesting as that change is directly about creating gmapsupp.img files. It originate from the following: http://www.mkgmap.org.uk/pipermail/mkgmap-dev/2010q4/009328.html Looking at this again, I think that although the original code is 'obviously' wrong, the new code is not correct either. It should be Dirent.ENTRY_SIZE instead of DirectoryEntry.SLOTS_PER_ENTRY. And the assert should definitely be there. There are two reasons for that. 1) I don't know that numbers other than 1 are allowed. 2) The rest of the code is written to make it 1. If that code is failing we need to know about it. Attached patch is what I think it should be. ..Steve
participants (2)
-
Andy Allan
-
Steve Ratcliffe