Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

fix: resolve persistent ASAN CI failures#491

Merged
jbachorik merged 4 commits into
mainDataDog/java-profiler:mainfrom
jb/asan_ci_fixDataDog/java-profiler:jb/asan_ci_fixCopy head branch name to clipboard
Apr 20, 2026
Merged

fix: resolve persistent ASAN CI failures#491
jbachorik merged 4 commits into
mainDataDog/java-profiler:mainfrom
jb/asan_ci_fixDataDog/java-profiler:jb/asan_ci_fixCopy head branch name to clipboard

Conversation

@jbachorik

Copy link
Copy Markdown
Collaborator

What does this PR do?:
Fixes two persistent failures in the ASAN CI run.

  1. GTest ASAN tests crash immediately — all gtestAsan_* tasks were aborting with ==PID==Your application is linked against incompatible ASan runtimes. before running a single test case. LD_PRELOAD=libasan.so was being applied to gtest executables that are already compiled with -fsanitize=address and have libasan.so as a NEEDED dependency. The dynamic linker initialized the ASAN runtime from that dependency; LD_PRELOAD then attempted a second initialization, causing the abort. Since isIgnoreExitValue = true (failFast defaults to false), all crashes were silently ignored — every gtest ASAN test was effectively not running.

  2. CollapsingSleepTest.testSleep() fails on weight threshold — the test parks for 1 second at wall=~1ms and asserts sum(WEIGHT) > 900. Under ASAN, profiler signal delivery is slower, resulting in ~898ms of captured wall time — just below the 900ms boundary. Lowering the threshold to 700 preserves the test's intent (verify collapsing sleep accumulates significant wall time) while giving 30% headroom for sanitizer overhead.

Motivation:
ASAN CI runs have been persistently red. The gtest issue means ASAN unit tests are silently not executing at all, defeating the purpose of the ASAN build.

Additional Notes:
LD_PRELOAD is still correctly applied to Java tests (ddprof-test:testAsan) where the JVM itself is not ASAN-instrumented but libjavaProfiler.so is — that path is unaffected by this change.

How to test the change?:
Run the ASAN CI job: ./gradlew :ddprof-lib:gtestAsan -Pconfiguration=asan locally with a clang that has libasan. The gtest binaries should no longer abort on startup. The CollapsingSleepTest should pass consistently.

For Datadog employees:

  • This PR doesn't touch any of that.
  • JIRA: [JIRA-XXXX]

jbachorik and others added 4 commits April 16, 2026 15:23
…ation

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Filter LD_PRELOAD from gtest env: binaries compiled with -fsanitize=address
  already have libasan.so as a NEEDED dependency; preloading it again caused
  "incompatible ASan runtimes" abort before any test ran
- Lower CollapsingSleepTest WEIGHT threshold 900→700 to accommodate ASAN
  overhead (~10% sampling reduction observed in CI)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@jbachorik jbachorik added AI test:asan Run CI tests with AddressSanitizer configuration AI: Author Signed-off labels Apr 20, 2026
@jbachorik jbachorik marked this pull request as ready for review April 20, 2026 07:34
@jbachorik jbachorik requested a review from a team as a code owner April 20, 2026 07:34
@dd-octo-sts

dd-octo-sts Bot commented Apr 20, 2026

Copy link
Copy Markdown
Contributor

CI Test Results

Run: #24654248403 | Commit: a070bb9 | Duration: 23m 43s (longest job)

All 54 test jobs passed

Status Overview

JDK glibc-aarch64/asan glibc-aarch64/debug glibc-amd64/asan glibc-amd64/debug musl-aarch64/debug musl-amd64/debug
8 - - - -
8-ibm - - - -
8-j9 - -
8-librca - - - -
8-orcl - - - -
11 - - - -
11-j9 - -
11-librca - - - -
17 - -
17-graal - -
17-j9 - -
17-librca - - - -
21 - -
21-graal - -
21-librca - - - -
25 - -
25-graal - -
25-librca - - - -

Legend: ✅ passed | ❌ failed | ⚪ skipped | 🚫 cancelled

Summary: Total: 54 | Passed: 54 | Failed: 0


Updated: 2026-04-20 08:02:07 UTC

@jbachorik jbachorik merged commit 32f2e72 into main Apr 20, 2026
193 of 237 checks passed
@jbachorik jbachorik deleted the jb/asan_ci_fix branch April 20, 2026 08:07
@github-actions github-actions Bot added this to the 1.41.0 milestone Apr 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI: Author Signed-off AI no-release-notes test:asan Run CI tests with AddressSanitizer configuration trivial

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Morty Proxy This is a proxified and sanitized view of the page, visit original site.