Skip to content

Profiler's fuzz tests store corpus files under wrong directories#656

Open
zhengyu123 wants to merge 3 commits into
mainfrom
zgu/fuzz_corpus_dir
Open

Profiler's fuzz tests store corpus files under wrong directories#656
zhengyu123 wants to merge 3 commits into
mainfrom
zgu/fuzz_corpus_dir

Conversation

@zhengyu123

@zhengyu123 zhengyu123 commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?:
The fuzz plugin strips the fuzz_ prefix when deriving fuzzName and passes File(corpusBaseDir, fuzzName) to libFuzzer, so fuzz_threadLocal.cpp runs with ddprof-lib/src/test/fuzz/corpus/threadLocal, not corpus/fuzz_threadLocal (see FuzzTargetsPlugin.kt lines 114-120 and 166-168). With the seeds committed and documented under corpus/fuzz_threadLocal, this new target silently starts from an empty corpus and never exercises the intended lifecycle/bit-pattern seeds unless the user manually points libFuzzer at the other directory.

This same mismatch exists for every other existing target already in the repo — corpus/fuzz_arguments/, fuzz_buffer/, fuzz_callTraceStorage/, fuzz_dwarf/, fuzz_elf/, and fuzz_stringDictionary/

Motivation:
Fix bug.

Additional Notes:

How to test the change?:

  • Run test
./gradlew :ddprof-lib:fuzz:linkFuzz_threadLocal
ddprof-lib/fuzz/build/bin/fuzz/threadLocal/threadLocal ddprof-lib/src/test/fuzz/corpus/threadLocal -runs=0
  • Check output
INFO:        6 files found in ddprof-lib/src/test/fuzz/corpus/threadLocal
INFO: seed corpus: files: 6 min: 4b max: 48b total: 121b rss: 42Mb

For Datadog employees:

  • If this PR touches code that signs or publishes builds or packages, or handles
    credentials of any kind, I've requested a security review (run the dd:platform-security-review
    skill, or file a request via the PSEC review form).
    bewaire also runs automatically on every PR.
  • This PR doesn't touch any of that.
  • JIRA: PROF-15393

Unsure? Have a question? Request a review!

@dd-octo-sts

dd-octo-sts Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Benchmark Results (commit 630a378)

Pipeline: https://gitlab.ddbuild.io/DataDog/apm-reliability/benchmarking-platform/-/pipelines/124392220 Commit: 630a378451ea91afc2fa1dbe698f92445539af30

⚠️ Significant outliers

  • 🟢 fj-kmeans (JDK 21): runtime -3.9% (2771→2662 ms)
  • 🔴 future-genetic (JDK 21): runtime +2.9% (2072→2132 ms)
  • 🔴 future-genetic (JDK 25): runtime +6.2% (1994→2117 ms)
Runtime details (per benchmark × JDK)
Benchmark JDK Latest Dev Δ (dev vs latest) Issues L/D
akka-uct 25 ✅ 8903 ms (24 iters) ✅ 8848 ms (24 iters) ≈ -0.6% (±10.2%) — / —
finagle-chirper 21 ✅ 5973 ms (33 iters) ✅ 5965 ms (33 iters) ≈ -0.1% (±24.3%) ⚠️ W:4 / ⚠️ W:3
finagle-chirper 25 ✅ 5510 ms (36 iters) ✅ 5519 ms (36 iters) ≈ +0.2% (±24.6%) ⚠️ W:3 / ⚠️ W:3
fj-kmeans 21 ✅ 2771 ms (68 iters) ✅ 2662 ms (69 iters) 🟢 -3.9% — / —
fj-kmeans 25 ✅ 2771 ms (68 iters) ✅ 2824 ms (66 iters) ≈ +1.9% (±2.8%) — / —
future-genetic 21 ✅ 2072 ms (89 iters) ✅ 2132 ms (87 iters) 🔴 +2.9% — / —
future-genetic 25 ✅ 1994 ms (93 iters) ✅ 2117 ms (88 iters) 🔴 +6.2% — / —
naive-bayes 21 ✅ 1281 ms (134 iters) ✅ 1295 ms (133 iters) ≈ +1.1% (±32.5%) — / —
naive-bayes 25 ✅ 964 ms (177 iters) ✅ 1009 ms (169 iters) ≈ +4.7% (±32.6%) — / —
reactors 21 ✅ 16279 ms (15 iters) ✅ 16615 ms (15 iters) ≈ +2.1% (±8.5%) — / —
reactors 25 ✅ 18517 ms (15 iters) ✅ 18578 ms (15 iters) ≈ +0.3% (±3.7%) — / —
Internal counter details (ddprof)

