[Gc] (Win32) attempt to unregister first GC thread will cause a crash.

Boehm, Hans hans.boehm at hp.com
Wed Dec 16 14:25:26 PST 2009


Under normal circumstances, this shouldn't be an issue, right?  The structure for the main thread should be statically allocated when the GC is initialized.  And GC_unregister_my_thread() shouldn't be called on the main thread.

The patch looks fine.  I just wonder whether there is correct client code that really needs it.

Hans

> -----Original Message-----
> From: gc-bounces at napali.hpl.hp.com 
> [mailto:gc-bounces at napali.hpl.hp.com] On Behalf Of 
> Jean-Claude Beaudoin
> Sent: Wednesday, December 16, 2009 4:30 AM
> To: gc at napali.hpl.hp.com
> Subject: [Gc] (Win32) attempt to unregister first GC thread 
> will cause a crash.
> 
> 
> Hello BDW-GC maintainers,
> 
> In file win32_threads.c there is a special case for the 
> static allocation of the first GC_thread structure.
> 
> If someone calls GC_unregister_my_thread() on that very first 
> GC thread there will be a segmentation violation inside 
> GC_delete_thread() when it tries to call GC_INTERNAL_FREE().
> 
> I attached to this message a patch against 7.2alpha4 that 
> seems to fix the problem.
> 
> Cheers,
> 
> Jean-Claude Beaudoin
> 
> 


More information about the Gc mailing list