From nobody Fri May 29 15:27:07 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 4gRnK74n9tz6fhvR for ; Fri, 29 May 2026 15:27:07 +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 4gRnK739Gkz47RP for ; Fri, 29 May 2026 15:27:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1780068427; 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=2svsVra9N24Y/hq6wq0SRJmJc+zemtA+6bY2OD/nMyk=; b=nTrbxvvmUIcx6dPJ2KgazTzPtPlqklh+1scoQJdkr+baFIQYEjyHLL6faCoJfxid3Epgf7 5RkV+75F7oVnIloAA9bnqoJlmNcC8szAplUmZ1dI7sKaLg3YrmiuU9ZlK7a3lMbJreJGJo 2toxGuNY1Qx4SyPgaEHHQkcS++RpezueScx9Y+bsKmEumWxmeopnLY4NjL3JpPCAcQL8Sb 61SDanyveCXUWafdIcjdjxktHZKjJ+40qhnB85VYwKaRDzDm95C5JuZLf1JLdas0pBnvdH lj7T8QWX4NshNhxpuCpcUt8+qm+7C8SsJLwWozAqr4T2+8ii9605ocDQbKgDFQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1780068427; a=rsa-sha256; cv=none; b=DLO/F1eEbbVJdJdm+rTjKdOojs+qLTJXV3GpvW3UoLamKnDplhVnCtns9oXCVdVX78ffaA OGMzKQ8x9ndjB8WJorJOk5bXok78bgm2gQjLQiQ50m1dkC8BBn5u3lsqcYIlx2WuxLAYH0 9JDD1f9JCJsKbl1ZdRg5dOmZxSnt4/B+Iqy5IkZ/aOOr6Kz/VlNI0YaTVeTXvPha4B3EFN A+hdOXw+cy31C4wVhUqQ0YaRED0NNZXTBMYKoC6Vweqol4a8QcXuiMveersNaNJetLVXvZ brdidDZ38Ki2oXjr91fpoNSRUgWpA4lXYHEzNfAqoyyuxQq9ajFk92QWxyTZtA== 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=1780068427; 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=2svsVra9N24Y/hq6wq0SRJmJc+zemtA+6bY2OD/nMyk=; b=SYllIiN+Q40qWo6G7bywfGf/yukiOkqzDzwtgZNxatLj/HK5xio2t+IwexqO95FKbaNOr9 UbMPgko47hFrzSwSAIg5Y4osu2DsL/TAUye71lKQCu4o0d/E+7htvqBpugbKAdOteSPjJA vcp+s1If9EPkZQZ7+HM3eJlrEBkqkdfFlpLd2SLDFDrgbsXKxIZL/PmElIdtRS2y/6X/f4 /xABSCescnO4l6341H+CYdhjfXNM1r/CCPNmnvYySHJWFE5OvUvaGLuyl3p1xgGK8RibAa CrlU5EP8MI2YVn/iWSjPV2jhkNC9qASYaP3ny64XjZGJRiGh6GRLd5bcWUVEvw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gRnK72j3Bzfdh for ; Fri, 29 May 2026 15:27:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 31646 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 29 May 2026 15:27:07 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: ShengYi Hung Subject: git: 661c4b1b949b - stable/14 - 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/14 X-Git-Reftype: branch X-Git-Commit: 661c4b1b949bef3a77a4f773d4d6977314d83533 Auto-Submitted: auto-generated Date: Fri, 29 May 2026 15:27:07 +0000 Message-Id: <6a19b04b.31646.682c5f77@gitrepo.freebsd.org> The branch stable/14 has been updated by aokblast: URL: https://cgit.FreeBSD.org/src/commit/?id=661c4b1b949bef3a77a4f773d4d6977314d83533 commit 661c4b1b949bef3a77a4f773d4d6977314d83533 Author: ShengYi Hung AuthorDate: 2026-03-17 14:53:08 +0000 Commit: ShengYi Hung CommitDate: 2026-05-29 15:25:49 +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)