Repository navigation
Remove execute_query_fuzzer, subsumed by clickhouse_fuzzer - #117140
Conversation
`clickhouse_fuzzer` runs each fuzz input through a real `clickhouse-local` (`mainEntryClickHouseLocal` on a runner thread, fed via `ClientBase::processQueryText`), so it strictly covers everything `execute_query_fuzzer` does and more: client-side parsing and multi-statement splitting, input/output formats, DDL and `INSERT` with data, on-disk storage, and state that carries over between inputs. `execute_query_fuzzer` calls `DB::executeQuery` directly against a `DatabaseMemory`-only context and executes only pulling pipelines - every non-`SELECT` pipeline is thrown away with `onCancelOrConnectionLoss`, so it cannot even populate a table to query. Keeping both also costs real fuzzing time. The two targets are by far the slowest in the nightly `libFuzzer tests` job (~3-5 exec/s each under ASan), and each gets a fixed one-hour budget on a shared 16-vCPU runner. `execute_query_fuzzer` spent essentially all of it re-reading its own inputs: in the 2026-08-30 run it started fuzzing at 04:36:42 and wrote its first new corpus unit at 05:34:36, because it must replay 4436 persistent corpus units plus its `execute_query_fuzzer.in` seed directory, which is a copy of all 10418 `tests/queries/0_stateless/*.sql` files. Its corpus grew by 4.3 units per night over the last 59 nights, and it has not reported a finding since 2026-05-18. Give `clickhouse_fuzzer` the `all.dict` dictionary that `execute_query_fuzzer` had and it did not, so the SQL keyword/function/type dictionary keeps being used for query-text fuzzing. Note for whoever merges this: `fuzzer/corpus/execute_query_fuzzer.zip` is left behind in the artifact bucket and can be deleted, or merged into `fuzzer/corpus/clickhouse_fuzzer.zip` - the inputs are query text in both cases, so they are directly reusable.
|
Workflow [PR], commit [61cd5bb] Summary: ✅
AI ReviewSummaryThis PR removes Findings
Final VerdictChanges requested. LLVM Coverage ReportMeasured on commit 61cd5bb.
Changed lines: Changed C/C++ lines covered: 3/3 (100.00%) · Uncovered code |
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
The official master build is compiled with Compile time of recompiled translation units7 translation units recompiled, 15 s compile time in total, 7 of them have a recent master baseline. |
`clickhouse_fuzzer` runs a real `clickhouse-local`, so a fuzz input can reach `url` or `s3` and block on a remote read. `--max_execution_time` does not bound this: a stalled HTTP read is retried `http_max_tries` times, each blocking for up to `http_receive_timeout`, and during query analysis it cannot observe cancellation (the same failure mode described in `ITableFunctionXDBC::getActualTableStructure`). Against a server that accepts the connection and never replies, `SELECT * FROM url(...)` takes 333 s with the current options and 1.1 s with these four settings. The libFuzzer unit timeout for this target is 20 s, so without them such an input is reported as a timeout finding. These settings were previously carried by `execute_query_fuzzer`, which is removed in this pull request. `s3_retry_attempts` is deliberately not carried over: it is deprecated by the server setting of the same name and is already a no-op as a query setting. Co-authored-by: Yakov Olkhovskiy <[email protected]>
|
|
…y-fuzzer Co-authored-by: Yakov Olkhovskiy <[email protected]>
…y-fuzzer Co-authored-by: Yakov Olkhovskiy <[email protected]>
`execute_query_fuzzer` called `executeQuery` with
`QueryFlags{ .internal = true }`, and that path zeroes `max_query_size`
for internal queries. `clickhouse_fuzzer` reaches `executeQuery` through
`LocalConnection`, which passes a default `QueryFlags{}`, so the normal
262144-byte limit applies and larger inputs are rejected at parse time.
This is not reachable today: `clickhouse_fuzzer.options` sets no
`max_len`, so libFuzzer derives the input ceiling from the corpus
(`SetMaxInputLen(clamp(MaxSize, 4096, 1 MiB))`) and the largest unit is
954 bytes, giving a 4096-byte ceiling. It becomes reachable as soon as
the `execute_query_fuzzer` corpus is handed over as the description
proposes: its largest unit is 286752 bytes, above the limit, so those
inputs would be dropped instead of transferring their coverage.
Verified against `clickhouse-local`: a 300 KB query through the same
multi-statement path the harness uses fails with `Max query size
exceeded` by default and succeeds with this setting.
Co-authored-by: Yakov Olkhovskiy <[email protected]>
…y-fuzzer Co-authored-by: Yakov Olkhovskiy <[email protected]>
…y-fuzzer Co-authored-by: Yakov Olkhovskiy <[email protected]>
clickhouse_fuzzerruns each fuzz input through a realclickhouse-local(mainEntryClickHouseLocalon a runner thread, fed viaClientBase::processQueryText), so it strictly covers everythingexecute_query_fuzzerdoes and more: client-side parsing and multi-statement splitting, input/output formats, DDL andINSERTwith data, on-disk storage, and state that carries over between inputs.execute_query_fuzzercallsDB::executeQuerydirectly against aDatabaseMemory-only context and executes only pulling pipelines - every non-SELECTpipeline is thrown away withonCancelOrConnectionLoss, so it cannot even populate a table to query.Keeping both also costs real fuzzing time. The two targets are by far the slowest in the nightly
libFuzzer testsjob (~3-5 exec/s each under ASan), and each gets a fixed one-hour budget on a shared 16-vCPU runner.execute_query_fuzzerspent essentially all of it re-reading its own inputs: in the 2026-08-30 run it started fuzzing at 04:36:42 and wrote its first new corpus unit at 05:34:36, because it must replay 4436 persistent corpus units plus itsexecute_query_fuzzer.inseed directory, which is a copy of all 10418tests/queries/0_stateless/*.sqlfiles. Its corpus grew by 4.3 units per night over the last 59 nights, and it has not reported a finding since 2026-05-18.clickhouse_fuzzergets theall.dictdictionary thatexecute_query_fuzzerhad and it did not, so the SQL keyword/function/type dictionary keeps being used for query-text fuzzing.One follow-up for whoever merges this:
fuzzer/corpus/execute_query_fuzzer.zipis left behind in the artifact bucket. It can be deleted, or merged intofuzzer/corpus/clickhouse_fuzzer.zip- the inputs are query text in both cases, so they are directly reusable.Related: #117141
Related: #117142
Related: #117143
Related: #117144
Related: #117145
Changelog category (leave one):
Workflow [PR]
Sync PR [sync-upstream/pr/117140]
Version info
26.9.1.652(included in26.9and later)