[BugFix] Fix ASAN crash for BOOLEAN nested in Avro complex-type columns (backport #76041)#76065
Closed
mergify[bot] wants to merge 1 commit into
Closed
[BugFix] Fix ASAN crash for BOOLEAN nested in Avro complex-type columns (backport #76041)#76065mergify[bot] wants to merge 1 commit into
mergify[bot] wants to merge 1 commit into
Conversation
Contributor
Author
|
Cherry-pick of bed4395 has failed: 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 |
Contributor
Author
|
@mergify[bot]: Backport conflict, please reslove the conflict and resubmit the pr |
Closed
18 tasks
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.
Why I'm doing:
Fix the daily ASAN crash reported in StarRocks/StarRocksTest#11522:
It aborts BE when an Avro routine load targets a native complex-type column (STRUCT/MAP/ARRAY) that contains a
BOOLEANfield/element/value.What I'm doing:
BooleanColumnisFixedLengthColumn<uint8_t>, but the nested (non-adaptive)add_nullable_columninbe/src/formats/avro/nullable_column.cppdispatchedTYPE_BOOLEANthroughadd_nullable_numeric_column<int8_t>.add_numeric_column<int8_t>thendown_casts the uint8 column toFixedLengthColumn<int8_t>*, which trips thedynamic_castassert under ASAN/DEBUG.The adaptive path (
add_adpative_nullable_column, used for top-level columns) already dispatchedTYPE_BOOLEANthrough the correct<uint8_t>— which is why only complex types crashed and a plain top-levelBOOLEANcolumn 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 fullAvroScannerTestsuite (26 tests) passes on a clean ASAN build.Notes:
int8_t/uint8_tare layout-identical, so for valid boolean data this is an ASAN/DEBUG crash rather than a release data-correctness issue.Fixes StarRocks/StarRocksTest#11522
What type of PR is this:
Does this PR entail a change in behavior?
Checklist:
Bugfix cherry-pick branch check:
This is an automatic backport of pull request #76041 done by [Mergify](https://mergify.com).