Problem with --index and 812KB _mdr.img files & "warning using default sort"

1. Could mkgmap clean up broken 812KB mdr_img files if creating crashes due to insufficient memory? This is a potential threat as the _mdr.img is broken but hard to notice if you don't look at error notices). 2. What does the "warning using default sort" thingy mean. Can it be overcome or if not could it be switched off?

Okay, well found out that the broken size is always the same. So for now on I just look whether *_mdr.img is smaller than 828KB (that's the smallest working I could produce for tiny map) and if found, I know the compile failed. The problematic thing on this error is, that usually if _mdr.img cannot be created because of memory shortage, also the overview map is not created. However you can run into the problem that the overview map is created but the index cannot be written out due to low memory and hence a crash that I did not expect. As long as the broken *_mdr.img does not increase in size, I can work without any patch to this (ideally though mkgmap should delete the tdb, the overview map and the _mdr.img in case of low memory so it's harder to run into such problems (the problem is here, that while you can open the map in mapsource, trying to send the map to the gps will crash Mapsource severly, needing to close it via task-manager) 2011/3/16 Felix Hartmann <extremecarver@gmail.com>:
1. Could mkgmap clean up broken 812KB mdr_img files if creating crashes due to insufficient memory? This is a potential threat as the _mdr.img is broken but hard to notice if you don't look at error notices).
2. What does the "warning using default sort" thingy mean. Can it be overcome or if not could it be switched off?

A trick I use to deal with this problem is to generate the files with a .embryo extension and once I know the file has been successfully written out and closed I perform a rename (which is atomic) to get rid of the .embryo. The next time the application is run, it can cleanup any .embryo files on startup (or just ignore and overwrite them). It's also possible to add uncaught exception handlers and shutdown hooks to try to clean up the incomplete files, but this can be tricky to get right, and it's often it's better to leave them there for diagnostic purposes anyway.
1. Could mkgmap clean up broken 812KB mdr_img files if creating crashes due to insufficient memory? This is a potential threat as the _mdr.img is broken but hard to notice if you don't look at error notices).
participants (3)
-
Chris Miller
-
Felix Hartman
-
Felix Hartmann