From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 90477385780B; Mon, 13 Sep 2021 10:46:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 90477385780B From: "fweimer at redhat dot com" To: glibc-bugs@sourceware.org Subject: [Bug nptl/19193] pthread_kill, pthread_cancel return ESRCH for a thread ID whose lifetime has not ended Date: Mon, 13 Sep 2021 10:46:27 +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: RESOLVED X-Bugzilla-Resolution: FIXED X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: fweimer at redhat dot com X-Bugzilla-Target-Milestone: 2.35 X-Bugzilla-Flags: security- X-Bugzilla-Changed-Fields: target_milestone bug_status resolution 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-BeenThere: glibc-bugs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Glibc-bugs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2021 10:46:27 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D19193 Florian Weimer changed: What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|--- |2.35 Status|ASSIGNED |RESOLVED Resolution|--- |FIXED --- Comment #6 from Florian Weimer --- Fixed for 2.35 via: commit 8af8456004edbab71f8903a60a3cae442cf6fe69 Author: Florian Weimer Date: Mon Sep 13 11:06:08 2021 +0200 nptl: pthread_kill, pthread_cancel should not fail after exit (bug 1919= 3) This closes one remaining race condition related to bug 12889: if the thread already exited on the kernel side, returning ESRCH is not correct because that error is reserved for the thread IDs (pthread_t values) whose lifetime has ended. In case of a kernel-side exit and a valid thread ID, no signal needs to be sent and cancellation does not have an effect, so just return 0. sysdeps/pthread/tst-kill4.c triggers undefined behavior and is removed with this commit. Reviewed-by: Adhemerval Zanella --=20 You are receiving this mail because: You are on the CC list for the bug.=