Repository navigation
Fix the CI failure reporter discarding the error message - #112014
PedroTadim merged 3 commits into
Conversation
`FuzzerLogParser.parse_failure` trims the matched log record to "all lines
before the next log line", but the scan started at index 0 - the matched line
itself. Seven of the `error_patterns` alternatives are written with a leading
`.*`, so `rg -o` keeps the record's own "] {query_id} <Level>" prefix and the
next-record guard fires on index 0, yielding `error_lines[:0] == []`. The
failure was then reported with an empty `Error:` section.
That is what "Server unresponsive: memory limit exceeded" has been doing: all
33 CIDB rows over 90 days carry a byte-identical 57-char envelope
("Log files: ...\nError:\n\n") while the job's own artifact holds the message,
the limit, the RSS and the allocation stack. Four prior investigations of that
signature had to guess a mechanism because the reporter had removed the
evidence.
Measured, one case per `error_patterns` entry: five entries lose their message
this way (memory limit, `_LIBCPP_ASSERT`, the watchdog signal-9 record,
`Sanitizer: CHECK failed:` and the `is located` runtime-error alternative), and
the alternatives without a leading `.*` (`Logical error`, `Segmentation fault`,
`Received signal`, the plain `Assertion` and header-form sanitizer reports) are
byte-identical before and after.
The guard itself is correct; only its start index was wrong. A loop that looks
for the NEXT log record must not examine the record it started from.
Internal second-model review (click to expand)Two independent reviews of this change before publication: an internal cold review Second-model gate pass: 0 findings. Coverage reported: both changed files read Internal cold review: no blockers, no majors. Independently re-derived the Three
Also verified independently: the vacuity trap the tests close is real. Without the Session id: cron:clickhouse-review-slot-9:20260727-041300 |
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-impl-slot-40:20260727-031000 |
|
cc @leshikus - could you review this? |
|
Workflow [PR], commit [eea5393] Summary: ✅ AI ReviewSummaryThe PR fixes Final Verdict✅ No review findings. |
CI finish ledger — ecda817CI is fully finished on this head (praktika
Both are debug/sanitizer-build assertions in code this PR does not touch. Session id: cron:our-pr-ci-monitor:20260727-090000 |
|
Discharging the finish-ledger promise for the
Correcting the reason column while I am here. The ledger row called it a fuzzer-tool self-abort on a Deterministic reproducer on an unpatched build, no fuzzing session needed: SELECT * FROM fuzzQuery('SELECT 1 FROM numbers(10) WHERE and()', 2000, 8) LIMIT 200 FORMAT Null;This pull request's own diff is two |
Follow-up to the review on ClickHouse#112139. - `extractPredicates` keeps its original `if (func->name == op && func->arguments)` condition; the degenerate-argument-list check is nested inside it rather than restructuring the branch order. - Removed `src/Common/tests/gtest_query_fuzzer_degenerate_predicate.cpp` and the friend declarations it needed, so `src/Common/QueryFuzzer.h` is untouched again. `04651_fuzzer_degenerate_logical_predicate` is the only test now. With the outer condition restored, a node whose `arguments` is null no longer reaches the degenerate branch in `extractPredicates`; it falls through to the call into `permutePredicateClause`, whose own early return breaks the recursion there. Verified by removing that early return and driving an `ASTFunction{name = "and", arguments = nullptr}` through it: stack overflow, SIGSEGV. All four statements of the stateless test still abort on a pristine master build and pass here. Removing both guards reproduces master exactly (the mutated file is byte-identical to master's). 50/50 randomized runs of the new test pass, as do `03031_table_function_fuzzquery`, `03834_fuzz_query_function`, `04141_fuzz_query_max_query_length`, `04202_storage_fuzzquery_engine` and the existing `QueryFuzzer` unit tests. Related: ClickHouse#112014 CI report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=112014&sha=ecda8174cacd8b3ea74e244c0c1231390fcef152&name_0=PR&name_1=AST%20fuzzer%20%28arm_asan_ubsan%29
Follow-up to the previous commit on this branch, which stopped the AST fuzzer from aborting on a degenerate logical call such as `and()`. That commit's stateless test asserts only that `fuzzQuery` returns rows, and `FuzzQuerySource::createColumn` falls back to emitting the unfuzzed base query, so an inert fuzzer still satisfies it. The abort oracle it provides does pin the removal of `chassert(!predicates.empty())`, but neither of the two guards that make the empty extraction impossible was pinned: dropping the degenerate-leaf `predicates.emplace_back(node)` in `extractPredicates`, or the degenerate early return in `permutePredicateClause`, left the suite green. `src/Common/tests/gtest_query_fuzzer_degenerate_predicate.cpp` calls the two private helpers directly, so each guard has its own assertion and no dependence on the fuzzer's random draw. `extractPredicates` must contribute exactly one opaque leaf for a degenerate node, and the same for a logical `ASTFunction` whose `arguments` is null (the shape that used to recurse on itself); `permutePredicateClause` must return that node unchanged, or `not` of it, never a fresh logical call wrapping it. Reverting either guard fails exactly the assertions for that guard and no others; reverting both fails all three. The gtest fixtures reach the helpers through the in-tree friend-class idiom, as `LRUFileCachePriority` and `TemporaryDataOnDisk` already do. The stateless test loses its `no-llvm-coverage` tag. Its rationale was that `fuzzQuery` drives the process-global `QueryFuzzer` whose accumulated state varies run-to-run, which is true of the scalar `fuzzQuery` function and of `03834_fuzz_query_function`, but not of the table function used here: `FuzzQuerySource` owns a per-source `QueryFuzzer` seeded from its `random_seed` argument, and `getGlobalASTFuzzer` has no caller under `src/Storages` or `src/TableFunctions`. The output is byte-identical across repeated runs and across an intervening load of 500 global-fuzzer calls, so there is nothing non-deterministic to skip. `04141_fuzz_query_max_query_length` is the same-form precedent and carries `no-fasttest` only. The remaining `no-fasttest` is load-bearing for a different reason, now stated in the test: fast builds are `NDEBUG` without sanitizers, so `chassert` expands to `(void)sizeof(...)` and the statements would pass vacuously. The comment on the new `extractPredicates` branch said extraction from a degenerate node "yields nothing" three lines above the code that appends a leaf. It now says the call contributes exactly one opaque leaf, which is the reason the extraction can no longer come back empty. The previous commit message described the test as covering every caller of `permutePredicateClause` a degenerate node can reach. That is not right: there are four call sites, the test drives a degenerate node through three of them, and the fourth, `fuzzMandatoryPredicate`, is covered by construction because the fix is in the shared callee. The failure was observed on an unrelated pull request, ClickHouse#112014, whose diff is two `ci/` Python files. It is linked below as the source of the CI report only, not as the cause. Related: ClickHouse#112014 CI report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=112014&sha=ecda8174cacd8b3ea74e244c0c1231390fcef152&name_0=PR&name_1=AST%20fuzzer%20%28arm_asan_ubsan%29 Co-Authored-By: Claude Opus 5 <[email protected]>
Follow-up to the previous commit on this branch, which stopped the AST fuzzer from aborting on a degenerate logical call such as `and()`. That commit's stateless test asserts only that `fuzzQuery` returns rows, and `FuzzQuerySource::createColumn` falls back to emitting the unfuzzed base query, so an inert fuzzer still satisfies it. The abort oracle it provides does pin the removal of `chassert(!predicates.empty())`, but neither of the two guards that make the empty extraction impossible was pinned: dropping the degenerate-leaf `predicates.emplace_back(node)` in `extractPredicates`, or the degenerate early return in `permutePredicateClause`, left the suite green. `src/Common/tests/gtest_query_fuzzer_degenerate_predicate.cpp` calls the two private helpers directly, so each guard has its own assertion and no dependence on the fuzzer's random draw. `extractPredicates` must contribute exactly one opaque leaf for a degenerate node, and the same for a logical `ASTFunction` whose `arguments` is null (the shape that used to recurse on itself); `permutePredicateClause` must return that node unchanged, or `not` of it, never a fresh logical call wrapping it. Reverting either guard fails exactly the assertions for that guard and no others; reverting both fails all three. The gtest fixtures reach the helpers through the in-tree friend-class idiom, as `LRUFileCachePriority` and `TemporaryDataOnDisk` already do. The stateless test loses its `no-llvm-coverage` tag. Its rationale was that `fuzzQuery` drives the process-global `QueryFuzzer` whose accumulated state varies run-to-run, which is true of the scalar `fuzzQuery` function and of `03834_fuzz_query_function`, but not of the table function used here: `FuzzQuerySource` owns a per-source `QueryFuzzer` seeded from its `random_seed` argument, and `getGlobalASTFuzzer` has no caller under `src/Storages` or `src/TableFunctions`. The output is byte-identical across repeated runs and across an intervening load of 500 global-fuzzer calls, so there is nothing non-deterministic to skip. `04141_fuzz_query_max_query_length` is the same-form precedent and carries `no-fasttest` only. The remaining `no-fasttest` is load-bearing for a different reason, now stated in the test: fast builds are `NDEBUG` without sanitizers, so `chassert` expands to `(void)sizeof(...)` and the statements would pass vacuously. The comment on the new `extractPredicates` branch said extraction from a degenerate node "yields nothing" three lines above the code that appends a leaf. It now says the call contributes exactly one opaque leaf, which is the reason the extraction can no longer come back empty. The previous commit message described the test as covering every caller of `permutePredicateClause` a degenerate node can reach. That is not right: there are four call sites, the test drives a degenerate node through three of them, and the fourth, `fuzzMandatoryPredicate`, is covered by construction because the fix is in the shared callee. The failure was observed on an unrelated pull request, ClickHouse#112014, whose diff is two `ci/` Python files. It is linked below as the source of the CI report only, not as the cause. Related: ClickHouse#112014 CI report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=112014&sha=ecda8174cacd8b3ea74e244c0c1231390fcef152&name_0=PR&name_1=AST%20fuzzer%20%28arm_asan_ubsan%29 Co-Authored-By: Claude Opus 5 <[email protected]>
Follow-up to the review on ClickHouse#112139. - `extractPredicates` keeps its original `if (func->name == op && func->arguments)` condition; the degenerate-argument-list check is nested inside it rather than restructuring the branch order. - Removed `src/Common/tests/gtest_query_fuzzer_degenerate_predicate.cpp` and the friend declarations it needed, so `src/Common/QueryFuzzer.h` is untouched again. `04651_fuzzer_degenerate_logical_predicate` is the only test now. With the outer condition restored, a node whose `arguments` is null no longer reaches the degenerate branch in `extractPredicates`; it falls through to the call into `permutePredicateClause`, whose own early return breaks the recursion there. Verified by removing that early return and driving an `ASTFunction{name = "and", arguments = nullptr}` through it: stack overflow, SIGSEGV. All four statements of the stateless test still abort on a pristine master build and pass here. Removing both guards reproduces master exactly (the mutated file is byte-identical to master's). 50/50 randomized runs of the new test pass, as do `03031_table_function_fuzzquery`, `03834_fuzz_query_function`, `04141_fuzz_query_max_query_length`, `04202_storage_fuzzquery_engine` and the existing `QueryFuzzer` unit tests. Related: ClickHouse#112014 CI report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=112014&sha=ecda8174cacd8b3ea74e244c0c1231390fcef152&name_0=PR&name_1=AST%20fuzzer%20%28arm_asan_ubsan%29
…rops-error-message Resolves the modify/delete conflict on ci/tests/test_log_parser.py by taking master's deletion. PR ClickHouse#114675 ("Remove unit tests for CI scripts") removed most of ci/tests, and .claude/CLAUDE.md now states: "When you want to test changes in the CI scripts, you can write and run a throwaway test, but you don't need to commit it to the repository, because we don't have automated CI tests." Six follow-up commits restored 43 of the 71 deleted suites; test_log_parser.py was deliberately not among them, so re-adding it would revert a maintainer decision. The one-line parser fix is unaffected and still applies to master, which kept both the index-0 scan and every pattern with a leading '.*'. Re-verified against master with a throwaway A/B harness, one case per ERROR_PATTERNS entry: five carriers go from an empty Error section to the full message (memory limit 0->171 bytes, _LIBCPP_ASSERT 0->108, watchdog signal 9 0->107, Sanitizer CHECK failed 0->121, "is located" 0->100) while the entries without a leading '.*' stay byte-identical (Logical error 36, Segmentation fault 48, Received signal 18, header-form AddressSanitizer 63). Master's newer is_check_failed blank-line arm is preserved, and the reworded comment no longer names the renamed error_patterns attribute.
|
Merged master to resolve the conflict. Head The conflict was a modify/delete on Re-verified against master with a throwaway A/B harness, one case per One behaviour note that the earlier description got wrong. Since master's refactor the |
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
Only the stripped binary is compared: the official master build keeps debug symbols while PR builds strip them, so the other binaries differ by construction. Compile time of recompiled translation units6 translation units recompiled, 4 s compile time in total, 6 of them have a recent master baseline. |
CI finish ledger - f0d85b7Every failure below has an owner: a fixing PR (mine or external), or a full-effort fix task
Both rows are one event with one owner: the missing Evidence from The job aborted at 14:02:42, before any test ran, which is why Why this is not caused by this PR, even though this PR changes CI reporting code: the diff is 3 #112974 is the fix for that path: it replaces Session id: cron:our-pr-ci-monitor:20260817-150000 |
|
Merging this to fix this PR CI result #118364 |
Related: #111892
Related: #111708
Related: #111873
Related: #111934
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
...
Description
FuzzerLogParser.parse_failuretrims the matched log record to "all lines beforethe next log line", but the scan started at index 0, i.e. it also tested the
matched line itself. Several
error_patternsalternatives are written with aleading
.*, sorg -okeeps the record's own] {query_id} <Level>prefix; thenext-record guard then fires at index 0,
error_lines[:0]is empty and the failureis reported with an empty
Error:section.This is what the
Server unresponsive: memory limit exceededleaf has been doing.Its 33 CIDB rows over 90 days span 23 pull requests and 9 master runs, and every
one of them has an empty
Error:section - 31 as the byte-identical 57-characterenvelope below, the other 2 as the same thing without the
Log files:line thatonly the stress job prepends:
while the job's own
clickhouse-server.err.logholds the message, the limit, theRSS and the allocation site. For master run
b0ab0f245a7ce9eb8c32bbb0f68d3c1359dcfac4(
Stress test (arm_release)), the record the parser matched and then dropped is:plus eight frames naming
MemoryTracker::allocImplunderMergeTreeReadTask::createReaders. Driving the real parser over that artifact:error_outputis 0 characters on master and 1911 characters (message + allocationsite, still bounded by the existing
head -n10) with this change.error_patternshas 7 entries holding 12 top-level alternatives. One case peralternative was driven through the real parser in both directions (the two marked
†follow from the leading-.*structure, sharing an entry with a measuredsibling). Five of the seven entries lose their message this way and are repaired
here; an entry can appear on both sides of the table, e.g.
Assertionhas oneaffected and two unaffected alternatives.
error_patternsentryError:on master.*\(total\) memory limit exceeded.*.*_LIBCPP_ASSERT.*.*Child process was terminated by signal 9.*.*[a-zA-Z]+Sanitizer: CHECK failed:.*.*is located.*.*runtime error: .*†Logical error.*Segmentation fault.*Received signal.*Assertion.*failedFailed assertion.*†(SUMMARY|ERROR|WARNING): ...Sanitizer:.*The alternatives that were already correct are exactly the ones without a leading
.*:rg -ostrips the prefix for them, so their line 0 never satisfied the guard.The guard itself is right; only its start index was wrong, and a loop looking for
the next log record must not examine the record it started from.
Job status is unaffected:
stress_job.py'sis_oomoverride is computedindependently of this parser, so this only restores the content of the leaf.
Five regression tests are added in
ci/tests/test_log_parser.py, one per repairedentry, each asserting the message is present in the
Error:section specifically(the same text can also appear in the separate
Stack trace:section, so anassertion over the whole info would pass even with the message dropped) and that
the capture still stops at the next log record. Reverting the one-line change fails
exactly those five and leaves the three pre-existing tests green.
ci/jobs/scripts/log_parser.pyis also touched by #111708, #111873 and #111934, allon other parts of the file. Each was merged onto this branch: all three merge with
no conflict and the combined
ci/tests/test_log_parser.pypasses (16, 12 and 8tests respectively). #111873 re-anchors the signal pattern, which incidentally
removes the leading
.*from one of the six alternatives above; the loop bound isstill wrong for the other five, so the two changes are independent and compose in
either merge order.
Workflow [PR]
Sync PR [sync-upstream/pr/112014]
Version info
26.9.1.895(included in26.9and later)