From nobody Tue Nov 24 09:39:33 2026
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 4jYd7T3dRHz72sj2
	for <threads@mlmmj.nyi.freebsd.org>; Tue, 24 Nov 2026 09:39:33 +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)
	(No client certificate requested)
	by mx1.freebsd.org (Postfix) with ESMTPS id 4jYd7T2fcRz4mfq
	for <threads@FreeBSD.org>; Tue, 24 Nov 2026 09:39:33 +0000 (UTC)
	(envelope-from bugzilla-noreply@freebsd.org)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim;
	t=1795513173;
	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=OIOnlo+vpdRlpS4cq5xdZxCkro/j2ZYw3VMRbLxX79I=;
	b=kNcJo9lHVdx89AmRnieMeE2aT8JAy8RRD8Yw/dsfmj6e1maiqtrEFE9L50f5V0En/RPMju
	wdN8cb15Lm+hC8KxBnIhYs2XdlGGjoxnsReC0UC0nMnPDONmfZKLR1+QX9mNu76zlMaNrt
	Q6Y80jLgjBLV5tTIZfb4OB+7wmDMkr6l0F8vm0/bR+fWNXysieHIRuJK6utwaxo6/XEkFA
	iZuXeBWCUS2vedj/u2b5Wt4l9hyS2DesaA46ncH2GqBMQqYoI6waHcmuiSj21djonGQ8ZU
	YsqrenCmz/4Z6R/ESoYvO15HF+jLVMeUCGhrMMWTMECRnGHzZM6J2cYWP9cQvw==
ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1795513173;
	b=tUsIQ09ekP6xhbRYQ7jhLekdYb/Dzt+soHfHhAxI1Yi3xcCMGBQu4iYy9MCs9G49Gslgfn
	O82F//VtiZ97Se+F+4T+1vz1b1jrAadALDC3/LQ9S7CwOeNjScjBm5jYJcrIq/S0uvHdDR
	BT14zgExpT6yRgNmmht3x0ns9EXabmHGxBcR7eOURdXxPMnMq3eTEauvGHlJmlgtCavn/Q
	6pwwBEuTS3R2ws7y1Jyn9qW0wusC+wJpMMoeHV3XiyAfSvETgBOoXiYKZvAUBqpegUVfXp
	5uWYjO1Si3x5ARrr7R14gbdnc9IBIw/VZ2KrwoUVhFMCxj0UF6MzxCAM3XqHoA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org;
	s=dkim; t=1795513173;
	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=OIOnlo+vpdRlpS4cq5xdZxCkro/j2ZYw3VMRbLxX79I=;
	b=Nph2+T+sXlmdHckCkVafG5JabABXek2UWYM10RDW+LbOQ1s/BrAHc+QjpnLhClzuNz1EMD
	QxjqFuJDXox5od2OC2kylzMPyEBcFE0Mp1hyzjpFV/yVUE9t5ie8yD2pgBJqeZEkMBDV7V
	/zrwlbG7QKu9j0JkjhsvRqKS0K4KSKs2e2nNtS6Q3F1UHC88CWM6UeaYMWGC1LY1fRBCDD
	UrwXwwI+YbTGJQTOQYGasZw46Y+WF0qqHX83bXCvQ+tWtmLzx1QvD1LyOhfMBE3YnAMlEC
	2Q18q6BFWb8ocw8cNdzSSaeKICJr0uM6wPepc/rCMjfRiazYEZ3mUq/qgb4i1w==
ARC-Authentication-Results: i=1;
	mx1.freebsd.org;
	none
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 4jYd7T2HNxzYYs
	for <threads@FreeBSD.org>; Tue, 24 Nov 2026 09:39:33 +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 6AO9dXnd030521
	for <threads@FreeBSD.org>; Tue, 24 Nov 2026 09:39:33 GMT
	(envelope-from bugzilla-noreply@freebsd.org)
Received: (from www@localhost)
	by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 6AO9dXHc030520
	for threads@FreeBSD.org; Tue, 24 Nov 2026 09:39:33 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 300942] pthread_exit() + exit() can race and crash with SEGV
Date: Tue, 24 Nov 2026 09:39:33 +0000
X-Bugzilla-Reason: AssignedTo
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: Base System
X-Bugzilla-Component: bin
X-Bugzilla-Version: 15.1-RELEASE
X-Bugzilla-Keywords: crash
X-Bugzilla-Severity: Affects Only Me
X-Bugzilla-Who: ivy@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: cc
Message-ID: <bug-300942-13406-JrcfkyYNcz@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-300942-13406@https.bugs.freebsd.org/bugzilla/>
References: <bug-300942-13406@https.bugs.freebsd.org/bugzilla/>
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset="UTF-8"
X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/
Auto-Submitted: auto-generated
List-Archive: https://lists.freebsd.org/archives/freebsd-threads
X-BeenThere: freebsd-threads@freebsd.org
List-Id: Threading on FreeBSD <freebsd-threads.FreeBSD.org>
List-Post: <mailto:freebsd-threads@FreeBSD.org>
List-Help: <mailto:freebsd-threads+help@FreeBSD.org>
List-Subscribe: <mailto:freebsd-threads+subscribe@FreeBSD.org>
List-Unsubscribe: <mailto:freebsd-threads+unsubscribe@FreeBSD.org>
List-Owner: <mailto:freebsd-threads+owner@FreeBSD.org>
Precedence: list
MIME-Version: 1.0

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D300942

Lexi Winter <ivy@FreeBSD.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |markj@FreeBSD.org

--- Comment #4 from Lexi Winter <ivy@FreeBSD.org> ---
D61812 didn't fix the problem.

the following patch does:

@@ -3218,7 +3226,8 @@ objlist_call_fini(Objlist *list, Obj_Entry *root,
RtldLockState *lockstate)
                         * invocation. */
                        STAILQ_REMOVE(list, elm, Struct_Objlist_Entry, link=
);
                        /* Ensure that new references cannot be acquired. */
-                       elm->obj->doomed =3D true;
+                       if (root !=3D NULL)
+                               elm->obj->doomed =3D true;

                        hold_object(elm->obj);
                        lock_release(rtld_bind_lock, lockstate);

note, this is LLM-generated and has had only mild testing.

rtld_exit() calling objlist_call_fini(..., NULL, ...) marks objects as doom=
ed
when finalizing; the later dlopen("libgcc_s.so.1") during exit unwinding ca=
uses
a second copy of all the doomed objects (including libc) to be loaded.

a separate bug (which i'm still investigating and might file separately) wh=
en
this happens is what causes the actual crash when the second libc is loaded,
but the existing behaviour is already a bug.  not setting doomed here is
sufficient to fix the problem, and it's safe since we aren't unmapping these
objects, we're just going to exit.

cc: markj as this behaviour was added by 510fe58c8243.

--=20
You are receiving this mail because:
You are the assignee for the bug.=

From nobody Tue Nov 24 10:00:45 2026
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 4jYdbx1Q7Vz6w0WG
	for <threads@mlmmj.nyi.freebsd.org>; Tue, 24 Nov 2026 10:00: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)
	(No client certificate requested)
	by mx1.freebsd.org (Postfix) with ESMTPS id 4jYdbx0tCJz4qhx
	for <threads@FreeBSD.org>; Tue, 24 Nov 2026 10:00:45 +0000 (UTC)
	(envelope-from bugzilla-noreply@freebsd.org)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim;
	t=1795514445;
	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=z+xJ0Y2LL66WOnltpH34KXbDRjN2W0rnFbvPatVmPKU=;
	b=Ie8USWMz8MFBMgMV0ffX+t6R3s93PBqIeDMpWw0nw/aFzjXV8wSe+lNYxHaZQ2kEMuAuyU
	10sBMJ1j4Qyak0IEOfpyEdxesXssc2tw6Axl6DDoNxF00qyCbh06vwLv1DiaJpea+Pfqgq
	loSP9g1Va1+yDa6ZZ9Muw6ZOB+d2bBC47s+CytsB6i7HWd+ziWzfjdDRDBnmGvTwfYh28I
	CxFmurVz+VHEOK632kn/1zO7LVSXEwatybzdcHI+hGfnBNv869PAVWp02hUw3/hI1uEouw
	T6cB+Qv5VajKlFjIFAFrVd0DsG+l8M6zCaM/Q7EmbNxVpdK8lOh0KCJlwxQmfw==
ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1795514445;
	b=hX1MypI8RnU+f0RAiStIuuHYSMvh0h2sETZzVbRlmYeI4L+Vblso/2TjA9+Db+K8mzKyHs
	F0RM5qiLQmHXTSEXlPJMPtPyU2bUQFhRyxBX8lLfsxjm0mdeUPcC6KHS1wCj4p8LQRRoLT
	mf5BaeRUHgJcCmQN8rukqHvyqXrocrc/Do+7KWhZ+q0Xa7LEptEOvC8kgmeVghjq+bzfjJ
	yDnkk3R/KNQFR81uhrVprWRi+Kg7dqlr3/ixNWMZwfxQN1tFTMgc9F1GXk8Rg3AJiS4L1K
	mckBAScIX3Fmry3WJbzxFzjQ0nvME/QGkqlTkuS6hwfD+/fFAbM9wEOeMI6gcg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org;
	s=dkim; t=1795514445;
	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=z+xJ0Y2LL66WOnltpH34KXbDRjN2W0rnFbvPatVmPKU=;
	b=bXuK4agrWkIuXARInsxy7/8tFXuvYTV2w2xAL3fqduazsSxfq7tDboANBO6UrYO7IJug7B
	m3KbjC2Rc5nGc66inIBeXl7gYvXTDe9uTCUrpI1b8FuafcHuSJXnnV9DGY8xh4cJl91P8E
	YXHFjzJ6ELXPVIKJp1rCDwkEGXscvuQrVFUllmR+qMNo7akcChwdwrH6nsp0dMl9PrgTox
	+LP4sipHl+7Tuwxr9V137GtXiNtbcyfangWCkd5KxeVblSBcXPWs51dsxv5r4Wjv6lQWMD
	EHDw7OaQe6751vCLKjFmthg4LYLN0p1sL+sAPiToGlIrpB2+resWCiuDlB0rlA==
