Repository navigation
Conversation
…ore deterministic - Check pthread attribute initialization, configuration, and thread creation errors. - Give the helper thread a dedicated and zero-initialized stack, to make the test less dependent on residual stack contents when checking whether stacks referencing the executable are skipped. The test checks that a helper thread that runs in libc and doesn't reference the main executable is excluded from the minidump. Initializing the dedicated stack should reduce the chance that stale pointers into the executable mapping cause the stack to be included. This changes a bit the original conditions of the test, since residual stack contents that could affect the result are eliminated. But it should make the test more deterministic. This test has been observed to sometimes fail in CI, reporting more threads with dumped stacks than expected.
This was referenced Oct 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
So, for this I may need some expertise by people like @slipher.
Basically, there is a test that can randomly fail in CI. It's related to threading. It's not just related to threading inside the test, but it is subject to the generic threading pressure on the build machine. For example on the CI using
make -j1may not reproduce the failure, whilemake -j4would. It depends on the machine. For example on my end I got it withmake -j32once.At some point while adding some
printffor debugging purpose made the bug disappear, and after removing them and adding otherprintfelsewhere, a single CI run reproduced it on bothlinux-amd64-clang,linux-arm64-gccandlinux-i686-gccbut notlinux-amd64-gcc… Adding suchprintfmay have impacted some thread synchronisation as a side effect and may reduce or increase the chance of reproducing the bug.By luck, the CI reproduces the failure very reliably with the
linux-i686platform, so I plumbed that platform in the CI the proper way to track down it:My own machine was unreliable to reproduce the bug even with the
linux-i686platform though I managed to catch it sometime, demonstrating it could be reproduced outside the CI. So I did all the debugging investigation by pushing debugging and diagnostic code to the CI, reading the log and doing back and forth implementing diagnostic code and attempted fixes followed by test runs this way.I'm not super familiar with threading so I got assisted by an LLM. I hope the purpose of the test has not been modified in the process.
With that patch, all the CI runs are passing reliably on that previously-unreliable test, on all platforms I tested (they all build and run all the checks):
I also tested a FreeBSD amd64 Clang run on my end and everything passed.
Make minidump stack-skipping test more deterministic.
The test checks that a helper thread that runs in libc and doesn't reference the main executable is excluded from the minidump. Initializing the dedicated stack should reduce the chance that stale pointers into the executable mapping cause the stack to be included.
This changes a bit the original conditions of the test, since residual stack contents that could affect the result are eliminated. But it should make the test more deterministic.
This test has been observed to sometimes fail in CI, reporting more threads with dumped stacks than expected.