Skip to content

Remove bogus assertion from format_fuzzer - #120385

Merged
Algunenano merged 2 commits into
ClickHouse:masterfrom
Algunenano:fix-format-fuzzer-assertion
Sep 21, 2026
Merged

Algunenano merged 2 commits into
ClickHouse:masterfrom
Algunenano:fix-format-fuzzer-assertion

Conversation

@Algunenano

@Algunenano Algunenano commented Sep 16, 2026 •

Copy link
Copy Markdown
Member

format_fuzzer aborted on the 12-byte input json\nD json\n at src/Formats/fuzzers/format_fuzzer.cpp:213:

chassert(input_format->getName() == format);

format is the format name read from the fuzzer input, while IInputFormat::getName returns the processor name. Those are different namespaces: for this input the object is JSONRowInputFormat, and when parallel parsing is selected the name is ParallelParsingBlockInputFormat. Of the 79 registered input formats only Native, One, Buffers, Puffin and PuffinMetadata have a class whose getName happens to equal the registered name, so the assertion fails for the other 74. Case is irrelevant, JSON aborts just like json.

The check was added as assert, which is compiled out in the fuzzers build, and only became live once it was converted to chassert, since that build uses -DSANITIZE=address.

Because the process dies as soon as an input format is constructed, the fuzzer cannot explore format parsing at all. The live corpus (18705 units) contains zero units whose first line names a registered input format; the only real format name left in it is Null, which is output-only and throws FORMAT_IS_NOT_SUITABLE_FOR_INPUT before reaching the assertion. Coverage in the failing run was 22896 of 9.3M instrumented counters. Re-seeding the corpus should follow separately.

getCreators already throws UNKNOWN_FORMAT or FORMAT_IS_NOT_SUITABLE_FOR_INPUT for a bad format name, and there is no public accessor for the canonical registered name, so the assertion is removed rather than repaired.

CI report: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?REF=master&sha=eb77c64f3d9837380c3b793e5688162493efe12c&name_0=NightlyFuzzers&name_1=libFuzzer%20tests&name_1=libFuzzer%20tests

Changelog category (leave one):

  • CI Fix or Improvement

Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):

🤖 Generated with Claude Code


Workflow [PR]
Sync PR [sync-upstream/pr/120385]

Version info

  • Merged into: 26.10.1.334-master (included in 26.10 and later)

`IInputFormat::getName` returns the processor name, such as
`JSONRowInputFormat`, not the registered format name, so the assertion held for
only 5 of the 79 input formats. It was an inert `assert` until it was converted
to a live `chassert`, and since then any input that successfully builds an input
format aborts the fuzzer, which is why the corpus no longer contains a single
unit naming a real input format.

CI report:
https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?REF=master&sha=eb77c64f3d9837380c3b793e5688162493efe12c&name_0=NightlyFuzzers&name_1=libFuzzer%20tests&name_1=libFuzzer%20tests

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@clickhouse-gh

clickhouse-gh Bot commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [46078c7]

Summary: ❌

job_name test_name status info comment
Performance Comparison (arm_release, master_head, 5/6) FAIL Performance dashboard
group_by_multiple_strings #16 unstable query history IGNORED
join_convert_to_fixed_hash_table #16 unstable query history IGNORED
Build profile diff ERROR IGNORED

AI Review

Summary

This PR removes the chassert in format_fuzzer that compared the requested format name with IInputFormat::getName. That check was invalid by construction because getName is the processor identity, not a canonical format-registry name, and valid input formats can legitimately be wrapped as ParallelParsingBlockInputFormat. I did not find a correctness, compatibility, or safety issue in the change itself.

Missing context / blind spots
  • ⚠️ The current PR pipeline on commit 46078c70 is still pending for the fuzzer/nightly surface, so this review could only validate the fix by code inspection and the linked failing nightly report, not by a fresh format_fuzzer run on the updated tree.
Final Verdict

✅ Approve. Removing the assertion is the correct fix for the reported abort, and the change is confined to the fuzzer harness.

LLVM Coverage Report

⚠️ No coverage measurement for commit 46078c7: no coverage data for the changed C/C++ source files (they may be new or not instrumented).

@clickhouse-gh clickhouse-gh Bot added the pr-ci label Sep 16, 2026
@clickhouse-gh clickhouse-gh Bot added the comp-formats Input/output formats (CSV/JSON/Parquet/ORC/Arrow/Protobuf/etc.). label Sep 16, 2026
@antaljanosbenjamin antaljanosbenjamin self-assigned this Sep 16, 2026
@clickhouse-gh

clickhouse-gh Bot commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

Build profile diff (arm_release)

Comparing commit 46078c705051e8dfc6fc048143f98bba137f78dc with master failed: RuntimeError: CI logs cluster query failed: SELECT file, library, argMax(dur, time) AS ….

See the job log for details.

@Algunenano
Algunenano added this pull request to the merge queue Sep 21, 2026
Merged via the queue into ClickHouse:master with commit acd853b Sep 21, 2026
174 of 177 checks passed
@Algunenano
Algunenano deleted the fix-format-fuzzer-assertion branch September 21, 2026 09:53
@robot-ch-test-poll3 robot-ch-test-poll3 added the pr-synced-to-cloud The PR is synced to the cloud repo label Sep 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp-formats Input/output formats (CSV/JSON/Parquet/ORC/Arrow/Protobuf/etc.). pr-ci pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants