fix: don't disable profiler on Alpine/musl over missing libgcc_s.so.1 - #720
fix: don't disable profiler on Alpine/musl over missing libgcc_s.so.1#720jbachorik wants to merge 4 commits into
Conversation
prewarmUnwinder() closes two separate lazy-load issues (J9 signal-context dlopen and glibc's pthread_exit __libc_dlopen abort) that share a fix but not a failure mode; only the glibc one should fail profiler startup. Fault-injection test updated to match. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Scan-Build Report
Bug Summary
Reports
|
||||||||||||||||||||||||||||||||||||
CI Test ResultsRun: #31102054098 | Commit:
Status Overview
Legend: ✅ passed | ❌ failed | ⚪ skipped | 🚫 cancelled Summary: Total: 32 | Passed: 32 | Failed: 0 Updated: 2026-08-06 12:52:56 UTC |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a69976b22f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Benchmark Results (commit a69976b)Pipeline: https://gitlab.ddbuild.io/DataDog/apm-reliability/benchmarking-platform/-/pipelines/129368968 Commit: ✅ Within expected boundariesNo significant runtime deltas (all within run-to-run noise) and no internal-counter outliers. Runtime details (per benchmark × JDK)
Internal counter details (ddprof)ddprof internal counters, latest / dev (✅ = 0, · = unavailable):
|
…njected prewarm failures Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
What does this PR do?:
checkState()was failing profiler startup on any host missinglibgcc_s.so.1, including musl/Alpine — but that failure mode (glibc'spthread_exit/pthread_cancelaborting via__libc_fatalwhen its private lazydlopenoflibgcc_sfails) is glibc-specific. musl never takes that code path, so a missinglibgcc_s.so.1there was never actually dangerous. The check now only treatsprewarmUnwinder()failure as fatal off musl (!prewarmUnwinder() && !OS::isMusl()), so Alpine/musl hosts withoutlibgcc_s.so.1start normally.Also rewrote the
prewarmUnwinder()comment, which had drifted to attribute the eager load to only one of the two lazy-load issues it actually closes (J9's DWARF-unwinder signal-context dlopen, and the glibc pthread_exit path above) — it now documents both, and why only one of them gates fatality.Motivation:
Distroless/hardened/Alpine images commonly ship without
libgcc_s.so.1. The overly broad check meant the profiler refused to start on those musl hosts even though nothing there was actually at risk.Additional Notes:
Also fixes
faultInjection_ut.cpp'sCheckStateSurfacesInjectedPrewarmUnwinderFailuretest, which assumed an injectedprewarmUnwinder()failure always surfaces as"Missing libgcc_s.so.1"— no longer true on musl. Latent until now since-PenableFaultInjectionisn't wired into CI yet, but fixed ahead of that.How to test the change?:
faultInjection_ut.cppto assert the correct behavior on both glibc and musl.libgcc_s.so.1); musl now starts normally instead of refusing to start.For Datadog employees:
credentials of any kind, I've requested a security review (run the
dd:platform-security-reviewskill, or file a request via the PSEC review form).
bewairealso runs automatically on every PR.Unsure? Have a question? Request a review!