Skip to content

Remove tcp_protocol_fuzzer, it has never fuzzed anything - #117141

Merged
alexey-milovidov merged 2 commits into
masterfrom
remove-tcp-protocol-fuzzer
Sep 2, 2026
Merged

alexey-milovidov merged 2 commits into
masterfrom
remove-tcp-protocol-fuzzer

Conversation

@alexey-milovidov

@alexey-milovidov alexey-milovidov commented Aug 30, 2026 •

Copy link
Copy Markdown
Member

The target has never accumulated a single corpus unit: fuzzer/corpus/tcp_protocol_fuzzer.zip in the artifact bucket is a 22-byte empty archive, and the nightly job logs report tcp_protocol_fuzzer corpus having 0 units on every one of the last 60 runs. A coverage-guided fuzzer that never saves an input is not exploring anything, and corpus minimization is permanently skipped for it with persistent corpus is empty.

It has never produced an actionable report either. All 212 recorded failures (2025-11-04 to 2026-03-17) carry the same message, No stack traces found - this is unusual - check output files: the process exited non-zero without a sanitizer report, which is the exit(-1) in LLVMFuzzerInitialize taken when the embedded server thread finishes before the server reaches isServerCompletelyStarted. Since 2026-03-17 it reports OK on every run, which in this harness only means the process was still alive when the runner killed it at the timeout - so it now burns an hour of the nightly budget silently. With an empty corpus the two remaining explanations are that startup never completes and the initialization loop spins, or that the server thread is dead and LLVMFuzzerTestOneInput rejects every input with return -1; the fuzzer output is not uploaded on success, so this cannot be narrowed down further from CI.

The harness is not repairable in its current shape. It embeds a whole clickhouse-server in the fuzzer process and hands each input to a TCP socket, so the server handles the input on its own threads while LLVMFuzzerTestOneInput polls the socket. The coverage libFuzzer attributes to an input is then whatever the process happened to execute concurrently, including every background thread, which makes coverage feedback, corpus minimization and crash reproduction all unsound. Fixing that means rewriting it as an out-of-process protocol fuzzer, which is a different target.

The native protocol surface is already covered by the stateless and integration suites, and query text specifically by clickhouse_fuzzer. Removing this also stops compiling Server.cpp and MetricsTransmitter.cpp a second time into a ~5 GB ASan binary in every fuzzers build.

One follow-up for whoever merges this: fuzzer/corpus/tcp_protocol_fuzzer.zip is left behind in the artifact bucket and can be deleted; it is empty anyway.

Related: #117140
Related: #117142
Related: #117143
Related: #117144
Related: #117145

Changelog category (leave one):

  • CI Fix or Improvement (changelog entry is not required)

Workflow [PR]
Sync PR [sync-upstream/pr/117141]

Version info

  • Merged into: 26.9.1.510 (included in 26.9 and later)

The target has never accumulated a single corpus unit:
`fuzzer/corpus/tcp_protocol_fuzzer.zip` in the artifact bucket is a 22-byte
empty archive, and the nightly job logs report `tcp_protocol_fuzzer corpus
having 0 units` on every one of the last 60 runs. A coverage-guided fuzzer
that never saves an input is not exploring anything, and corpus minimization
is permanently skipped for it with `persistent corpus is empty`.

It has never produced an actionable report either. All 212 recorded failures
(2025-11-04 to 2026-03-17) carry the same message, `No stack traces found -
this is unusual - check output files`: the process exited non-zero without a
sanitizer report, which is the `exit(-1)` in `LLVMFuzzerInitialize` taken when
the embedded server thread finishes before the server reaches
`isServerCompletelyStarted`. Since 2026-03-17 it reports `OK` on every run,
which in this harness only means the process was still alive when the runner
killed it at the timeout - so it now burns an hour of the nightly budget
silently. With an empty corpus, the two remaining explanations are that
startup never completes and the initialization loop spins, or that the server
thread is dead and `LLVMFuzzerTestOneInput` rejects every input with
`return -1`; the fuzzer output is not uploaded on success, so this cannot be
narrowed down further from CI.

The harness is not repairable in its current shape. It embeds a whole
`clickhouse-server` in the fuzzer process and hands each input to a TCP
socket, so the server handles the input on its own threads while
`LLVMFuzzerTestOneInput` polls the socket. The coverage libFuzzer attributes
to an input is then whatever the process happened to execute concurrently,
including every background thread, which makes coverage feedback, corpus
minimization and crash reproduction all unsound. Fixing that means rewriting
it as an out-of-process protocol fuzzer, which is a different target.

The native protocol surface is already covered by the stateless and
integration suites, and query text specifically by `clickhouse_fuzzer`.
Removing this also stops compiling `Server.cpp` and `MetricsTransmitter.cpp`
a second time into a ~5 GB ASan binary in every fuzzers build.

