From nobody Fri Dec 20 17:52:40 2024 X-Original-To: threads@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YFFPP05dvz5X3sL for ; Fri, 20 Dec 2024 17:52:41 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YFFPN673Xz4FHp for ; Fri, 20 Dec 2024 17:52:40 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734717160; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+rBKkgkq0GhOoOk/QOWT5+ggiPO2uwuoG1K6eWdAW0g=; b=JvdMjMLyCmEsjUeISrvUbIncch8kCq8BxAKxg1BExWlTx+9uBW3lUHh03S+xtMY2o+4Bii ZKVrIDtcPuAuMF2JJKPwft5Jo/1FbI2O+gjRH10TUkbZyT5rtHr1ShuWikrB5iJWOT/yWn wedUYBAUzgqLlXur5rWXChXRF7SxRgyJbmhc+hf9CPRLwSJ+GjCPQoPnJrSXuLlPux+aWt diB84gYXEAuIiV/1h8dwNVc1jZAGo0fofxCdsAcBsh8O71NrLnfU27E/ydMVxEoADPD7a9 u9SMGmofPWUS30Q+cnm6d28C3CyXKBzwEm7iV5wgwwz+9VeqMw2lZVRtL/AyKQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1734717160; a=rsa-sha256; cv=none; b=xUZxKskZv5WowBJV9sm2BmoO9ySq6pH49RdBwP9RFAPUeEhiHu8RYtFLlHlbS93R8GPW7m Jo308cuXhMPjHcfnn/c6guG/jN0m2c4kytCZ2Uqc7yzdZ7Abl85ugZj6H8PYavSLJ+X3w6 noqROEwN7X7Byn1ZhnrHn6B2lf0UQ1sVxZvjwL3I8QOLbVw1s2VuoNvcsQJg89/zw795+s IVDzt/ppjVbGRnX7B+smLNKuOXIOc9fZLgEnDkAeWGH586qbVMUgp9Gs5x6NYQx173T58P 5kLs2KNtwrWTFEnMKhTM2sjA76AFibMVcyfkO1SEjYcrLDiJ1TytKAfWXEz57Q== Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YFFPN5kY0znnx for ; Fri, 20 Dec 2024 17:52:40 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 4BKHqeoT066443 for ; Fri, 20 Dec 2024 17:52:40 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 4BKHqeed066442 for threads@FreeBSD.org; Fri, 20 Dec 2024 17:52:40 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: threads@FreeBSD.org Subject: [Bug 283101] pthread_cancel() doesn't cancel a thread that's currently in pause() Date: Fri, 20 Dec 2024 17:52:40 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: threads X-Bugzilla-Version: 13.3-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: kib@FreeBSD.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: threads@FreeBSD.org X-Bugzilla-Flags: 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: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Threading List-Archive: https://lists.freebsd.org/archives/freebsd-threads List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: freebsd-threads@freebsd.org Sender: owner-freebsd-threads@FreeBSD.org MIME-Version: 1.0 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D283101 --- Comment #17 from Konstantin Belousov --- (In reply to vedad from comment #16) We seems to getting close, but still not quite. The victim thread was caught by SIGCANCEL inside the critical section. Then, returning from the section should have caused cancellation to trigger. Since it does not, and I verified manually all places where we leave critical counters, lets try with more debugging to see what happens. Please provide me with both the backtrace and the p *curthread on the victim thread. diff --git a/lib/libthr/thread/thr_sig.c b/lib/libthr/thread/thr_sig.c index b953c430158c..9f7fcbe33566 100644 --- a/lib/libthr/thread/thr_sig.c +++ b/lib/libthr/thread/thr_sig.c @@ -191,8 +191,13 @@ sigcancel_handler(int sig __unused, struct pthread *curthread =3D _get_curthread(); int err; - if (THR_IN_CRITICAL(curthread)) + if (THR_IN_CRITICAL(curthread)) { + void *p[1]; + + p[0] =3D curthread; + abort2("thr_in_critical %p", 1, p); return; + } err =3D errno; check_suspend(curthread); check_cancel(curthread, ucp); --=20 You are receiving this mail because: You are the assignee for the bug.=