Re: [Fwd: Possible bug in Thread.start()]

Chris Pickett <[email protected]>
Newsgroups gmane.comp.java.vm.sablevm.devel
Message-ID <[email protected]>
Etienne Gagnon wrote:
> -------- Original Message --------
> Subject: Possible bug in Thread.start()
> Date: Mon, 13 Dec 2004 17:38:47 -0600
> From: Archie Cobbs <[email protected]>
> To: old mailing-list
> 
> Hello Sablevm folks,
> 
> I recently discovered a bug in JC that may also apply to SableVM,
> because JC's thread handling is based on SableVM.
> 
> The bug is a race condition between thread #1 stopping the world
> and thread #2 creating a new thread via Thread.start().
> 
> The problem is that the stop the world operation completes when
> pending_halt_thread_count goes to zero. But during this time the
> halting thread sleeps and releases the VM mutex. This may allow
> another thread to be created, added to the thread list, and start
> running (note Thread.start() does not invoke _svmf_halt_if_requested()).
> Then the halting thread wakes up and proceeds but then the new thread
> comes alive and is not halted.
> 
> The fix is simple: invoke _svmf_halt_if_requested() at the
> beginning of _svmf_thread_start().
> 
> Hope this helps.

Thanks Archie, I've chased bugs related to thread startup in the GC 
stuff before (threads will reach the "impossible control flow" case), 
but never managed to nail it.

Chris
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.