Repository navigation
fix(build): link libm, and run system-tests on pull requests - #128
cbeauchesne wants to merge 3 commits into
Conversation
dd-trace-cpp 2.4.1 uses std::round, which is in libm: Apache doesn't load it, so mod_datadog.so fails to load with "undefined symbol: round". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The excluded scenarios don't require credentials anymore. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The module is built against musl, where libm is part of libc: linking it adds nothing. Like ceil/ceilf in glibc_compat.c, round is defined in the module, for glibc hosts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ddba4b8a09
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| __asm__("roundsd $0x0B, %[x], %[result]" | ||
| : [result] "=x"(result) | ||
| : [x] "x"(x)); |
There was a problem hiding this comment.
Keep the rounding code within the x86-64 ISA baseline
On an x86_64 host without SSE4.1, every call to this replacement executes the SSE4.1-only roundsd instruction and kills the Apache worker with SIGILL. The project publishes generic x86_64 artifacts without declaring a newer CPU baseline, so an otherwise supported older server or VM can load the module and then crash when dd-trace-cpp rounds a sampling value. Use a baseline-safe implementation or dispatch only after checking the CPU feature.
Useful? React with 👍 / 👎.
xlamorlette-datadog
left a comment
There was a problem hiding this comment.
The most adequate way to fix this is #127.
|
Replaced by #127 |
Overview
roundin the module (mod_datadog/src/libm_compat.cpp)DEFAULTonly. The wholetracer-releasegroup (withDEFAULT) still runs onmainexcluded_scenarios:APM_TRACING_E2E_OTELandAPM_TRACING_E2E_SINGLE_SPANdon't require credentials anymoreMotivation
Since #126 (dd-trace-cpp 2.1.0 → 2.4.1), Apache can't load the module:
The module has no
NEEDEDentry: it relies on the Apache process for every libc function. dd-trace-cpp 2.4.1 added a call tostd::round(OpenTelemetry tracestate sampling,src/datadog/trace_segment.cpp), which is in libm, and Apache doesn't load libm. It's the only libm symbol among the module's undefined symbols.The module is built against musl, where libm is part of libc, so linking libm adds nothing. Like
ceil/ceilfindeps/nginx-datadog/build_env/glibc_compat.c,roundis now defined in the module:roundsd(truncate) then half away from zero on x86_64,frintaon aarch64. It stays local to the module (symbols.ld). Its proper home would beglibc_compat.cin nginx-datadog, but httpd-datadog gets it through the devcontainer image.It breaks the
cpp_httpd, devjobs of every system-tests PR (e.g. https://github.com/DataDog/system-tests/actions/runs/41662355703/job/126014462409). It wasn't caught here because the system-tests workflow only ran onmain: this PR enables it on pull requests too, and this PR's run validates the fix.Additional Notes
Checked against
std::round, bit for bit, on edge cases (±0, halves,0.49999999999999994, large values, infinities, NaN, subnormals) and 5M generated values, on amd64 and arm64. The module wasn't built locally: this PR's system-tests run is the check, andnm -D mod_datadog.soshould no longer listU round.References
Jira ticket:
Contributor Checklist
🤖 Generated with Claude Code