[Gc] GC_thread_exit_proc error on win32_threads.c

Boehm, Hans hans.boehm at hp.com
Mon Jun 5 15:53:59 PDT 2006


Can you track this down to a particular instruction that generates the
segmentation fault?  This sounds like a possible race in the
pthread_cleanup implementation.  Do you use thread cancellation?
 
Hans


________________________________

	From: gc-bounces at napali.hpl.hp.com
[mailto:gc-bounces at napali.hpl.hp.com] On Behalf Of Tommaso Tagliapietra
(EXT VE SYS)
	Sent: Monday, May 29, 2006 2:24 AM
	To: gc at napali.hpl.hp.com
	Subject: [Gc] GC_thread_exit_proc error on win32_threads.c
	
	
	In a Pentium4 2.6Ghz with WindowsXP Professional SP2, I have a
problem with the release 6.4 of the garbage collector under Cygwin, and
probably with other releases of the collector.  It seems that at the end
of GC_thread_exit_proc (win32_threads.c module), sometimes my program
exit with a Segmentation Fault. I'm sure that there is not my code the
problem and probably not the Garbage Collector too. However I've
resolved the problem adding a "Sleep(10);" at the end of the function:
	 
	 
	void GC_thread_exit_proc(void *arg)
	{
	    GC_thread me = (GC_thread)arg;
	
	#   if DEBUG_CYGWIN_THREADS
	      GC_printf2("thread 0x%x(0x%x) called pthread_exit().\n",
	                 (int)pthread_self(), GetCurrentThreadId());
	#   endif
	 
	    LOCK();
	    if (me -> flags & DETACHED) {
	      GC_delete_thread(GetCurrentThreadId());
	    } else {
	      /* deallocate it as part of join */
	      me -> flags |= FINISHED;
	    }
	    UNLOCK();
	    Sleep(10);
	}
	 
	 
	The same problem doesn't not happen into a P4 2Ghz WindowsXP
Professional SP2. Same compiler. Why this stupid change works without
segmentation fault? Can be some race conditions the reason?
	 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://napali.hpl.hp.com/pipermail/gc/attachments/20060605/5097e7b1/attachment.htm


More information about the Gc mailing list