This is the mail archive of the
java-prs@gcc.gnu.org
mailing list for the Java project.
[Bug libgcj/22211] New: Thread.interrupt sometimes causes abort if thread is already dead
- From: "greenrd at greenrd dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: java-prs at gcc dot gnu dot org
- Date: 28 Jun 2005 02:30:09 -0000
- Subject: [Bug libgcj/22211] New: Thread.interrupt sometimes causes abort if thread is already dead
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Thread.interrupt does not check if the thread is alive - it just signals the
thread regardless. This sometimes causes a segfault followed by an abort,
because the native thread library gets passed stale data.
Unable to create a reproducable test case - but I would hope it's self-evident
that the existing code in _Jv_ThreadInterrupt is bogus.
To fix this correctly, two things need to happen. (1) When interrupting, don't
do anything if the thread is not alive. (2) Properly synchronize access to the
alive_flag, to avoid races.
--
Summary: Thread.interrupt sometimes causes abort if thread is
already dead
Product: gcc
Version: 4.0.0
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: libgcj
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: greenrd at greenrd dot org
CC: gcc-bugs at gcc dot gnu dot org,java-prs at gcc dot gnu
dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22211