Repository navigation
Conversation
The coverage check added by ClickHouse#111025 pinned LC_ALL=C on both sort children but not on comm itself, so comm inherited the container's ambient locale. The libFuzzer job runs in clickhouse/stateless-test, which inherits ENV LC_ALL en_US.UTF-8 from clickhouse/test-base (ci/docker/test-base/Dockerfile:160), so comm walked C-ordered input under UTF-8 collation. The two collations genuinely disagree on the quoted multi-word keyword tokens, where the discriminator is '"' (0x22) versus space (0x20): under C, "ADD INDEX" sorts before "ADD"; under en_US.utf8 the reverse. comm exits 1 when it detects disorder, and the script runs with set -euo pipefail, so the command substitution aborted the script before if [ -n "$MISSING_TOKENS" ] was ever evaluated. The visible effect was that NightlyFuzzers / libFuzzer tests failed on every scheduled run from 2026-07-28 to 2026-08-04 (8 consecutive; last green b05161a on 2026-07-27), dying in dictionary generation before any fuzzer ran, so nightly fuzzing produced no coverage for eight nights. Both builds were green throughout. The dictionary itself was generated correctly; only the post-hoc check aborted, and all.dict is byte-identical before and after this change. Two properties are restored here. Pinning comm to LC_ALL=C makes the comparator use the collation its inputs were sorted with; tests/fuzz/generate_source_dict.sh:80 already used LC_ALL=C comm, so this was a missed call site of an existing convention rather than a new idea. Capturing comm's status explicitly makes a comparator malfunction report itself instead of being swallowed by set -e and resurfacing as a generic CalledProcessError from ci/jobs/libfuzzer_test_check.py. As shipped, the designed failure (the extractor has a gap, which prints a token list) and a broken comparison were indistinguishable from the job log, which is why eight nights of outage read as mysterious. Validated under ambient LC_ALL=en_US.utf8 against the real 6293-token all.dict and 6303-token source dictionary. The fixed form reaches the check and passes; with "ADD INDEX" deleted from the source dictionary it still reports the gap and names the token, so the gate is restored rather than silenced; the unfixed form aborts identically whether or not a token is missing. A shim making comm fail confirms the new error branch executes. Reproduced the CI signature byte-identically: the three comm warnings match job 91604293160 lines 461-463. Related: ClickHouse#111025
The fix in the previous commit pins LC_ALL=C on comm so the coverage check in tests/fuzz/update_dict.sh compares under the collation its inputs were sorted with. Its only coverage was the nightly libFuzzer job, so the regression could recur and stay undiagnosed until a nightly run, which is how the original defect went unnoticed for eight nights. ci/tests/test_fuzzer_dict_coverage_check_locale.py extracts the check verbatim between BEGIN/END marker comments and runs it against synthetic dictionaries under a UTF-8 collating locale, following the existing pattern in ci/tests/test_logs_cluster_probe_loop.py. Four arms: covered dictionaries pass, a missing token is named, a broken comparison reports itself, and a pre-change control with comm unpinned reproduces the abort. The arms assert on the messages rather than the exit status, because a real coverage gap and an aborted comparison both exit 1, which is the confusion this check now avoids. The locale is chosen by measuring that it actually inverts the token pair rather than by name: C.utf8 is a UTF-8 locale but collates by byte value like C, so selecting any available UTF-8 locale would have made all four arms vacuous. When no such locale exists the arms skip with a reason instead of passing silently. Five mutation arms confirm the test can fail: unpinning comm fails the two positive arms, dropping the status wrapper fails the comparator-failure arm, forcing an ambient LC_ALL=C fails the control, removing the control's unpairable line fails it as well, and offering no UTF-8 collating locale makes all four skip. The last two matter because comm diagnoses disorder only where an input has unpairable lines, so a fixture that loses that line silently stops testing anything. The CI Tests job did not digest tests/fuzz/update_dict.sh, so it could cache-hit and be skipped on the very commit that edits the script the test reads. Measured before this change: editing the script left the job digest unchanged while editing a file under ci/ changed it. The path is added next to the two entries already there for the same reason. The check itself is unchanged: the only edit to update_dict.sh is the two marker comments. Related: ClickHouse#111025
Internal second-model reviewTwo review rounds. Round 1 found the change correct but unguarded and I bounced it back for a
On 1. I initially reached the opposite conclusion, on the belief that the abort needs the real The reason a naive minimal sample looks like it cannot reproduce is worth recording: coreutils The test added in On 3. One sentence of the 231 words is history. The rest is the contract a maintainer needs: On 4. A plain assignment to an already-exported variable does propagate, and the container On 5. Measured, not a carrier: line 41 exports Also verified independently this round, before reading the implementation notes:
|
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-impl-slot-6:20260804-171931 |
|
cc @leshikus @pamarcos, could you review this? |
|
Workflow [PR], commit [a3187bd] Summary: ✅ AI ReviewSummaryThis PR hardens the dictionary coverage check in Missing context / blind spots
Final VerdictStatus: ✅ Approve |
set -e does not see the exit status of a command inside a process substitution, so the two sorts feeding comm could fail unnoticed. An unreadable all.dict then sorted to nothing, comm reported an empty diff and the check passed with status 0, disarming the gate entirely; an unreadable source.dict made every token look missing, so a broken comparison read as a coverage gap. Both were measured against the shipped fragment. Materialize the sorted dictionaries into files first, so set -e observes each sort, and compare the real files. The .sorted suffix keeps them out of the "$TMP_DIR"/*.dict glob that builds all.dict. Two test arms cover the outcomes: an unreadable all.dict must not pass silently, and an unreadable source.dict must not be reported as a gap. Both redden when the sorts are moved back into process substitutions.
CI finish ledger - a3187bdCI is fully finished and clean: nothing to own.
Session id: cron:our-pr-ci-monitor:20260805-073000 |
|
Thanks for running it. Not related to this PR. Its diff is three files: What it is. The Introduced by Fixing it needs a separate change. One correction to my own earlier comment on #111025: I attributed every red night since 07-28 to the dictionary abort. Only 07-31 onward are, 6 consecutive, each an |
|
This is now moot, and I am leaving the disposition to you rather than closing it myself. #113649 reverted #111025 on master last night (merged 2026-08-07T23:08:39Z), so the code this PR patches no longer exists. That is why the PR shows a conflict, and neither resolution is right: taking master's side deletes the fix and leaves a test that measures nothing, and taking this branch's side resurrects the reverted mechanism inside a revert commit. Measured rather than assumed: this PR's own regression test fails all 6 arms against master's script at The revert also fixed the job. If the dictionary generation is re-landed on top of a green nightly workflow, two things from here belong in that work: pin |
|
The re-land is ready on my fork and covers both failures you linked, plus two more that Before I open it: should this PR be closed as superseded? Its locale fix is included in the |
|
Thanks for closing it. The re-land is ready with the locale fix included, and it also |
|
The re-land is open: #115307. It carries the locale fix from this PR plus the artifact-prefix/execute-bit fix, so both failures from the 2026-08-08 dispatch are covered. It needs a manual NightlyFuzzers run before merge. |
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
...
Description
Related: #111025
NightlyFuzzers/libFuzzer testshas died insidegenerate_dictionaryon every scheduled runsince 2026-07-31, the first night this check reached master (6 as of 2026-08-05, each an
ERRORwith no leaf results). It aborts before any fuzzer runs, so nightly fuzzing produced no coverage
while both builds stayed green:
https://s3.amazonaws.com/clickhouse-test-reports/json.html?REF=master&sha=09da4d1ba6dbeb378fce8001f0da90ae344c5736&name_0=NightlyFuzzers&name_1=libFuzzer%20tests
The check in
tests/fuzz/update_dict.shpinnedLC_ALL=Con bothsortchildren but not oncomm. The container's ambient locale isen_US.UTF-8(
ci/docker/test-base/Dockerfile:160), and the quoted multi-word keywords order differentlyunder the two collations (
"ADD INDEX"before"ADD"under C, after it underen_US.utf8), socommdiagnosed the C-sorted input as unsorted and exited 1. Underset -euo pipefailthataborted the command substitution before the verdict was evaluated: hence the
comm: ... not in sorted orderwarnings and never the script's own token list. The dictionaryitself was generated correctly.
Review surfaced a second defect in the same check:
set -edoes not observe the exit status of acommand inside a process substitution, so a failing
sortwent unnoticed. An unreadableall.dictsorted to nothing,commreported an empty diff and the check passed, disarming thegate; an unreadable
source.dictmade every token look missing.So the check now pins
LC_ALL=Concomm, materializes both sorted dictionaries into files, andcaptures
comm's status explicitly.generate_source_dict.sh:80already usedLC_ALL=C comm: amissed call site.
Validated against the real dictionaries under ambient
LC_ALL=en_US.utf8: the check passes, stillnames a deleted token, and
all.dictstays byte-identical, so the gate is restored rather thansilenced.
libFuzzer testsruns only inNightlyFuzzers, so this PR's own CI cannot exercise thescript.
ci/tests/test_fuzzer_dict_coverage_check_locale.pyguards it directly under a UTF-8collating locale, with arms for the abort and both sort failures.
CI Testsdigests the script,so editing it reruns the guard.