[Gc] GC7.0 Release problem

Christophe Meessen meessen at cppm.in2p3.fr
Sat Jul 7 01:57:25 PDT 2007


Hello,

I've collected more info on the problem.

When compiled in debug mode, no problem. When compiled in release mode I
get an exception when the first started thread does a LOCK.
The exception says that reading memory at address 10 has been attempted.
This is very likely due to dereferencing a NULL pointer.
The exception is thrown from within the EnterCriticalSection done in the
LOCK statement of GC_lookup_thread().
This call is performed by GC from within the newly started thread to
initialize it and before calling the user code.
When I comment out GC_INIT in main I get exactly the same outcome in
debug too and at exactly the same spot.

Tracing in assembly I see the problem is inside CriticalSection handling
of MSWIN32 in release mode when called from the newly created thread. In
debug mode a different code is used so I can't compare.

There seem to be an interference between libgc and window's critical
section. I will first verify that Critical sections works well without
libgc and I will compare. If it works well, as I expect, then it would
mean there is an interference between libgc and windows CS handling.
Thread local storage might be a good candidate, I mean the Id used to
access variables. What Id are libgc using ?





More information about the Gc mailing list