ddprof internal counters, latest / dev (✅ = 0, · = unavailable):

Benchmark JDK Dropped rec Dropped jvmti Dropped trace Skipped WC AGCT fail Unwind fail
akka-uct 21 ✅ / ✅ ✅ / ✅ ✅ / ✅ ✅ / ✅ ✅ / ✅ ✅ / ✅
akka-uct 25 ✅ / ✅ ✅ / ✅ 1 / 1 2328 / 2246 ✅ / ✅ ✅ / ✅
finagle-chirper 21 ✅ / ✅ ✅ / ✅ 2 / 3 8740 / 8675 ✅ / ✅ ✅ / ✅
finagle-chirper 25 ✅ / ✅ ✅ / ✅ ✅ / 2 8359 / 8233 ✅ / ✅ ✅ / ✅
fj-kmeans 21 ✅ / ✅ ✅ / ✅ ✅ / 2 1260 / 1242 ✅ / ✅ ✅ / ✅
fj-kmeans 25 ✅ / ✅ ✅ / ✅ 1 / 1 1303 / 1267 ✅ / ✅ ✅ / ✅
future-genetic 21 ✅ / ✅ ✅ / ✅ ✅ / 1 2925 / 2934 ✅ / ✅ ✅ / ✅
future-genetic 25 ✅ / ✅ ✅ / ✅ 2 / 2 2911 / 2877 ✅ / ✅ ✅ / ✅
naive-bayes 21 ✅ / ✅ ✅ / ✅ 1 / 4 3533 / 3525 ✅ / ✅ ✅ / ✅
naive-bayes 25 ✅ / ✅ ✅ / ✅ 3 / 2 3480 / 3456 ✅ / ✅ ✅ / ✅
reactors 21 ✅ / ✅ ✅ / ✅ 1 / 2 1705 / 1715 ✅ / ✅ ✅ / ✅
reactors 25 ✅ / ✅ ✅ / ✅ ✅ / 1 1851 / 1839 ✅ / ✅ ✅ / ✅

@dd-octo-sts

dd-octo-sts Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

CI Test Results

Run: #29320660052 | Commit: 47e4040 | Duration: 13m 54s (longest job)

1 of 32 test jobs failed

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

Failed Tests

glibc-amd64/debug / 11-j9

Job: View logs

No detailed failure information available. Check the job logs.

Summary: Total: 32 | Passed: 31 | Failed: 1


Updated: 2026-07-14 09:26:40 UTC

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Fixes fuzzing seed-corpus discovery by aligning committed corpus directories with the fuzz plugin’s derived target names (stripping the fuzz_ prefix), so fuzzers start with the intended seeds instead of an empty corpus.

Changes:

  • Updates fuzzing docs/comments to reference corpus/<targetName>/ (without fuzz_).
  • Adds/relocates seed corpus entries under the corrected per-target directories (e.g., corpus/threadLocal/, corpus/arguments/, etc.).
  • Adds new lifecycle/bit-pattern seeds for the threadLocal fuzz target.

Reviewed changes

Copilot reviewed 2 out of 24 changed files in this pull request and generated no comments.

