public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
* [Bug libgcj/22211] [4.0 only] Thread.interrupt sometimes causes abort if thread is already dead [not found] <20050628023007.22211.greenrd@gcc.gnu.org> @ 2005-09-06 23:56 ` cvs-commit at gcc dot gnu dot org 2005-09-06 23:56 ` tromey at gcc dot gnu dot org 1 sibling, 0 replies; 4+ messages in thread From: cvs-commit at gcc dot gnu dot org @ 2005-09-06 23:56 UTC (permalink / raw) To: gcc-bugs ------- Additional Comments From cvs-commit at gcc dot gnu dot org 2005-09-06 23:55 ------- Subject: Bug 22211 CVSROOT: /cvs/gcc Module name: gcc Branch: gcc-4_0-branch Changes by: tromey@gcc.gnu.org 2005-09-06 23:53:46 Modified files: libjava : ChangeLog libjava/java/lang: Thread.java natThread.cc Log message: PR libgcj/22211: * java/lang/natThread.cc (finish_): Synchronize when updating alive_flag. (_Jv_AttachCurrentThread): Likewise. (interrupt): Only call _Jv_ThreadInterrupt if thread is alive. * java/lang/Thread.java (isAlive): Now synchronized. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libjava/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.3391.2.95&r2=1.3391.2.96 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libjava/java/lang/Thread.java.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.35&r2=1.35.8.1 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libjava/java/lang/natThread.cc.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.30&r2=1.30.8.1 ------- Additional Comments From tromey at gcc dot gnu dot org 2005-09-06 23:56 ------- Fix on branch as well. -- What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |RESOLVED Resolution| |FIXED http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22211 ^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug libgcj/22211] [4.0 only] Thread.interrupt sometimes causes abort if thread is already dead [not found] <20050628023007.22211.greenrd@gcc.gnu.org> 2005-09-06 23:56 ` [Bug libgcj/22211] [4.0 only] Thread.interrupt sometimes causes abort if thread is already dead cvs-commit at gcc dot gnu dot org @ 2005-09-06 23:56 ` tromey at gcc dot gnu dot org 1 sibling, 0 replies; 4+ messages in thread From: tromey at gcc dot gnu dot org @ 2005-09-06 23:56 UTC (permalink / raw) To: gcc-bugs ------- Additional Comments From cvs-commit at gcc dot gnu dot org 2005-09-06 23:55 ------- Subject: Bug 22211 CVSROOT: /cvs/gcc Module name: gcc Branch: gcc-4_0-branch Changes by: tromey@gcc.gnu.org 2005-09-06 23:53:46 Modified files: libjava : ChangeLog libjava/java/lang: Thread.java natThread.cc Log message: PR libgcj/22211: * java/lang/natThread.cc (finish_): Synchronize when updating alive_flag. (_Jv_AttachCurrentThread): Likewise. (interrupt): Only call _Jv_ThreadInterrupt if thread is alive. * java/lang/Thread.java (isAlive): Now synchronized. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libjava/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.3391.2.95&r2=1.3391.2.96 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libjava/java/lang/Thread.java.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.35&r2=1.35.8.1 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libjava/java/lang/natThread.cc.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.30&r2=1.30.8.1 ------- Additional Comments From tromey at gcc dot gnu dot org 2005-09-06 23:56 ------- Fix on branch as well. -- What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |RESOLVED Resolution| |FIXED http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22211 ^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug libgcj/22211] New: Thread.interrupt sometimes causes abort if thread is already dead @ 2005-06-28 2:30 greenrd at greenrd dot org 2005-06-29 17:49 ` [Bug libgcj/22211] [4.0 only] " pinskia at gcc dot gnu dot org 2005-08-09 0:11 ` greenrd at greenrd dot org 0 siblings, 2 replies; 4+ messages in thread From: greenrd at greenrd dot org @ 2005-06-28 2:30 UTC (permalink / raw) To: gcc-bugs 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 ^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug libgcj/22211] [4.0 only] Thread.interrupt sometimes causes abort if thread is already dead 2005-06-28 2:30 [Bug libgcj/22211] New: " greenrd at greenrd dot org @ 2005-06-29 17:49 ` pinskia at gcc dot gnu dot org 2005-08-09 0:11 ` greenrd at greenrd dot org 1 sibling, 0 replies; 4+ messages in thread From: pinskia at gcc dot gnu dot org @ 2005-06-29 17:49 UTC (permalink / raw) To: gcc-bugs -- What |Removed |Added ---------------------------------------------------------------------------- Summary|Thread.interrupt sometimes |[4.0 only] Thread.interrupt |causes abort if thread is |sometimes causes abort if |already dead |thread is already dead Target Milestone|--- |4.0.2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22211 ^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug libgcj/22211] [4.0 only] Thread.interrupt sometimes causes abort if thread is already dead 2005-06-28 2:30 [Bug libgcj/22211] New: " greenrd at greenrd dot org 2005-06-29 17:49 ` [Bug libgcj/22211] [4.0 only] " pinskia at gcc dot gnu dot org @ 2005-08-09 0:11 ` greenrd at greenrd dot org 1 sibling, 0 replies; 4+ messages in thread From: greenrd at greenrd dot org @ 2005-08-09 0:11 UTC (permalink / raw) To: gcc-bugs ------- Additional Comments From greenrd at greenrd dot org 2005-08-09 00:11 ------- (In reply to comment #7) > I checked this in to cvs trunk. > It should go in 4.0 as well once the branch reopens. Ping. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22211 ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2005-09-06 23:56 UTC | newest] Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- [not found] <20050628023007.22211.greenrd@gcc.gnu.org> 2005-09-06 23:56 ` [Bug libgcj/22211] [4.0 only] Thread.interrupt sometimes causes abort if thread is already dead cvs-commit at gcc dot gnu dot org 2005-09-06 23:56 ` tromey at gcc dot gnu dot org 2005-06-28 2:30 [Bug libgcj/22211] New: " greenrd at greenrd dot org 2005-06-29 17:49 ` [Bug libgcj/22211] [4.0 only] " pinskia at gcc dot gnu dot org 2005-08-09 0:11 ` greenrd at greenrd dot org
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).