ARC-Authentication-Results: i=1;
	mx1.freebsd.org;
	none
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 4jYdbx0XjPzWjy
	for <threads@FreeBSD.org>; Tue, 24 Nov 2026 10:00:45 +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 6AOA0ifs065315
	for <threads@FreeBSD.org>; Tue, 24 Nov 2026 10:00:44 GMT
	(envelope-from bugzilla-noreply@freebsd.org)
Received: (from www@localhost)
	by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 6AOA0iZK065314
	for threads@FreeBSD.org; Tue, 24 Nov 2026 10:00: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 300942] pthread_exit() + exit() can race and crash with SEGV
Date: Tue, 24 Nov 2026 10:00:45 +0000
X-Bugzilla-Reason: AssignedTo
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: Base System
X-Bugzilla-Component: bin
X-Bugzilla-Version: 15.1-RELEASE
X-Bugzilla-Keywords: crash
X-Bugzilla-Severity: Affects Only Me
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: <bug-300942-13406-ymlDvDLJhC@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-300942-13406@https.bugs.freebsd.org/bugzilla/>
References: <bug-300942-13406@https.bugs.freebsd.org/bugzilla/>
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset="UTF-8"
X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/
Auto-Submitted: auto-generated
List-Archive: https://lists.freebsd.org/archives/freebsd-threads
X-BeenThere: freebsd-threads@freebsd.org
List-Id: Threading on FreeBSD <freebsd-threads.FreeBSD.org>
List-Post: <mailto:freebsd-threads@FreeBSD.org>
List-Help: <mailto:freebsd-threads+help@FreeBSD.org>
List-Subscribe: <mailto:freebsd-threads+subscribe@FreeBSD.org>
List-Unsubscribe: <mailto:freebsd-threads+unsubscribe@FreeBSD.org>
List-Owner: <mailto:freebsd-threads+owner@FreeBSD.org>
Precedence: list
MIME-Version: 1.0

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D300942

--- Comment #5 from Konstantin Belousov <kib@FreeBSD.org> ---
(In reply to Lexi Winter from comment #4)
I do not think this is right.  Your change basically reverts the 510fe58c82=
43
for the case when the process is exiting.  But since dlopen() might be still
called (and is called by libthr thread exit code, for instance), the 'fix'
just silences the real cause, I believe.

Perhaps dlclose() should check harder against running initializers, same as
dlopen() should check against doomed objects.  I will try to update the D61=
812
along that line.

--=20
You are receiving this mail because:
You are the assignee for the bug.=

From nobody Tue Nov 24 10:12:39 2026
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 4jYdsg2Mycz6w210
	for <threads@mlmmj.nyi.freebsd.org>; Tue, 24 Nov 2026 10:12:39 +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)
	(No client certificate requested)
	by mx1.freebsd.org (Postfix) with ESMTPS id 4jYdsg1tscz4spR
	for <threads@FreeBSD.org>; Tue, 24 Nov 2026 10:12:39 +0000 (UTC)
	(envelope-from bugzilla-noreply@freebsd.org)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim;
	t=1795515159;
	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=l7oqYf7Tc5K/PC/MkwNqDEgeKNoCCCf/j2yU7bbaEEY=;
	b=pctR4UC7p3hXAvQc5gACR2uzPmVkteZRJ+8z5gehUwC7bo+8pguXGN5FUDgtW+Z/wM2yls
	Yf1K5lWveDLDGx/iZkZN9ZDygukQdbFzVXu1od3ZX3elyDMncwR79Fbyz47qL0kWECn3KE
	kb99dDXCoi0tSDGbBOTb6eRILDDcXXN0JQ4NxjzXnXOBne5WZWWYmeAmhh/YmTNq3t8MSo
	1dCVvC0ub81mTxRB5bSiRjug94I+mjLMx+MYcnowjABCQPnxUYND7u5r0CtZ4CwwuqedL7
	UZosMIJLCrGHrMIFY4WM9hW096z7uLDSgrchRa9AHmcs8gGUchuXG3UWkCYRrA==
ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1795515159;
	b=iRPPB7gbpFU9X9IO8w9ASF5fHsecl/mOvR1D+DXmTWxCDlGGm5SOUynrb9Zq3jlU92kH5h
	R/g9k3yX6ydnbhZrh9ze2/HE53O/TUxQOB6go/Fw7/prgwqhvg6anRSEE1F2Q2rZCAWnsY
	UWwz6m6knBiN6whSDJFamM8Ptrd6Q2uPCuB+Gxm5Ilq4qSyI7ASW7TtQmbKVYzPuk2tXRY
	Jfm8BnqK+QJ1XSmFJcVO2qiSFl9dnAehq+fkZ1XNt90pAvZNrPi8smljd3SYa3c0ipPlRp
	LWvnaqXEbokCJDMay71My0HY3ngqJQX5uswlzq6NV5+MfADZNT9UwIqcOUMPiQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org;
	s=dkim; t=1795515159;
	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=l7oqYf7Tc5K/PC/MkwNqDEgeKNoCCCf/j2yU7bbaEEY=;
	b=DxLC79nHCt6pEjlNfL+u8Epdzzg8uc8sC6Dd60rPXe1h4KeDUEyWwfut++hGaudZxiqc+a
	ipSQAHptqgw61KZsDcyE+ITSMiLYz9GzxczMRPNKAtYX+63TB5SvDDH6Fds2aHacH/x1Dh
	k/erwtjXAXoXLC/1FluZ0buJHeMejfaB3IiAIStas5htZKYpJ3Gw/nkgHCOHnqY3yAWCnX
	73h48LAruil/Oyk4C+tbtYvPKKuMTh4rRcQDqs1srMtLPYd87C5ZCZytIVQl0OJuQxOeDc
	hzJV5lKwp+U7OhyzgwOTFp4AMI2qOd/6zQ/UwjtvLw71NbBsVoRM0JOfjn1yBg==
ARC-Authentication-Results: i=1;
	mx1.freebsd.org;
	none
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 4jYdsg1Z1zzb0h
	for <threads@FreeBSD.org>; Tue, 24 Nov 2026 10:12: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 6AOACdwu095820
	for <threads@FreeBSD.org>; Tue, 24 Nov 2026 10:12:39 GMT
	(envelope-from bugzilla-noreply@freebsd.org)
Received: (from www@localhost)
	by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 6AOACdcb095819
	for threads@FreeBSD.org; Tue, 24 Nov 2026 10:12:39 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 300942] pthread_exit() + exit() can race and crash with SEGV
Date: Tue, 24 Nov 2026 10:12:39 +0000
X-Bugzilla-Reason: AssignedTo
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: Base System
X-Bugzilla-Component: bin
X-Bugzilla-Version: 15.1-RELEASE
X-Bugzilla-Keywords: crash
X-Bugzilla-Severity: Affects Only Me
X-Bugzilla-Who: ivy@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: <bug-300942-13406-gCTLmHcYdJ@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-300942-13406@https.bugs.freebsd.org/bugzilla/>
References: <bug-300942-13406@https.bugs.freebsd.org/bugzilla/>
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset="UTF-8"
X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/
Auto-Submitted: auto-generated
List-Archive: https://lists.freebsd.org/archives/freebsd-threads
X-BeenThere: freebsd-threads@freebsd.org
List-Id: Threading on FreeBSD <freebsd-threads.FreeBSD.org>
List-Post: <mailto:freebsd-threads@FreeBSD.org>
List-Help: <mailto:freebsd-threads+help@FreeBSD.org>
List-Subscribe: <mailto:freebsd-threads+subscribe@FreeBSD.org>
List-Unsubscribe: <mailto:freebsd-threads+unsubscribe@FreeBSD.org>
List-Owner: <mailto:freebsd-threads+owner@FreeBSD.org>
Precedence: list
MIME-Version: 1.0

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D300942

--- Comment #6 from Lexi Winter <ivy@FreeBSD.org> ---
there's a related issue where concurrent dlopen()s of the same object can r=
un
initialisers before relocation has finished.  i have a reproducer for that =
but
i think it's unrelated to this PR other than involving rtld locking; do you
want a separate PR for that?

