Skip to content

[cppinterop] Use threadsafe death-test style in TracingTests - #22162

Merged
aaronj0 merged 1 commit into
root-project:masterfrom
aaronj0:fix-tracing-death
May 7, 2026
Merged

aaronj0 merged 1 commit into
root-project:masterfrom
aaronj0:fix-tracing-death

Conversation

@aaronj0

@aaronj0 aaronj0 commented May 6, 2026 •

Copy link
Copy Markdown
Contributor

This should fix the failures seen on mac-beta and mac26. On apple systems, gtest's default "fast" death-test style forks the child without exec(), so the child inherits parent process state (atfork handlers, dyld closures, stdio locks) which can kill/stall before EXPECT_DEATH writes to stderr, so gtest captures an empty buffer and reports "died but not with expected error" with an empty Actualmsg.

This is a known issue and the fix as seen in LLVM's compiler-rt sanitizer tests, which set testing::GTEST_FLAG(death_test_style) = "threadsafe"; in their gtest entry points. Also see gtest-death-test.cc:250 - "Death tests use fork(), which is unsafe particularly in a threaded context", and the project's docs recommend threadsafe for this case.

@aaronj0
aaronj0 requested a review from bellenot as a code owner May 6, 2026 14:36
@aaronj0 aaronj0 self-assigned this May 6, 2026
@aaronj0
aaronj0 force-pushed the fix-tracing-death branch from 979bfb3 to 6c34c97 Compare May 6, 2026 15:44
@github-actions

github-actions Bot commented May 6, 2026

Copy link
Copy Markdown

Test Results

    22 files      22 suites   3d 7h 54m 44s ⏱️
 3 850 tests  3 850 ✅ 0 💤 0 ❌
76 031 runs  76 031 ✅ 0 💤 0 ❌

Results for commit 6c34c97.

@aaronj0
aaronj0 requested review from guitargeek and vgvassilev May 7, 2026 11:43

@vgvassilev vgvassilev left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm!

@aaronj0
aaronj0 merged commit f330497 into root-project:master May 7, 2026
31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants