[Gc] Incremental collection/thread local free lists problem

Brian Alliet brian@brian-web.com
Tue, 13 May 2003 00:45:50 -0400


Hi-

I was just about to put some finishing touches on my darwin patch a few 
weeks ago when I decided to take a stab at getting the incremental 
collector going on darwin. Unfortunately, it appears I ran into another 
bug in my darwin patch that only seems to show up when incremental 
collection is turned on. I know bug is not in my incremental collection 
code (getting the fault address, etc) because it shows up with 
DEFAULT_VDB too. There is a good chance it has nothing to do with 
incremental collection at all, thats just what is triggering it.

Gctest ends up blowing up in GC_set_fl_marks because there is an 
invalid pointer on one of the ptrfree_freelists. I modified 
GC_local_malloc_atomic to set the first four bytes of each pointer 
returned to 0xdeadbeef, and modified test.c (in mktree, the ifdef 
THREAD_LOCAL_ALLOC block) to just allocate a chunk of memory then not 
touch it at all. Sure enough, 0xdeadbeef ends up on the freelist 
somehow. If I have test.c modify the memory (memset(result,'a',17)) 
sometimes 0xdeadbeef will show up, other times 0x61616161 (aaaa) will. 
Anybody have any ideas on how this could happen or any suggestions on 
where I should look?

Thanks,

-Brian