From nobody Mon Dec 16 21:11:20 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 4YBt0T2mw8z5gVdD for ; Mon, 16 Dec 2024 21:11:21 +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 4YBt0S4Wj9z3xKr for ; Mon, 16 Dec 2024 21:11:20 +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=1734383480; 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=VHvS+sUpiq0pojLolBS6T6MZ4qtDG9kMjDjB6va7jgc=; b=sz4IkJXzbvqWp3HF5balK1XX2DyNlLHbycX9+hwKcfhuZ53mcS3yOfVx9JI0n3/khHmDrS +2XaCrbSYI8xXA8BCW040N38iTgtfaFebAlhGcbxrMLl8lJ0ByAV/KEZ2KckWu2r60VUPP iUzN9NIIcnGdMROsyFr3BYndBwAqKaBF5bRSxC/pBDxQAUG7pcnqbFQ3PnFbRVppGxmJeF WKmRbEMMdZHgHKMskYknP8ERg5sFnXmEUIlJFi4vWsaywMO4paVLLjXSoIQ4LXRUPV7XKQ zyhqyBe0NJnI4OeagI7Oo3SxELKmzq164YHWwYtLYRX7zDRwm5/Ol6mOIdTQqw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1734383480; a=rsa-sha256; cv=none; b=D9Dp1Dq7ezZh4GeYCMFivRdr2Di1c817sYyqa2NDNkP7mOUbwYlLZk/O9RDuRaxP+TQp7N smkmt+BntTwVn1/ZVgDH4rUnlBzBstmTVhbut1/f/iPxTtcwScXU0dHw6moFTGHRht1clV BhU/mw/QIs3p5+NSwehJoiIrLLb5D7HxRmzixiigN2yBLTF8celpqOos68db2kfkZf1v/8 cCAmrAWak+O+vlavOvwd0tihGbNhRC4dqrC/UIApaY4GAQXFLbsw3UFGOSSk6uA+fUOO71 /9UZTPtYuZ/yvN4eXsZZR1Ltqtmqf4zx2iLoQW0MPDjtz//2/tHVHgXU3OFeIQ== 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 4YBt0S474zz18K5 for ; Mon, 16 Dec 2024 21:11:20 +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 4BGLBKqN064972 for ; Mon, 16 Dec 2024 21:11:20 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 4BGLBKUJ064971 for threads@FreeBSD.org; Mon, 16 Dec 2024 21:11:20 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: Mon, 16 Dec 2024 21:11:20 +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: vedad@kajtaz.net X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: threads@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: attachments.created 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 #8 from vedad@kajtaz.net --- Created attachment 255901 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D255901&action= =3Dedit Reproducing pthread_cancel() deadlock --=20 You are receiving this mail because: You are the assignee for the bug.= From nobody Mon Dec 16 21:12:32 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 4YBt1r6JJjz5gVym for ; Mon, 16 Dec 2024 21:12:32 +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 4YBt1r58xXz3xnp for ; Mon, 16 Dec 2024 21:12:32 +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=1734383552; 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=CuWCxM5cLLy1SHGAtYgiTa5IQClrITN+047xH81GOvE=; b=A/j+JW1aNr92lL1l0pKUmGWoPf7s3UtkAs2A+8y0El+i2JFYUhxqweMqxunE1KaAzrRRL8 xy7a/n0kl0ItClImAP1yeBW4z6QdZHZazKwNxnS1mECuvTgI9uFxVycEegGoWvDxeuXbYE DJ2juWiYWrAQZp0tQ5/TIYpMsK4h5Bif5rr/QECYbRa1GowOEvQsBXh/lSww3l4DcEm6vO /c9cDVoFm8krZo6YNuQmrxtDAFCURJU/7yDKGvxGSDAupz7PnWjVZOMuugDgHeurTBgHJ6 5I55xnEPOtVDbTU4QefA+Z9NnGNrz1fLxPDnMQ+WLqDUse6InizKi8oLg8u79g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1734383552; a=rsa-sha256; cv=none; b=BSxxhI2Swy082WZUuNyp92ZifLsfOcXEz4b+QWxyFrdF26T/RLIMnO/W4l4AQzyhXGqAAq M/OmLEhIzXW1e8RSQwB360nqsMTseOdkvVeuPPS1Lgx9KXsiX9prDv4/PPz6NY1OjUZ+3z Mb2v90qQDD4zke0slVooK9udWQ376z22s5rbT2ltdkZcf6y2Nzm24xyJm+GTnYioSMmtL3 962ba02v9Ckjw41bXAJWFK8ZpOWXU68uLgtCGydRMKePk7GKnk1IRIo3C3utsvZ7s8NFbS PS4+zDDINsUglxTo5gdHMB+e7Wvl9G55IAM7L9kDbnrEe7YcP0UDF/aDfxLxRA== 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 4YBt1r4m8bz184Q for ; Mon, 16 Dec 2024 21:12:32 +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 4BGLCWEt072562 for ; Mon, 16 Dec 2024 21:12:32 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 4BGLCWGw072561 for threads@FreeBSD.org; Mon, 16 Dec 2024 21:12:32 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: Mon, 16 Dec 2024 21:12:32 +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: vedad@kajtaz.net X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: threads@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: attachments.created 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 #9 from vedad@kajtaz.net --- Created attachment 255902 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D255902&action= =3Dedit Runner for the pthread.c --=20 You are receiving this mail because: You are the assignee for the bug.= From nobody Mon Dec 16 21:14:44 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 4YBt4P2nG0z5gWQd for ; Mon, 16 Dec 2024 21:14:45 +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 4YBt4N72cTz3y4C for ; Mon, 16 Dec 2024 21:14:44 +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=1734383685; 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=os40SalHwFVHZadhQz2c6g6EHZlBVN7Ewa4ItXiIHV0=; b=Rvn3saEjo60WYDmt/FuRP4wduEyE8qn4nbOoH57GtFTOM/e9kVFgT+tRhJzgdzUoPDzLdz teQJLqzL8tRoOKCTDEGsT5hKsJ5UHRbWZN86OHGa7xhWLqX/3Pxmjk0MNXyh6CA6u+l3h3 B2DmLZyNW3N42KaSzUdwrLEY/36WIjriUNqrJV+3OEq9IOcY91bWHQAW0xpgNjZr2CgzP+ LhAsa+IzrBa4TUYtOz1P3LyYF2htxAJGtO2SJWa+3QelUyhyFlqDA/2QlcCy1fh6n31rik zWcdUKljCkB2zP1OKGG6LB9ZvMCWbhkUlmN7i68KXsoeNTjvkMn/A+3cuR6T8g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1734383685; a=rsa-sha256; cv=none; b=fxjdb+oPqxPoq/0wvZrrXjLUiIh364YXJtZactzm7ZrNAqt7shY4MyW8LqTbCHMeHJkdHB myNz9DB177rCg5yQrAEmN6t1ujGPhPWoawk+lVUsEcbD/3iSNLUesLzwh0kJUHw/tuczeQ lggXyE7cgQLlUPYsGDm8eIwJsMLyYM8Chfdne4hPORuH1EWHgcjyN3ZG3aPNmH8YAQZsSY 4a0UKPZslMo/9Jp85juU1M5jkRF2BwKMqE9w4eVK8+VKnjHEeRxEKj4XeydRo04MKaiMdm oimqjY3Pt5BGfcKh/44S4X0L+vUg+pWLYdjvdDnBCTm1nwjQvp2KIwerMzO0Sw== 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 4YBt4N56sfz18VW for ; Mon, 16 Dec 2024 21:14:44 +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 4BGLEi6l074111 for ; Mon, 16 Dec 2024 21:14:44 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 4BGLEiEB074110 for threads@FreeBSD.org; Mon, 16 Dec 2024 21:14:44 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: Mon, 16 Dec 2024 21:14:44 +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: vedad@kajtaz.net 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 #10 from vedad@kajtaz.net --- Hi, I'm able to reproduce this using the attached pthread.c and run shell script. Reproduced on: * QEMU * Intel(R) Celeron(R) CPU G3900T * Intel(R) Xeon(R) CPU E5-2470 v2 Instructions: // For quick results (usually under 10 minutes), invoke `./run` from a dozen // consoles or GNU screen windows in parallel. --=20 You are receiving this mail because: You are the assignee for the bug.= From nobody Mon Dec 16 22:03:03 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 4YBv874Nt9z5gb4G for ; Mon, 16 Dec 2024 22:03:03 +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 4YBv873Dwgz4303 for ; Mon, 16 Dec 2024 22:03:03 +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=1734386583; 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=rXUX2edXv+hMrEp2GPMvbxd3IVu39i9LIwmbmuKpAbY=; b=pn2p6AqJjMv/WqAlzPbVOEQPLKrhWSzS9zDRW+II7VenTDIBBMqv2wWZbGDvd2YiYcVbZx ZUbPsFAQD5GXgnPRgFrrXb3f+N/mJGM5VXiDZb8spUwnkhc3EumBku1iYZEEBnouqP6Rld ld/T0PVw+qjurvJO5d++ojoKD85ZCuTQjd81ISs/Hu110M8GKsfn3E6InzRdHy5fBfeKr3 EBYK5/u5+OUpmtEyBCJsPQvzpeY//Gohbgz0G6CIpUyskrkz/aA/TrzTghSzoCni6Ra7mG C6PBLNGW5nR6MCCOhNljz/K+/ZBuWTMCPd+mM00wckisaxq8HtlK03AiNeNQZg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1734386583; a=rsa-sha256; cv=none; b=hb7sTFkDXY+TFR/+4BRQ80jVsYH/aXRLCYjn+6/R/KOXiAs+mGoXys/UmFtiBaHkosna6x 55DAKunq7rvRCZc9PO20F8e2/8KLiE/TB8LdgAfCQuqPK/tqb0wX5K70XsaoLPHRgm64BR gTLC0GhpW9DJmrXx8SyMdLLwkpFdbHrnNF4ySHGVGcizrjeiWuWeTGQGPftRT7NoqV1jj+ UbSx2sF333KxqqhxO4rhwU04mHDxLNvk2nwVQUj1WBykisFpdWAWqP2+8jAJvB2tQ8tZjX zGp/hTrtHKeJWI3MH7CaJMooJCIHHH7M6W6BQneGA2wlTUmy9xu3zhmVa1cfng== 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 4YBv872Zbrz19qN for ; Mon, 16 Dec 2024 22:03:03 +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 4BGM335Z055433 for ; Mon, 16 Dec 2024 22:03:03 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 4BGM33aa055432 for threads@FreeBSD.org; Mon, 16 Dec 2024 22:03:03 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: Mon, 16 Dec 2024 22:03:03 +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 #11 from Konstantin Belousov --- If you have an easy to reproduce setup, please rebuild system libraries with full debug info, like this: # for x in lib/libsys liexec/rtld-elf lib/libc lib/libthr ; do make -C /usr/src/$x DEBUG_FLAGS=3D-g clean all install; done then reproduce it and show the backtraces from both threads. Also useful a= re the printouts of 'struct thread' for them. --=20 You are receiving this mail because: You are the assignee for the bug.= From nobody Thu Dec 19 09:50:39 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 4YDQlh29Bjz5gwRK for ; Thu, 19 Dec 2024 09:50:40 +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 4YDQlg0jkfz49dN for ; Thu, 19 Dec 2024 09:50:39 +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=1734601839; 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=hhQcB3AeBjxYxgkuTN8lMCU11wnEESCxVK+W7Vqnq8M=; b=W7uf2R1rFX04ZC9+YYtf7c+8i5GYVbTXJ3OBGvJnWwAzt0GGmx7Q6M5I/PUHQjws9sPyE3 LmNr1oO4rU4rY88XiOsgfC11rUj5TWKhtFOfB6HqvyC/V/CfVU9K99M39LxMrcXZVpavWS NQjPb7Q45NtptgdB9/kacLMU2nXAZ3WUacyVyLhZ8RWpxDZk/ocy0LKoPdpVuHWkUKoL9E 2CkG/J42yvvHhJGGeqV7FyE/aVfQ2pflOw53qm/BKyH4MxS2OsDxm0U+jeng4dnenu1/Bp xXTay37Zj8AyuKf9vxMEJwUctANmMEbN3pm515lrcouKXEWSxuw1foRkQImXLg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1734601839; a=rsa-sha256; cv=none; b=OvGEDiKJElXtEB7rP32rgXCd7lmpp7kKTpGi4dku/OWM6AC7fwBAldTD8ORgh+oscmKlqO lHo5R+I90F/AOpfxf2PEY/inWVZpTbp3b3uELBCbKnGj5CfUomYmGdpDkXIYjRybVjZs6e 1jsYjst9B2SX45G6Pyo1VWwY72ROGOtsYPFM+QYP4k0PlyZhp83wn+v08rfZ1PR4aO23ib l/naDvFGhgeV5qIZhir04XF0fcO1iESTSOYjEVpWaPgOJZ6OIXqTEtYHSS6zeFSSnPFOk5 ZmYXYOBHl1Dt5OVtPuWI/0e1tViHeAMxzOZ/MUH0VWnmaFSJrrABqw+NaWqbTQ== 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 4YDQlg02H2zpMJ for ; Thu, 19 Dec 2024 09:50:39 +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 4BJ9ocbZ039603 for ; Thu, 19 Dec 2024 09:50:38 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 4BJ9ocov039602 for threads@FreeBSD.org; Thu, 19 Dec 2024 09:50:38 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: Thu, 19 Dec 2024 09:50:39 +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: vedad@kajtaz.net 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 #12 from vedad@kajtaz.net --- (In reply to Konstantin Belousov from comment #11) (gdb) thread apply all bt full Thread 2 (LWP 215869 of process 56582): #0 _sigsuspend () at _sigsuspend.S:4 No locals. #1 0x000000082268cfb6 in __thr_sigsuspend (set=3D0x8269d3f90) at /usr/src/lib/libthr/thread/thr_sig.c:688 newset =3D {__bits =3D {0, 0, 0, 0}} curthread =3D 0x3a2768013500 old =3D 0 ret =3D #2 0x0000000823a09a65 in __pause () at /usr/src/lib/libc/gen/pause.c:51 oset =3D {__bits =3D {0, 0, 0, 0}} #3 0x0000000000201ac5 in thread () No symbol table info available. #4 0x0000000822683b05 in thread_start (curthread=3D0x3a2768013500) at /usr/src/lib/libthr/thread/thr_create.c:289 set =3D {__bits =3D {0, 0, 660918232, 8}} #5 0x0000000000000000 in ?? () No symbol table info available. Backtrace stopped: Cannot access memory at address 0x8269d4000 Thread 1 (LWP 100557 of process 56582): #0 _umtx_op_err () at /usr/src/lib/libthr/arch/amd64/amd64/_umtx_op_err.S:= 38 No locals. #1 0x0000000822690cdb in _thr_umtx_wait (mtx=3D0x3a2768013500, id=3D215869, timeout=3D0x0) at /usr/src/lib/libthr/thread/thr_umtx.c:198 No locals. #2 0x0000000822685a2e in join_common (pthread=3D0x3a2768013500, thread_return=3D0x820817e20, abstime=3D0x0, peek=3D) at /usr/src/lib/libthr/thread/thr_join.c:144 __cup =3D {prev =3D 0x0, routine =3D 0x822685ba0 , ro= utine_arg =3D 0x3a2768013500, onheap =3D 0} ts =3D {tv_sec =3D 34905095632, tv_nsec =3D 34937006492} ts2 =3D {tv_sec =3D 100557, tv_nsec =3D 63940923039744} curthread =3D 0x3a2768012000 ret =3D tid =3D 215869 tsp =3D 0x34b3d tmp =3D #3 0x0000000000201a4a in main () No symbol table info available. (gdb) frame 2 #2 0x0000000822685a2e in join_common (pthread=3D0x3a2768013500, thread_return=3D0x820817e20, abstime=3D0x0, peek=3D) at /usr/src/lib/libthr/thread/thr_join.c:144 144 ret =3D _thr_umtx_wait(&pthread->tid, tid, tsp); (gdb) print *pthread $2 =3D {tid =3D 215869, lock =3D {m_owner =3D 0, m_flags =3D 0, m_ceilings = =3D {0, 0}, m_rb_lnk =3D 0, m_spare =3D {0, 0}}, cycle =3D 0, locklevel =3D 0, critical= _count =3D 0, sigblock =3D 0, fsigblock =3D 0, tle =3D {tqe_next =3D 0x3a2768012000, tqe_= prev =3D 0x822694580 <_thread_list>}, gcle =3D { tqe_next =3D 0x0, tqe_prev =3D 0x0}, hle =3D {le_next =3D 0x0, le_prev = =3D 0x822694e58}, wle =3D {tqe_next =3D 0x0, tqe_prev =3D 0x0}, refcount =3D 1, start_routine =3D 0x201ab0 , arg =3D 0x0, attr =3D {sched_policy = =3D 2, sched_inherit =3D 4, prio =3D 0, suspend =3D 0, flags =3D 2, stackaddr_attr =3D 0x8267d4000, stacksize_attr =3D 2097152, guardsize_a= ttr =3D 4096, cpuset =3D 0x0, cpusetsize =3D 0}, cancel_enable =3D 1, cancel_pendin= g =3D 1, cancel_point =3D 1, no_cancel =3D 0, cancel_async =3D 0, cancelling =3D 0, = sigmask =3D {__bits =3D {0, 0, 0, 0}}, unblock_sigcancel =3D 0, in_sigsuspend =3D 1, deferred_siginfo =3D {si_si= gno =3D 0, si_errno =3D 0, si_code =3D 0, si_pid =3D 0, si_uid =3D 0, si_status =3D 0,= si_addr =3D 0x0, si_value =3D {sival_int =3D 0, sival_ptr =3D 0x0, sigval_int =3D 0, si= gval_ptr =3D 0x0}, _reason =3D {_fault =3D { _trapno =3D 0}, _timer =3D {_timerid =3D 0, _overrun =3D 0}, _mesgq= =3D {_mqd =3D 0}, _poll =3D {_band =3D 0}, _capsicum =3D {_syscall =3D 0}, __spare__ =3D = {__spare1__ =3D 0, __spare2__ =3D {0, 0, 0, 0, 0, 0, 0}}}}, deferred_sigmask =3D {__bits = =3D {0, 0, 0, 0}}, deferred_sigact =3D { __sigaction_u =3D {__sa_handler =3D 0x0, __sa_sigaction =3D 0x0}, sa_fl= ags =3D 0, sa_mask =3D {__bits =3D {0, 0, 0, 0}}}, deferred_run =3D 0, force_exit =3D = 0, state =3D PS_RUNNING, error =3D 0, joiner =3D 0x3a2768012000, flags =3D 0, tlflags = =3D 2, mq =3D {{tqh_first =3D 0x0, tqh_last =3D 0x3a27680136a8}, {tqh_first =3D 0x0, tqh_last =3D 0x3a27= 680136b8}, {tqh_first =3D 0x0, tqh_last =3D 0x3a27680136c8}, {tqh_first =3D 0x0, tqh_l= ast =3D 0x3a27680136d8}, {tqh_first =3D 0x0, tqh_last =3D 0x3a27680136e8}, {tqh_fir= st =3D 0x0, tqh_last =3D 0x3a27680136f8}}, ret =3D 0x0, specific =3D 0x0, specific_data_count =3D 0, rdlock_count = =3D 0, rtld_bits =3D 0, tcb =3D 0x3a276860b120, cleanup =3D 0x0, ex =3D {exception= _class =3D 0, exception_cleanup =3D 0x0, private_1 =3D 0, private_2 =3D 0}, unwind_stacke= nd =3D 0x8269d4000, unwind_disabled =3D 0, magic =3D 3499860245, report_events =3D 0, event_mask =3D 0, event_buf = =3D {event =3D TD_EVENT_NONE, th_p =3D 0, data =3D 0}, wchan =3D 0x0, mutex_obj =3D 0x0, w= ill_sleep =3D 0, nwaiter_defer =3D 0, robust_inited =3D 0, robust_list =3D 0, priv_robust= _list =3D 0, inact_mtx =3D 0, defer_waiters =3D { 0x0 }, wake_addr =3D 0x3a2768600030, sleepqueue =3D 0x3a27680190c0, name =3D 0x0, dlerror_msg =3D '\000' , dlerror_seen =3D 0} --=20 You are receiving this mail because: You are the assignee for the bug.= From nobody Thu Dec 19 09:57:52 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 4YDQw03ZG9z5gx5R for ; Thu, 19 Dec 2024 09:57:52 +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 4YDQw011BMz4G19 for ; Thu, 19 Dec 2024 09:57:52 +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=1734602272; 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=0lZcMKWSx3NNalmehXmlTBgS4JvmABVhcm682sGG9XU=; b=lodYsCFtSaieZ4YDBlybNvZZceJodWaTKHoquBlv9qjBkdDVq2Y14MhKvXRFDttWwFGL31 PdbVh5qeCQw4JpiUNEdPXzH6JnyKW8ZeEJfYsSytptHEe7l/lT++xbIeEg4hJ+Nk1HeTXN J/NToSnIWEtFVkxcDL/9Gf3nn5BFOFJnnLp0UIyOi3uWnkbS+XcpVKeQwgOHR6pohVzqMI XfO99bDMAi/ulQmz7L9wnr+wzRKmkvB6zb+L0PpK/Ybv9DKqlB0qney0I3MJF4SAMJrUiZ dQavnP4LloaY24xZU7NEN9BQIKpi1M1NHQuwyauANXQ7myS4eDdI71WE5ewb5Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1734602272; a=rsa-sha256; cv=none; b=FT4MWPsErYXF7yT8Z/U/3mmYiPnTZF6izsW5knYWwCzY4bpWeTJtJh7ToRC5V9tkgenEmb NAuQm2mtIn4jWTNshsu6Cdp7pnJVDasDcN07Jxda8eCpBz/BADO6B8DFY9zevqm6LBbYkO KGJcFkAiAQdGsxhJPVSTBrnXKax7celwkGgUe6Nq0c2i6bBvTr+8jZaDRHtra9EOT/n+4O hraAlx0v0suQJbAXt1I9df5GRJ843cVWZ0srf0vj2lZ47n8xK2g6g7s4rzQ+TDRyb7rOi+ sQH+SGPMr2hhSPGiQNMMl1t6znx2672G0QBWMvzrcE/FQu0DPKXKyRe/51/1mg== 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 4YDQw00SXszp32 for ; Thu, 19 Dec 2024 09:57:52 +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 4BJ9vpgY053041 for ; Thu, 19 Dec 2024 09:57:51 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 4BJ9vpn9053040 for threads@FreeBSD.org; Thu, 19 Dec 2024 09:57:51 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: Thu, 19 Dec 2024 09:57:52 +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: vedad@kajtaz.net 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 #13 from vedad@kajtaz.net --- Local *curthread from the frame #2: (gdb) print *curthread $3 =3D {tid =3D 100557, lock =3D {m_owner =3D 0, m_flags =3D 0, m_ceilings = =3D {0, 0}, m_rb_lnk =3D 0, m_spare =3D {0, 0}}, cycle =3D 0, locklevel =3D 0, critical= _count =3D 0, sigblock =3D 0, fsigblock =3D 0, tle =3D {tqe_next =3D 0x0, tqe_prev =3D 0x= 3a2768013540}, gcle =3D {tqe_next =3D 0x0, tqe_prev =3D 0x0}, hle =3D {le_next =3D 0x0, le_prev =3D 0x822694db0}, = wle =3D {tqe_next =3D 0x0, tqe_prev =3D 0x0}, refcount =3D 0, start_routine =3D 0x0= , arg =3D 0x0, attr =3D {sched_policy =3D 2, sched_inherit =3D 4, prio =3D 0, suspend =3D = 0, flags =3D 258, stackaddr_attr =3D 0x800819000, stacksize_attr =3D 536870912, guardsize_attr =3D 4096, cpuset =3D 0x0, = cpusetsize =3D 0}, cancel_enable =3D 1, cancel_pending =3D 0, cancel_point =3D 1, no_c= ancel =3D 0, cancel_async =3D 0, cancelling =3D 0, sigmask =3D {__bits =3D {0, 0, 0, 0}}, unblock_sigcancel =3D 0, in_sigsuspend =3D 0, deferred_siginfo =3D {si_signo =3D 0, si_errno =3D 0, si_code =3D 0, si_p= id =3D 0, si_uid =3D 0, si_status =3D 0, si_addr =3D 0x0, si_value =3D {sival_int =3D= 0, sival_ptr =3D 0x0, sigval_int =3D 0, sigval_ptr =3D 0x0}, _reason =3D {_fault =3D {_t= rapno =3D 0}, _timer =3D {_timerid =3D 0, _overrun =3D 0}, _mesgq =3D {_mqd =3D 0}, _poll =3D {_band =3D 0}, _capsicum =3D {_sys= call =3D 0}, __spare__ =3D {__spare1__ =3D 0, __spare2__ =3D {0, 0, 0, 0, 0, 0, 0}}}}, deferred_sigmask =3D {__bits =3D {0, 0, 0, 0}}, deferred_sigact =3D {__siga= ction_u =3D {__sa_handler =3D 0x0, __sa_sigaction =3D 0x0}, sa_flags =3D 0, sa_mask =3D {__bits =3D {0, 0, 0, 0}}}, deferred_run = =3D 0, force_exit =3D 0, state =3D PS_RUNNING, error =3D 0, joiner =3D 0x0, flags = =3D 0, tlflags =3D 2, mq =3D {{tqh_first =3D 0x0, tqh_last =3D 0x3a27680121a8}, {tqh_first= =3D 0x0, tqh_last =3D 0x3a27680121b8}, { tqh_first =3D 0x0, tqh_last =3D 0x3a27680121c8}, {tqh_first =3D 0x0, = tqh_last =3D 0x3a27680121d8}, {tqh_first =3D 0x0, tqh_last =3D 0x3a27680121e8}, {tqh_fir= st =3D 0x0, tqh_last =3D 0x3a27680121f8}}, ret =3D 0x0, specific =3D 0x0, specific_data_count =3D 0, rdlock_count =3D 0, rtld_bits =3D 0, tcb =3D 0x3a2767c1c120, cleanup =3D 0x820817da0, ex =3D {exception_class =3D 0, exception_cleanup =3D 0x0, private_1 =3D 0, private= _2 =3D 0}, unwind_stackend =3D 0x820819000, unwind_disabled =3D 0, magic =3D 349986024= 5, report_events =3D 0, event_mask =3D 0, event_buf =3D { event =3D TD_EVENT_NONE, th_p =3D 0, data =3D 0}, wchan =3D 0x0, mutex_= obj =3D 0x0, will_sleep =3D 0, nwaiter_defer =3D 0, robust_inited =3D 0, robust_list =3D= 0, priv_robust_list =3D 0, inact_mtx =3D 0, defer_waiters =3D {0x0 }, wake_addr =3D 0x8226950e0, sleepqueue =3D 0x3a2768019000, name =3D 0x0, dlerror_msg =3D "Invalid sha= red object handle 0x822694bf0", '\000' , dlerror_seen =3D 1} --=20 You are receiving this mail because: You are the assignee for the bug.= From nobody Thu Dec 19 16:39:13 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 4YDbq56mNGz5hRHJ for ; Thu, 19 Dec 2024 16:39:13 +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 4YDbq55ggtz3wxq for ; Thu, 19 Dec 2024 16:39:13 +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=1734626353; 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=mrOXzdjsfc9joNXCKitxHzj6o5rqY2WQcHPlANRoIp4=; b=FZeYyQdpeetG1g90MQjXMmA8rCEaNtCqqpFuSRksPnZr9PQoKFZi4SyP78VnzrcG7MILdb ndlUuSiXdd1xiDhiHB1GNQm5IDe2TATokX9O2hnFV2E6DSAb7CSMpjx9ZGNTHNhyANRO/y PC1V4URv/xG2NnBAAQprdVV2k5DneKbArEwvquOC3BS6AKK8C2sDbu+88IANzdAynr/HLi xGY6jyVTNZ1LPPp+pK6bezwyNsXAuHfWJecYJ13sjcVmi89P2B1LUEei5kXZIBFL3J5YQE 36ozHyA8gzRq7lAlHFWC2tpbpiWQkL4oWiSNXnZsyOiVPuPHyRCsj41fzWXBPg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1734626353; a=rsa-sha256; cv=none; b=bSj3dEHgEIYu/4mKDx9oTcgHxvnTRLfai3OSGb0oMxSfn4MQpzY2xsOsi2m6ag7q+0lsX4 X8b+8kt19LB9Gg73KKtayR0QTYL1W6V9DKHvmYPSdRsGfRsUa/RdL1kJRzWedb1dxQrcya DyDjeNvQgEE+9L3OvSq+ymgWkuoZZE9eSXqhbBQuXceNowLgfJ0ton8ZPx1SBQyqfO3GKP 3LZGA+PLGAj94ygERJ6N/kpYAq9S/XM84it2fY9x13FJaUwhYhfnX2zYi3mhHdopq14xJX ODaMGMDC/psxOXCP9uFPYwyN1mUFOwj4tHHFTMIRLq4U/6b1G0B6hjSXeo82UA== 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 4YDbq559QBz11pD for ; Thu, 19 Dec 2024 16:39:13 +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 4BJGdDXo091181 for ; Thu, 19 Dec 2024 16:39:13 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 4BJGdD3W091180 for threads@FreeBSD.org; Thu, 19 Dec 2024 16:39:13 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: Thu, 19 Dec 2024 16:39:13 +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 #14 from Konstantin Belousov --- So the victim (would be cancelled) thread has cancel_pending =3D 1, which m= ean that the main thread successfully executed _thr_cancel() against it. The actions of _thr_cancel() are setting cancel_pending, and sending SIGCANCEL to the target using thr_kill(2). Since the victim is happily sleeping in sigsuspend(), either SIGCANCEL was = not delivered at all, or delivered but ignored due to convoluted threaded handl= er. I tried to find any point where SIGCANCEL could be lost, but so far I do not see it. Can you please apply the debugging patch below and repeat the same data gathering? I want to see if the victim thread' userspace got SIGCANCEL at = all. --=20 You are receiving this mail because: You are the assignee for the bug.= From nobody Thu Dec 19 16:39:41 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 4YDbqd60j1z5hR94 for ; Thu, 19 Dec 2024 16:39: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 4YDbqd4rjJz3x3s for ; Thu, 19 Dec 2024 16:39:41 +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=1734626381; 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=2dBuh965GM7puznKrGpLHn2YURcZuzcC1SlOko2Wq78=; b=eGQ/3+TzC/O5tByZciVfNU1i0mPLDW5RAd0KuIfbQAF6oqkmGKml2coBCJBFbkSXLg5Iy0 msVQkP93RB9YMIGU7mxmu+OuOPm1Xsd8EOGNlPjfqVWo+a3N4AYBdynbQ5prgkzfVxerVU MzTC2KVgS4Ogn1WdVzkVzhFucYDpb4GLLYv6YaODEstGbPBRGG3wr8in5YyY62pE8OTbZ/ 5+Hn8YmW8HT/a6z8Om0s2sgsvSZclTl5yU68nfv1IA6G4fBc3ch138pBnaODAcRX5REO1U nDGQm2jFtF4ByweP0rxVmjaULCF4y0Gqz2SApMy84OiZ/B6J0CGcawqs9XRpgA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1734626381; a=rsa-sha256; cv=none; b=CaWh6QeZLgcXxeZuCoNOVfVcpNorvHV4VqSggn6Vqpzex9N6rmHX96tQv76d+rqe2d1W57 hszZ123bEzU1cL2/B42Rny6PSSYue2WZft87+6yFFK6DrI94WG95ANfd1a/oSq6RvGimIg oVOSlorTB3tdZ5oNBVwaXjqupGBRNdoqv4ZdPT/7NbVHljf618GAvMf+yHZtjNbA/f46+L SQrYvcL9YEwyNDmYvSNl8yVzVNAjUBpEdTXyCqKgZQ2j4CQdNZeIjg1eiOgaADJqNFJ+La sKku6FKaQps/L2NWNVUjlZvtuBKWPr8g3OIya+rUorYqYMVfZlzdu8NCaLr8Pw== 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 4YDbqd4RGdz11WF for ; Thu, 19 Dec 2024 16:39:41 +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 4BJGdfma091445 for ; Thu, 19 Dec 2024 16:39:41 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 4BJGdfaC091443 for threads@FreeBSD.org; Thu, 19 Dec 2024 16:39:41 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: Thu, 19 Dec 2024 16:39:41 +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: attachments.created 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 #15 from Konstantin Belousov --- Created attachment 255955 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D255955&action= =3Dedit Debug SIGCANCEL delivery --=20 You are receiving this mail because: You are the assignee for the bug.= From nobody Fri Dec 20 11:10:13 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 4YF4T14c4Fz5hnnD for ; Fri, 20 Dec 2024 11:10:13 +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 4YF4T11bvzz4TqD for ; Fri, 20 Dec 2024 11:10:13 +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=1734693013; 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=vM6bTgAMFnTl77VOg/G5tnUsfCaopZSma8KLsmDlAtk=; b=kt2v15FDP2DAGl4nj0QrZwkZLpXnXpBoAbCJjO36EFL6c1DZADb+hNCyPuhyQjLYkIXU8s gGInNp6aZvwC+FIIdy/TnKKe0pehchSEGxqsXd+MjF8Lt7zqBqrIGjsYLz/6atdGfpmeu0 d1ruTRfPR0Ccii3uNSu+TsF/f69EIqtRbzoljNy4qPhagLWi7ZwN8IH0JE2ZoXCrPRy/dp AykZLus4a5fkJSTa+8+3JtvV7eUUQfJjMygM9lg0uE9KxfIdUtLDY7jlaZra5MJaZVHNt+ cSDhx00n4JBe+fTOgtIaWWN7fVpmnbQgabaxxJ25EZ85NPYyAtpQTs8dL1fVJQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1734693013; a=rsa-sha256; cv=none; b=nILY3esMRIRDAMbX6GxmIYmUje47Znh5c4tOyv90rsDg+Pe3JyxeYI9BQLQJFbqVyEqdfQ dWtgqQwn3YxX/VklcPJOOi4VlI8r/kpKQlLea+FKolwC3ZsqcmVoMFuGm1X+e8qGBGYJDS id2vppQiZZEjjC0Q/vhkfpkoEYyczelkDoo5NzIrEMDZejBb5l9B+RTZlIaj2K0bmWbf1u MB05OB9obbp74hRrZoVfnP67JtDEQLbZ3G0mME8idNOwJXXJB9IK5XZLc5H72wTsBax26f 2tdvyyBB3he+0y2aezOjpjYVnQhML7tpG772l+YU72Cu8+fmUq0RaODLC0/WSQ== 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 4YF4T114ymzc0m for ; Fri, 20 Dec 2024 11:10:13 +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 4BKBADEm052341 for ; Fri, 20 Dec 2024 11:10:13 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 4BKBADsx052340 for threads@FreeBSD.org; Fri, 20 Dec 2024 11:10:13 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 11:10:13 +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: vedad@kajtaz.net 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 #16 from vedad@kajtaz.net --- (In reply to Konstantin Belousov from comment #14) Here it is: (gdb) print *pthread $1 =3D {tid =3D 394413, lock =3D {m_owner =3D 0, m_flags =3D 0, m_ceilings = =3D {0, 0}, m_rb_lnk =3D 0, m_spare =3D {0, 0}}, cycle =3D 0, locklevel =3D 0, critical= _count =3D 0, sigblock =3D 0, fsigblock =3D 0, tle =3D {tqe_next =3D 0xf1713c12000, tqe_p= rev =3D 0x821f39590 <_thread_list>}, gcle =3D { tqe_next =3D 0x0, tqe_prev =3D 0x0}, hle =3D {le_next =3D 0x0, le_prev = =3D 0x821f39e20}, wle =3D {tqe_next =3D 0x0, tqe_prev =3D 0x0}, refcount =3D 1, start_routine =3D 0x201a70 , arg =3D 0x0, attr =3D {sched_policy = =3D 2, sched_inherit =3D 4, prio =3D 0, suspend =3D 0, flags =3D 2, stackaddr_attr =3D 0x823a8f000, stacksize_attr =3D 2097152, guardsize_a= ttr =3D 4096, cpuset =3D 0x0, cpusetsize =3D 0}, sigcancel_cnt =3D 1, sigcancel_cri= t_cnt =3D 1, cancel_enable =3D 1, cancel_pending =3D 1, cancel_point =3D 1, no_cancel = =3D 0, cancel_async =3D 0, cancelling =3D 0, sigmask =3D {__bits =3D {0, 0, 0, 0}}, unblock_sigcancel =3D 0, in_sigsus= pend =3D 1, deferred_siginfo =3D {si_signo =3D 0, si_errno =3D 0, si_code =3D 0, si_pid= =3D 0, si_uid =3D 0, si_status =3D 0, si_addr =3D 0x0, si_value =3D {sival_int =3D 0, siv= al_ptr =3D 0x0, sigval_int =3D 0, sigval_ptr =3D 0x0}, _reason =3D {_fault =3D {_trapno =3D 0}, _timer = =3D {_timerid =3D 0, _overrun =3D 0}, _mesgq =3D {_mqd =3D 0}, _poll =3D {_band =3D 0}, _= capsicum =3D {_syscall =3D 0}, __spare__ =3D {__spare1__ =3D 0, __spare2__ =3D {0, 0, 0,= 0, 0, 0, 0}}}}, deferred_sigmask =3D {__bits =3D {0, 0, 0, 0}}, deferred_sigact =3D {__sigaction_u =3D {__sa_handler =3D 0= x0, __sa_sigaction =3D 0x0}, sa_flags =3D 0, sa_mask =3D {__bits =3D {0, 0, 0, = 0}}}, deferred_run =3D 0, force_exit =3D 0, state =3D PS_RUNNING, error =3D 0, jo= iner =3D 0xf1713c12000, flags =3D 0, tlflags =3D 2, mq =3D {{ tqh_first =3D 0x0, tqh_last =3D 0xf1713c12fb0}, {tqh_first =3D 0x0, t= qh_last =3D 0xf1713c12fc0}, {tqh_first =3D 0x0, tqh_last =3D 0xf1713c12fd0}, {tqh_first= =3D 0x0, tqh_last =3D 0xf1713c12fe0}, {tqh_first =3D 0x0, tqh_last =3D 0xf1713c12ff0= }, {tqh_first =3D 0x0, tqh_last =3D 0xf1713c13000}}, ret =3D 0x0, specific =3D 0x0, specific_data_count =3D 0, rdlock_count =3D 0, rtld_bits =3D 0, tcb =3D 0xf= 171420f120, cleanup =3D 0x0, ex =3D {exception_class =3D 0, exception_cleanup =3D 0x0, = private_1 =3D 0, private_2 =3D 0}, unwind_stackend =3D 0x823c8f000, unwind_disabled =3D 0, magic =3D 3499860245, report_events =3D 0, event_m= ask =3D 0, event_buf =3D {event =3D TD_EVENT_NONE, th_p =3D 0, data =3D 0}, wchan =3D = 0x0, mutex_obj =3D 0x0, will_sleep =3D 0, nwaiter_defer =3D 0, robust_inited =3D 0, robust= _list =3D 0, priv_robust_list =3D 0, inact_mtx =3D 0, defer_waiters =3D {0x0 }, wake_addr =3D 0xf1714200018, sleepqueue =3D 0xf1713c19080, name =3D 0x0, dlerror_msg =3D = '\000' , dlerror_seen =3D 0} (gdb) print *curthread $2 =3D {tid =3D 100589, lock =3D {m_owner =3D 0, m_flags =3D 0, m_ceilings = =3D {0, 0}, m_rb_lnk =3D 0, m_spare =3D {0, 0}}, cycle =3D 0, locklevel =3D 0, critical= _count =3D 0, sigblock =3D 0, fsigblock =3D 0, tle =3D {tqe_next =3D 0x0, tqe_prev =3D 0x= f1713c12e40}, gcle =3D {tqe_next =3D 0x0, tqe_prev =3D 0x0}, hle =3D {le_next =3D 0x0, le_prev =3D 0x821f39db0}, = wle =3D {tqe_next =3D 0x0, tqe_prev =3D 0x0}, refcount =3D 0, start_routine =3D 0x0= , arg =3D 0x0, attr =3D {sched_policy =3D 2, sched_inherit =3D 4, prio =3D 0, suspend =3D = 0, flags =3D 258, stackaddr_attr =3D 0x8003a5000, stacksize_attr =3D 536870912, guardsize_attr =3D 4096, cpuset =3D 0x0, = cpusetsize =3D 0}, sigcancel_cnt =3D 0, sigcancel_crit_cnt =3D 0, cancel_enable =3D 1, cancel_pending =3D 0, cancel_point =3D 1, no_cancel =3D 0, cancel_async =3D= 0, cancelling =3D 0, sigmask =3D {__bits =3D {0, 0, 0, 0}}, unblock_sigcancel =3D 0, in_sigsuspend =3D 0, deferred_siginfo =3D {si_si= gno =3D 0, si_errno =3D 0, si_code =3D 0, si_pid =3D 0, si_uid =3D 0, si_status =3D 0,= si_addr =3D 0x0, si_value =3D {sival_int =3D 0, sival_ptr =3D 0x0, sigval_int =3D 0, si= gval_ptr =3D 0x0}, _reason =3D {_fault =3D { _trapno =3D 0}, _timer =3D {_timerid =3D 0, _overrun =3D 0}, _mesgq= =3D {_mqd =3D 0}, _poll =3D {_band =3D 0}, _capsicum =3D {_syscall =3D 0}, __spare__ =3D = {__spare1__ =3D 0, __spare2__ =3D {0, 0, 0, 0, 0, 0, 0}}}}, deferred_sigmask =3D {__bits = =3D {0, 0, 0, 0}}, deferred_sigact =3D { __sigaction_u =3D {__sa_handler =3D 0x0, __sa_sigaction =3D 0x0}, sa_fl= ags =3D 0, sa_mask =3D {__bits =3D {0, 0, 0, 0}}}, deferred_run =3D 0, force_exit =3D = 0, state =3D PS_RUNNING, error =3D 0, joiner =3D 0x0, flags =3D 0, tlflags =3D 2, mq =3D= {{tqh_first =3D 0x0, tqh_last =3D 0xf1713c121b0}, { tqh_first =3D 0x0, tqh_last =3D 0xf1713c121c0}, {tqh_first =3D 0x0, t= qh_last =3D 0xf1713c121d0}, {tqh_first =3D 0x0, tqh_last =3D 0xf1713c121e0}, {tqh_first= =3D 0x0, tqh_last =3D 0xf1713c121f0}, {tqh_first =3D 0x0, tqh_last =3D 0xf1713c12200= }}, ret =3D 0x0, specific =3D 0x0, specific_data_count =3D 0, rdlock_count =3D 0, rtld_bits =3D 0, tcb =3D 0xf171381c120, cleanup =3D 0x8203a39f0, ex =3D {exception_class =3D 0, exception_cleanup =3D 0x0, private_1 =3D 0, private_2 =3D 0}, unwind_stacke= nd =3D 0x8203a5000, unwind_disabled =3D 0, magic =3D 3499860245, report_events =3D 0, event_mask =3D 0, event_buf =3D {event =3D TD_EVENT_= NONE, th_p =3D 0, data =3D 0}, wchan =3D 0x0, mutex_obj =3D 0x0, will_sleep =3D 0, nwaiter= _defer =3D 0, robust_inited =3D 0, robust_list =3D 0, priv_robust_list =3D 0, inact_mtx = =3D 0, defer_waiters =3D { 0x0 }, wake_addr =3D 0x821f3a0e0, sleepqueue =3D 0xf1713c19000, name =3D 0x0, dlerror_msg =3D "Invalid shared object handle 0x821f39bf0", '\000' , dlerror_seen =3D 1} --=20 You are receiving this mail because: You are the assignee for the bug.= 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.= From nobody Sat Dec 21 11:15:35 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 4YFhXl50cGz5Yygx for ; Sat, 21 Dec 2024 11:15:35 +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 4YFhXl0hNpz4sDm for ; Sat, 21 Dec 2024 11:15:35 +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=1734779735; 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=n+tF4C34dWdeRIA7jwYALzbIckPu8trnPkuUgmgojHE=; b=VqjaRNpgMDZAp+tHxPFEQjFME81+ac7GS2xDLS680+BED0ByPSYtj/jQmhjHFR9PArYjA1 r6NonDoHG+TMGr2ggLo+n4vJmaQ+g89yeDhNIMkHRPvmlK0YOD7xurfnjU76IJDvJL9Fpu M750AnhbRkTr44STDjlXzEwWDcx+DDR4xUewUXzRSV/MJw/bonkbcaO5obZEYxaG1vK0M2 ayUGe3H6prGDxh2jKNj+EIip9gFHXUaUU49uyuIoAkNnEf/Zkw4BelaYzaD64z+6fJfldo Aq1nsBjsx31Pv+M/qvSevvsYGhhCwZDEFIIPGK7BpDZW/OUfGMy1+DpZYYCeog== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1734779735; a=rsa-sha256; cv=none; b=FrYM2ZTSLnQnUTuYHavgG+9Wl676OusugC1klIuE5RmUfSoW3VMyvEN1cK9zYZgPl3z4Mb AyN74IXJFK6hFRomutVgwruwod2RW448iByGZqKo7PqheomKkWyHj+4eOl28HUmQLAgaAZ aXsoUEdgxCVwknYxSyD7AjKD4WGPIAW/vNZyNEhS22BQKdynh7+q6/4iXS3YRXUAntK3qu X+wqmobffYu/XPGjFFGFT+pZYYDV8t5QWaapZlfJekmUH2dUrsL07x2gr8wgSsXsbonR8O ocjQ+jNWJuKqnjI41JZmeYnPzGloUUs5pS7nTHzZ8pezV7bXofhbPIcXnzhtiw== 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 4YFhXl0JkNzM5h for ; Sat, 21 Dec 2024 11:15:35 +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 4BLBFY37033726 for ; Sat, 21 Dec 2024 11:15:34 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 4BLBFYTM033725 for threads@FreeBSD.org; Sat, 21 Dec 2024 11:15:34 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: Sat, 21 Dec 2024 11:15:35 +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: vedad@kajtaz.net 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 #18 from vedad@kajtaz.net --- (In reply to Konstantin Belousov from comment #17) Your latest patch didn't apply over the previous one, so I git-checkout'd first. > PID 33078, iteration 340...pthread_cancel() succeeded > OK > Abort trap (core dumped) I guess the abort() occurred at iteration 341, whose stdout wasn't flushed. dmesg: > pthread(pid 33078 uid 0) aborted: thr_in_critical %p(0x1fc231a12700) (gdb) thread apply all bt full Thread 2 (LWP 337498): #0 _umtx_op_err () at /usr/src/lib/libthr/arch/amd64/amd64/_umtx_op_err.S:= 38 No locals. #1 0x0000000821978d4b in _thr_umtx_wait (mtx=3D0x1fc231a12700, id=3D688152, timeout=3D0x0) at /usr/src/lib/libthr/thread/thr_umtx.c:198 No locals. #2 0x000000082196da7e in join_common (pthread=3D0x1fc231a12700, thread_return=3D0x82043ebc0, abstime=3D0x0, peek=3D) at /usr/src/lib/libthr/thread/thr_join.c:144 __cup =3D {prev =3D 0x0, routine =3D 0x82196dbf0 , ro= utine_arg =3D 0x1fc231a12700, onheap =3D 0} ts =3D {tv_sec =3D 34901060464, tv_nsec =3D 34923276780} ts2 =3D {tv_sec =3D 0, tv_nsec =3D 34918916759552} curthread =3D 0x1fc231a12000 ret =3D tid =3D 688152 tsp =3D 0xa8018 tmp =3D #3 0x0000000000201aee in thread_cancel_and_join (ptid=3D0x1fc231a12700) at pthread.c:28 status =3D 0x0 error =3D 0 #4 0x0000000000201a2c in main (argc=3D1, argv=3D0x82043ec98) at pthread.c:= 73 ptid =3D 0x1fc231a12700 err =3D 0 iteration =3D 341 pid =3D 33078 Thread 1 (LWP 688152): #0 abort2 () at abort2.S:4 No locals. #1 0x0000000821974b0e in sigcancel_handler (sig=3D, info=3D, ucp=3D) at /usr/src/lib/libthr/thread/thr_sig.c:198 p =3D {0x1fc231a12700} curthread =3D 0x1fc231a12700 err =3D #2 No symbol table info available. #3 _umtx_op_err () at /usr/src/lib/libthr/arch/amd64/amd64/_umtx_op_err.S:= 38 No locals. #4 0x0000000821978a30 in __thr_umutex_lock (mtx=3D0x1fc231a12708, id=3D688= 152) at /usr/src/lib/libthr/thread/thr_umtx.c:79 owner =3D #5 0x000000082196c30a in _thr_umutex_lock (mtx=3D0x1fc231a12708, id=3D17) = at /usr/src/lib/libthr/thread/thr_umtx.h:123 No locals. #6 exit_thread () at /usr/src/lib/libthr/thread/thr_exit.c:301 curthread =3D 0x1fc231a12700 #7 0x000000082196c1fe in _pthread_exit_mask (status=3Dstatus@entry=3D0x1, mask=3Dmask@entry=3D0x0) at /usr/src/lib/libthr/thread/thr_exit.c:263 curthread =3D 0x1fc231a12700 cleanup =3D #8 0x000000082196c06b in _Tthr_exit (status=3D0x1fc231a12708, status@entry= =3D0x1) at /usr/src/lib/libthr/thread/thr_exit.c:206 No locals. #9 0x000000082196a400 in testcancel (curthread=3D) at /usr/src/lib/libthr/thread/thr_cancel.c:51 No locals. #10 _thr_cancel_enter (curthread=3Dcurthread@entry=3D0x1fc231a12700) at /usr/src/lib/libthr/thread/thr_cancel.c:149 No locals. #11 0x0000000821975002 in __thr_sigsuspend (set=3D0x822ca5f80) at /usr/src/lib/libthr/thread/thr_sig.c:692 newset =3D {__bits =3D {583688064, 8, 0, 0}} curthread =3D 0x1fc231a12700 old =3D 0 ret =3D #12 0x0000000821fcea65 in __pause () at /usr/src/lib/libc/gen/pause.c:51 oset =3D {__bits =3D {0, 0, 0, 0}} #13 0x0000000000201a81 in thread (arg=3D0x0) at pthread.c:12 No locals. #14 0x000000082196bb55 in thread_start (curthread=3D0x1fc231a12700) at /usr/src/lib/libthr/thread/thr_create.c:289 set =3D {__bits =3D {0, 0, 596938712, 8}} #15 0x0000000000000000 in ?? () (gdb) frame 1 #1 0x0000000821974b0e in sigcancel_handler (sig=3D, info=3D, ucp=3D) at /usr/src/lib/libthr/thread/thr_sig.c:198 198 abort2("thr_in_critical %p", 1, p); (gdb) print *curthread $1 =3D {tid =3D 688152, lock =3D {m_owner =3D 0, m_flags =3D 0, m_ceilings = =3D {0, 0}, m_rb_lnk =3D 0, m_spare =3D {0, 0}}, cycle =3D 0, locklevel =3D 1, critical= _count =3D 0, sigblock =3D 0, fsigblock =3D 0, tle =3D {tqe_next =3D 0x1fc231a12000, tqe_= prev =3D 0x82197c600 <_thread_list>}, gcle =3D { tqe_next =3D 0x0, tqe_prev =3D 0x0}, hle =3D {le_next =3D 0x0, le_prev = =3D 0x82197ce68}, wle =3D {tqe_next =3D 0x0, tqe_prev =3D 0x0}, refcount =3D 1, start_routine =3D 0x201a70 , arg =3D 0x0, attr =3D {sched_policy = =3D 2, sched_inherit =3D 4, prio =3D 0, suspend =3D 0, flags =3D 2, stackaddr_attr =3D 0x822aa6000, stacksize_attr =3D 2097152, guardsize_a= ttr =3D 4096, cpuset =3D 0x0, cpusetsize =3D 0}, cancel_enable =3D 1, cancel_pendin= g =3D 1, cancel_point =3D 0, no_cancel =3D 1, cancel_async =3D 0, cancelling =3D 1, = sigmask =3D {__bits =3D {0, 0, 0, 0}}, unblock_sigcancel =3D 0, in_sigsuspend =3D 1, deferred_siginfo =3D {si_si= gno =3D 0, si_errno =3D 0, si_code =3D 0, si_pid =3D 0, si_uid =3D 0, si_status =3D 0,= si_addr =3D 0x0, si_value =3D {sival_int =3D 0, sival_ptr =3D 0x0, sigval_int =3D 0, si= gval_ptr =3D 0x0}, _reason =3D {_fault =3D { _trapno =3D 0}, _timer =3D {_timerid =3D 0, _overrun =3D 0}, _mesgq= =3D {_mqd =3D 0}, _poll =3D {_band =3D 0}, _capsicum =3D {_syscall =3D 0}, __spare__ =3D = {__spare1__ =3D 0, __spare2__ =3D {0, 0, 0, 0, 0, 0, 0}}}}, deferred_sigmask =3D {__bits = =3D {0, 0, 0, 0}}, deferred_sigact =3D { __sigaction_u =3D {__sa_handler =3D 0x0, __sa_sigaction =3D 0x0}, sa_fl= ags =3D 0, sa_mask =3D {__bits =3D {0, 0, 0, 0}}}, deferred_run =3D 0, force_exit =3D = 0, state =3D PS_RUNNING, error =3D 0, joiner =3D 0x1fc231a12000, flags =3D 0, tlflags = =3D 2, mq =3D {{tqh_first =3D 0x0, tqh_last =3D 0x1fc231a128a8}, {tqh_first =3D 0x0, tqh_last =3D 0x1fc2= 31a128b8}, {tqh_first =3D 0x0, tqh_last =3D 0x1fc231a128c8}, {tqh_first =3D 0x0, tqh_l= ast =3D 0x1fc231a128d8}, {tqh_first =3D 0x0, tqh_last =3D 0x1fc231a128e8}, {tqh_fir= st =3D 0x0, tqh_last =3D 0x1fc231a128f8}}, ret =3D 0x1, specific =3D 0x0, specific_data_count =3D 0, rdlock_count = =3D 0, rtld_bits =3D 0, tcb =3D 0x1fc232003120, cleanup =3D 0x0, ex =3D {exception= _class =3D 0, exception_cleanup =3D 0x0, private_1 =3D 0, private_2 =3D 0}, unwind_stacke= nd =3D 0x822ca6000, unwind_disabled =3D 0, magic =3D 3499860245, report_events =3D 0, event_mask =3D 0, event_buf = =3D {event =3D TD_EVENT_NONE, th_p =3D 0, data =3D 0}, wchan =3D 0x0, mutex_obj =3D 0x0, w= ill_sleep =3D 0, nwaiter_defer =3D 0, robust_inited =3D 0, robust_list =3D 0, priv_robust= _list =3D 0, inact_mtx =3D 0, defer_waiters =3D { 0x0 }, wake_addr =3D 0x1fc232000000, sleepqueue =3D 0x1fc231a19040, name =3D 0x0, dlerror_msg =3D "Undefined symbol \"_Unwind_ForcedUnwind\"", '\000' , dlerror_seen =3D 0} --=20 You are receiving this mail because: You are the assignee for the bug.= From nobody Sat Dec 21 18:43:20 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 4YFtTQ36z6z5WtJ8 for ; Sat, 21 Dec 2024 18:43:22 +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 4YFtTQ0bM8z4cRT for ; Sat, 21 Dec 2024 18:43:22 +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=1734806602; 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=GFOx0MgB4dvcDvQaliP68+ujvBRfbLgLVVM6r6sXoIg=; b=bv8pb+RqohJ9Szv1nIhQMDFv3HI0SwphmfDr8YNtdUkhgBAWWovtr1I6bP3hRlmeVcJ4g+ LzzJG/izzWNTD0IeHSrQKREO0b5Rhrp1CEm+20smAHn2evUUX/cCmCgjGP0cB0JNy+bv4Q q7zWPkbo8iiZ4qkbBQ0t0h5BLc70YyUsrzrqzf4U83F3F9PQLodJZUMu0QNwqXcTbmVK4A lTB1qMS98fmiu5ail7D8CuofSbcW0Wpx8nR1v5uijzuGdE1LT5MCDOH9Az83TlmDjxpwPb WsKMS+ZgBMeBMBTEbg5cXnYeU41lCnYWWZfvKBUrhbKaBm+aPQkS2rpID58JkQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1734806602; a=rsa-sha256; cv=none; b=RgSoMU900ILCBdY73WCZvQ8ap6qG4plCN51K6a+3Oo66NAUR8QCRFv8A/RFM8XK0Ye25O6 9U3sN1SsirTf0vM2z1Wx1niV3JCiJ/dqGjBIOh1lYI9V+gSEUspQtnXBbBSPrHqplezTj9 YOS9KCxVUbCYiilIiAT1qSP7ly1ka8i48aXjiVJc+MxCNEkIrWQ1QmWMHhkcOLl9pSalfO xDkswqNqNysYt7C3kgKzyFDNHL9Tp6zGYvd40nkOEtu8XWY4CeygOXTMDkgXVLCGvnAo82 ppS7Wtnbl1RM8w88qK7dmnpYAg+dssN4sCVhN4h1wzoT4cElPD6nWbyMqQS+ZQ== 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 4YFtTP6gGMzbKC for ; Sat, 21 Dec 2024 18:43:21 +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 4BLIhLuV068955 for ; Sat, 21 Dec 2024 18:43:21 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 4BLIhL3k068954 for threads@FreeBSD.org; Sat, 21 Dec 2024 18:43:21 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: Sat, 21 Dec 2024 18:43:20 +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 #19 from Konstantin Belousov --- (In reply to vedad from comment #18) Hm, no, this case is not interesting: there is THR_LOCK() call in the thread exit path, and the debugging patch was too rough to avoid this case. When the victim exiting, the deadlock cannot occur, since we are already past the pause()/sigsuspend() sleep. I slightly improved the detector part of the patch. Also, it is available at https://kib.kiev.ua/git/deviant3.git branch cancel. Lets try again. diff --git a/lib/libthr/thread/thr_sig.c b/lib/libthr/thread/thr_sig.c index b953c430158c..a393e51b746a 100644 --- a/lib/libthr/thread/thr_sig.c +++ b/lib/libthr/thread/thr_sig.c @@ -191,8 +191,15 @@ sigcancel_handler(int sig __unused, struct pthread *curthread =3D _get_curthread(); int err; - if (THR_IN_CRITICAL(curthread)) + if (THR_IN_CRITICAL(curthread)) { + if (!curthread->cancelling) { + void *p[1]; +=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 + 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.= From nobody Sun Dec 22 00:04:07 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 4YG1bX1CJ6z5hhhM for ; Sun, 22 Dec 2024 00:04:08 +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 4YG1bX08Lhz58ZX for ; Sun, 22 Dec 2024 00:04:08 +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=1734825848; 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=Ke4djM4b4jwB8CLpEynIQflrO3oPx1ohCnWZyz8j5G8=; b=h9VhTwFi1y8GB2mBfpsM9QoJ60kRPZwVBSQjvv6wUpej4RHb0+fEp8agCOLRKWvAhIvNll Jt4xm7EoRmaqQQs6RGwXkqiV0UuICscDmlKH6gPWY/k3qwUIdN6w8NNSxEklpbIU9VblJJ uN54ph0PM1klWPtT3GjinEL103AgM6Ia7vdu9KyOenZdEEKxx//q8Fch/AaFdT54K9ud9g RCwcqHz+h4m0tf+16CmizDHOLrh6r2xk9Zzlct4KV2nwvZZkvmFhlz6q/dC2xTQ+mKrbZQ aeOmoUFZyxkXD5eSdg/zzrOpZNvYJqIMStxi0Rqtou6Y+9yAoSkUVkzFSoJeyA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1734825848; a=rsa-sha256; cv=none; b=tbTGwIQAf727QY0l4AF2l1jsHHvlmTaTs6h/cMgNi1TWaS9ecb6Caf+SEhB7P6eynVd7Aw 8BNaS2pHArgWG0dVPruu4b2c3bq/7CrzNy26qw1qsHwBvQ07YW0bndbmUWujvG5uxuKd0+ XQb9LdMQSp0rAWeo0fTMM/4/Pgq3pzhNfSaQomlx8FZVYOPc9cl8HrUzz0s9j+otqjKkWH X6WYfEDG/YbtCkcnJ4KM7KPo+F72ruqm8MIL2O1XTHsrS6E3uqeUVrksigWiMsKyNOKhQp WhauR1eZMvOo4NfK+M2QJqvgwEGwluqY1MPc59FuRtF2Nr8QH374I9OZuLU6eA== 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 4YG1bW6nHlzlP0 for ; Sun, 22 Dec 2024 00:04:07 +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 4BM04745081927 for ; Sun, 22 Dec 2024 00:04:07 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 4BM047IK081926 for threads@FreeBSD.org; Sun, 22 Dec 2024 00:04:07 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: Sun, 22 Dec 2024 00:04:07 +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: vedad@kajtaz.net 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 #20 from vedad@kajtaz.net --- (In reply to Konstantin Belousov from comment #19) (gdb) thread apply all bt full Thread 2 (LWP 100391): #0 _umtx_op_err () at /usr/src/lib/libthr/arch/amd64/amd64/_umtx_op_err.S:= 38 No locals. #1 0x00000008215fdd4b in _thr_umtx_wait (mtx=3D0xd7be813c00, id=3D707144, timeout=3D0x0) at /usr/src/lib/libthr/thread/thr_umtx.c:198 No locals. #2 0x00000008215f2a7e in join_common (pthread=3D0xd7be813c00, thread_return=3D0x820da5ca0, abstime=3D0x0, peek=3D) at /usr/src/lib/libthr/thread/thr_join.c:144 __cup =3D {prev =3D 0x0, routine =3D 0x8215f2bf0 , ro= utine_arg =3D 0xd7be813c00, onheap =3D 0} ts =3D {tv_sec =3D 34910919760, tv_nsec =3D 34919627244} ts2 =3D {tv_sec =3D 0, tv_nsec =3D 926614102016} curthread =3D 0xd7be812000 ret =3D tid =3D 707144 tsp =3D 0xaca48 tmp =3D #3 0x0000000000201aee in thread_cancel_and_join (ptid=3D0xd7be813c00) at pthread.c:28 status =3D 0x0 error =3D 0 #4 0x0000000000201a2c in main (argc=3D1, argv=3D0x820da5d78) at pthread.c:= 73 ptid =3D 0xd7be813c00 err =3D 0 iteration =3D 499 pid =3D 31870 Thread 1 (LWP 707144): #0 abort2 () at abort2.S:4 No locals. #1 0x00000008215f9b0d in sigcancel_handler (sig=3D, info=3D, ucp=3D) at /usr/src/lib/libthr/thread/thr_sig.c:199 p =3D {0xd7be813c00} curthread =3D 0xd7be813c00 err =3D #2 No symbol table info available. #3 _umtx_op_err () at /usr/src/lib/libthr/arch/amd64/amd64/_umtx_op_err.S:= 38 No locals. #4 0x00000008215fda30 in __thr_umutex_lock (mtx=3D0xd7be813c08, id=3D70714= 4) at /usr/src/lib/libthr/thread/thr_umtx.c:79 owner =3D #5 0x00000008215f0aa4 in _thr_umutex_lock (mtx=3D0xd7be813c08, id=3D17) at /usr/src/lib/libthr/thread/thr_umtx.h:123 No locals. #6 thread_start (curthread=3D0xd7be813c00) at /usr/src/lib/libthr/thread/thr_create.c:264 set =3D {__bits =3D {0, 0, 617922520, 8}} #7 0x0000000000000000 in ?? () No symbol table info available. Backtrace stopped: Cannot access memory at address 0x82452e000 (gdb) frame 1 #1 0x00000008215f9b0d in sigcancel_handler (sig=3D, info=3D, ucp=3D) at /usr/src/lib/libthr/thread/thr_sig.c:199 199 abort2("thr_in_critical %p", 1, p); (gdb) print *curthread $1 =3D {tid =3D 707144, lock =3D {m_owner =3D 0, m_flags =3D 0, m_ceilings = =3D {0, 0}, m_rb_lnk =3D 0, m_spare =3D {0, 0}}, cycle =3D 0, locklevel =3D 1, critical= _count =3D 0, sigblock =3D 0, fsigblock =3D 0, tle =3D {tqe_next =3D 0xd7be812000, tqe_pr= ev =3D 0x821601600 <_thread_list>}, gcle =3D { tqe_next =3D 0x0, tqe_prev =3D 0x0}, hle =3D {le_next =3D 0x0, le_prev = =3D 0x821601f10}, wle =3D {tqe_next =3D 0x0, tqe_prev =3D 0x0}, refcount =3D 1, start_routine =3D 0x201a70 , arg =3D 0x0, attr =3D {sched_policy = =3D 2, sched_inherit =3D 4, prio =3D 0, suspend =3D 0, flags =3D 2, stackaddr_attr =3D 0x82432e000, stacksize_attr =3D 2097152, guardsize_a= ttr =3D 4096, cpuset =3D 0x0, cpusetsize =3D 0}, cancel_enable =3D 1, cancel_pendin= g =3D 1, cancel_point =3D 0, no_cancel =3D 0, cancel_async =3D 0, cancelling =3D 0, = sigmask =3D {__bits =3D {0, 0, 0, 0}}, unblock_sigcancel =3D 0, in_sigsuspend =3D 0, deferred_siginfo =3D {si_si= gno =3D 0, si_errno =3D 0, si_code =3D 0, si_pid =3D 0, si_uid =3D 0, si_status =3D 0,= si_addr =3D 0x0, si_value =3D {sival_int =3D 0, sival_ptr =3D 0x0, sigval_int =3D 0, si= gval_ptr =3D 0x0}, _reason =3D {_fault =3D { _trapno =3D 0}, _timer =3D {_timerid =3D 0, _overrun =3D 0}, _mesgq= =3D {_mqd =3D 0}, _poll =3D {_band =3D 0}, _capsicum =3D {_syscall =3D 0}, __spare__ =3D = {__spare1__ =3D 0, __spare2__ =3D {0, 0, 0, 0, 0, 0, 0}}}}, deferred_sigmask =3D {__bits = =3D {0, 0, 0, 0}}, deferred_sigact =3D { __sigaction_u =3D {__sa_handler =3D 0x0, __sa_sigaction =3D 0x0}, sa_fl= ags =3D 0, sa_mask =3D {__bits =3D {0, 0, 0, 0}}}, deferred_run =3D 0, force_exit =3D = 0, state =3D PS_RUNNING, error =3D 0, joiner =3D 0xd7be812000, flags =3D 0, tlflags =3D = 2, mq =3D {{tqh_first =3D 0x0, tqh_last =3D 0xd7be813da8}, {tqh_first =3D 0x0, tqh_last =3D 0xd7be81= 3db8}, {tqh_first =3D 0x0, tqh_last =3D 0xd7be813dc8}, {tqh_first =3D 0x0, tqh_las= t =3D 0xd7be813dd8}, {tqh_first =3D 0x0, tqh_last =3D 0xd7be813de8}, {tqh_first = =3D 0x0, tqh_last =3D 0xd7be813df8}}, ret =3D 0x0, specific =3D 0x0, specific_data_count =3D 0, rdlock_count =3D 0, rtld_bit= s =3D 0, tcb =3D 0xd7bee07120, cleanup =3D 0x0, ex =3D {exception_class =3D 0, exception= _cleanup =3D 0x0, private_1 =3D 0, private_2 =3D 0}, unwind_stackend =3D 0x0, unwind_dis= abled =3D 0, magic =3D 3499860245, report_events =3D 0, event_mask =3D 0, event_buf =3D {event =3D TD_EVENT_= NONE, th_p =3D 0, data =3D 0}, wchan =3D 0x0, mutex_obj =3D 0x0, will_sleep =3D 0, nwaiter= _defer =3D 0, robust_inited =3D 0, robust_list =3D 0, priv_robust_list =3D 0, inact_mtx = =3D 0, defer_waiters =3D { 0x0 }, wake_addr =3D 0xd7bee00048, sleepqueue =3D 0xd7be819100, name =3D 0x0, dlerror_msg =3D '\000' , dlerror_seen =3D 0} --=20 You are receiving this mail because: You are the assignee for the bug.=