aryash45 opened a new pull request, #60776:
URL: https://github.com/apache/doris/pull/60776
…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:
- 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
### What problem does this PR solve?
Issue Number: close #60713
Problem Summary:
BE nodes crash with SIGSEGV in `ColumnStr<unsigned
int>::insert_indices_from` during 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
- [ ] Regression test
- [x] Unit Test
- [ ] Manual test (add detailed scripts or steps below)
- [ ] No need to test or manual test. Explain why:
- [ ] This is a refactor/code format and no logic has been changed.
- [ ] Previous test can cover this change.
- [ ] No code files have been changed.
- [ ] Other reason
- Behavior changed:
- [x] No.
- [ ] Yes.
- Does this need documentation?
- [x] No.
- [ ] Yes.
### Check List (For Reviewer )
- [ ] Confirm the release note
- [ ] Confirm test cases
- [ ] Confirm document
- [ ] Add branch pick label
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]