Open
Conversation
CI Test ResultsRun: #21720936948 | Commit:
Summary
Updated: 2026-02-05 17:19:56 UTC |
Scan-Build Report
Bug Summary
Reports
|
||||||||||||||||||||||||||||||||||||
Block profiling signals during context_tls_v1 initialization to prevent signal handler reentrancy into musl's TLS setup. Consolidate CriticalSection and SignalBlocker into guards module. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
c7c16fc to
f3db26e
Compare
zhengyu123
approved these changes
Feb 5, 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.
What does this PR do?:
Fixes a crash on musl libc systems where profiling signal handlers interrupt thread-local storage (TLS) initialization, causing reentrancy into musl's non-reentrant TLS setup code.
Motivation:
On musl-based systems (Alpine Linux, embedded systems), the profiler crashes with this stack trace:
The issue occurs because:
initializeContextTls0()which accessescontext_tls_v1(thread_local variable)pthread_getspecific()Additional Notes:
CriticalSectionand newSignalBlockerinto unifiedguards.h/cppmoduleHow to test the change?:
Automated tests: All existing tests pass (128/128), including TLS-related tests:
gtestDebug_context_sanity_ut- Context TLS testsgtestDebug_test_tlsPriming- TLS priming testsgtestDebug_stress_callTraceStorage- Uses CriticalSectionManual testing on musl: Deploy on Alpine Linux or musl-based system with high thread creation rate during active profiling to reproduce the race condition.
Code review: Focus areas:
For Datadog employees:
🤖 Generated with Claude Code