Skip to content

fix(fuzzer): fix link failure, UBSan in fuzz targets, add ASan log capture#597

Open
jbachorik wants to merge 1 commit into
mainfrom
fix/fuzzer-issues
Open

fix(fuzzer): fix link failure, UBSan in fuzz targets, add ASan log capture#597
jbachorik wants to merge 1 commit into
mainfrom
fix/fuzzer-issues

Conversation

@jbachorik

Copy link
Copy Markdown
Collaborator

What does this PR do?:
Fixes two fuzz-CI failures found in run 27394653882 and adds ASan log capture to make future testAsan crashes diagnosable.

  1. callTraceStorage.hstatic const u64 DROPPED_TRACE_ID changed to static constexpr. The fuzz target passes it by const u64& to unordered_set::find, which ODR-uses it. static const (non-constexpr) requires an out-of-class definition in that case; static constexpr is implicitly inline in C++17 and needs none. The linker error was: undefined reference to CallTraceStorage::DROPPED_TRACE_ID.

  2. buffers.h — Added __attribute__((no_sanitize("undefined"))) to put16. It does an unaligned short* store to a byte array (same pattern as put32, which already carries this annotation with a comment). UBSan reported: store to misaligned address for type 'short', which requires 2 byte alignment.

  3. ConfigurationPresets.kt — Added log_path=/tmp/asan.log to ASAN_OPTIONS for the asan config. ASan writes one file per PID (/tmp/asan.log.<pid>), preserving output even when the JVM exits abruptly before Gradle captures stderr.

  4. test_workflow.yml — Added Upload ASan logs artifact steps to all four test jobs (glibc/musl × amd64/aarch64), conditioned on failure() && matrix.config == 'asan' with if-no-files-found: ignore. This makes the actual ASan report available as a downloadable artifact on future testAsan failures.

Motivation:
The fuzz CI job was failing with a linker error (never ran the callTraceStorage fuzzer), and the buffers fuzzer was hitting a UBSan error. The testAsan job was crashing with exit code 1 and no visible output — the ASan report was being lost.

Additional Notes:
The testAsan crash root cause is still unknown — changes 3 and 4 are purely diagnostic. The next failure will produce an asan-logs-glibc-11-amd64 artifact with the actual report.

How to test the change?:

  • CI: the fuzz job should now link and run both fuzz targets without UBSan errors.
  • CI: on any future testAsan failure, an asan-logs-* artifact will appear in the run.

For Datadog employees:

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

… capture

- callTraceStorage.h: static const -> static constexpr for DROPPED_TRACE_ID
  to satisfy ODR when passed by const-ref to unordered_set::find
- buffers.h: add no_sanitize("undefined") to put16, same as put32
- ConfigurationPresets.kt: add log_path=/tmp/asan.log to ASAN_OPTIONS
- test_workflow.yml: upload /tmp/asan.log.* on asan failure (all 4 jobs)

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
@jbachorik jbachorik added the AI label Jun 12, 2026
@jbachorik jbachorik marked this pull request as ready for review June 12, 2026 15:01
@jbachorik jbachorik requested a review from a team as a code owner June 12, 2026 15:01
@dd-octo-sts

dd-octo-sts Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

CI Test Results

Run: #27423686995 | Commit: ca0c64e | Duration: 13m 15s (longest job)

All 32 test jobs passed

Status Overview

JDK glibc-aarch64/debug 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: 32 | Passed: 32 | Failed: 0


Updated: 2026-06-12 15:13:33 UTC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant