From nobody Sun Mar 22 02:48:35 2026 X-Original-To: dev-commits-src-main@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 4fdgjH5yXgz6Vlm0 for ; Sun, 22 Mar 2026 02:48:35 +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 4fdgjH5R23z448J for ; Sun, 22 Mar 2026 02:48:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1774147715; 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=Ct/y0FN/x6c41/jT696QZIFS7IPrN6yCX5WYmhTKxVeTC4aA2+GJH5EGMK4KcXMqUHl6K8 OwMrL/plAi05/Ccabw3z0plRWnpbnL66VTodApMVGTd+f16Vuxdi464Em/VtMvN3u4aOXq HnX+5lX8/iVJWjILnWVCexfKWodaehUzNK+SwtCpAyeRq/pn1nXEksEli66mdj5PyRUfgL nYZnX+bXOnhneRXRm5RxJk9ob7vUktg1QYqcfooUMtoQBHBVCUmMt71lbVOrDyrMjZUSY0 M///G/7ZlHfhhy+w0Dc26lDd/OL0Z1UqKGFofjQQGQzQtLCVJHnzbzHTOWminw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1774147715; a=rsa-sha256; cv=none; b=ojnXaJMAErGQT8lrjpB+ETX9OPsrrLsK4D3KLoLka1b9tAiwlt2uC4RTCMUc4/sIVWqp7q 2AvtzYZIGnbk54OyqSwjxQT7zzNgYynMIW7mPWGn7/4JvY2p1Lq98HBJDNjWorb6qFoPfy Yjb9JR32ZKZJ6L8gD2l7Z8fsqQ/hgAnop7QHfiz1plysk24GXYQbimfUx1hlp/0Jjp4SkI JazAegvm8RsXyTpr73wyvc/L47RE7teSUN2/qlZEolA8/vi861x41lOXvbDewIEPq1FbBp dXKfNej+64pmX6DPz7g6iWPK2zRxkxjdLP3qWP+npr3NkjBAGru96VCtIZpjOw== 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=1774147715; 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=oNYdnMWwVULZzQeIPm7ORJm5tKHqQFzBK84U7TDKoUQExkHiq5INFzFcTzEPeAuW09gLEV X9eeAmzaw6ZNGodlogX9XG+pdTHPsGzyhHNCQsgeJCdWfAXUOCPOuvM57d10Pua10WN+8h rlaj1kV4vb74hr6sfQCTwCwDW43mf4I8gzW3uXBH/F0DIXgkZ1OpbC9HC+hTaG4h/pA9kj 3O9bJ/nPEfTyS/DYfIYJaLMJEbs+etvvnbrdTyM0u+ruCeJmEsJI8MbCfwIiN5cmri7DNo RG9YXJZgu2UhJZ7GmWKNZ0I9b51EqvncRu7MnDoz8xyzlTSy1kijpFk7rp1/8A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fdgjH5271zgyy for ; Sun, 22 Mar 2026 02:48:35 +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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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)