[Gc] Thoughts on this deadlock issue?

jim marshall jim.marshall at wbemsolutions.com
Fri Jun 22 17:05:15 PDT 2007

We've run into what appears to be a deadlock situation. We have an 
application which dynamically loads shared objects. These shared objects 
can do a lot of things and are not required to use our applications 
memory routines (which use GC). We are seeing a situation where one of 
these shared objects starts a bunch of threads, it uses normal 
malloc/free calls. At some point a thread calls a function in our 
application which allocates some memory. The GC does it's stop world 
thing, then goes into debug_malloc (this is a debug build). What appears 
to happen is that the GC attempts to get the heap lock, but one of the 
other non-GC threads is already in a malloc/free call and owns the lock. 
So we get into a deadlock where the GC is stuck waiting for a mutex 
which is owned by one of the other threads which is stopped.

Does this sound plausible (I am basing this off of result from another 
Any thoughts on how to work around it?


Jim Marshall
Sr. Staff Engineer
WBEM Solutions, Inc.

More information about the Gc mailing list