--=20
You are receiving this mail because:
You are the assignee for the bug.=

From nobody Tue Nov 24 10:35:00 2026
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 4jYfMS3WxKz6w4bX
	for <threads@mlmmj.nyi.freebsd.org>; Tue, 24 Nov 2026 10:35:00 +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)
	(No client certificate requested)
	by mx1.freebsd.org (Postfix) with ESMTPS id 4jYfMS2vlJz3CLT
	for <threads@FreeBSD.org>; Tue, 24 Nov 2026 10:35:00 +0000 (UTC)
	(envelope-from bugzilla-noreply@freebsd.org)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim;
	t=1795516500;
	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=VWp4gk7/vQwi6CzKl9pYtmTFOW2aZA3JGrqK7X8wnyk=;
	b=Saj4WahW1H0XslGGMuz2eRV9KUoBFpbWTItITuKAM7CwyMQ2PV2+ElNFl0sFfMuyvCJqpZ
	I1bpjmj7MN62803NyqM6/k6FABTix7i/p0SLgudOknECr2BzpX1WuLQhVBt67a1pIDhPYE
	akQLXgKCePtgn2FY9OXnFR1KcqHeZSaFdK//cp5UyzVCypLqqkS7o8M0I7BE6BCkLVA+26
	l+Ct14X/QIics+JLCRElpO2u2rUwUte+FLXmM3A8jplCJh659V6gM7Iex7l7Swvzep93Zi
	2k1y1DBWgtjx3HlfVCdrer1s6jwJ8M9rjLZiYR6AFtOqtn7OvlIgJDMCz/fO3w==
ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1795516500;
	b=yoeCFPmhljluQjtYIceqS5wzpOtg0ftUnRmIZVMVenVqxwHqZxFEFz9UDVHQKnZe9LPpOr
	0GOmFZYJOWa6FnocFm8IeYj0uvtiNaQbtawEce4DeZ0+vxiDZBKsLpvMHEGiLfPbihUsHJ
	BJudDmdG9W3OTY6wl2PiOEBFWka0h5dXl8bA/rn+56oqKH/q/lS2mRzskUXs8Ht7L/WWNv
	ZXwkPQwwxuJQbU1eAcEuxJ/R7gMsM3A+6znQkIvOukfSTMK9UTWRuQS+vuhW1b+DmazWii
	7yyq+3E2Kbi0W+EqDMUs0ZbtIyOdB5/rrO/GYUByo6VM54FxIhq+DIEE2Jo81Q==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org;
	s=dkim; t=1795516500;
	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=VWp4gk7/vQwi6CzKl9pYtmTFOW2aZA3JGrqK7X8wnyk=;
	b=YcTiC0edc8wXQbm2Zt7F6zqabc1Xkpc4Lixwjop1ygUay6zg8Jucudg33bh/oNF2w/Pj1X
	VD03Qca5IQPMI5C2Ltlwtv66eNSdKahY9Srjc6QtoNir8XJeBxTx8QOaxA7eU8WqUs/fV9
	gi6zwY2K5FV839o/SeinFmaew7o6MxL8toZFdzp6raNpMtEV3JVxtXPOLikNZTzPIdYi7b
	nrOHd5xnk5JOVDB8XTKVX0cgfb9KnpIURVes3XA+KJcxVeUKFNkPsl7Fz+jYVI65KSfAPU
	TQuNWm5RP7qzqfhlLgywYU97LT8fyNLz7UndAgIC+bcKgZFIRMOL0XSrbu9waw==
ARC-Authentication-Results: i=1;
	mx1.freebsd.org;
	none
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 4jYfMS2Z7wzbSx
	for <threads@FreeBSD.org>; Tue, 24 Nov 2026 10:35:00 +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 6AOAZ01j026338
	for <threads@FreeBSD.org>; Tue, 24 Nov 2026 10:35:00 GMT
	(envelope-from bugzilla-noreply@freebsd.org)
Received: (from www@localhost)
	by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 6AOAZ0Y7026337
	for threads@FreeBSD.org; Tue, 24 Nov 2026 10:35:00 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 300942] pthread_exit() + exit() can race and crash with SEGV
Date: Tue, 24 Nov 2026 10:35:00 +0000
X-Bugzilla-Reason: AssignedTo
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: Base System
X-Bugzilla-Component: bin
X-Bugzilla-Version: 15.1-RELEASE
X-Bugzilla-Keywords: crash
X-Bugzilla-Severity: Affects Only Me
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: <bug-300942-13406-PXy9Ou2WQh@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-300942-13406@https.bugs.freebsd.org/bugzilla/>
References: <bug-300942-13406@https.bugs.freebsd.org/bugzilla/>
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset="UTF-8"
X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/
Auto-Submitted: auto-generated
List-Archive: https://lists.freebsd.org/archives/freebsd-threads
X-BeenThere: freebsd-threads@freebsd.org
List-Id: Threading on FreeBSD <freebsd-threads.FreeBSD.org>
List-Post: <mailto:freebsd-threads@FreeBSD.org>
List-Help: <mailto:freebsd-threads+help@FreeBSD.org>
List-Subscribe: <mailto:freebsd-threads+subscribe@FreeBSD.org>
List-Unsubscribe: <mailto:freebsd-threads+unsubscribe@FreeBSD.org>
List-Owner: <mailto:freebsd-threads+owner@FreeBSD.org>
Precedence: list
MIME-Version: 1.0

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D300942

--- Comment #7 from Konstantin Belousov <kib@FreeBSD.org> ---
I updated D61812 with some skips that might fix the problem.

--=20
You are receiving this mail because:
You are the assignee for the bug.=

From nobody Tue Nov 24 10:45:20 2026
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 4jYfbN5n2Zz6w5gX
	for <threads@mlmmj.nyi.freebsd.org>; Tue, 24 Nov 2026 10:45:20 +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)
	(No client certificate requested)
	by mx1.freebsd.org (Postfix) with ESMTPS id 4jYfbN5JYyz3Fr1
	for <threads@FreeBSD.org>; Tue, 24 Nov 2026 10:45:20 +0000 (UTC)
	(envelope-from bugzilla-noreply@freebsd.org)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim;
	t=1795517120;
	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=FZ+n67eGgBmOJE7M8wzjStjcn6CWyZUXVBHKgjPgP9Q=;
	b=cPFTw8mKEdlKnW4gRrd7RBwj88gY70xDIj5iir+I1AAAWmk+iWcratHfhrg75PwuAL1sy7
	/eNa8UTMT+DERRFKUFR2pzTgL8LeHGcz4I2q1NsarDt+dOWJxFZhifuGv+dLLv39IN2LGP
	mqtYZmhxouu/d8Pph/BqF40TIRSWniT0oLm8IWoHNStX0dVpTsu6NBNTNje+KXOTHn3Eh/
	zEDRlXdXo+ArX+nYfjwdM+TdauDkyWvcLTxNjuTU7m/2XFjMDT+e0297wLbhhUeZ12HfOw
	S5qEDE+7+OLGi6oXDRKgjXxAcszUStM75DjEQaZf/2QVRoSVbrBfh0KSB/4iaA==
ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1795517120;
	b=DD+mEmZ7VRFUWnhRk44TSyYNF3DWzCCiDq97rDM66D9/O5itME9m0hjK54/NWpsJtRGjz5
	VByE9pR6B90z8z73BH+Yx41BNt2Y7I2TzPVgBTpnFwbtJU+QnqVG1goiMslBowizWQ4Eoc
	+vMFq+FLXupijrU2fWCJbh991rKeyy4h6y1ksQatzKjOHqr6n6pXqTse62rDeebHYsdsJl
	Tad+RLj07p6BTO3sscAK8GMq7dp+HWmWoyky3Dl9ufoGEmzj4R/hbrkVwKF3YgyyRpdclj
	39q77PVnCloLJacY/ShIhMCGuYxRvOw05OWjLB60/h6KT27XvjM66cpQ4dBCNg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org;
	s=dkim; t=1795517120;
	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=FZ+n67eGgBmOJE7M8wzjStjcn6CWyZUXVBHKgjPgP9Q=;
	b=o7k112FKCSKNWbKjcVLSU2+20/qIZ/Eu58n9xKCqUitbbD2V6pd4+ekkUMmm8HqQKItPDn
	hMV6bBCbF2NrBFFwYICEuu/7+RNOnMWPffsC3SF28MyygJDTJ0+tDBTXWh7VmyUQc6DWfI
	KM1hWrcI2LLf3pjrAiss1DFqqOIMEpwBqkjw+dxLqrlulVtpx+DLumcAziuUY9j4RQvjZm
	rIdB5BDMlYR5npmqGUT0SQnNTT0DEeF0gvanNwVbEg0A7/w8cVYsSYn1Y1m1Jcpuu1Otu6
	nkveyuuI0G491vGWHSKDOqVB5ndpg3Vc2xV/ryHD+f1E+KDEd9htBX4GjW3mww==
ARC-Authentication-Results: i=1;
	mx1.freebsd.org;
	none
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 4jYfbN4y74zc01
	for <threads@FreeBSD.org>; Tue, 24 Nov 2026 10:45: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 6AOAjKF4041172
	for <threads@FreeBSD.org>; Tue, 24 Nov 2026 10:45:20 GMT
	(envelope-from bugzilla-noreply@freebsd.org)
Received: (from www@localhost)
	by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 6AOAjKZB041171
	for threads@FreeBSD.org; Tue, 24 Nov 2026 10:45: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 300942] pthread_exit() + exit() can race and crash with SEGV
Date: Tue, 24 Nov 2026 10:45:20 +0000
X-Bugzilla-Reason: AssignedTo
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: Base System
X-Bugzilla-Component: bin
X-Bugzilla-Version: 15.1-RELEASE
X-Bugzilla-Keywords: crash
X-Bugzilla-Severity: Affects Only Me
X-Bugzilla-Who: ivy@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: <bug-300942-13406-tRrkdg8Vsg@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-300942-13406@https.bugs.freebsd.org/bugzilla/>
References: <bug-300942-13406@https.bugs.freebsd.org/bugzilla/>
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset="UTF-8"
X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/
Auto-Submitted: auto-generated
List-Archive: https://lists.freebsd.org/archives/freebsd-threads
X-BeenThere: freebsd-threads@freebsd.org
List-Id: Threading on FreeBSD <freebsd-threads.FreeBSD.org>
List-Post: <mailto:freebsd-threads@FreeBSD.org>
List-Help: <mailto:freebsd-threads+help@FreeBSD.org>
List-Subscribe: <mailto:freebsd-threads+subscribe@FreeBSD.org>
List-Unsubscribe: <mailto:freebsd-threads+unsubscribe@FreeBSD.org>
List-Owner: <mailto:freebsd-threads+owner@FreeBSD.org>
Precedence: list
MIME-Version: 1.0

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D300942

--- Comment #8 from Lexi Winter <ivy@FreeBSD.org> ---
sorry, the updated D61812 (diff 193947) doesn't fix the test case from this=
 PR.

--=20
You are receiving this mail because:
You are the assignee for the bug.=

From nobody Tue Nov 24 11:04:49 2026
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 4jYg1s2XGBz6w7bw
	for <threads@mlmmj.nyi.freebsd.org>; Tue, 24 Nov 2026 11:04:49 +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)
	(No client certificate requested)
	by mx1.freebsd.org (Postfix) with ESMTPS id 4jYg1s1wBBz3Lsy
	for <threads@FreeBSD.org>; Tue, 24 Nov 2026 11:04:49 +0000 (UTC)
	(envelope-from bugzilla-noreply@freebsd.org)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim;
	t=1795518289;
	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=Y8bEBIbMdOdnMOqB0hig/GBTqDzoGjbBKHyXWmvZC2U=;
	b=VGDXqPHWE3+/JtOmvrS5EJiSc9DjhDKR7qzHKiFvRZCbu5+7vNzWsYzwTuvYLSgJwiRU2Z
	6F+JcebiTjo7qEP/Mag2kwPRTD+l0hocsDxaoVEmatZC/Haq3j0nl6KC904+vkeMlQeRLb
	W7A3ypSLE/8ipFsfPdWN6Vcvl7cl7pu3vrHMJrUGNb20Jo/36IwuDoc9woJIKF1grDxtIL
	SDB67nRh0uX6JyNl8W3z0tqNInWpypTUu35dRFTA5+4eoc4FRWNo+voofrMj7iHgOMp0RL
	e/FTF4DqMZsjyb/shnOFRZ7pidt4UJ6ljMwcwZRtpE6USQoL+dCgTtbNTMymDA==
ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1795518289;
	b=smeVFfiDchpI+8GWE+COWWUq0zoNHndP9zxGo6+4V+9TLqxoMjXwLRHbN2MUPSOb54GrMd
	91LJenpDopLIM3IldUuLtJj7knEo4kX7JJ542gyRXNrVyyaFOw1Bbh5vKxhpNfj4a8gmXV
	1VOl43mYkY0lm/IWRGSvhZpKtH6gl2E36jN644Dkux47W0OYoLnvhIUCNu6LBsy5nvHJEQ
	mwrMoWVKxUzeT7qKUXcoNVEDUbhY4vfWtNZxYKhIKYm303Gr8/jhOKNHfNhBYpwTpOdO5/
	2/8UhgXCQ1gAqq/KI//oW79lgDs3UbIIJv9OePmXdxeHSHf9Np2SitnvdJBKew==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org;
	s=dkim; t=1795518289;
	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=Y8bEBIbMdOdnMOqB0hig/GBTqDzoGjbBKHyXWmvZC2U=;
	b=qK+uOLroui0t/lzY9m2UehXmKKa+uff/9pNY07jVwGx5gq4A6KurO93M4slFFtjxWh5mrJ
	1kFRSzCQHBMtABECPW0xIEUQCMCdzkR+vXRd6qSzLP32YdTDtrZAvXocYZ86CZHbzjTvfG
	WoRGFlUElJ/XdtQOU2qOl8XMNJS+CELhGrJhWn/leemriO9Gb7Fb9/5Q5VU3fGfyArO+pg
	EUHUWgSHC73g5JankYv+Ywx0vgD/n7T41WxAuhvopPP9BtNmZBGGsE5rVBibR2nobIPJjz
	O3r0e0y7X0KMqrupHrho8kJ91LRlorxCYMcWdPhip6Nv7Jnxx9DBp9STU/MAfg==
ARC-Authentication-Results: i=1;
	mx1.freebsd.org;
	none
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 4jYg1s1Zq5zcNn
	for <threads@FreeBSD.org>; Tue, 24 Nov 2026 11:04:49 +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 6AOB4nFJ073168
	for <threads@FreeBSD.org>; Tue, 24 Nov 2026 11:04:49 GMT
	(envelope-from bugzilla-noreply@freebsd.org)
Received: (from www@localhost)
	by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 6AOB4nbd073167
	for threads@FreeBSD.org; Tue, 24 Nov 2026 11:04:49 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 300942] pthread_exit() + exit() can race and crash with SEGV
Date: Tue, 24 Nov 2026 11:04:49 +0000
X-Bugzilla-Reason: AssignedTo
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: Base System
X-Bugzilla-Component: bin
X-Bugzilla-Version: 15.1-RELEASE
X-Bugzilla-Keywords: crash
X-Bugzilla-Severity: Affects Only Me
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: <bug-300942-13406-TVBCLv7Pk2@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-300942-13406@https.bugs.freebsd.org/bugzilla/>
References: <bug-300942-13406@https.bugs.freebsd.org/bugzilla/>
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset="UTF-8"
X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/
Auto-Submitted: auto-generated
List-Archive: https://lists.freebsd.org/archives/freebsd-threads
X-BeenThere: freebsd-threads@freebsd.org
List-Id: Threading on FreeBSD <freebsd-threads.FreeBSD.org>
List-Post: <mailto:freebsd-threads@FreeBSD.org>
List-Help: <mailto:freebsd-threads+help@FreeBSD.org>
List-Subscribe: <mailto:freebsd-threads+subscribe@FreeBSD.org>
List-Unsubscribe: <mailto:freebsd-threads+unsubscribe@FreeBSD.org>
List-Owner: <mailto:freebsd-threads+owner@FreeBSD.org>
Precedence: list
MIME-Version: 1.0

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D300942

