From nobody Fri May 29 15:27:06 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 4gRnK64cPDz6fhX8 for ; Fri, 29 May 2026 15:27:06 +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 4gRnK62LnPz47hd for ; Fri, 29 May 2026 15:27:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1780068426; 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=/ugDo7H/LyIoVN6N0X0iLbzA1an3TTbDVMhJvVkzT/I=; b=fgtFfSgT7n9cTHikHCVSvFlnPKF4ibCRf99oMNoqYjk5fkUXw7a5upfqETXpEytatvJqKM sz0pNbQ3c8KJw1TJGfWTe5PncwFebhbxxs3JRS8PX27SyVbEmmptSwxe64AfB2shksiTho rEoUc1JS8bHoQJGy0NtgJ8DQTsV+AxMcuqwcYTcM3LXWxaBFg8Ndo9ApUaPapm93dPjM1o ODnlyFPBykkiuop6sVQRdV3U9NBtkwwIeR7yMKGWfAl/KjaOShvVQKzjp+ZuqKfbwiEawQ UYrVMlyDfmX1pCqwRZkzxrUs9A4sfJxp00y1y+Gqq8kwhBen0LyvV3diUyPGAA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1780068426; a=rsa-sha256; cv=none; b=qhBWvjDLKQ5b9taJA+7pkxJzLLM/m6622cm8ookuQUnEianUPY8ArScKU/GEhkcPMRmcwX FP7ar3uKPuFH05qA6C2C/GAciK4fWPP7701Dyvx7GHKzExGy+VabmRODPglqHlr4TPAqGN nkfdnisypZXapKeJqNGFeMgc5Ba18NVUajupQhzkw1PcG6mrGycdEtuJRkNC0Di3Ph7XOG 2ft0joVn9e25PpLoJq0JBHcaE6YejgoE/c9NmFjQx4hMb9m8ey9y9eabVHWQ+qyeRYsHCJ tOGloWiSfUdHYc09JMC+Q3FGSdkbduwGqVhlB70fV9+BRk3B/M2cTQRzDOsqaQ== 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=1780068426; 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=/ugDo7H/LyIoVN6N0X0iLbzA1an3TTbDVMhJvVkzT/I=; b=cNvRWiyVOfZ2zXhdWPbI6XADMHGla0q95aINC4oZZqwrPabEOfusqVp5c5XQzmkQH/VNbZ K8T2mPC7Nz8rcyV0ZExInv2yPELMUVSMGFB9qBYzvIKmLDweo8wrJwx06su9TmWGAcHVwG OaEArZt7EA9RuRmn/fKdY48jLthOkhYUlnxukzkom/eNj87X7UA6LA4CXbuqrROpH49oX1 IX+WbznlFcjtKkvjCGRIbSv/9NyI2Wh9HzHRGdmQvhc6c+GAllJtDghqYOiiEVFeXHSNyA 2OmrCHYhulkzIWksluotGR//n9Nx7WtiUqwAqMviNm3WNETmXP/h4qBNayAiSg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gRnK61w4lzfq0 for ; Fri, 29 May 2026 15:27:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 308b7 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 29 May 2026 15:27:06 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: ShengYi Hung Subject: git: 9d200dc7103a - stable/14 - 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/14 X-Git-Reftype: branch X-Git-Commit: 9d200dc7103a6ca2112ab0ea47edc28b2141e14e Auto-Submitted: auto-generated Date: Fri, 29 May 2026 15:27:06 +0000 Message-Id: <6a19b04a.308b7.766e2cf8@gitrepo.freebsd.org> The branch stable/14 has been updated by aokblast: URL: https://cgit.FreeBSD.org/src/commit/?id=9d200dc7103a6ca2112ab0ea47edc28b2141e14e commit 9d200dc7103a6ca2112ab0ea47edc28b2141e14e Author: ShengYi Hung AuthorDate: 2026-03-12 13:40:34 +0000 Commit: ShengYi Hung CommitDate: 2026-05-29 15:25:42 +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);