Repository navigation
Closed
Labels
potential bugTo be reviewed by developers and confirmed/rejected.
Description
Company or project name
AWS
Describe what's wrong
A null pointer dereference in ProtobufRowInputFormat::syncAfterError() crashes the ClickHouse server when a Protobuf INSERT encounters malformed/truncated data and input_format_allow_errors_num > 0. Once crashed, the server refuses all new connections (including /ping) because isCrashed() returns true.
The problem is in this code:
void ProtobufRowInputFormat::syncAfterError()
{
reader->endMessage(true); // reader is null here → SIGSEGV
}
Stack trace:
Signal: Segmentation fault (11)
2026.06.09 22:29:10.679561 [ 1140 ] {} <Fatal> BaseDaemon: Address: 0x18. Access: <not available>. Address not mapped to object.
2026.06.09 22:29:10.679567 [ 1140 ] {} <Fatal> BaseDaemon: Stack trace: ....
2026.06.09 22:29:10.679616 [ 1140 ] {} <Fatal> BaseDaemon: 2. DB::ProtobufReader::endMessage(bool) @ 0x000000001a72ed71
2026.06.09 22:29:10.679649 [ 1140 ] {} <Fatal> BaseDaemon: 3. DB::IRowInputFormat::read() @ 0x000000001a5398b4
2026.06.09 22:29:10.679680 [ 1140 ] {} <Fatal> BaseDaemon: 4. DB::IInputFormat::generate() @ 0x000000001a4d0fe0
2026.06.09 22:29:10.679712 [ 1140 ] {} <Fatal> BaseDaemon: 5. DB::ISource::tryGenerate() @ 0x000000001a4a7acc
2026.06.09 22:29:10.679748 [ 1140 ] {} <Fatal> BaseDaemon: 6. DB::ISource::work() @ 0x000000001a4a7660
2026.06.09 22:29:10.679797 [ 1140 ] {} <Fatal> BaseDaemon: 7. DB::ExecutionThreadContext::executeTask() @ 0x000000001a4c1a94
2026.06.09 22:29:10.679844 [ 1140 ] {} <Fatal> BaseDaemon: 8. DB::PipelineExecutor::executeStepImpl(unsigned long, DB::IAcquiredSlot*, std::atomic<bool>*) @ 0x000000001a4b4dc8
2026.06.09 22:29:10.679885 [ 1140 ] {} <Fatal> BaseDaemon: 9. DB::PipelineExecutor::executeStep(std::atomic<bool>*) @ 0x000000001a4b3ce8
2026.06.09 22:29:10.679927 [ 1140 ] {} <Fatal> BaseDaemon: 10. DB::PullingPipelineExecutor::pull(DB::Chunk&) @ 0x000000001a4cb750
2026.06.09 22:29:10.679969 [ 1140 ] {} <Fatal> BaseDaemon: 11. DB::PullingPipelineExecutor::pull(DB::Block&) @ 0x000000001a4cba20
Does it reproduce on the most recent release?
Yes
How to reproduce
Any INSERT with truncated Protobuf data where:
- The format is
Protobufwith length-delimited messages - A fixed-size field (
fixed32/fixed64/double/float) is truncated mid-read input_format_allow_errors_num > 0(orinput_format_allow_errors_ratio > 0)
Expected behavior
Clickhouse server shouldn't crash in this situation
Error message and/or stacktrace
Signal: Segmentation fault (11)
2026.06.09 22:29:10.679561 [ 1140 ] {} <Fatal> BaseDaemon: Address: 0x18. Access: <not available>. Address not mapped to object.
2026.06.09 22:29:10.679567 [ 1140 ] {} <Fatal> BaseDaemon: Stack trace: ....
2026.06.09 22:29:10.679616 [ 1140 ] {} <Fatal> BaseDaemon: 2. DB::ProtobufReader::endMessage(bool) @ 0x000000001a72ed71
2026.06.09 22:29:10.679649 [ 1140 ] {} <Fatal> BaseDaemon: 3. DB::IRowInputFormat::read() @ 0x000000001a5398b4
2026.06.09 22:29:10.679680 [ 1140 ] {} <Fatal> BaseDaemon: 4. DB::IInputFormat::generate() @ 0x000000001a4d0fe0
2026.06.09 22:29:10.679712 [ 1140 ] {} <Fatal> BaseDaemon: 5. DB::ISource::tryGenerate() @ 0x000000001a4a7acc
2026.06.09 22:29:10.679748 [ 1140 ] {} <Fatal> BaseDaemon: 6. DB::ISource::work() @ 0x000000001a4a7660
2026.06.09 22:29:10.679797 [ 1140 ] {} <Fatal> BaseDaemon: 7. DB::ExecutionThreadContext::executeTask() @ 0x000000001a4c1a94
2026.06.09 22:29:10.679844 [ 1140 ] {} <Fatal> BaseDaemon: 8. DB::PipelineExecutor::executeStepImpl(unsigned long, DB::IAcquiredSlot*, std::atomic<bool>*) @ 0x000000001a4b4dc8
2026.06.09 22:29:10.679885 [ 1140 ] {} <Fatal> BaseDaemon: 9. DB::PipelineExecutor::executeStep(std::atomic<bool>*) @ 0x000000001a4b3ce8
2026.06.09 22:29:10.679927 [ 1140 ] {} <Fatal> BaseDaemon: 10. DB::PullingPipelineExecutor::pull(DB::Chunk&) @ 0x000000001a4cb750
2026.06.09 22:29:10.679969 [ 1140 ] {} <Fatal> BaseDaemon: 11. DB::PullingPipelineExecutor::pull(DB::Block&) @ 0x000000001a4cba20
Related issues and pull requests
No response
Additional context
No response
Version info
- Resolved by: Fix crash in ProtobufRowInputFormat::syncAfterError on null reader #106905
- Merged into:
26.6.1.863 - Backported to:
26.5.3.38,26.4.5.42,26.3.14.34
Metadata
Metadata
Assignees
Labels
potential bugTo be reviewed by developers and confirmed/rejected.
Activity
Fix crash in ProtobufRowInputFormat::syncAfterError on null reader
Fix crash in ProtobufRowInputFormat::syncAfterError on null reader
Fix crash in ProtobufRowInputFormat::syncAfterError on null reader
Fix crash in ProtobufRowInputFormat::syncAfterError on null reader
Fix crash in ProtobufRowInputFormat::syncAfterError on null reader
Fix crash in ProtobufRowInputFormat::syncAfterError on null reader
Fix crash in ProtobufRowInputFormat::syncAfterError on null reader
clickgapai commentedon Jun 13, 2026
Found via ClickGap automated review. Please close or comment if this is incorrect or needs adjustment.
TL;DR
Server crash in ProtobufReader::endMessage when processing truncated Protobuf INSERT with error skipping enabled
ClickGap verified: reproduced it with the script below on
master; tested 5 version(s) — 5 affected, 0 clean (see Affects); confirmed it predates the oldest available release (pre-existing).Reproduction
Shell reproducer — run against a local ClickHouse build (
bash <script> <clickhouse-binary>); requires the referenced test fixtures from the repo.Bisect
v25.7.8.71— reproduces on every release line tested down to there; the introducer predates the oldest release with a downloadable binary, so a single commit isn't pinnable from release binaries (not a recent regression).Affects
master, 26.5, 26.4, 26.3, 25.8Suggested next step
Manual triage of the
comp-formatspath is needed. The reproducer above should be a fast first check.Component:
comp-formatsSeverity:
P2ClickGap · Finding:
h_issue_106904atsarevskiy commentedon Jun 15, 2026
I have sent a fix #106905
Avogar commentedon Jun 15, 2026
Thanks! I will take a look