Skip to content

Fix memory corruption of INIs in ZTS builds#3898

Open
bwoebi wants to merge 2 commits into
masterfrom
bob/preload_zts
Open

Fix memory corruption of INIs in ZTS builds#3898
bwoebi wants to merge 2 commits into
masterfrom
bob/preload_zts

Conversation

@bwoebi
Copy link
Copy Markdown
Collaborator

@bwoebi bwoebi commented May 21, 2026

The preloading skip was lost during the last refactor; putting it back.

Fixes #3896.

The preloading skip was lost during the last refactor; putting it back.
@bwoebi bwoebi requested a review from a team as a code owner May 21, 2026 15:39
@datadog-prod-us1-5
Copy link
Copy Markdown

datadog-prod-us1-5 Bot commented May 21, 2026

Pipelines  Tests

Fix all issues with BitsAI

⚠️ Warnings

🚦 84 Pipeline jobs failed

DataDog/apm-reliability/dd-trace-php | ASAN test_c: [8.1, arm64]   View in Datadog   GitLab

🔧 Fix in code (Fix with Cursor). Assertion failed in config/config_ini.c:410: ZTS INI values must not be shared before syncing. Multiple tests failed due to this assertion.

🧪 18 Tests failed

tmp/build_extension/tests/ext/active_span.phpt (DDTrace\active_span basic functionality) from php.tmp.build_extension.tests.ext   View in Datadog (Fix with Cursor)
Termsig=6
tmp/build_extension/tests/ext/add_global_tag_on_userland_and_internal_spans.phpt (DDTrace\add_global_tag() on all sorts of spans) from php.tmp.build_extension.tests.ext   View in Datadog (Fix with Cursor)
001+ php: tmp/build_extension/zend_abstract_interface/config/config_ini.c:410: void zai_config_ini_rinit(void): Assertion \`ini->value != source->value && "ZTS INI values must not be shared before syncing"' failed.
002+ Aborted
003+ 
004+ Termsig=6
001- HOOK METHOD arg
002- array(2) {
003-   [0]=>
004-   array(10) {
005-     ["trace_id"]=>
006-     string(%d) "%d"
...
View all 18 test failures

DataDog/apm-reliability/dd-trace-php | ASAN Internal api randomized tests: [7.4, amd64]   View in Datadog   GitLab

🔧 Fix in code (Fix with Cursor). Test aborted with exit code 134 during execution of internal API stress test.

DataDog/apm-reliability/dd-trace-php | ASAN Internal api randomized tests: [7.4, arm64]   View in Datadog   GitLab

🔧 Fix in code (Fix with Cursor). Aborted error during execution of PHP stress test. Exit code: 134

View all 84 failed jobs.

🧪 2 Tests failed

    tmp/build_extension/tests/C2PHP/get_context_distributed_tracing_test.phpt (Distributed tracing context with an origin) from php.tmp.build_extension.tests.C2PHP (Fix with Cursor)

    tmp/build_extension/tests/C2PHP/get_context_distributed_tracing_test.phpt (Distributed tracing context with an origin) from PHP.tmp.build_extension.tests.C2PHP (Fix with Cursor)

ℹ️ Info

No other issues found (see more)

❄️ No new flaky tests detected

🎯 Code Coverage (details)
Patch Coverage: 100.00%
Overall Coverage: 60.74% (+0.00%)

Useful? React with 👍 / 👎

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 7d1d633 | Docs | Datadog PR Page | Give us feedback!

Copy link
Copy Markdown
Collaborator

@morrisonlevi morrisonlevi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should be able to write a test for this, yes?

@bwoebi
Copy link
Copy Markdown
Collaborator Author

bwoebi commented May 21, 2026

Yeah, probably an asan tea test would catch it.

Comment thread zend_abstract_interface/config/config_ini.c
@realFlowControl
Copy link
Copy Markdown
Member

@bwoebi / @morrisonlevi I have a PR at #3907 to add a test, but the preloading test in PHP profiling also fails. We could merge the PR, but actually we either need ZTS ASAN NDEBUG builds or support DEBUG builds in the profiler. WDYT?

@realFlowControl
Copy link
Copy Markdown
Member

Whoops @bwoebi could you have a look at the failing ASAN tests?

@realFlowControl
Copy link
Copy Markdown
Member

@morrisonlevi see https://github.com/DataDog/dd-trace-php/actions/runs/26288603294/job/77382502552?pr=3908 for a DEBUG ZTS ASAN run, it shows this issue 🎉

@pr-commenter
Copy link
Copy Markdown

pr-commenter Bot commented May 22, 2026

Benchmarks [ tracer ]

Benchmark execution time: 2026-05-22 13:37:35

Comparing candidate commit 7d1d633 in PR branch bob/preload_zts with baseline commit 818209f in branch master.

Found 1 performance improvements and 4 performance regressions! Performance is the same for 188 metrics, 1 unstable metrics.

scenario:MessagePackSerializationBench/benchMessagePackSerialization-opcache

  • 🟩 execution_time [-4.899µs; -3.281µs] or [-4.701%; -3.149%]

scenario:PDOBench/benchPDOOverhead

  • 🟥 execution_time [+5.794µs; +9.298µs] or [+2.352%; +3.775%]

scenario:PDOBench/benchPDOOverheadWithDBM

  • 🟥 execution_time [+7.484µs; +10.507µs] or [+3.049%; +4.281%]

scenario:PHPRedisBench/benchRedisOverhead

  • 🟥 execution_time [+34.756µs; +52.220µs] or [+3.619%; +5.437%]

scenario:TraceSerializationBench/benchSerializeTrace

  • 🟥 execution_time [+11.296µs; +21.204µs] or [+2.656%; +4.985%]

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.

[Bug]: datadog-profiling 1.19.x/1.20.0 aborts FrankenPHP with "Out of memory" when opcache.preload is set

3 participants