Repository navigation
Cherry pick #112498 to 26.3: Fix segfault reading a Parquet file with an inconsistent bloom filter size - #114573
Merged
robot-ch-test-poll2 merged 4 commits intoAug 14, 2026
Conversation
… size `Reader::processBloomFilterHeader` took the bloom filter bitset size from the file (`BloomFilterHeader.numBytes`, validated only for sign and 32-byte alignment) and derived the byte range of each 32-byte bloom filter block from it, without checking that `header_size + numBytes` fits inside the bloom filter byte range it registered for reading - `ColumnMetaData.bloom_filter_length`, or the next-known-offset upper bound when the file doesn't record it. `Prefetcher::splitRange` was the only guard, and it missed the case twice. Its `length > range.end - start` check underflows when `start > range.end`, and it only runs while the parent range is still in state `HasRange`: the bloom filter header and data ranges start at the same offset and the data range is normally shorter than `min_bytes_for_seek`, so starting the header prefetch coalesces the data range into the same read task and flips it to `HasTask`, whose tail path computed `task_offset` unchecked. `Prefetcher::getRangeData` then guarded the resulting span with `chassert` only, which is compiled out in release builds, so `findAnyHash` read unmapped memory and the server died with SIGSEGV. When the out-of-range block landed inside the buffer instead, the row group was pruned on unrelated bytes and rows went missing silently. Reject such a header with INCORRECT_DATA, make the `splitRange` checks underflow-safe and apply them on the coalesced path too, and turn the `getRangeData` assertion into a real check. Co-Authored-By: Claude Opus 5 <[email protected]>
00900_long_parquet_load_2 loads every .parquet in data_parquet/ (minus an EXCLUDE list); this PR adds 04654_bloom_filter_bitset_out_of_bounds.parquet, which 00900 then also loads, appending rows not in its reference. Exclude the hand-crafted fixture the same way the other purpose-built data files (04045/04065/04099) are. Co-Authored-By: Claude Opus 4.8 <[email protected]>
…ob-read Fix segfault reading a Parquet file with an inconsistent bloom filter size
….3-112498 # Conflicts: # src/Processors/Formats/Impl/Parquet/Prefetcher.cpp # tests/queries/0_stateless/00900_long_parquet_load_2.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Original pull-request #112498
Do not merge this PR manually
This pull-request is a first step of an automated backporting.
It contains changes similar to calling
git cherry-picklocally.If you intend to continue backporting the changes, then resolve all conflicts if any.
Otherwise, if you do not want to backport them, then just close this pull-request.
The check results does not matter at this step - you can safely ignore them.
Troubleshooting
If the conflicts were resolved in a wrong way
If this cherry-pick PR is completely screwed by a wrong conflicts resolution, and you want to recreate it:
pr-cherrypicklabel from the PRYou also need to check the Original pull-request for
pr-backports-createdlabel, and delete if it's presented thereThe PR source
The PR is created in the CI job