Skip to content

fix(tracing): avoid unresolved round symbol - #367

Closed
e-n-0 wants to merge 1 commit into
mainfrom
flavien.darche/fix-musl-round-symbol
Closed

fix(tracing): avoid unresolved round symbol#367
e-n-0 wants to merge 1 commit into
mainfrom
flavien.darche/fix-musl-round-symbol

Conversation

@e-n-0

@e-n-0 e-n-0 commented Sep 3, 2026

Copy link
Copy Markdown
Member

Summary

  • replace std::round in OpenTelemetry sampling threshold calculation with equivalent non-negative arithmetic
  • preserve threshold behavior at the 0 and 1 sampling-rate boundaries
  • prevent libc-free downstream modules from retaining an unresolved round symbol

Root cause

nginx-datadog removes its musl libc dependency after linking. The std::round call introduced by #354 remained undefined in the module, causing nginx to fail at startup with undefined symbol: round.

Validation

  • focused OpenTelemetry sampling test: 52 assertions passed
  • full unit suite: 199,862 assertions in 134 test cases passed
  • clang-format 14 dry-run passed
  • trace_segment.cpp.o has no undefined round symbol

@pr-commenter

pr-commenter Bot commented Sep 3, 2026

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2026-09-03 18:14:01

Comparing candidate commit f9c2f73 in PR branch flavien.darche/fix-musl-round-symbol with baseline commit d7a2e2a in branch main.

Found 0 performance improvements and 2 performance regressions! Performance is the same for 6 metrics, 0 unstable metrics.

Explanation

This is an A/B test comparing a candidate commit's performance against that of a baseline commit. Performance changes are noted in the tables below as:

  • 🟩 = significantly better candidate vs. baseline
  • 🟥 = significantly worse candidate vs. baseline

We compute a confidence interval (CI) over the relative difference of means between metrics from the candidate and baseline commits, considering the baseline as the reference.

If the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD), the change is considered significant.

Feel free to reach out to #apm-benchmarking-platform on Slack if you have any questions.

More details about the CI and significant changes

You can imagine this CI as a range of values that is likely to contain the true difference of means between the candidate and baseline commits.

CIs of the difference of means are often centered around 0%, because often changes are not that big:

---------------------------------(------|---^--------)-------------------------------->
                              -0.6%    0%  0.3%     +1.2%
                                 |          |        |
         lower bound of the CI --'          |        |
sample mean (center of the CI) -------------'        |
         upper bound of the CI ----------------------'

As described above, a change is considered significant if the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD).

For instance, for an execution time metric, this confidence interval indicates a significantly worse performance:

----------------------------------------|---------|---(---------^---------)---------->
                                       0%        1%  1.3%      2.2%      3.1%
                                                  |   |         |         |
       significant impact threshold --------------'   |         |         |
                      lower bound of CI --------------'         |         |
       sample mean (center of the CI) --------------------------'         |
                      upper bound of CI ----------------------------------'

scenario:BM_HexPadded_uint64/NoPadding

  • 🟥 execution_time [+1.683ns; +1.724ns] or [+3.147%; +3.224%]

scenario:BM_HexPadded_uint64/WorstCasePadding

  • 🟥 execution_time [+1.244ns; +1.283ns] or [+2.571%; +2.653%]

@e-n-0

e-n-0 commented Sep 3, 2026

Copy link
Copy Markdown
Member Author

Closing this workaround because the fix now lives at the correct compatibility boundary in DataDog/nginx-datadog#426. The exact x86_64 artifact from nginx-datadog head 4550c26474cae6e63af88de98ebc68a8a26d9ccc loads successfully in nginx:1.31.3-alpine, and its dynamic symbol table has no unresolved round, ceil, or ceilf symbols.

@e-n-0 e-n-0 closed this Sep 3, 2026
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.

1 participant