Comment 7 for bug 957231

Revision history for this message
David Kalnischkies (donkult) wrote :

Colin is right, its about remapping. WriteUniqString() can cause the underlying data storage to move. FileI is registered to be rewritten to accommodate the move, but the compiler already has the address calculated so the rewrite of FileI is too late.

The line must be split into
map_ptrloc foobar = WriteUniqString(data);
FileI->Origin = foobar;
to work properly.

You want to backport rev. 2219.1.8 which fixes this line and a few siblings. There might be more as it was pretty hard and equally dull task to allow the storage to move arround (to fix the "mmap ran out of room") so I overlooked quiet a few cases which were uncovered over the year(s). I haven't seen any segfault with trunk for a while so I hope we finally have found everything, which usually means its the right time to introduce new bugs ;)

And for the record: Most of the time you not only need the sources but the exact same files as with a earlier/later version of the index files its likely that the content has changed causing the remap to happen earlier/later (if at all) so that this line works and might fail at another (or works because other places deal correctly with it).