-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Wed, 28 Dec 2005, Anders Reggestad wrote:
Hello,
I try to get my application to not crash on exit, but relize that that might
be difficutl when walktest crash on exit as well.
walktest data/terrainf crash in this way:
Cleaning up...
Assertion failed: FindBlock(p) != csArrayItemNotFound
Location: include/csutil/blockallocator.h:412
Call stack:
/home/andersr/prog/planeshift/CS/engine.so(csKDTree::RemoveObject(csKDTreeChild*)+0x36)
[0x415914b0]
/home/andersr/prog/planeshift/CS/engine.so(csSectorLightList::FreeLight(iLight*)+0x7b)
[0x4154af21]
I believe this is a bug in the block allocator that has always been there,
but by some stroke of luck, it doesn't show up on most platforms. It's
bitten me before and I've even tried to fix it. Come to think about it, I
may even have a fix (or more likely a workaround) in my personal working
copy on my computer at home. At any rate, in my experience bug tends to
rear its ugly head pretty reliably on AMD64, and/or applications with
patterns of memory allocation significantly different from the typical
"load all the CS map data up front" model.
The issue is related to a recursive problem in which block allocator
itself is being deallocated: it cleans up the blocks it manages by
iterating through the list of blocks and calling the destructor on each
one. The problem is that with linked structures like kdtree, a given node
points to other nodes, and those nodes in turn will also be deleted by the
destructor. However, due to the way the allocator blindly deletes
everything in sequence, it may end up trying to delete a block that is
earlier in squence, meaning that the allocator has already deallocated it
on its own.
There may be some additional kinks, but the gist of the problem was that
the block allocator and kdtree were making incompatible assumptions about
who was responsible for cleaning up memory.
I can look into this when I get home tonight.
[ Peter Amstutz ][ [EMAIL PROTECTED] ][ [EMAIL PROTECTED] ]
[Lead Programmer][Interreality Project][Virtual Reality for the Internet]
[ VOS: Next Generation Internet Communication][ http://interreality.org ]
[ http://interreality.org/~tetron ][ pgpkey: pgpkeys.mit.edu 18C21DF7 ]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
iD8DBQFDsueHaeHUyhjCHfcRAk8JAJ0Qevz7tJGqgcUvL19PwC3CIHntewCeMueR
gkBdu4ZuRoGKb0CzUnkMkMk=
=6Tog
-----END PGP SIGNATURE-----
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
Crystal-main mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/crystal-main
Unsubscribe: mailto:[EMAIL PROTECTED]