[bf1942] Another stacktrace

Ryan C. Gordon icculus at clutteredmind.org
Fri Dec 13 20:37:48 EST 2002


> (gdb) backtrace
> #0  0x08f644c8 in dice::ref2::MemoryPool::alloc ()
> #1  0x08f64558 in dice::ref2::MemoryPool::alloc ()

Just to update y'all:

As you might have guessed, this is almost certainly a memory corruption
bug. The reason that almost all of the stacktraces end with two calls to
that alloc() method is because we keep a linked list of MemoryPool
objects, and if there isn't space in a given memory pool, we call alloc()
in the next pool in the linked list...but if we piddled over memory we
either corrupt the next pool or corrupt the pointer to it, so it pukes,
but not necessarily anywhere near where the actual corruption occurred,
depending on how big the memory pool was, etc.

This is why some people are getting crashes and others aren't, and why
some people can play for ten minutes, some for an hour, etc...and why I
never crash. I've got a blessed box, apparently. But rather than ship the
server with an icon that reads, "Best Played On Ryan's Development Box",
I've decided to fix this.  :)

In my local tree, I've moved to a simpler form of memory allocation so I
can track down the problem(s). Among other things, it'll let me
run the thing through valgrind and get more meaningful results.

More updates when I have them...may not be tonight. Again, thank you for
your patience; I'm trying to fix this "codesalat" as quickly as I can.

--ryan.





More information about the Bf1942 mailing list