sollhui opened a new pull request, #45485:
URL: https://github.com/apache/doris/pull/45485

   ### What problem does this PR solve?
   
   Problem Summary:
   Core dump when load csv file to Doris:
   ```
   ==878493==ERROR: AddressSanitizer: heap-buffer-overflow on address 
0x7fe0fda1c800 at pc 0x559d3db60c48 bp 0x7fde739b2b20 sp 0x7fde739b22d8
   READ of size 6 at 0x7fe0fda1c800 thread T545 (_scanner_scan)
       #0 0x559d3db60c47 in memmem 
(/mnt/disk1/laihui/doris/output/be/lib/doris_be+0x61eefc47) (BuildId: 
5f823a8a2b6a81c7)
       #1 0x559d6d02ea60 in unsigned char const* 
doris::EncloseCsvLineReaderContext::look_for_column_sep_pos<false>(unsigned 
char const*, unsigned long, char const*, unsigned long) 
/mnt/disk1/laihui/doris/be/src/vec/exec/format/file_reader/
   new_plain_text_line_reader.cpp:111:33
       #2 0x559d6d01f21e in 
doris::EncloseCsvLineReaderContext::_on_match_enclose(unsigned char const*, 
unsigned long&) 
/mnt/disk1/laihui/doris/be/src/vec/exec/format/file_reader/new_plain_text_line_reader.cpp:177:13
       #3 0x559d6d01c7aa in 
doris::EncloseCsvLineReaderContext::read_line_impl(unsigned char const*, 
unsigned long) 
/mnt/disk1/laihui/doris/be/src/vec/exec/format/file_reader/new_plain_text_line_reader.cpp:68:13
       #4 0x559d6cf9e616 in 
doris::BaseTextLineReaderContext<doris::EncloseCsvLineReaderContext>::read_line(unsigned
 char const*, unsigned long) 
/mnt/disk1/laihui/doris/be/src/vec/exec/format/file_reader/new_plain_text_line_reader.h:77:41
       #5 0x559d6d0258a3 in doris::NewPlainTextLineReader::read_line(unsigned 
char const**, unsigned long*, bool*, doris::io::IOContext const*) 
/mnt/disk1/laihui/doris/be/src/vec/exec/format/file_reader/new_plain_text_line_reader.cpp:335:48
       #6 0x559d6cf5fc8c in 
doris::vectorized::CsvReader::get_next_block(doris::vectorized::Block*, 
unsigned long*, bool*) 
/mnt/disk1/laihui/doris/be/src/vec/exec/format/csv/csv_reader.cpp:538:13
       #7 0x559d90f388bb in 
doris::vectorized::VFileScanner::_get_block_wrapped(doris::RuntimeState*, 
doris::vectorized::Block*, bool*) 
/mnt/disk1/laihui/doris/be/src/vec/exec/scan/vfile_scanner.cpp:306:13
       #8 0x559d90f37222 in 
doris::vectorized::VFileScanner::_get_block_impl(doris::RuntimeState*, 
doris::vectorized::Block*, bool*) 
/mnt/disk1/laihui/doris/be/src/vec/exec/scan/vfile_scanner.cpp:248:17
   ```
   
   ```
   const uint8_t* delim_pos = find_col_sep_func(curr_start, curr_len, 
_column_sep.c_str(), _column_sep_len);
   ```
   curr_len should len - _idx rather than _column_sep_len.
   ### Release note
   
   None
   
   ### Check List (For Author)
   
   - Test <!-- At least one of them must be included. -->
       - [ ] Regression test
       - [ ] 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 <!-- Add your reason?  -->
   
   - Behavior changed:
       - [ ] No.
       - [ ] Yes. <!-- Explain the behavior change -->
   
   - Does this need documentation?
       - [ ] No.
       - [ ] Yes. <!-- Add document PR link here. eg: 
https://github.com/apache/doris-website/pull/1214 -->
   
   ### Check List (For Reviewer who merge this PR)
   
   - [ ] Confirm the release note
   - [ ] Confirm test cases
   - [ ] Confirm document
   - [ ] Add branch pick label <!-- Add branch pick label that this PR should 
merge into -->
   
   


-- 
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: commits-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to