Skip to content

[BugFix] Fix ASAN crash for BOOLEAN nested in Avro complex-type columns (backport #76041)#76065

Closed
mergify[bot] wants to merge 1 commit into
branch-4.0from
mergify/bp/branch-4.0/pr-76041
Closed

[BugFix] Fix ASAN crash for BOOLEAN nested in Avro complex-type columns (backport #76041)#76065
mergify[bot] wants to merge 1 commit into
branch-4.0from
mergify/bp/branch-4.0/pr-76041

Conversation

@mergify

@mergify mergify Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Why I'm doing:

Fix the daily ASAN crash reported in StarRocks/StarRocksTest#11522:

be/src/gutil/casts.h:78: To down_cast(From*) [with To = FixedLengthColumn<signed char>*; ...]:
Assertion `f == __null || dynamic_cast<To>(f) != __null' failed.

It aborts BE when an Avro routine load targets a native complex-type column (STRUCT/MAP/ARRAY) that contains a BOOLEAN field/element/value.

What I'm doing:

BooleanColumn is FixedLengthColumn<uint8_t>, but the nested (non-adaptive) add_nullable_column in be/src/formats/avro/nullable_column.cpp dispatched TYPE_BOOLEAN through add_nullable_numeric_column<int8_t>. add_numeric_column<int8_t> then down_casts the uint8 column to FixedLengthColumn<int8_t>*, which trips the dynamic_cast assert under ASAN/DEBUG.

The adaptive path (add_adpative_nullable_column, used for top-level columns) already dispatched TYPE_BOOLEAN through the correct <uint8_t> — which is why only complex types crashed and a plain top-level BOOLEAN column was fine. The fix dispatches the nested path through <uint8_t> too. add_numeric_column<uint8_t> is already explicitly instantiated, so no other change is needed.

Added regression test AvroScannerTest.test_struct_with_boolean; the full AvroScannerTest suite (26 tests) passes on a clean ASAN build.

Notes:

Fixes StarRocks/StarRocksTest#11522

What type of PR is this:

  • BugFix
  • Feature
  • Enhancement
  • Refactor
  • UT
  • Doc
  • Tool

Does this PR entail a change in behavior?

  • Yes, this PR will result in a change in behavior.
  • No, this PR will not result in a change in behavior.

Checklist:

  • I have added test cases for my bug fix or my new feature
  • This pr needs user documentation (for new or modified features or behaviors)
    • I have added documentation for my new feature or new function
    • This pr needs auto generate documentation
  • This is a backport pr

Bugfix cherry-pick branch check:

  • I have checked the version labels which the pr will be auto-backported to the target branch
    • 4.1
    • 4.0
    • 3.5

This is an automatic backport of pull request #76041 done by [Mergify](https://mergify.com).

…ns (#76041)

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
(cherry picked from commit bed4395)

# Conflicts:
#	be/src/formats/avro/nullable_column.cpp
#	be/test/exec/avro_scanner_test.cpp
@mergify mergify Bot added the conflicts label Jul 9, 2026
@mergify

mergify Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor Author

Cherry-pick of bed4395 has failed:

On branch mergify/bp/branch-4.0/pr-76041
Your branch is up to date with 'origin/branch-4.0'.

You are currently cherry-picking commit bed4395814.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   be/src/formats/avro/nullable_column.cpp
	both modified:   be/test/exec/avro_scanner_test.cpp

no changes added to commit (use "git add" and/or "git commit -a")

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

@wanpengfei-git wanpengfei-git enabled auto-merge (squash) July 9, 2026 02:13
@mergify mergify Bot closed this Jul 9, 2026
auto-merge was automatically disabled July 9, 2026 02:13

Pull request was closed

@mergify

mergify Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor Author

@mergify[bot]: Backport conflict, please reslove the conflict and resubmit the pr

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant