From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 46286 invoked by alias); 31 Oct 2015 12:08:55 -0000 Mailing-List: contact glibc-bugs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: glibc-bugs-owner@sourceware.org Received: (qmail 46248 invoked by uid 48); 31 Oct 2015 12:08:51 -0000 From: "fweimer at redhat dot com" To: glibc-bugs@sourceware.org Subject: [Bug nptl/12889] Race condition in pthread_kill Date: Sat, 31 Oct 2015 12:08:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: glibc X-Bugzilla-Component: nptl X-Bugzilla-Version: unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: fweimer at redhat dot com X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: security- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-10/txt/msg00403.txt.bz2 https://sourceware.org/bugzilla/show_bug.cgi?id=3D12889 --- Comment #1 from Florian Weimer --- POSIX says: =E2=80=9CThe lifetime of a thread ID ends after the thread terminates if it= was created with the detachstate attribute set to PTHREAD_CREATE_DETACHED or if pthread_detach() or pthread_join() has been called for that thread.=E2=80=9D How is this to be interpreted? This way? TERMINATED && (CREATED-AS-DETACHED || DETACH-CALLED || JOIN-CALLED) Or this way? (TERMINATED && CREATED-AS-DETACHED) || DETACH-CALLED || JOIN-CALLED In the second case, pthread_detach and pthread_join could just clear the TI= D in the thread descriptor to avoid the race, before reaping the TID from the kernel. --=20 You are receiving this mail because: You are on the CC list for the bug. >>From glibc-bugs-return-30367-listarch-glibc-bugs=sources.redhat.com@sourceware.org Sat Oct 31 12:11:20 2015 Return-Path: Delivered-To: listarch-glibc-bugs@sources.redhat.com Received: (qmail 47872 invoked by alias); 31 Oct 2015 12:11:20 -0000 Mailing-List: contact glibc-bugs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: glibc-bugs-owner@sourceware.org Delivered-To: mailing list glibc-bugs@sourceware.org Received: (qmail 47841 invoked by uid 48); 31 Oct 2015 12:11:16 -0000 From: "fweimer at redhat dot com" To: glibc-bugs@sourceware.org Subject: [Bug nptl/19193] pthread_kill returns ESRCH for a thread ID whose lifetime has not ended Date: Sat, 31 Oct 2015 12:11:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: glibc X-Bugzilla-Component: nptl X-Bugzilla-Version: 2.23 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: fweimer at redhat dot com X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: security- X-Bugzilla-Changed-Fields: attachments.created Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-10/txt/msg00404.txt.bz2 Content-length: 413 https://sourceware.org/bugzilla/show_bug.cgi?id=19193 --- Comment #1 from Florian Weimer --- Created attachment 8759 --> https://sourceware.org/bugzilla/attachment.cgi?id=8759&action=edit bug19193.c Test case. I think it has to be time-based. Another test with pthread_tryjoin_np would be desirable. -- You are receiving this mail because: You are on the CC list for the bug.