[fix](columns) Add bounds checking in ColumnStr::insert_indices_from …#60776
Open
aryash45 wants to merge 3 commits intoapache:masterfrom
Open
[fix](columns) Add bounds checking in ColumnStr::insert_indices_from …#60776aryash45 wants to merge 3 commits intoapache:masterfrom
aryash45 wants to merge 3 commits intoapache:masterfrom
Conversation
Contributor
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
…to prevent SIGSEGV (apache#60713) The insert_indices_from function in ColumnStr accesses src_offset_data[src_offset] without validating that src_offset is within the valid range of the source column. If an out-of-bounds index is passed, this causes a SIGSEGV crash. Changes: - Add early return for empty indices list - Add validation that source column is not empty when indices are provided - Add bounds checking loop to verify all indices are within [0, src_size) - Strengthen DCHECK in MutableBlock::add_rows to a runtime check - Add unit test for out-of-bounds indices scenarios
6e83725 to
878c24e
Compare
Author
|
hey @morningman @zclllyybb please review my pr and tell me if any change is needed |
Contributor
thanks for your pr~ actually I think this may be not a proper patch. for a out of bound issue, we should figure out why and who passed an invalid index. that's where we should fix. |
Author
|
thank for your reply @zclllyybb i will look into it and make the commit |
yiguolei
reviewed
Feb 16, 2026
| void ColumnStr<T>::insert_indices_from(const IColumn& src, const uint32_t* indices_begin, | ||
| const uint32_t* indices_end) { | ||
| if (indices_begin == indices_end) { | ||
| return; |
Contributor
There was a problem hiding this comment.
in normal cases, this should not happen. Do you find the real reason why the indices not valid???
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.
…to prevent SIGSEGV (#60713)
The insert_indices_from function in ColumnStr accesses src_offset_data[src_offset] without validating that src_offset is within the valid range of the source column. If an out-of-bounds index is passed, this causes a SIGSEGV crash.
Changes:
What problem does this PR solve?
Issue Number: close #60713
Problem Summary:
BE nodes crash with SIGSEGV in
ColumnStr<unsigned int>::insert_indices_fromduring INSERT...SELECT operations. The crash occurs because indices are accessed without bounds validation, leading to out-of-bounds memory access when invalid indices are passed during data exchange between BE nodes.Release note
None
Check List (For Author)
Test
Behavior changed:
Does this need documentation?
Check List (For Reviewer )