Repository navigation
Fuzzers: select_parser_fuzzer - change max_parser_backtracks to 10.000 (was 1.000.000) - #92325
Merged
Merged
Conversation
Contributor
|
Workflow [PR], commit [bc1bc67] Summary: ⏳
|
alexey-milovidov
approved these changes
Dec 17, 2025
Member
|
Nice, this makes |
1 task
pull Bot
pushed a commit
to mikeyhodl/ClickHouse
that referenced
this pull request
May 14, 2026
Commit b5a006c ("add parameters for select_parser_fuzzer, set default threshoulds lower", May 11 2026) made the per-input parser limits in `select_parser_fuzzer` configurable via `-ignore_remaining_args=1` plus `-max_parser_backtracks=N`. As a side effect it changed the in-source default for `max_parser_backtracks` from `5000` to `DBMS_DEFAULT_MAX_PARSER_BACKTRACKS` (= 1,000,000), i.e. a 200x increase. For sibling `create_parser_fuzzer`, the same author followed up with commit e9453b7 ("tune up create_parser_fuzzer settings") that restored a fuzzer-safe budget by adding [fuzzer_arguments] max_parser_backtracks = 10000 to `tests/fuzz/create_parser_fuzzer.options`. The matching update to `tests/fuzz/select_parser_fuzzer.options` was missed, so `libFuzzer` runs of `select_parser_fuzzer` parse each input with a 1,000,000-step backtrack budget. On pathological inputs (deeply-nested parentheses with mixed function-call / subquery shapes — exactly the pattern of closed issue ClickHouse#92282) the parser spends 20-26s before bailing, which is above the 20s `libFuzzer` timeout. CIDB confirms the regression: day select_parser_fuzzer FAIL/ERROR distinct PRs 2026-04-19 1 1 (PR ClickHouse#99740, author's branch) ... 2026-05-11 1 1 (PR ClickHouse#99740) 2026-05-13 24 24 (24 unrelated PRs) 2026-05-14 13 13 (13 unrelated PRs) The spike on 2026-05-13 starts exactly the first day master PRs picked up commit b5a006c. Every recent failure is a `timeout-*` artefact of the form `timeout after 20-26 seconds`, matching issue ClickHouse#92282. The fix is the minimum config change to restore the previously known- good per-input backtrack budget for `select_parser_fuzzer`, mirroring the `create_parser_fuzzer.options` fix. Local mechanism reproduction (clickhouse-local, debug build): SELECT te(((...((SELECT tuple(... (~470 bytes, malformed) --max_parser_depth=300 --max_parser_backtracks=10000 -> 0.16s (TOO_SLOW_PARSING) --max_parser_depth=300 --max_parser_backtracks=1000000 -> 0.92s (~6x slower for the same input) Pre-PR validation gate: - Deterministic repro: yes (see above). - Root cause explained: yes (regression date matches commit b5a006c). - Fix matches root cause: yes (restore 10k backtrack budget that was intentionally set in PR ClickHouse#92325 to fix the timeout class in ClickHouse#92282). - Test intent preserved: yes — fuzzer still exercises the SELECT parser with the same depth (300/150), AST element / depth limits, and corpus. Only the per-input backtrack budget changes. - Both directions demonstrated: yes — local clickhouse-local repro shows the 6x time difference; CIDB shows the regression spike exactly aligned with the commit. Refs: - Tracker issue ClickHouse#93438 ("libFuzzer tests are flaky"). - Originating closed issue ClickHouse#92282 (`select_parser_fuzzer` timeout on deeply nested parens). - Sibling fix: commit e9453b7 (`create_parser_fuzzer.options`). - Regression: commit b5a006c (`select_parser_fuzzer.cpp`). Co-Authored-By: Claude Opus 4.7 <[email protected]>
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):
closes #92282