[fix](be) Fix SEGV in OrcReader when _row_reader is nullptr#63922
Open
heguanhui wants to merge 1 commit into
Open
[fix](be) Fix SEGV in OrcReader when _row_reader is nullptr#63922heguanhui wants to merge 1 commit into
heguanhui wants to merge 1 commit into
Conversation
Contributor
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
Contributor
Author
|
:run buildall |
Contributor
Author
|
run buildall |
### What problem does this PR solve? Issue Number: close apache#63921 Problem Summary: When OrcReader::_init_orc_row_reader() catches an exception from createRowReader with should_stop=true and error message "stop", it swallows the exception and returns Status::OK(), leaving _row_reader as nullptr. Subsequent calls to _seek_to_read_one_line() dereference the null _row_reader via _row_reader->seekToRow(), causing SEGV. This is inconsistent with _create_file_reader() which returns Status::EndOfFile("stop") in the same should_stop scenario. ### Release note None ### Check List (For Author) - Test: Unit Test - Existing OrcReadLinesTest can cover this change - Behavior changed: No - Does this need documentation: No
7556630 to
340ae89
Compare
Contributor
Author
|
run buildall |
Contributor
TPC-H: Total hot run time: 28854 ms |
Contributor
TPC-DS: Total hot run time: 171252 ms |
Contributor
BE UT Coverage ReportIncrement line coverage Increment coverage report
|
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.
What problem does this PR solve?
Issue Number: close #63921
Related PR: #xxx
Problem Summary:
When
OrcReader::_init_orc_row_reader()catches an exception fromcreateRowReaderwithshould_stop=trueand error message"stop", it swallows the exception and returnsStatus::OK(), leaving_row_readeras nullptr. Subsequent calls to_seek_to_read_one_line()dereference the null_row_readervia_row_reader->seekToRow(), causing SEGV.This is inconsistent with
_create_file_reader()which returnsStatus::EndOfFile("stop")in the sameshould_stopscenario.ASAN crash stack:
Root cause chain:
_init_orc_row_reader()catch block:should_stop+"stop"→ swallows exception, returnsStatus::OK(),_row_readerremains nullptrStatus::OK(), proceeds to callget_next_block()_get_next_block_impl()→_seek_to_read_one_line()→_row_reader->seekToRow()→ SEGVFix:
_init_orc_row_reader()catch block: returnStatus::EndOfFile("stop")instead ofStatus::OK(), consistent with_create_file_reader()_seek_to_read_one_line(): change return type frombooltoStatus, addDORIS_CHECK(_row_reader)assertion for precondition_get_next_block_impl(): adapt to handleStatusreturn from_seek_to_read_one_line(), distinguishEND_OF_FILEfrom other errorsEXPECT_TRUE→ASSERT_TRUEto prevent continuing after init failureRelease note
None
Check List (For Author)
Test
Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)