Repository navigation
Conversation
…to a subcolumn accessor
QueryFuzzer::fuzzExpressionList's subcolumn-rewrite branch turns a column
reference like c into c.null / c.1 / c[0] etc. For a query-parameter
identifier such as {p:Identifier}.col, the ASTIdentifier carries the
placeholder as an empty name_part plus a name_params child. Cases 0 and 3
copied name_parts (including the empty part) and rebuilt the identifier via
make_intrusive<ASTIdentifier>(std::move(parts)) without name_params, so the
constructor took the non-parametrized branch and hit chassert(!part.empty()),
aborting clickhouse-client (SIGABRT) during AST fuzzing.
Skip parameter identifiers in this branch (isParam()); the branch is meant
for column references, and query-parameter identifiers are not fuzzed here.
Found by the AST fuzzer (client-side abort, QueryFuzzer.cpp -> ASTIdentifier.cpp
!part.empty()).
Co-Authored-By: Claude Opus 4.8 <[email protected]>
Collaborator
Author
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-worker-slot-2:20260716-191000 |
Collaborator
Author
|
cc @PedroTadim — small AST-fuzzer fix: the subcolumn-rewrite branch you added in #110228 aborts the client when the identifier is a |
Member
|
This is done by #110712 and better there |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
...
Description
QueryFuzzer::fuzzExpressionListhas a branch (added in #110228) that rewrites a column referencecinto one of its subcolumn accessors:c.null,c.1,c[0],getSubcolumn(c, ...). For a query-parameter identifier like{p:Identifier}.col, theASTIdentifierstores the placeholder as an emptyname_partplus aname_paramschild. Cases 0 and 3 copiedname_parts(including that empty part) and rebuilt the identifier viamake_intrusive<ASTIdentifier>(std::move(parts))without thename_params, so the constructor took the non-parametrized branch and trippedchassert(!part.empty()), abortingclickhouse-client(SIGABRT) mid-fuzzing.The fix skips parameter identifiers in this branch (
!ident->isParam()): the branch is for column references, and query-parameter identifiers are not fuzzed here.Found by the AST fuzzer (client-side abort). CIDB shows this hitting several unrelated PRs and master starting 2026-07-16, e.g.
AST fuzzer (amd_tsan):https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=110641&sha=9be63c5843bb3d9cdb7267ea5e81ce6a025b5155&name_0=PR&name_1=AST%20fuzzer%20%28amd_tsan%29
Client-side backtrace:
QueryFuzzer::fuzzExpressionList(QueryFuzzer.cpp:3515) ->make_intrusive<ASTIdentifier>->ASTIdentifier::ASTIdentifier(ASTIdentifier.cpp:48) ->chassert(!part.empty()).Note: the same
!part.empty()assertion can also be reached server-side (IdentifierNode::toASTImpl) via an unresolved{p:Identifier}inside a namedWINDOWclause; that is a separate parser issue fixed by #110506. This PR fixes only the client-side fuzzer path, which #110506 does not touch.Verified locally (debug build): the AST fuzzer crashes client-side without this change and no longer does with it.