Skip to content

Backport #106905 to 25.8: Fix crash in ProtobufRowInputFormat::syncAfterError on null reader - #107627

Closed
robot-clickhouse wants to merge 1 commit into
25.8from
backport/25.8/106905
Closed

robot-clickhouse wants to merge 1 commit into
25.8from
backport/25.8/106905

Conversation

@robot-clickhouse

Copy link
Copy Markdown
Member

Original pull-request #106905
Cherry-pick pull-request #107626

This pull-request is a last step of an automated backporting.
Treat it as a standard pull-request: look at the checks and resolve conflicts.
Merge it only if you intend to backport changes to the target branch, otherwise just close it.

The PR source

The PR is created in the CI job

@robot-clickhouse robot-clickhouse added pr-backport Changes, backported to release branch. Do not use manually - automated use only! pr-critical-bugfix labels Jun 16, 2026
@clickhouse-gh

clickhouse-gh Bot commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Workflow [BackportPR], commit [dc21c5f]

@Avogar Avogar closed this Jun 17, 2026
alexey-milovidov added a commit that referenced this pull request Jul 26, 2026
…-contained

The functional test added by #107739
(`04409_protobuf_skip_bad_row_after_valid`) crashed with `SIGSEGV` on `25.8`
because the prerequisite fix from #106905 is missing on this branch: its
backport #107627 was closed without merging, so `25.8` still has

    void ProtobufRowInputFormat::syncAfterError()
    {
        reader->endMessage(true);
    }

After a parse error, `readRow`'s catch block calls
`destroyReaderAndSerializer`, which nulls `reader`. `IRowInputFormat::read`
then calls `syncAfterError`, which dereferences the null `reader` -> `SIGSEGV`.
The `setColumns` fix backported here is therefore necessary but not sufficient
on `25.8`.

Cherry-pick the `ProtobufRowInputFormat.cpp` part of #106905
(`cda04909d946c83546b4a9073ddf7032e9616669`): resync via `endMessage(true)`
inside `readRow`'s catch while `reader` is still alive, make `syncAfterError` a
no-op, and restrict `allowSyncAfterError` to the length-delimited case. The
resulting `readRow` / `syncAfterError` / `allowSyncAfterError` logic is now
byte-identical to `master`.

The unit test from #106905 is not carried over: `25.8` has no
`src/Processors/Formats/Impl/tests` directory, and the functional test
`04409_protobuf_skip_bad_row_after_valid` already covers this path.

Original pull-request: #107739
Prerequisite pull-request: #106905
Related: #107627
CI report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=111910&sha=latest&name_0=BackportPR&name_1=Stateless%20tests%20(amd_asan%2C%20distributed%20plan%2C%20parallel%2C%202%2F2)

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@maxknv
maxknv deleted the backport/25.8/106905 branch November 13, 2026 13:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-backport Changes, backported to release branch. Do not use manually - automated use only! pr-critical-bugfix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants