From nobody Fri May 29 15:20:31 2026 X-Original-To: dev-commits-src-all@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 4gRn9W4mJYz6fhRM for ; Fri, 29 May 2026 15:20:31 +0000 (UTC) (envelope-from git@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 "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gRn9W3lh4z43nZ for ; Fri, 29 May 2026 15:20:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1780068031; 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; bh=qPQP6fAUsO7p6gSd4TemjR1t3JwGNYftK5TzbchXzg0=; b=LdgLYtKMSLlabFfm3ADoTZ8LVK3lrsHKDCbSfEWWB8DooAL5LkFcAlzGGarozBjCoVB5Fu qiu4sBG+UlDvDccCR6tm48zvYJZifz0Tcj3dlbKADVYdoB66VfeiOxkO3JjutfMi0pQ+qM 7kIXlqBVEK87ZtIvrglLU379YXCMlrhqxgh87f2CeeJclpReQXQJXkPAx+EkQ1OJLcLCb4 5RJ6YGz2BRD3jrF8BvalEDgW0HNipQjmIQUO28pw79Jey3vAIix9cH81L60w2QdmAaf3ur L37Em61h7zuF4ubTzxttyxCOwWzDKTsoCONRKO341AcMchxjpx8hS+HT14ICjQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1780068031; a=rsa-sha256; cv=none; b=klWSMiMjfLzlSaufwxbM2c9sgdEBkI9D9a1Jpjdki+ytFPjGqDa0TA+/+gN3+tbj2DkVj1 2I1HAShuCC2zJbPRTnaBUtSZdTDKlTzS5oTQ0HPIbYFbMEVTyrvzsZ4MNCbu9f/hL7i2xG wr8f1tkNZFZKF2yimuTXRL4JG+fYsRU+u+75b8O9z227iqw737Wv9H/TKXhwPCsRq+eQZ5 KTNgS3Lfov3QaZRTBOxDS8oFgF0d8vodrKkfdd/gozzqcjxodhH8njYsAL4te4ucETddDL kX0iM2v7I5/OAq47s8mWiZtT+tXQK3CW6kQWhpZSQ0XNf3NYNerb3R290TqoOQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1780068031; 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; bh=qPQP6fAUsO7p6gSd4TemjR1t3JwGNYftK5TzbchXzg0=; b=rCo7qAtoSgdTLPMZLK5omTosNbGG6zsMd4BPNuES9Mdyn0bcz0stknksjw/Xg8K7MgGPVS 51P6YVt5ZvnaYzuFCvIoOA04rSNFygCvSrV04s35rUmKxOv84KXYJrdKT8JMAfPQXub2zn 6vIQt+Jr3j5Jlf3n0BA5kwbSPS1SeFM2VrqDHc+6hDAJE3aSBpY/Jhh30v6oSNQFBIvBDF zbaNSjx4oe2VYmG9PInnyrDXHyWUj2daXBE2MAdYOXLVwqewvF5uBcwI62zqtrSMgTRjQ/ HyHlzGtHI0+yUv2wS8PTNtn3sht8ETWmHKJqCESmwoaoaFHvOoeP1H+KTZL08w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gRn9W3LyLzfJj for ; Fri, 29 May 2026 15:20:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 27ddf by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 29 May 2026 15:20:31 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: ShengYi Hung Subject: git: e9c2f7f1a4f6 - stable/15 - libc: Fix dtor order in __cxa_thread_atexit List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: aokblast X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: e9c2f7f1a4f65403686e0195172efcbc51a0a11b Auto-Submitted: auto-generated Date: Fri, 29 May 2026 15:20:31 +0000 Message-Id: <6a19aebf.27ddf.1abd59f4@gitrepo.freebsd.org> The branch stable/15 has been updated by aokblast: URL: https://cgit.FreeBSD.org/src/commit/?id=e9c2f7f1a4f65403686e0195172efcbc51a0a11b commit e9c2f7f1a4f65403686e0195172efcbc51a0a11b Author: ShengYi Hung AuthorDate: 2026-03-12 13:40:34 +0000 Commit: ShengYi Hung CommitDate: 2026-05-29 15:19:48 +0000 libc: Fix dtor order in __cxa_thread_atexit The thread_local variable may creates another thread_local variable inside its dtor. This new object is immediately be registered in __cxa_thread_atexit() and need to be freed before processing another variable. This fixes the libcxx test thread_local_destruction_order.pass.cpp. Reported by: kib Approved by: lwhsu (mentor) MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D55826 (cherry picked from commit 9d26b82826d9962d5085bc5d9df7f8a762c57602) --- lib/libc/stdlib/cxa_thread_atexit_impl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/libc/stdlib/cxa_thread_atexit_impl.c b/lib/libc/stdlib/cxa_thread_atexit_impl.c index 3123bd12dca8..3d742d90fb44 100644 --- a/lib/libc/stdlib/cxa_thread_atexit_impl.c +++ b/lib/libc/stdlib/cxa_thread_atexit_impl.c @@ -119,9 +119,9 @@ walk_cb_nocall(struct cxa_thread_dtor *dtor __unused) static void cxa_thread_walk(void (*cb)(struct cxa_thread_dtor *)) { - struct cxa_thread_dtor *dtor, *tdtor; + struct cxa_thread_dtor *dtor; - LIST_FOREACH_SAFE(dtor, &dtors, entry, tdtor) { + while ((dtor = LIST_FIRST(&dtors)) != NULL) { LIST_REMOVE(dtor, entry); cb(dtor); free(dtor);