Show a summary per file
File Description
ddprof-lib/src/test/fuzz/README.md Documentation updated to reflect corpus/<target>/ directory naming.
ddprof-lib/src/test/fuzz/fuzz_arguments.cpp Comment updated to point to the corrected corpus/arguments/ seed directory.
ddprof-lib/src/test/fuzz/corpus/threadLocal/tracked_overwrite_padding Seed corpus entry for threadLocal target.
ddprof-lib/src/test/fuzz/corpus/threadLocal/tracked_nullptr_recreate Seed corpus entry for threadLocal target.
ddprof-lib/src/test/fuzz/corpus/threadLocal/tracked_lifecycle Seed corpus entry for threadLocal target.
ddprof-lib/src/test/fuzz/corpus/threadLocal/intptr_roundtrip Seed corpus entry for threadLocal target.
ddprof-lib/src/test/fuzz/corpus/threadLocal/double_truncated_payload Seed corpus entry for threadLocal target.
ddprof-lib/src/test/fuzz/corpus/threadLocal/double_special_values Seed corpus entry for threadLocal target.
ddprof-lib/src/test/fuzz/corpus/stringDictionary/basic_rotation Seed corpus entry for stringDictionary target.
ddprof-lib/src/test/fuzz/corpus/elf/bug3_buildid_note_overflow Seed corpus entry for elf target.
ddprof-lib/src/test/fuzz/corpus/elf/bug2_symtab_size_oob Seed corpus entry for elf target.
ddprof-lib/src/test/fuzz/corpus/elf/bug1_section_header_oob_2 Seed corpus entry for elf target.
ddprof-lib/src/test/fuzz/corpus/elf/bug1_section_header_oob_1 Seed corpus entry for elf target.
ddprof-lib/src/test/fuzz/corpus/dwarf/minimal_eh_frame_hdr Seed corpus entry for dwarf target.
ddprof-lib/src/test/fuzz/corpus/callTraceStorage/seed0 Seed corpus entry for callTraceStorage target.
ddprof-lib/src/test/fuzz/corpus/buffer/varint_max Seed corpus entry for buffer target.
ddprof-lib/src/test/fuzz/corpus/buffer/utf8_string Seed corpus entry for buffer target.
ddprof-lib/src/test/fuzz/corpus/buffer/put8_sequence Seed corpus entry for buffer target.
ddprof-lib/src/test/fuzz/corpus/arguments/stop Seed corpus entry for arguments target.
ddprof-lib/src/test/fuzz/corpus/arguments/start_wall_file Seed corpus entry for arguments target.
ddprof-lib/src/test/fuzz/corpus/arguments/start_cpu Seed corpus entry for arguments target.
ddprof-lib/src/test/fuzz/corpus/arguments/start_alloc Seed corpus entry for arguments target.
ddprof-lib/src/test/fuzz/corpus/arguments/cstack_dwarf Seed corpus entry for arguments target.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@dd-octo-sts

dd-octo-sts Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Reliability & Chaos Results

All reliability & chaos checks passed Pipeline: https://gitlab.ddbuild.io/DataDog/java-profiler/-/pipelines/124403086

@datadog-datadog-us1-prod

This comment has been minimized.

@dd-octo-sts

dd-octo-sts Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Benchmark Results (commit 53f4cc2)

Pipeline: https://gitlab.ddbuild.io/DataDog/apm-reliability/benchmarking-platform/-/pipelines/124403098 Commit: 53f4cc24c64a265397afc7ec3df7ead13c879818

⚠️ Significant outliers

  • 🔴 fj-kmeans (JDK 21): runtime +3.4% (2670→2762 ms)
  • 🟢 future-genetic (JDK 25): runtime -2.6% (2140→2084 ms)
Runtime details (per benchmark × JDK)
Benchmark JDK Latest Dev Δ (dev vs latest) Issues L/D
akka-uct 21 ✅ 10371 ms (21 iters) ✅ 10197 ms (21 iters) ≈ -1.7% (±11.2%) — / —
akka-uct 25 ✅ 8776 ms (24 iters) ✅ 8946 ms (24 iters) ≈ +1.9% (±11.1%) — / —
finagle-chirper 21 ✅ 5958 ms (33 iters) ✅ 6039 ms (33 iters) ≈ +1.4% (±25.5%) ⚠️ W:3 / ⚠️ W:3
fj-kmeans 21 ✅ 2670 ms (71 iters) ✅ 2762 ms (68 iters) 🔴 +3.4% — / —
future-genetic 25 ✅ 2140 ms (87 iters) ✅ 2084 ms (89 iters) 🟢 -2.6% — / —
naive-bayes 21 ✅ 1239 ms (138 iters) ✅ 1295 ms (132 iters) ≈ +4.5% (±33.5%) — / —
naive-bayes 25 ✅ 1019 ms (168 iters) ✅ 1010 ms (170 iters) ≈ -0.9% (±31.4%) — / —
reactors 21 ✅ 16396 ms (15 iters) ✅ 16350 ms (16 iters) ≈ -0.3% (±8.2%) — / —
reactors 25 ✅ 18761 ms (15 iters) ✅ 18273 ms (15 iters) ≈ -2.6% (±4.8%) — / —
Internal counter details (ddprof)

ddprof internal counters, latest / dev (✅ = 0, · = unavailable):

Benchmark JDK Dropped rec Dropped jvmti Dropped trace Skipped WC AGCT fail Unwind fail
akka-uct 21 ✅ / ✅ ✅ / ✅ 4 / 3 1881 / 1912 ✅ / ✅ ✅ / ✅
akka-uct 25 ✅ / ✅ ✅ / ✅ 6 / 1 2170 / 2389 ✅ / ✅ ✅ / ✅
finagle-chirper 21 ✅ / ✅ ✅ / ✅ 2 / 1 8265 / 8595 ✅ / ✅ ✅ / ✅
fj-kmeans 21 ✅ / ✅ ✅ / ✅ 1 / 2 1305 / 1274 ✅ / ✅ ✅ / ✅
future-genetic 21 · / ✅ · / ✅ · / ✅ · / ✅ · / ✅ · / ✅
future-genetic 25 ✅ / ✅ ✅ / ✅ 5 / ✅ 2888 / 2868 ✅ / ✅ ✅ / ✅
naive-bayes 21 ✅ / ✅ ✅ / ✅ 4 / ✅ 3532 / 3534 ✅ / ✅ ✅ / ✅
naive-bayes 25 ✅ / ✅ ✅ / ✅ 5 / 3 3491 / 3460 ✅ / ✅ ✅ / ✅
reactors 21 ✅ / ✅ ✅ / ✅ ✅ / 2 1634 / 1682 ✅ / ✅ ✅ / ✅
reactors 25 ✅ / ✅ ✅ / ✅ 2 / 1 1936 / 1824 ✅ / ✅ ✅ / ✅

@zhengyu123 zhengyu123 marked this pull request as ready for review July 13, 2026 20:09
@zhengyu123 zhengyu123 requested a review from a team as a code owner July 13, 2026 20:09
@dd-octo-sts

dd-octo-sts Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Benchmark Results (commit 4124e5f)

Pipeline: https://gitlab.ddbuild.io/DataDog/apm-reliability/benchmarking-platform/-/pipelines/124487523 Commit: 4124e5feebed4ea954e13870eebf777df71b47d6

⚠️ Significant outliers

  • 🔴 fj-kmeans (JDK 21): runtime +5.5% (2673→2821 ms)
  • 🔴 future-genetic (JDK 25): runtime +4.8% (2043→2141 ms)
Runtime details (per benchmark × JDK)
Benchmark JDK Latest Dev Δ (dev vs latest) Issues L/D
akka-uct 21 ✅ 10124 ms (21 iters) ✅ 10228 ms (21 iters) ≈ +1% (±11.3%) — / —
akka-uct 25 ✅ 9002 ms (24 iters) ✅ 8891 ms (24 iters) ≈ -1.2% (±9.8%) ⚠️ W:2 / —
finagle-chirper 21 ✅ 5982 ms (33 iters) ✅ 6019 ms (33 iters) ≈ +0.6% (±25.3%) ⚠️ W:3 / ⚠️ W:3
finagle-chirper 25 ✅ 5476 ms (36 iters) ✅ 5461 ms (36 iters) ≈ -0.3% (±24.6%) ⚠️ W:4 / ⚠️ W:3
fj-kmeans 21 ✅ 2673 ms (71 iters) ✅ 2821 ms (66 iters) 🔴 +5.5% — / —
fj-kmeans 25 ✅ 2822 ms (66 iters) ✅ 2849 ms (66 iters) ≈ +1% (±2.6%) — / —
future-genetic 21 ✅ 2109 ms (88 iters) ✅ 2084 ms (89 iters) ≈ -1.2% (±2.8%) — / —
future-genetic 25 ✅ 2043 ms (91 iters) ✅ 2141 ms (87 iters) 🔴 +4.8% — / —
naive-bayes 21 ✅ 1277 ms (134 iters) ✅ 1326 ms (130 iters) ≈ +3.8% (±32.7%) — / —
naive-bayes 25 ✅ 995 ms (171 iters) ✅ 957 ms (178 iters) ≈ -3.8% (±31.2%) — / —
reactors 21 ✅ 16225 ms (15 iters) ✅ 15913 ms (15 iters) ≈ -1.9% (±7.7%) — / —
reactors 25 ✅ 18711 ms (15 iters) ✅ 18785 ms (15 iters) ≈ +0.4% (±4.8%) — / —
Internal counter details (ddprof)

ddprof internal counters, latest / dev (✅ = 0, · = unavailable):

Benchmark JDK Dropped rec Dropped jvmti Dropped trace Skipped WC AGCT fail Unwind fail
akka-uct 21 ✅ / ✅ ✅ / ✅ 3 / ✅ 1927 / 1969 ✅ / ✅ ✅ / ✅
akka-uct 25 ✅ / ✅ ✅ / ✅ 1 / ✅ 2335 / 2061 ✅ / ✅ ✅ / ✅
finagle-chirper 21 ✅ / ✅ ✅ / ✅ 1 / 6 8161 / 9080 ✅ / ✅ ✅ / ✅
finagle-chirper 25 ✅ / ✅ ✅ / ✅ 3 / ✅ 8203 / 8159 ✅ / ✅ ✅ / ✅
fj-kmeans 21 ✅ / ✅ ✅ / ✅ 4 / 3 1291 / 1254 ✅ / ✅ ✅ / ✅
fj-kmeans 25 ✅ / ✅ ✅ / ✅ ✅ / 2 1269 / 1279 ✅ / ✅ ✅ / ✅
future-genetic 21 ✅ / ✅ ✅ / ✅ ✅ / 1 2948 / 3020 ✅ / ✅ ✅ / ✅
future-genetic 25 ✅ / ✅ ✅ / ✅ ✅ / 1 2836 / 2956 ✅ / ✅ ✅ / ✅
naive-bayes 21 ✅ / ✅ ✅ / ✅ 2 / 3 3507 / 3529 ✅ / ✅ ✅ / ✅
naive-bayes 25 ✅ / ✅ ✅ / ✅ 9 / 4 3467 / 3508 ✅ / ✅ ✅ / ✅
reactors 21 ✅ / ✅ ✅ / ✅ ✅ / 1 1715 / 1506 ✅ / ✅ ✅ / ✅
reactors 25 ✅ / ✅ ✅ / ✅ ✅ / 1 1945 / 1908 ✅ / ✅ ✅ / ✅

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.

3 participants