--- Comment #9 from Konstantin Belousov <kib@FreeBSD.org> ---
(In reply to Lexi Winter from comment #8)
Can you show me the backtrace and specifics of the line where the fault
occurs?

I run the following
   $ while true; do ./exitrace 100; done
for some time (tens of minutes) without seeing a crash.  It might be that I=
 am
unlucky with the race, as usual.

--=20
You are receiving this mail because:
You are the assignee for the bug.=

From nobody Tue Nov 24 11:20:02 2026
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 4jYgMQ61Ggz6w9Fl
	for <threads@mlmmj.nyi.freebsd.org>; Tue, 24 Nov 2026 11:20:02 +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)
	(No client certificate requested)
	by mx1.freebsd.org (Postfix) with ESMTPS id 4jYgMQ5PNwz3Ms4
	for <threads@FreeBSD.org>; Tue, 24 Nov 2026 11:20:02 +0000 (UTC)
	(envelope-from bugzilla-noreply@freebsd.org)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim;
	t=1795519202;
	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=LpjuwXgWcuUPx/43Q9qxc4028gZdgeT6r6VuF/qvUWc=;
	b=SUtpK4tngNbLaiYD+UyB8hhoSwbrcKfut63bP3cnY3ijJhr89RfXSpZP+jBPffe3Y5QOv2
	ovpzjvYRZi27Wx1XPVAXAE93dJp+EFn/nbv90fd7qH6DXS3V/J6yEQVlwipPCTXCpRGs6y
	ktzqABKoSjnJV4swZqp1k7Nmh+9CeWHe4PXVdJ/tQq+T7KArlLDClcymydNRQplfKtJHKa
	+acOya0Wa83CH6z/zV/u/iw/VqUPml1/Po/OWC7ImGHlOn3KVuIfvCAFKA75vWHsZjqdzQ
	ZosdIXVADtYqEsxoM/Vm52xpSyQmCcYp2x5g5aOTL7VgTNbR2HLtrZF4x/V7og==
ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1795519202;
	b=HOW2339K3Nnv54gZ1htAMnFvflus57gt2+3q9221UYQijnoupP2xVlN57hh/pSCz4CX/Ls
	nZ/V8PvTqWgTp3kLbpGEHj8pryBNv+kG6ur7i9u6KT0YUBnFJyj/575Rki97HaWuk00vJL
	QK6BKZprM2K7Yvfj3z7TyZu7z4qgfUwskM7B3afs6hF/uJt2CSt9ihJn33Ijs/WH3PvnqJ
	rR88ddh1T1Ecl1Zwpt4Imv3Db1BoVERmvFAoiXNlocVV2vX8vQRt3hRuEDY1BJCNaEGLRd
	ygoxhEV3uxLozkuKscCbB4Bpv5yOCJfjvv6OS9rjWalm1pwO/u9viZF504xbLA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org;
	s=dkim; t=1795519202;
	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=LpjuwXgWcuUPx/43Q9qxc4028gZdgeT6r6VuF/qvUWc=;
	b=GixAZ+VRngKmAgF0WM3P26HFEbYl6SMOzBR6s1Hjm6OfK1tOzLNnvy/Yg3Ci8yPJGn6XSW
	i9QL0FwpEYkwtkkGe3Gs8kbNdApxF4VSw44+XoILgJN0E8AWYW6m1232iUnsTg8WsQj3r6
	SVaFnopI87c8m80GOSrstGKeC3nODWQH08CDXve3JetdZEaqX2P7Hq8yhh30GsQBO03uOO
	QFqW/0uMjkkay9DHAxuHxQrLFqsaN6s3gLefgCoKZt4bMuXqDatLySXANMmhaqRZTKQVP4
	imzBCBEnwOWRRr3Vj5YVDjnhDaFafOjkNF1CAOuyFIxz8SfOlZ2mCiu+AeW54A==
ARC-Authentication-Results: i=1;
	mx1.freebsd.org;
	none
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 4jYgMQ52NszcPd
	for <threads@FreeBSD.org>; Tue, 24 Nov 2026 11:20:02 +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 6AOBK2US089764
	for <threads@FreeBSD.org>; Tue, 24 Nov 2026 11:20:02 GMT
	(envelope-from bugzilla-noreply@freebsd.org)
Received: (from www@localhost)
	by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 6AOBK22a089763
	for threads@FreeBSD.org; Tue, 24 Nov 2026 11:20:02 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 300942] pthread_exit() + exit() can race and crash with SEGV
Date: Tue, 24 Nov 2026 11:20:02 +0000
X-Bugzilla-Reason: AssignedTo
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: Base System
X-Bugzilla-Component: bin
X-Bugzilla-Version: 15.1-RELEASE
X-Bugzilla-Keywords: crash
X-Bugzilla-Severity: Affects Only Me
X-Bugzilla-Who: ivy@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: <bug-300942-13406-BjBIDqiSUX@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-300942-13406@https.bugs.freebsd.org/bugzilla/>
References: <bug-300942-13406@https.bugs.freebsd.org/bugzilla/>
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset="UTF-8"
X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/
Auto-Submitted: auto-generated
List-Archive: https://lists.freebsd.org/archives/freebsd-threads
X-BeenThere: freebsd-threads@freebsd.org
List-Id: Threading on FreeBSD <freebsd-threads.FreeBSD.org>
List-Post: <mailto:freebsd-threads@FreeBSD.org>
List-Help: <mailto:freebsd-threads+help@FreeBSD.org>
List-Subscribe: <mailto:freebsd-threads+subscribe@FreeBSD.org>
List-Unsubscribe: <mailto:freebsd-threads+unsubscribe@FreeBSD.org>
List-Owner: <mailto:freebsd-threads+owner@FreeBSD.org>
Precedence: list
MIME-Version: 1.0

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D300942

--- Comment #10 from Lexi Winter <ivy@FreeBSD.org> ---
i can't reproduce the problem if i run it in a tight loop.  i can reproduce=
 it
if i run manually from zsh:

139? 16!tansy ~/tmp% while sleep 0; do echo -n .; ./exitrace 32; done
...........................................................................=
...........................................................................=
...........................................................................=
...........................................................................=
...........................................................................=
...........................................................................=
...........................................................................=
...........................................................................=
...........................................................................=
...........................................................................=
...........................................................................=
...........................................................................=
...........................................................................=
...........................................................................=
..................................^C%
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20
            130? 17!tansy ~/tmp% ./exitrace 32
18!tansy ~/tmp% ./exitrace 32
18!tansy ~/tmp% ./exitrace 32
18!tansy ~/tmp% ./exitrace 32
[1]    7894 segmentation fault (core dumped)  ./exitrace 32
139? 18!tansy ~/tmp%

i don't know what's causing that.

the backtrace is the same as in the original comment:

Core was generated by `./exitrace 32'.
Program terminated with signal SIGSEGV, Segmentation fault.
Address not mapped to object.
#0  0x000000083b01c730 in __guard_setup () at
/src/bsd/main/lib/libc/secure/libc_stack_protector.c:69
69              if (__stack_chk_guard[0] !=3D 0)
[Current thread is 1 (LWP 411148)]
(gdb) bt
#0  0x000000083b01c730 in __guard_setup () at
/src/bsd/main/lib/libc/secure/libc_stack_protector.c:69
#1  0x000031f7f00d2b5d in objlist_call_init (list=3Dlist@entry=3D0x835812aa=
8,
lockstate=3Dlockstate@entry=3D0x835812a20) at
/src/bsd/main/libexec/rtld-elf/rtld.c:3438
#2  0x000031f7f00d7f1c in dlopen_object (name=3Dname@entry=3D0x2d9920e00168
"/lib/libgcc_s.so.1", fd=3Dfd@entry=3D-1, refobj=3D<optimized out>,
lo_flags=3D<optimized out>, mode=3Dmode@entry=3D1, lockstate=3D0x835812a20,
    lockstate@entry=3D0x0) at /src/bsd/main/libexec/rtld-elf/rtld.c:4244
#3  0x000031f7f00d3e23 in rtld_dlopen (name=3D0x2d9920e00168
"/lib/libgcc_s.so.1", fd=3D-1, mode=3D<optimized out>) at
/src/bsd/main/libexec/rtld-elf/rtld.c:4093
#4  0x00000008224b6b62 in thread_uw_init () at
/src/bsd/main/lib/libthr/thread/thr_exit.c:86
#5  _pthread_exit_mask (status=3D0x0, mask=3Dmask@entry=3D0x0) at
/src/bsd/main/lib/libthr/thread/thr_exit.c:241
#6  0x00000008224b6a9b in _Tthr_exit (status=3D0x2) at
/src/bsd/main/lib/libthr/thread/thr_exit.c:206
#7  0x00000008224b6643 in thread_start (curthread=3D0x2d9920e53810) at
/src/bsd/main/lib/libthr/thread/thr_create.c:299
#8  0x0000000000000000 in ?? ()
Backtrace stopped: Cannot access memory at address 0x835813000
(gdb)

--=20
You are receiving this mail because:
You are the assignee for the bug.=

From nobody Tue Nov 24 11:32:16 2026
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 4jYgdX31BCz6wBRY
	for <threads@mlmmj.nyi.freebsd.org>; Tue, 24 Nov 2026 11:32:16 +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)
	(No client certificate requested)
	by mx1.freebsd.org (Postfix) with ESMTPS id 4jYgdX1nrxz3Nqb
	for <threads@FreeBSD.org>; Tue, 24 Nov 2026 11:32:16 +0000 (UTC)
	(envelope-from bugzilla-noreply@freebsd.org)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim;
	t=1795519936;
	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=+roBVS9JXf++cP/BlI7jFSzfcBbuEGSFn7XNjlZ+bZc=;
	b=hqTi0gA+O9xq9QXA6FTbq97C02Sek7uopuo/oU2qVGyw0PqmqedXrzoEk5Zbi2UelV/RM/
	epJqBgVgeETqi8eGKIgjbGVM2Qi+72FYxSRgcWjo9kRcq72iKBDQDiK/VHzRTyrwSaGx7N
	mxDcXqr3GCmf3+/TYD8uaseoaHZvAsEdQdEvLkv4X6Gm7GYFI7H3fGfF9Upj67053dARmv
	/mpzilpZuQDPPLsrcqpckEDAW7fnIkmmQWJt0FL6LDSqMly2Awh6gAoHiGgXJz20ocRZFg
	OBc5hobcneOe1jQfmy0lr23+Re1TltRDL+r34E2ljjiAI4a0utGX+8p7ZzP1cw==
ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1795519936;
	b=XRvpCpzGBnT+Mfj0xdeQoWT9uYhaddpnj0EYz2gdRxbzff9YZiii0+R3quQ9lA7lnvfHmZ
	WlqGPCEiLXQQmuNHp0khOvF83e4oTkdKa37GQOX5oL5oK6DZuGk3jqJAIgkf/qMkztrYSI
	Z1Af07mtUOfA5GfXgsMLWZFzB/2WMtwGsWDzgkAJiyC0JxrcDx6k3KCNU0+9RZ7/+IhwCX
	6nMz36I5wx3rgdk5WXyPiKMu6xNqw9+8kOvWxceQvPvIc02Np0czBmAkpD57kbitdrhUtW
	mEUjTCKCeWzcNjDWXZceVjV1GpEw/l1XKZRT/40NaBNszKudTp5kid9C6+hyaQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org;
	s=dkim; t=1795519936;
	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=+roBVS9JXf++cP/BlI7jFSzfcBbuEGSFn7XNjlZ+bZc=;
	b=Hcz3hXAKBJug0j15wPpfYglbe4PQ7/h98L9uJJNWwhlbmktz04UdF9MmHIN+xhkOWRltOi
	UVNGO9wq25BDhv+gUZvmVpTnAMo9APSmB3rSfoROz7U6OtP1I6L0tQ5NNKN/8qMIhuqoEk
	o89t3lsox9mV9uwSwiXf9nhzMa7hJbAMMOptsIrgtmkbKNRtiAsBuYFbjPOh39l+0OnMXS
	l48juN3Co1cXwiOKwyT4zE9rorwvxoPnf+QKjPVvfDTPHleaexDV02UEa7DxHG/y7NUvG3
	LQ3Gbgm4kfsfdd7av4c/zVSk3lDoi7i7S4yJRDT/QUNh6YXZPbJbJYFjjGtb1w==
ARC-Authentication-Results: i=1;
	mx1.freebsd.org;
	none
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 4jYgdX1S8bzdPd
	for <threads@FreeBSD.org>; Tue, 24 Nov 2026 11:32:16 +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 6AOBWGTm015347
	for <threads@FreeBSD.org>; Tue, 24 Nov 2026 11:32:16 GMT
	(envelope-from bugzilla-noreply@freebsd.org)
Received: (from www@localhost)
	by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 6AOBWGMa015346
	for threads@FreeBSD.org; Tue, 24 Nov 2026 11:32:16 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 300942] pthread_exit() + exit() can race and crash with SEGV
Date: Tue, 24 Nov 2026 11:32:16 +0000
X-Bugzilla-Reason: AssignedTo
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: Base System
X-Bugzilla-Component: bin
X-Bugzilla-Version: 15.1-RELEASE
X-Bugzilla-Keywords: crash
X-Bugzilla-Severity: Affects Only Me
X-Bugzilla-Who: ivy@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: <bug-300942-13406-ELMkj10nOH@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-300942-13406@https.bugs.freebsd.org/bugzilla/>
References: <bug-300942-13406@https.bugs.freebsd.org/bugzilla/>
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset="UTF-8"
X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/
Auto-Submitted: auto-generated
List-Archive: https://lists.freebsd.org/archives/freebsd-threads
X-BeenThere: freebsd-threads@freebsd.org
List-Id: Threading on FreeBSD <freebsd-threads.FreeBSD.org>
List-Post: <mailto:freebsd-threads@FreeBSD.org>
List-Help: <mailto:freebsd-threads+help@FreeBSD.org>
List-Subscribe: <mailto:freebsd-threads+subscribe@FreeBSD.org>
List-Unsubscribe: <mailto:freebsd-threads+unsubscribe@FreeBSD.org>
List-Owner: <mailto:freebsd-threads+owner@FreeBSD.org>
Precedence: list
MIME-Version: 1.0

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D300942

--- Comment #11 from Lexi Winter <ivy@FreeBSD.org> ---
okay, my problem was apparently because zsh doesn't print the crash banner =
when
it's not running the binary as a job.  i can easily reproduce it using /bin=
/sh:

$ while sleep 0; do echo -n .; ./exitrace 32; done
...................Segmentation fault (core dumped)

or with a better zsh loop:

% while sleep 0; do echo -n .; ./exitrace 32 || echo -n X; done
........X..............X.......X..X..............................X.........=
.....X
.X..X.........X...X.......X............X.....X...............X.........X.X.=
..X...
.........X..........X.......X...X............X..X..........X..............X=
......
.............X...........X.........X...X.X....X......X...........X....X....=
......
...X...............X..X.X..X....X...................................X.X....=
......
......X.X.................X...........X.X...X......X.......................=
.X.X..
...X.X.......X...X..........X...X.........X.X..X...............^C

--=20
You are receiving this mail because:
You are the assignee for the bug.=

From nobody Tue Nov 24 11:51:25 2026
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 4jYh3d0hDBz70wJ6
	for <threads@mlmmj.nyi.freebsd.org>; Tue, 24 Nov 2026 11:51:25 +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)
	(No client certificate requested)
	by mx1.freebsd.org (Postfix) with ESMTPS id 4jYh3d02mbz4F1L
	for <threads@FreeBSD.org>; Tue, 24 Nov 2026 11:51:25 +0000 (UTC)
	(envelope-from bugzilla-noreply@freebsd.org)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim;
	t=1795521085;
	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=pQjBvuGiHGf0Ex5PtTK7taOUl9jqGBLg3drKcDJtbgA=;
	b=udfVTlkfB9by7JdsONLZUTKN/OY16zFY1NPLyrDlhsacjMlW4Gjs/xGd9oIaFNjvIGws9M
	yzu+B/30orQXeSmG+BnfLbytZ4VJ4rMwleyrsD85oG2zOuktSGeTV0jdwsnimkXDl6PEF6
	9H0uvVWTog1YRctKUDV6SKECHzg7x/53ANOHlPlpFcOswXKI8j/vzI+Lbi4uqGPKKMth0Q
	h4AHPM3MhqFBbFXZ4CWlZD2JFf5Qvs1EBvXR5D5BOq/9+JvkjFvH+N3FtxBY3F72bTCP4c
	tJF2MUhwWBdiyDf5jw+7tggmR7EU4L4wfs5A+2zKqZFEnBM+HQtQKld/Yv7bZQ==
ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1795521085;
	b=aCQVKwwhfw0Mh8wwquea3ImgVJrGt9d4FvPZsErevHVXLFPPP1NulaI3KYa4ygutqscvIK
	NBEGuRRPU0qBVSfwcod4lhJPgbIL9Mq++ZH19ExLfus1YBdYoSDEERBGfaEdu2w3ZNSY1c
	3P+uQmR32oStLboJYYjxOeVKlKlvEgHNOWjvcK+9Uf1j7hieoQEdDqCrQ5P26vRQtLlrRj
	iI6Dp8sTYwYZIRS4NGPsJ4e2ao423BibQJ2smTkzaCPx9CDqSTe5CSo2S4+Rg6c+HYJg4q
	ZmHDWfVGivFvQv3WsXzPfYWiQMxJYP3UqZRtQevm+SxLQG4XlT2kIDycEl2q7w==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org;
	s=dkim; t=1795521085;
	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=pQjBvuGiHGf0Ex5PtTK7taOUl9jqGBLg3drKcDJtbgA=;
	b=bQvI6JIvyAl3b3HmC7ZACa6K7WWR/aOMF8ySlHpc3bNDG700boIo5t8CaJPlTzndp3uj1W
	jddkSXJacL4x2rD1qmDzeRF/01YMTn4Zru1jtZS+VngLIQx3so/v82avZkhwnLXLRORr8C
	Gy76La0/hoY1enrvNfbaXP9yUfdErwZzfPGTRIGLrM1UOuJRotP34cvGeeAE9PwwMcAqqs
	2u5VHhL/hlOH8yV2I0hGhiLOTctM7ltwrNJpCe0CVcokb54TYgjvlr0GQPjjGlLJu5ltel
	5ZpVEX52EzOuiJoF6WrC0lbLg7M1GWWvkbCxep5Ibg8cmIauMtEAHx3JrIcDMQ==
ARC-Authentication-Results: i=1;
	mx1.freebsd.org;
	none
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 4jYh3c6q8GzdxK
	for <threads@FreeBSD.org>; Tue, 24 Nov 2026 11:51:24 +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 6AOBpObt039732
	for <threads@FreeBSD.org>; Tue, 24 Nov 2026 11:51:24 GMT
	(envelope-from bugzilla-noreply@freebsd.org)
Received: (from www@localhost)
	by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 6AOBpOG7039731
	for threads@FreeBSD.org; Tue, 24 Nov 2026 11:51:24 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 300942] pthread_exit() + exit() can race and crash with SEGV
Date: Tue, 24 Nov 2026 11:51:25 +0000
X-Bugzilla-Reason: AssignedTo
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: Base System
X-Bugzilla-Component: bin
X-Bugzilla-Version: 15.1-RELEASE
X-Bugzilla-Keywords: crash
X-Bugzilla-Severity: Affects Only Me
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: <bug-300942-13406-RswSZwMmIe@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-300942-13406@https.bugs.freebsd.org/bugzilla/>
References: <bug-300942-13406@https.bugs.freebsd.org/bugzilla/>
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset="UTF-8"
X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/
Auto-Submitted: auto-generated
List-Archive: https://lists.freebsd.org/archives/freebsd-threads
X-BeenThere: freebsd-threads@freebsd.org
List-Id: Threading on FreeBSD <freebsd-threads.FreeBSD.org>
List-Post: <mailto:freebsd-threads@FreeBSD.org>
List-Help: <mailto:freebsd-threads+help@FreeBSD.org>
List-Subscribe: <mailto:freebsd-threads+subscribe@FreeBSD.org>
List-Unsubscribe: <mailto:freebsd-threads+unsubscribe@FreeBSD.org>
List-Owner: <mailto:freebsd-threads+owner@FreeBSD.org>
Precedence: list
MIME-Version: 1.0

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D300942

--- Comment #12 from Konstantin Belousov <kib@FreeBSD.org> ---
while sleep 0; do echo -n .; ./exitrace 32 || echo -n X; done
...........................................................................=
...........................................................................=
...........................................................................=
...........................................................................=
...........................................................................=
...........................................................................=
...........................................................................=
...........................................................................=
...........................................................................=
...........................................................................=
...........................................................................=
...........................................................................=
...........................................................................=
...........................................................................=
......................................................................

--=20
You are receiving this mail because:
You are the assignee for the bug.=

From nobody Tue Nov 24 11:54:05 2026
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 4jYh6j0ztqz70x3K
	for <threads@mlmmj.nyi.freebsd.org>; Tue, 24 Nov 2026 11:54:05 +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)
	(No client certificate requested)
	by mx1.freebsd.org (Postfix) with ESMTPS id 4jYh6j0Tnlz4F3S
	for <threads@FreeBSD.org>; Tue, 24 Nov 2026 11:54:05 +0000 (UTC)
	(envelope-from bugzilla-noreply@freebsd.org)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim;
	t=1795521245;
	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=4YKOL/eJhzaKIWD672s4JnYTNVGIJjwDFBrgM/erRgI=;
	b=g46+j+X1m2+B3NPoazz5B9bDtxVoAlmVkYh4m4ayWu+GOxRDi0HgnS9IqLnZ3QBpUIAO1x
	nh5Xp4TURa5HKP3zdu2wNyw07gdHoc60OvEHF0YYTdNvIgpbkDqPDwC3p6Y7VcfXl0QAbq
	ZCFh/vgzWxneqLtnr6J0QYIvILrzJaebTXlCYP+C/9x5dLFIULHYrOG8niJmTqzsa7jUtJ
	Bt7yhFMqSZcEkhuptJE/tdvOkXhFQdC0A9UH2kP+hCqlmbiTOPGdsPusMO2/v0cBCB5iKt
	hkdhYtJ6EwJvegHYleOHtQAuF82RGDg423cySGs/FmBlUChzc52POGSKFyphfQ==
ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1795521245;
	b=QNVEHSLJ+GpR5OGtUHFEuXQ76efg5nM8dD5ITZhz0jXhoujr/jCslcWc1tC8Y7yJkJan3b
	k+VUPL/2M1iu+tJRzjU4RyPzN5v4SUHvNOguzi8lYK1U2Ik/h0nT/MvjTwQPiBGPi1ffw1
	EDpFXbZ0wWYHxzbLU0l2Ppqx+RWB2g/oDwNtw5OLBvrRHod0vCAsNySp6qTo1ect33dnz/
	HOgn1JAdji+DxRWIIB34g5B0pcRTpSJaWCI1IpU8BONoz44UHZ/L1/REAJEOB8suZ/XRJE
	XX49ZnMBqCv0ID+5/jOo37xeC3b6d/cT7neH4l0Cggh5mL3bCAyST4tLDJC/gQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org;
	s=dkim; t=1795521245;
	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=4YKOL/eJhzaKIWD672s4JnYTNVGIJjwDFBrgM/erRgI=;
	b=pw50Fw56pukAbjPnHqYowaOatpfdnbq7jvLanyTXD2g9JdNxUkiXKZ4HXdbf3R3n9+2vbc
	sm3bAMLkRtza3d0ju99AzKmkL0I2MElQBr/tcQQDK6kB75BDglOsTDa0YDqQrzPWYh+AFs
	kWF01eQvgu66woRz8bU9NShlwPVKl3MfF2N8kY06vTk3Z9Dac8VnEMlC7NyzG7UIj0697w
	Hij17X2l9aBZPJKrT8RmW3a6VIkoLNZlURlManTr9EM9R9dXwY/rujbd4tglCeqeKjAOOF
	o6gB/nMQc97mKY8tozTLweBzPZaK8uTwNreN56MonDgb9c9pMqLWXea9pUD1OQ==
ARC-Authentication-Results: i=1;
	mx1.freebsd.org;
	none
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 4jYh6j09PWzdTq
	for <threads@FreeBSD.org>; Tue, 24 Nov 2026 11:54:05 +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 6AOBs4FH046289
	for <threads@FreeBSD.org>; Tue, 24 Nov 2026 11:54:04 GMT
	(envelope-from bugzilla-noreply@freebsd.org)
Received: (from www@localhost)
	by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 6AOBs4oZ046288
	for threads@FreeBSD.org; Tue, 24 Nov 2026 11:54:04 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 300942] pthread_exit() + exit() can race and crash with SEGV
Date: Tue, 24 Nov 2026 11:54:05 +0000
X-Bugzilla-Reason: AssignedTo
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: Base System
X-Bugzilla-Component: bin
X-Bugzilla-Version: 15.1-RELEASE
X-Bugzilla-Keywords: crash
X-Bugzilla-Severity: Affects Only Me
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: <bug-300942-13406-RzZtoOScup@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-300942-13406@https.bugs.freebsd.org/bugzilla/>
References: <bug-300942-13406@https.bugs.freebsd.org/bugzilla/>
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset="UTF-8"
X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/
Auto-Submitted: auto-generated
List-Archive: https://lists.freebsd.org/archives/freebsd-threads
X-BeenThere: freebsd-threads@freebsd.org
List-Id: Threading on FreeBSD <freebsd-threads.FreeBSD.org>
List-Post: <mailto:freebsd-threads@FreeBSD.org>
List-Help: <mailto:freebsd-threads+help@FreeBSD.org>
List-Subscribe: <mailto:freebsd-threads+subscribe@FreeBSD.org>
List-Unsubscribe: <mailto:freebsd-threads+unsubscribe@FreeBSD.org>
List-Owner: <mailto:freebsd-threads+owner@FreeBSD.org>
Precedence: list
MIME-Version: 1.0

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D300942

--- Comment #13 from Konstantin Belousov <kib@FreeBSD.org> ---
Hmm, can you get the github.com/kostikbel/freebsd-src branch rtld and try i=
t.

There are some additional fixes.  The ifunc race might be what you mentione=
d.

--=20
You are receiving this mail because:
You are the assignee for the bug.=

From nobody Tue Nov 24 12:00:41 2026
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 4jYhGK09Bwz70xj1
	for <threads@mlmmj.nyi.freebsd.org>; Tue, 24 Nov 2026 12:00: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)
	(No client certificate requested)
	by mx1.freebsd.org (Postfix) with ESMTPS id 4jYhGJ6pMrz4Fyw
	for <threads@FreeBSD.org>; Tue, 24 Nov 2026 12:00:40 +0000 (UTC)
	(envelope-from bugzilla-noreply@freebsd.org)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim;
	t=1795521641;
	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=bg8YotCKbncXSVYXGV1RwnikKvq/KCm1BFpUGuAcvSw=;
	b=jpU13Okm6CMlPkVJ27sJkAw+YaelvS7RgziV64FZHU/VysXUGfwKNK71VWSUB6JXDvndqv
	Fan0NojUEvORM8Ox5yya8YXzuLrhX0iyhpNBrEPlppkgUXYFxdNkMcnd5SHx6LB+4tNFiC
	1WrvgLHlWW9VMwrd8fT7euQf7D2QdV9vFLS9YydQAt3BHe9LE88n06MWBEhSO+b5x6maRf
	ew3+z/4eOIX6iLIiY3WruYF1+VWSF8hpWGnH89Z4vvrIpsnkAcDbTCDV0rcZeaeQ/EO9u4
	i6EBRjkcVdhctg+/hV48E0ZFqCer/SDk92wPHUN7oHBzn4JRiu73jnGH2qWNeg==
ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1795521641;
	b=bRI0dvvb2+9ocau7+vsiApamIk4kOIgMLEzkHPMn6eR4JZE/bXzaLGi+Kj7/gprI+NC99i
	E98Nvj5D2NKA8X/3ZQbYIr+ikyHl2cR5mZIKbpuWw0cm8NmkGDEhO9wGBgDpRyaBQOgmr2
	bhxpEwwe8VZehb8eWXgnSx/thlGIvWm1UmbOiCfL9oW3ODnSASeTG18z/f7XXqu4uQ7hf6
	0uG2b5s93Bk50tamDDrbFVQ1r7RnVD4lCULESpTj1cPJgujhFFYrrwWm7NSfkdbnbiUKYY
	BbgFvknSolmFagFivPFlP9VZw2IlT5I2XrrgJ1lrrwMo76g+Vf54Y2b1y/jwYw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org;
	s=dkim; t=1795521640;
	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=bg8YotCKbncXSVYXGV1RwnikKvq/KCm1BFpUGuAcvSw=;
	b=tA2jx6cVQHzsCTOC/qszf4dIgU7YRQRqs/nnm5dOHsD8dAKZ5qFm5RrFTrWeOW0wQmVIzM
	cliJ/T8YQxiqajNIqMxgw/t6i/Z8YxJpkwWmIfbOBu1G/R32dLHsWwAIV3OUWqUOFnHepi
	05OOvYm7ENlRqF981l6R1xYus21hcT3anoIAA/RFpaafLaCmqkMZmiSq/MEZhxbjd44ZNx
	A+qI/o9jvTfACr1YvjcTLAF6+tLPqrYvrV6LjvCWnD7h5eI+3Xt5gMvpuydN14xxDdPYZo
	I6iBVVzGVaR8RUt0mA1rV5swdzf+rVmUGHBDt2xzkLHjVuGENYyo0eOnf5+uGw==
ARC-Authentication-Results: i=1;
	mx1.freebsd.org;
	none
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 4jYhGJ6TZDzdTt
	for <threads@FreeBSD.org>; Tue, 24 Nov 2026 12:00: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 6AOC0e5w051704
	for <threads@FreeBSD.org>; Tue, 24 Nov 2026 12:00:40 GMT
	(envelope-from bugzilla-noreply@freebsd.org)
Received: (from www@localhost)
	by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 6AOC0eZ7051703
	for threads@FreeBSD.org; Tue, 24 Nov 2026 12:00: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 300942] pthread_exit() + exit() can race and crash with SEGV
Date: Tue, 24 Nov 2026 12:00:41 +0000
X-Bugzilla-Reason: AssignedTo
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: Base System
X-Bugzilla-Component: bin
X-Bugzilla-Version: 15.1-RELEASE
X-Bugzilla-Keywords: crash
X-Bugzilla-Severity: Affects Only Me
X-Bugzilla-Who: ivy@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: <bug-300942-13406-4mycecyYcU@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-300942-13406@https.bugs.freebsd.org/bugzilla/>
References: <bug-300942-13406@https.bugs.freebsd.org/bugzilla/>
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset="UTF-8"
X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/
Auto-Submitted: auto-generated
List-Archive: https://lists.freebsd.org/archives/freebsd-threads
X-BeenThere: freebsd-threads@freebsd.org
List-Id: Threading on FreeBSD <freebsd-threads.FreeBSD.org>
List-Post: <mailto:freebsd-threads@FreeBSD.org>
List-Help: <mailto:freebsd-threads+help@FreeBSD.org>
List-Subscribe: <mailto:freebsd-threads+subscribe@FreeBSD.org>
List-Unsubscribe: <mailto:freebsd-threads+unsubscribe@FreeBSD.org>
List-Owner: <mailto:freebsd-threads+owner@FreeBSD.org>
Precedence: list
MIME-Version: 1.0

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D300942

--- Comment #14 from Lexi Winter <ivy@FreeBSD.org> ---
i've put the binary, core, related shlibs and debuginfo here:
https://people.freebsd.org/~ivy/tmp/exitrace-core.tar.Z

i'll try your branch and see what happens.

--=20
You are receiving this mail because:
You are the assignee for the bug.=

From nobody Tue Nov 24 12:07:29 2026
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 4jYhQ92tgDz70yGW
	for <threads@mlmmj.nyi.freebsd.org>; Tue, 24 Nov 2026 12:07:29 +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)
	(No client certificate requested)
	by mx1.freebsd.org (Postfix) with ESMTPS id 4jYhQ926z8z4Ghj
	for <threads@FreeBSD.org>; Tue, 24 Nov 2026 12:07:29 +0000 (UTC)
	(envelope-from bugzilla-noreply@freebsd.org)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim;
	t=1795522049;
	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=NRoh9XuHDnk/pUliVqcdL2q0cKbl6S3bg0d0K6KjOl0=;
	b=edQznUWTMReojxExPGn3IMBoz42KukAsdqcz7FdGH9oUfdGtmPdJatC8k6KdVATki+b6Ue
	lzKqLp17veQcq+Bi9X0W84qXGev2gkslBK7S/HsDUMg0dMjUNn2KxMJTn6DZAKpit0mgYE
	Gm+vj4h5pJ1zDdWNQ6yvkIw4JO3AdvinjPvrLtH8tIMW60B3+ybknHmGxVq84egMXPPs0t
	MiepNxnQ9+WJbRmw1dhbu7tFtuXvtpHX5BPUPjX40bvoKB6Q5UkiKm6/owOw9GYUlf6ClU
	9+4ANMeZjI8+gynER4DQZie6mZb0euqjTYQYYOFSxgdc33OsG6NLOWWGTZmDcw==
ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1795522049;
	b=EupEPukiZVOW/Oc1e6vYKe45748mn4xlSqnactnGMKz3r9+thDHYy4HiF/hcOcB5/JoSmk
	4V4oLE8t4LOwzISs4FJKQRr088rSapVU0wa0XrFytXXDNVf4ynCr0UvvyDAmcNgWiGB/Vq
	OdZHYMvFJOdiYf65ngyvEq6ZCzfNufd5iip1rlJRKJJ6TfvCE3rF2BvQymQO0VO3LjOG16
	pbPZFsRk3JXoZedVGb7rqQzv7Qj2meQB+jDqzGcnD7s6CgE6w/uiGTMiR4MDkOHyAbS/vx
	tws279gI6KcfxZeAz844LqWwjNVe9DcXmV8851617mwGRMwdMeMwvu6R0fa5gQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org;
	s=dkim; t=1795522049;
	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=NRoh9XuHDnk/pUliVqcdL2q0cKbl6S3bg0d0K6KjOl0=;
	b=YIJgwOCWTDh60XM1kpQDho1gDEF0Hn6LqK6q3mn+N1cVUXi2KP4go53nxYCY+se5ptdQy1
	DgwPez54jeZw0boHwsx43fVBRoqNVVO4ov4h/JYw5lql3UoxCsQH8h9aMFMkIsCQFdkFXp
	vxh/oGvtXpDli1P52sHUUA18vs+JXtRq/pljm4AidrSbIxponyzA2MQnz4lMwyKSSEvUGX
	EPKCmL14jQFNrQ5vm+9A8N4oPjwl/ZYIhE3Ipb+fnlxRf7G5Nwi6RuJk9DWppNK8S+R/fL
	bLuvbfm2Op706JVlTIf0SQDu8TAMftWLxUtK/Cma0F5xjQt2BeDJ7DGQpg9Nfg==
ARC-Authentication-Results: i=1;
	mx1.freebsd.org;
	none
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 4jYhQ91nSMzfLj
	for <threads@FreeBSD.org>; Tue, 24 Nov 2026 12:07:29 +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 6AOC7TAT065442
	for <threads@FreeBSD.org>; Tue, 24 Nov 2026 12:07:29 GMT
	(envelope-from bugzilla-noreply@freebsd.org)
Received: (from www@localhost)
	by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 6AOC7TWh065439
	for threads@FreeBSD.org; Tue, 24 Nov 2026 12:07:29 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 300942] pthread_exit() + exit() can race and crash with SEGV
Date: Tue, 24 Nov 2026 12:07:29 +0000
X-Bugzilla-Reason: AssignedTo
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: Base System
X-Bugzilla-Component: bin
X-Bugzilla-Version: 15.1-RELEASE
X-Bugzilla-Keywords: crash
X-Bugzilla-Severity: Affects Only Me
X-Bugzilla-Who: ivy@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: <bug-300942-13406-SQZip4tYy6@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-300942-13406@https.bugs.freebsd.org/bugzilla/>
References: <bug-300942-13406@https.bugs.freebsd.org/bugzilla/>
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset="UTF-8"
X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/
Auto-Submitted: auto-generated
List-Archive: https://lists.freebsd.org/archives/freebsd-threads
X-BeenThere: freebsd-threads@freebsd.org
List-Id: Threading on FreeBSD <freebsd-threads.FreeBSD.org>
List-Post: <mailto:freebsd-threads@FreeBSD.org>
List-Help: <mailto:freebsd-threads+help@FreeBSD.org>
List-Subscribe: <mailto:freebsd-threads+subscribe@FreeBSD.org>
List-Unsubscribe: <mailto:freebsd-threads+unsubscribe@FreeBSD.org>
List-Owner: <mailto:freebsd-threads+owner@FreeBSD.org>
Precedence: list
MIME-Version: 1.0

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D300942

--- Comment #15 from Lexi Winter <ivy@FreeBSD.org> ---
the rtld branch doesn't fix the problem, but it makes it happen about 10% of
the time: with 32 threads, main crashes 270 times per 2,000 runs while your
branch crashes 31 times per 2,000 runs.

the failure mode is still the same: it loads a second copy of libc etc. whi=
ch
crashes due to the issue i mentioned in comment 6.

--=20
You are receiving this mail because:
You are the assignee for the bug.=

