Repository navigation
More fuzzing for CI - #116689
More fuzzing for CI#116689
Conversation
|
Workflow [PR], commit [a3c7e3c] Summary: ✅
AI ReviewSummaryThis PR expands BuzzHouse and AST-fuzzer coverage around empty Findings
Tests
Final VerdictStatus:
LLVM Coverage Report |
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
The official master build is compiled with Object file sizes5 object files changed (+29.10 KiB total), 0 added.
716 more object files are built by the master warmup baseline only (it builds every object-file target, a pull request build only Compile time of recompiled translation units28 translation units recompiled, 174 s compile time in total, 28 of them have a recent master baseline. Symbol sizes
|
# Conflicts: # src/Client/BuzzHouse/Generator/SessionSettings.cpp
…ST fuzzer
`{name:Identifier}` in a table position parses to an `ASTTableIdentifier` whose
`name_parts` are empty strings, carrying one `ASTQueryParameter` child per empty
part, so `ASTIdentifier::isParam` is true. `ASTTableIdentifier::getTableId`
builds a `StorageID` from those parts unconditionally, and `StorageID`'s
constructor runs `assertNotEmpty` and throws `UNKNOWN_TABLE, "Both table name
and UUID are empty"`.
`fuzzTableName`, `wrapTableAsDistributed` and `wrapTableAsMerge` checked only the
node type and then tested the result of that call for emptiness. Those emptiness
tests were dead code on this input: `getTableId` cannot return an empty
`StorageID`, and `StorageID::getTableName` asserts as well, so the read throws
before the test runs. The precondition has to be checked before the read, which
is what `callTableAsParameterizedView` in the same file already does.
The placeholder is produced by the fuzzer itself, in
`makeParameterizedIdentifier` (7cc8d90, ClickHouse#116689), and a successful fuzzed
AST is promoted to the next round's seed, so a later round reads it back as a
name. `fuzzMain` is called with no try/catch, so the exception escapes
`executeASTFuzzerQueries` and is logged by `tryLogCurrentException("ASTFuzzer")`
on the outer query's thread group; that streams it to the client's stderr and
`clickhouse-test` fails the test on non-empty stderr.
19 CIDB rows over 12 pull requests and 7 check flavours between 2026-09-04 and
2026-09-23, none on master. Per site: `fuzzTableName` 17 rows,
`wrapTableAsMerge` 2, `wrapTableAsDistributed` 0 (latent, identical ordering
behind a 1-in-40 gate).
The guard also stops the fuzzer silently de-parameterizing a reference whose
database part is a placeholder. `{pdb:Identifier}.src` is `isParam` but does not
throw, and `fuzzTableName` used to rewrite it to a plain name while the wrappers
substituted `currentDatabase()` for the parameter, producing a query that means
something different from the seed.
The regression test drives the same mutations from SQL through `fuzzQuery`, which
parses its argument and calls `fuzzMain` on it with no parameter substitution in
between. Its seed is chosen by measurement so that all three guarded helpers are
reached within 20 rows (`fuzzTableName` 30 entries, `wrapTableAsDistributed` 2,
`wrapTableAsMerge` 1, the last two behind a 1-in-40 gate each), and reverting any
one of the three guards on its own reds the test. The oracle matches the
parameter name rather than the whole `{name:Type}` text, because the fuzzer
rewrites a placeholder's declared type but never its name, and it requires every
row to keep the placeholder, because an unguarded wrapper rewrites the expression
part way through the sequence and each fuzzed AST becomes the next row's seed.
Failing job: https://github.com/ClickHouse/ClickHouse/actions/runs/35802239304/job/107027400109
Split out of ClickHouse#115786 as requested in
ClickHouse#120453 (comment)
Co-Authored-By: Claude Opus 5 <[email protected]>
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Workflow [PR]
Sync PR [sync-upstream/pr/116689]