Skip to content

🐛 fix(fuzz): compile out replay helpers in fuzz mode - #1236

Merged
gaborbernat merged 1 commit into
tox-dev:mainfrom
gaborbernat:fix/harness-fuzz-unused
Oct 8, 2026
Merged

gaborbernat merged 1 commit into
tox-dev:mainfrom
gaborbernat:fix/harness-fuzz-unused

Conversation

@gaborbernat

Copy link
Copy Markdown
Member

The IDNA, phone and JS harnesses define their file-replay helpers in every build, but only main() calls them. A libFuzzer build with -DTH_IDNA_FUZZ, -DTH_PHONE_FUZZ or -DJM_FUZZ drops main(), so -Werror stops on -Wunused-function for run_builtins and run_file, plus run_dump in the phone harness. #1225 moved the JS entry point behind JM_FUZZ and left its helpers in the same state.

Each harness now opens its #ifdef entry-point switch above the replay helpers, so the libFuzzer build leaves them out and the replay build keeps them. With clang 18, -Wall -Wextra -Werror now builds all six harness and mode pairs, and each libFuzzer binary runs 2,000 inputs clean under ASan and UBSan.

The IDNA, phone and JS harnesses define their file-replay helpers in
every build, but only main() calls them. A libFuzzer build with
-DTH_IDNA_FUZZ, -DTH_PHONE_FUZZ or -DJM_FUZZ drops main(), so clang's
-Wunused-function turns the helpers into errors under -Werror.

Each harness now opens its entry-point switch above the replay helpers,
so the libFuzzer build leaves them out, and the replay build keeps them.
@gaborbernat gaborbernat added the bug Something isn't working label Oct 8, 2026
@codspeed

codspeed Bot commented Oct 8, 2026

Copy link
Copy Markdown

Merging this PR will regress 1 benchmark

⚡ 1 improved benchmark
❌ 1 regressed benchmark
✅ 579 untouched benchmarks
⏩ 32 skipped benchmarks1

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Benchmark BASE HEAD Efficiency
❌ test_feature[prune-shared-single] 89.1 µs 96.7 µs -7.88%
⚡ test_feature[shadow-slot-comments] 137.9 µs 110.1 µs +25.23%

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing gaborbernat:fix/harness-fuzz-unused (3a33885) with main (af31f20)

Open in CodSpeed

Footnotes

  1. 32 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

@gaborbernat
gaborbernat merged commit 02f8695 into tox-dev:main Oct 8, 2026
54 of 63 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant