From nobody Fri May 29 15:20:32 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 4gRn9Y0sPFz6fhTt for ; Fri, 29 May 2026 15:20:33 +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 4gRn9X4hGsz43sn for ; Fri, 29 May 2026 15:20:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1780068032; 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=CdHT07UW/LVZ17yAG1mVc1h3qdQH9g0eo2ECir1GZhM=; b=VMRv+ZpxRohVJ/rNIJnXDgwDkfV5NXXT1IuHc+03/24zmfSHON/P9Fl0jQQHzZOSZjBcNi F+wiZ/yGPkGbYG4NaGjlyht2QeWpyx4bPj8nlaIX35UjMn2/jtR8JywTvYN9TZnyfNsrgL ZjrM6JOi5x4/l9U5gnR3jE5JdXYjk/7zcsSGwOvwmCTi/4gQUk/6OR4Vq9z9FXMrkUjFw8 ZZZG8Gu3cVy8MfzIbsPSvZgpFCLdo+Iwms4BJDo1kuZAV6vlUMoih/80jNMsHJ9neeMNjF rmivwxcojYFTbYQKW2TO4VIQ1w0pFZrajWxeKWVUT0mMwmn22jtXbOr7A/+f4A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1780068032; a=rsa-sha256; cv=none; b=SSThpjL9qJgu66XC00OL/TFDBtoUeVWpK/hoQwlQbuMfMb7EVuBS7kCuGUSwshiE51+0Qh nb539av0c4FOyGAuW8WYtWjL5EclUtf/clYICqQTf4ym81R+06d4qWzGv2mbu89xhMcO5W nwLwyK17H9PidmoYfQ1gD/Zw2g9slLV4an/IF8bOoaK6jTIrhSFfWiWTxmiKUGOl4JXrwL VRvmk/M/OBbhNqeeIV4umlI62NbwbSLlSFXnHZaPlN1OA7xCvy7PN4yh3HL2zazoCgCG97 zmcoxzkx3zA8s6vg4v792BjHxQGDAhvp+P8cv1AbQGGpQfFlz/3BfnQ7Y8zqYg== 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=1780068032; 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=CdHT07UW/LVZ17yAG1mVc1h3qdQH9g0eo2ECir1GZhM=; b=uehyYY19XO0BxpC4gh52D3OjA+a36FWV8zt5/iXPo8Zh+pNWHnGOONxPIL0PlFGvUMmdtj kpcy4WuV4cWfap+NXsumBPxzN4R5xpHjbxlQ09AJ1zLaNNYc/bQpyYWE/Q3954W7janP2R wl5YT3MdZ3gmvR04lx28X4jw8lxhrjvaYlk+vfbf4HGiSMUr5m4y8xsjNA8Rkr4thVG4px xiZDoX77w394RaEvZTc92Ecq1ZnAe27iL0/M61slgL6kMD5SPPJddgCC0M4QWxQ2BNbP1R +hMpBWyBGLd5d3RvRga9FG3+aDpieiYmPOJfV0VYTxqF2wjl5ClE8+OT50jRtQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gRn9X47XnzfX2 for ; Fri, 29 May 2026 15:20:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 30f9c by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 29 May 2026 15:20:32 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: ShengYi Hung Subject: git: 2aff8c5e4ebf - stable/15 - libc: Fix cxa_thread_atexit{,nothr} test. 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: 2aff8c5e4ebfef2d0146c22c179a18274ecd5dd2 Auto-Submitted: auto-generated Date: Fri, 29 May 2026 15:20:32 +0000 Message-Id: <6a19aec0.30f9c.664d8354@gitrepo.freebsd.org> The branch stable/15 has been updated by aokblast: URL: https://cgit.FreeBSD.org/src/commit/?id=2aff8c5e4ebfef2d0146c22c179a18274ecd5dd2 commit 2aff8c5e4ebfef2d0146c22c179a18274ecd5dd2 Author: ShengYi Hung AuthorDate: 2026-03-17 14:53:08 +0000 Commit: ShengYi Hung CommitDate: 2026-05-29 15:19:48 +0000 libc: Fix cxa_thread_atexit{,nothr} test. After patch 9d26b82, we don't provide recursive call protection anymore. Therefore, to pass the test, we adjust the testcase by protecting on caller and the testcase is to make sure the dtors is properly handled. Reported by: siva Reviewed by: kib Approved by: markj (mentor) Fixes: 9d26b82826d9 ("libc: Fix dtor order in __cxa_thread_atexit") MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D55893 (cherry picked from commit c25976f0a9a3a102ce47b45c19b2c93e8069433b) --- lib/libc/tests/stdlib/cxa_thread_atexit_nothr_test.cc | 11 ++++++++--- lib/libc/tests/stdlib/cxa_thread_atexit_test.cc | 10 ++++++++-- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/lib/libc/tests/stdlib/cxa_thread_atexit_nothr_test.cc b/lib/libc/tests/stdlib/cxa_thread_atexit_nothr_test.cc index 0b3b9497a6bd..d70c6b1b88dc 100644 --- a/lib/libc/tests/stdlib/cxa_thread_atexit_nothr_test.cc +++ b/lib/libc/tests/stdlib/cxa_thread_atexit_nothr_test.cc @@ -30,7 +30,10 @@ #include #include +#define AGAIN_CALL_LIMIT 20 + static FILE *output = NULL; +static int again_counter = 0; struct Foo { Foo() { ATF_REQUIRE(fprintf(output, "Created\n") > 0); } @@ -79,14 +82,16 @@ extern "C" int __cxa_thread_atexit(void (*)(void *), void *, void *); static void again(void *arg) { - - __cxa_thread_atexit(again, arg, &output); + if (again_counter < AGAIN_CALL_LIMIT) { + again_counter++; + __cxa_thread_atexit(again, arg, &output); + } } ATF_TEST_CASE_WITHOUT_HEAD(cxx__thread_inf_dtors); ATF_TEST_CASE_BODY(cxx__thread_inf_dtors) { - + skip("Skip since we only have main thread"); again(NULL); } diff --git a/lib/libc/tests/stdlib/cxa_thread_atexit_test.cc b/lib/libc/tests/stdlib/cxa_thread_atexit_test.cc index 628a70b510d1..6a5587698d37 100644 --- a/lib/libc/tests/stdlib/cxa_thread_atexit_test.cc +++ b/lib/libc/tests/stdlib/cxa_thread_atexit_test.cc @@ -30,7 +30,10 @@ #include #include +#define AGAIN_CALL_LIMIT 20 + static FILE *output = NULL; +static int again_counter = 0; struct Foo { Foo() { ATF_REQUIRE(fprintf(output, "Created\n") > 0); } @@ -52,8 +55,10 @@ extern "C" int __cxa_thread_atexit(void (*)(void *), void *, void *); static void again(void *arg) { - - __cxa_thread_atexit(again, arg, &output); + if (again_counter < AGAIN_CALL_LIMIT) { + ++again_counter; + __cxa_thread_atexit(again, arg, &output); + } } struct Baz { @@ -164,6 +169,7 @@ ATF_TEST_CASE_BODY(cxx__thread_inf_dtors) std::thread t([]() { e.use(); }); t.join(); + ATF_REQUIRE_EQ(again_counter, AGAIN_CALL_LIMIT); } ATF_INIT_TEST_CASES(tcs)