Note for whoever merges this: `fuzzer/corpus/tcp_protocol_fuzzer.zip` is left
behind in the artifact bucket and can be deleted; it is empty anyway.
@clickhouse-gh

clickhouse-gh Bot commented Aug 30, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [846284d]

Summary: ✅


AI Review

Summary

This PR removes the unused tcp_protocol_fuzzer target, its ENABLE_FUZZING CMake wiring, and its .options file. I did not find a correctness or integration problem in the removal itself: repo-side references are gone, and the remaining libFuzzer CI paths discover fuzzers dynamically rather than through a hardcoded tcp_protocol_fuzzer list.

Missing context / blind spots
  • ⚠️ The Build (arm_fuzzers) / libFuzzer tests jobs were still pending during review, so I could not validate the post-removal ENABLE_FUZZING artifact set end-to-end from CI. Those jobs passing would close the remaining build-system gap.
Final Verdict

✅ No review findings at this time.

LLVM Coverage Report

⚠️ No coverage measurement for commit 846284d: no coverage data for the changed C/C++ source files (they may be new or not instrumented).

@clickhouse-gh

clickhouse-gh Bot commented Aug 30, 2026 •

Copy link
Copy Markdown
Contributor

Build profile diff (arm_release)

Comparing 846284d3f with master bb113c384 (stripped binary size, per-symbol sizes and ThinLTO time; object sizes against the warmup build of d469feea5; compile times per translation unit against the most recent warmup build that recompiled it).

✅ No significant changes.

Binary sizes

programs/clickhouse-stripped: smaller than the master baseline by the known offset between the two builds, so the difference is not shown. A delta that differs from the offset by more than 50% of it is shown, in either direction.

The official master build is compiled with -g and a pull request build is not, and XRay counts debug instructions towards its instrumentation threshold, so master instruments thousands of functions more and its binary is ~0.4% larger no matter what the pull request does.

Compile time of recompiled translation units

6 translation units recompiled, 4 s compile time in total, 6 of them have a recent master baseline.

Job report

@yakov-olkhovskiy yakov-olkhovskiy self-assigned this Aug 31, 2026
@clickhouse-gh

clickhouse-gh Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

📊 Cloud Performance Report

✅ AI verdict: no_change — no significant changes across 42 queries analysed

This PR only deletes the TCP-protocol fuzzer (a fuzzing-only build target gated behind ENABLE_FUZZING) and its CMake wiring; it changes no query-execution code. None of the four flagged ClickBench queries (18, 30, 31, 33) exercise anything this diff touches, and all four are already not_sure with either flat CPU time inside master's variance band or the two tests disagreeing. Read all four deltas as run-to-run variance, not a PR effect.

clickbench

⚠️ 4 inconclusive

Flagged queries (4 of 43)
Query Verdict Baseline median (ms) PR median (ms) Change q-value Hint
⚠️ 18 not_sure 1110 1053 -5.1% 0.0188 This PR only removes the TCP-protocol fuzzer build target; it touches no query-execution code, so this -5.1% is run-to-run variance, consistent with the two tests disagreeing.
⚠️ 30 not_sure 237 262 +10.5% <0.0001 The +10.5% sits inside master's normal variance band and CPU time is essentially flat; the fuzzer-removal diff can't affect this query, so treat it as noise.
⚠️ 31 not_sure 327 364 +11.3% <0.0001 The +11.3% is within master's variance band with flat CPU time; nothing in this build-only change touches the query path.
⚠️ 33 not_sure 1282 1202 -6.2% 0.0216 The -6.2% comes with the two tests disagreeing and no code path this query runs was changed, so this is run-to-run variance.

Change = percent below ×2; the ratio of medians (×N faster/slower) beyond, where percent understates the scale. q-value = BH-FDR adjusted p; smaller is stronger evidence. MIRAI flags a query when q < fdr_q (default 0.10) — the value the verdict is based on.

tpch_adapted_1_official

🟢 No significant changes

Debug info
  • StressHouse run: 4d84b174-8184-443d-b31c-6ccdcab8253b
  • MIRAI run: c2046f3a-3ffb-4f9f-b1a7-7cfd312e248f
  • PR check IDs:
    • clickbench_783857_1788291833
    • clickbench_783859_1788291833
    • clickbench_783861_1788291833
    • tpch_adapted_1_official_783863_1788291833
    • tpch_adapted_1_official_783865_1788291833
    • tpch_adapted_1_official_783926_1788291833

@alexey-milovidov
alexey-milovidov added this pull request to the merge queue Sep 2, 2026
Merged via the queue into master with commit 88dd163 Sep 2, 2026
344 of 345 checks passed
@alexey-milovidov
alexey-milovidov deleted the remove-tcp-protocol-fuzzer branch September 2, 2026 06:57
@robot-ch-test-poll2 robot-ch-test-poll2 added the pr-synced-to-cloud The PR is synced to the cloud repo label Sep 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-ci pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants