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

Etienne Gagnon <[email protected]>
Newsgroups gmane.comp.java.vm.sablevm.devel
Organization UQAM
Message-ID <[email protected]>
-------- 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.

Cheers,
-Archie

P.S. Please CC: me on replies as I'm not currently subscribed.

__________________________________________________________________________
Archie Cobbs      *        CTO, Awarix        *      http://www.awarix.com

_______________________________________________
SableVM-devel mailing list
[email protected]
http://sablevm.org/lists/control/listinfo/sablevm-devel
signature.asc (application/pgp-signature, 256 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFBvlDxjyrJi4rH84gRAqkfAJ9KC4Y4klW9ZiklasoZBkvn7W08FQCfR0n9
93wfwWJi61VgbpNdpvmny34=
=S4bf
-----END PGP SIGNATURE-----
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.