fix(fuzzer): fix link failure, UBSan in fuzz targets, add ASan log capture#597
Open
jbachorik wants to merge 1 commit into
Open
fix(fuzzer): fix link failure, UBSan in fuzz targets, add ASan log capture#597jbachorik wants to merge 1 commit into
jbachorik wants to merge 1 commit into
Conversation
… 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>
Contributor
CI Test ResultsRun: #27423686995 | Commit:
Status Overview
Legend: ✅ passed | ❌ failed | ⚪ skipped | 🚫 cancelled Summary: Total: 32 | Passed: 32 | Failed: 0 Updated: 2026-06-12 15:13:33 UTC |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?:
Fixes two fuzz-CI failures found in run 27394653882 and adds ASan log capture to make future
testAsancrashes diagnosable.callTraceStorage.h—static const u64 DROPPED_TRACE_IDchanged tostatic constexpr. The fuzz target passes it byconst u64&tounordered_set::find, which ODR-uses it.static const(non-constexpr) requires an out-of-class definition in that case;static constexpris implicitly inline in C++17 and needs none. The linker error was:undefined reference to CallTraceStorage::DROPPED_TRACE_ID.buffers.h— Added__attribute__((no_sanitize("undefined")))toput16. It does an unalignedshort*store to a byte array (same pattern asput32, which already carries this annotation with a comment). UBSan reported:store to misaligned address for type 'short', which requires 2 byte alignment.ConfigurationPresets.kt— Addedlog_path=/tmp/asan.logtoASAN_OPTIONSfor theasanconfig. ASan writes one file per PID (/tmp/asan.log.<pid>), preserving output even when the JVM exits abruptly before Gradle captures stderr.test_workflow.yml— AddedUpload ASan logsartifact steps to all four test jobs (glibc/musl × amd64/aarch64), conditioned onfailure() && matrix.config == 'asan'withif-no-files-found: ignore. This makes the actual ASan report available as a downloadable artifact on futuretestAsanfailures.Motivation:
The
fuzzCI job was failing with a linker error (never ran thecallTraceStoragefuzzer), and the buffers fuzzer was hitting a UBSan error. ThetestAsanjob was crashing with exit code 1 and no visible output — the ASan report was being lost.Additional Notes:
The
testAsancrash root cause is still unknown — changes 3 and 4 are purely diagnostic. The next failure will produce anasan-logs-glibc-11-amd64artifact with the actual report.How to test the change?:
fuzzjob should now link and run both fuzz targets without UBSan errors.testAsanfailure, anasan-logs-*artifact will appear in the run.For Datadog employees: