Hi

i got the following error from mkgmap (mkgmap-r1914):


Exception in thread "main" java.lang.AssertionError
          at uk.me.parabola.imgfmt.sys.Directory.sync(Directory.java:160)
          at uk.me.parabola.imgfmt.sys.ImgFS.sync(ImgFS.java:230)
          at uk.me.parabola.imgfmt.sys.ImgFS.close(ImgFS.java:240)

Could you try the attached patch on exactly the same input files and arguments.

I've long suspected that there is a slight problem with the way the size of the gmapsupp is calculated, which leads to a problem with particular sized input files.

Thanks,
..Steve
Index: src/uk/me/parabola/mkgmap/combiners/GmapsuppBuilder.java
===================================================================
--- src/uk/me/parabola/mkgmap/combiners/GmapsuppBuilder.java	(revision 1885)
+++ src/uk/me/parabola/mkgmap/combiners/GmapsuppBuilder.java	(revision )
@@ -442,14 +442,20 @@
 				totHeaderSlots += slots;
 			}
 
+			// Estimate the number of blocks needed for the MPS file
+			int mpsSize = files.size() * 80 + 100;
+			int mpsBlocks = (mpsSize + (bs - 1)) / bs;
+			int mpsSlots = (mpsBlocks + ENTRY_SIZE-1) / ENTRY_SIZE;
+
+			totBlocks += mpsBlocks;
+			totHeaderSlots += mpsSlots;
+
 			totHeaderSlots += 2;
 			int totHeaderBlocks = totHeaderSlots * 512 / bs;
 
 			log.info("total blocks for", bs, "is", totHeaderBlocks, "based on slots=", totHeaderSlots);
 
 			if (totBlocks < 0xfffe && totHeaderBlocks <= ENTRY_SIZE) {
-				// Add one for the MPS file
-				totHeaderSlots += 1;
 				return new BlockInfo(bs, totHeaderSlots, totHeaderSlots / bs + 1);
 			}
 		}
_______________________________________________
mkgmap-dev mailing list
[email protected]
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Reply via email to