From nobody Sun Mar 22 02:48:35 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 4fdgjP1BQgz6Vm1K for ; Sun, 22 Mar 2026 02:48:41 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fdgjP0ZrTz44NV for ; Sun, 22 Mar 2026 02:48:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1774147721; 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=SFPh8LwBeZIk/IC79Tdjwm+qOPItpmUiDFpqKq+DUNc=; b=PRRxeOr/jvo251ldjza/rMFOttUR8Hy7FBoF+Bxaa9VSK/IMk136fIg/6NuOnHQOg68dRr Izte+3s7j4kJYlpqC9AnaEJYJoGXPUOAXKjh5vzUeXDB9eCwI1Yq7BW6Qvf72yF8D/mdvx A5rX3abTy7yfoxgExAZRHVwI/Kc8mrPXdz8niO1nnuskV/w4XLrXnc22uN21nhnTui11df XmifskwGpUEGogmGiKkTl2fFZydOtj5CJW4ArhapEuhHWPu39A0KpOSGSK4pqQLH0ECKcd L0EFp/aZNSNZf6b1Ci9Rt/IlZSplMkrMnWrW7yJGDIHU35Qw79RzGotFEUc71w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1774147721; a=rsa-sha256; cv=none; b=gAqIAtus/H7xSDLAEy9aQSJljKG0zByRdwlMuDaZk7u7G4Y/smcAfgxZvChjjFly4/JR2v pgHmR4Vf1EKXwpRWLZmYqI3d3RDdhKAhTyYtEDjTDOo//xw4RIc4lCgMWh3ftdN6RXY/t5 oOP5mUy9JL0FaqXs1PwQ+adYo5e1Hp9dnA67t2huHWFrHgG0qAlA+sdzivMPbjWY+TAQi6 t9MDYIQL2h0lESDObQR0s+ME/ZOZoqxhpFS0IsVzBWmPUlAIq6lYDNZb5aMBuLJ67j2U7k pOBShOLqSUw8x3dhN0Ou6ECXS+RZPmGGW33xS7N87bBBhTErRbxoPW9Tc9aiXQ== 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=1774147721; 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=SFPh8LwBeZIk/IC79Tdjwm+qOPItpmUiDFpqKq+DUNc=; b=i7E6+DACLdaN7lkR2LjH73n+Ak1zUNuuy/3Nwlus01HNk06sO0XK8I1/zW5OrfbYyuHS7P mVI7VzgvimdkxZ74FmBa4yrqP5Cjb5qCRym0r1WtzZBluR1MEbtowLVj1KFDExDt6MG+US xAKBMO7R5NVE8oiaQtn5dSnXscHFIq/Qtx3ayEyKujKwiM+LZ3Cm42izp7zkaa2feMC51y IpIINM2Mger0PU556kZ4+/3T8yRu3P4XA/V/ocQnStyCnV1xWacdnvb6sm4ZtSlKPKnXNK IHIZ5a4sya6eN/F7jC/7T+neoqIWveso9DSkS/0qw2OwJv630gdi3WloI7x4FA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fdgjN727HzgbS for ; Sun, 22 Mar 2026 02:48:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 46f32 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sun, 22 Mar 2026 02:48:35 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: ShengYi Hung Subject: git: c25976f0a9a3 - main - 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 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/main X-Git-Reftype: branch X-Git-Commit: c25976f0a9a3a102ce47b45c19b2c93e8069433b Auto-Submitted: auto-generated Date: Sun, 22 Mar 2026 02:48:35 +0000 Message-Id: <69bf5883.46f32.5d9349e3@gitrepo.freebsd.org> The branch main has been updated by aokblast: URL: https://cgit.FreeBSD.org/src/commit/?id=c25976f0a9a3a102ce47b45c19b2c93e8069433b commit c25976f0a9a3a102ce47b45c19b2c93e8069433b Author: ShengYi Hung AuthorDate: 2026-03-17 14:53:08 +0000 Commit: ShengYi Hung CommitDate: 2026-03-22 02:48:24 +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 --- 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)