Skip to content

fix(ci): fix Valgrind false positives and CentOS 7 aarch64 profiling build#3772

Open
Leiyks wants to merge 7 commits intomasterfrom
leiyks/fix-ci-valgrind-and-openssl-xfail
Open

fix(ci): fix Valgrind false positives and CentOS 7 aarch64 profiling build#3772
Leiyks wants to merge 7 commits intomasterfrom
leiyks/fix-ci-valgrind-and-openssl-xfail

Conversation

@Leiyks
Copy link
Copy Markdown
Contributor

@Leiyks Leiyks commented Apr 3, 2026

Summary

Valgrind false positives

  • tests/ext/base_service.phpt: add --SKIPIF-- to skip under Valgrind (USE_TRACKED_ALLOC=1). The test has a memory leak on PHP 7.0 that causes test_extension_ci: [7.0] to fail via the leaked-test check in the Makefile.
  • Makefile: pass DD_SPAWN_WORKER_STABLE_TRAMPOLINE=1 in the Valgrind test command. When set, the trampoline defers its self-deletion until after the entry function returns, so Valgrind can read DWARF symbols without getting "connection to image failed". PHP's run-tests.php marks any test with a non-empty .mem file as LEAKED, so this was causing false CI failures.
  • .gitlab/collect_artifacts.sh: collect *.mem files alongside *.diff so Valgrind leak output is available in CI artifacts.
  • libdatadog submodule bump to pick up the spawn_worker trampoline fix (see libdatadog#1844).

CentOS 7 aarch64 profiling build

  • .gitlab/build-profiler.sh and .gitlab/generate-profiler.php: set BINDGEN_EXTRA_CLANG_ARGS="-I$(clang --print-resource-dir)/include" on CentOS 7 aarch64. The custom-built LLVM 17 in the CI image doesn't put its resource directory on the default include path, causing bindgen to fail with fatal error: 'stddef.h' file not found. Mirrors the existing Alpine aarch64 workaround.

Test plan

  • test_extension_ci: [7.0] Valgrind pass no longer reports leaked test
  • profiling tests / compile profiler extension on CentOS 7 aarch64 pass

@datadog-official
Copy link
Copy Markdown

datadog-official bot commented Apr 3, 2026

✅ Tests

🎉 All green!

❄️ No new flaky tests detected
🧪 All tests passed

🎯 Code Coverage (details)
Patch Coverage: 100.00%
Overall Coverage: 60.65% (-0.03%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: a4edd57 | Docs | Datadog PR Page | Was this helpful? React with 👍/👎 or give us feedback!

@Leiyks Leiyks marked this pull request as ready for review April 3, 2026 11:20
@Leiyks Leiyks requested review from a team as code owners April 3, 2026 11:20
@pr-commenter
Copy link
Copy Markdown

pr-commenter bot commented Apr 3, 2026

Benchmarks [ tracer ]

Benchmark execution time: 2026-04-07 02:03:57

Comparing candidate commit 732de87 in PR branch leiyks/fix-ci-valgrind-and-openssl-xfail with baseline commit 5bc467b in branch master.

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

scenario:MessagePackSerializationBench/benchMessagePackSerialization

  • 🟩 execution_time [-5.418µs; -3.362µs] or [-4.937%; -3.063%]

scenario:MessagePackSerializationBench/benchMessagePackSerialization-opcache

  • 🟩 execution_time [-3.655µs; -2.745µs] or [-3.353%; -2.518%]

@morrisonlevi morrisonlevi force-pushed the leiyks/fix-ci-valgrind-and-openssl-xfail branch from ac1de97 to 732de87 Compare April 7, 2026 00:57
@Leiyks Leiyks force-pushed the leiyks/fix-ci-valgrind-and-openssl-xfail branch 2 times, most recently from 977e120 to 5f9c9b2 Compare April 8, 2026 08:46
@Leiyks Leiyks changed the title fix(ci): skip base_service Valgrind leak and xfail OpenSSL SNI tests fix(ci): fix Valgrind false positives, xfail OpenSSL SNI, update crashtracker/debugger tests, fix CentOS 7 aarch64 profiling build Apr 8, 2026
@Leiyks Leiyks changed the title fix(ci): fix Valgrind false positives, xfail OpenSSL SNI, update crashtracker/debugger tests, fix CentOS 7 aarch64 profiling build fix(ci): fix Valgrind false positives, update crashtracker/debugger tests, fix CentOS 7 aarch64 profiling build Apr 8, 2026
@Leiyks Leiyks changed the title fix(ci): fix Valgrind false positives, update crashtracker/debugger tests, fix CentOS 7 aarch64 profiling build fix(ci): fix Valgrind false positives and CentOS 7 aarch64 profiling build Apr 8, 2026
Copy link
Copy Markdown
Collaborator

@bwoebi bwoebi left a comment

Choose a reason for hiding this comment

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

Looks good! ... Updating libdatadog module first.

@bwoebi bwoebi force-pushed the leiyks/fix-ci-valgrind-and-openssl-xfail branch from 27f9fcf to 076835f Compare April 9, 2026 12:49
bwoebi and others added 7 commits April 9, 2026 14:50
Signed-off-by: Bob Weinand <bob.weinand@datadoghq.com>
…ice leak

Set DD_SPAWN_WORKER_STABLE_TRAMPOLINE=1 in the test_extension_ci Valgrind
pass so the sidecar spawn_worker writes the trampoline to a stable per-
process path instead of a random temp file that gets self-deleted before
Valgrind can read it.

Updates libdatadog to DataDog/libdatadog#1844.
…chema

- runtime_stack moved to message.experimental.runtime_stack
- new error block with native crash stack (Datadog Crashtracker 1.0 format)
- data_schema_version bumped to 1.6
- signal message changed to "Process terminated with SI_USER (SIGSEGV)"
…patibility

PHP 7.2-7.4 produce a different payload structure (no experimental.runtime_stack
with PHP-level frames). Use %A wildcards for the version-dependent sections,
keeping only stable anchors: error.source_type and metadata fields.
…ef.h not found

On the CentOS 7 arm64 runners, clang's built-in stddef.h is not found
automatically during bindgen, causing the profiler build to fail with:

  /usr/include/stdlib.h:32:10: fatal error: 'stddef.h' file not found

Mirror the existing Alpine aarch64 workaround: detect the devtoolset-7
environment (CentOS 7) + aarch64 and export BINDGEN_EXTRA_CLANG_ARGS
pointing at the clang resource dir's include path.
@bwoebi bwoebi force-pushed the leiyks/fix-ci-valgrind-and-openssl-xfail branch from 076835f to a4edd57 Compare April 9, 2026 12:50
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.

2 participants