Skip to content

branch-4.1: [fix](bitmap) fix SIGSEGV when reading zero-length serialized BITMAP/HLL/QuantileState cell #67473 - #68497

Merged
yiguolei merged 1 commit into
branch-4.1from
auto-pick-67473-branch-4.1
Sep 25, 2026
Merged

yiguolei merged 1 commit into
branch-4.1from
auto-pick-67473-branch-4.1

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Cherry-picked from #67473

…HLL/QuantileState cell (#67473)

When a BITMAP / HLL / QUANTILE_STATE cell on disk has a serialized
length
of 0, ColumnComplexType::insert_binary_data used to interpret the raw
page bytes as an in-memory value_type object via reinterpret_cast and
then copy-assign it, which is undefined behavior. The heap-pointer
members of BitmapValue / HyperLogLog / QuantileState were dereferenced
as if they were valid pointers, and BE processes crashed with SIGSEGV
during queries that hit read_by_rowids (e.g. lazy materialization on
aggregate / unique-key tables that carry a BITMAP value column).

Fix it by keeping the default-constructed empty object produced by
insert_default() and returning early when length == 0.

Add regression tests in be/test/core/column/column_complex_test.cpp
covering all three complex types and all three code paths that flow
into insert_binary_data.
@github-actions
github-actions Bot requested a review from yiguolei as a code owner September 24, 2026 11:44
@hello-stephen

Copy link
Copy Markdown
Contributor

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

@hello-stephen

Copy link
Copy Markdown
Contributor

run buildall

@hello-stephen

Copy link
Copy Markdown
Contributor

BE UT Coverage Report

Increment line coverage 100.00% (1/1) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 60.30% (26232/43499)
Line Coverage 45.03% (271518/603012)
Region Coverage 40.80% (215203/527437)
Branch Coverage 42.29% (99536/235339)

@yiguolei

Copy link
Copy Markdown
Contributor

skip buildall

@github-actions

Copy link
Copy Markdown
Contributor Author

PR approved by anyone and no changes requested.

@github-actions github-actions Bot added the approved Indicates a PR has been approved by one committer. label Sep 25, 2026
@yiguolei
yiguolei merged commit 617a17c into branch-4.1 Sep 25, 2026
38 checks passed
@github-actions

Copy link
Copy Markdown
Contributor Author

PR approved by at least one committer and no changes requested.

yiguolei pushed a commit that referenced this pull request Sep 25, 2026
…ized BITMAP/HLL/QuantileState cell #67473 (#68497)

Cherry-picked from #67473

Co-authored-by: shee <13843187+qzsee@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by one committer. reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants