[Gc] windows static thread (release) error

Christophe Meessen meessen at cppm.in2p3.fr
Thu May 17 13:59:33 PDT 2007


First another nano enhancement of the code:
In file win32threads.c at line 1057, just after the _beginthreadex call
one should add this line to avoid tiny memory leaks when thread fails to
start. Otherwise the args won't be removed I guess.
   if( thread_h == 0 ) GC_free( args );

I didn't manage to debug the segmentation fault when running my code in
release mode, but I could make sure it is not due to my code.

Just after GC_INIT, the first instruction of my program, I call
_beginthreadex, and the segmentation fault occurs before the given
thread function is called. Apparently in  GC_lookup_thread_inner().
First-chance exception at 0x7c928fea in Server.exe: 0xC0000005: Access
violation writing location 0x00000010.

I added a simple print statement in this call and saw that it is called
twice when the program starts and without any problem. The problem is
systematic and at the same location. Could the gc thread be the source
of the problem ?

More information about the Gc mailing list