[Bug libgcj/22211] New: Thread.interrupt sometimes causes abort if thread is already dead

greenrd at greenrd dot org gcc-bugzilla@gcc.gnu.org
Tue Jun 28 02:30:00 GMT 2005


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



More information about the Gcc-bugs mailing list