wangbo opened a new issue #4030:
URL: https://github.com/apache/incubator-doris/issues/4030


   **be core dump when mem_pool allocate memory failed**
   ```
   #0  0x00007fe8daf3dfdb in __memcpy_ssse3_back () from /lib64/libc.so.6
   #1  0x0000000000f586c2 in get (length=<optimized out>, dst_size=<optimized 
out>, dst=<optimized out>, this=0x8c0940c0) at 
/opt///palo-12/be/src/olap/byte_buffer.h:161
   #2  get (dst_size=<optimized out>, dst=<optimized out>, this=0x8c0940c0) at 
/opt///palo-12/be/src/olap/byte_buffer.h:168
   #3  read (buf_size=<synthetic pointer>, buffer=<optimized out>, 
this=0xb6aa720) at /opt///palo-12/be/src/olap/file_stream.h:267
   #4  doris::StringColumnDirectReader::next_vector 
(this=this@entry=0xe0221fd0, column_vector=column_vector@entry=0x7b3ff8c0, 
size=size@entry=54, mem_pool=<optimized out>, read_bytes=0x77459700)
       at /opt///palo-12/be/src/olap/rowset/column_reader.cpp:219
   #5  0x0000000000f60326 in 
doris::VarStringColumnReader<doris::StringColumnDirectReader>::next_vector 
(this=0xe0221f80, column_vector=0x7b3ff8c0, size=<optimized out>, 
mem_pool=0x8bc85780)
       at /opt///palo-12/be/src/olap/rowset/column_reader.h:722
   #6  0x0000000000f4abec in 
doris::SegmentReader::_load_to_vectorized_row_batch 
(this=this@entry=0x77991180, batch=batch@entry=0xf695bc0, size=54)
       at /opt///palo-12/be/src/olap/rowset/segment_reader.cpp:897
   #7  0x0000000000f4adf8 in doris::SegmentReader::get_block (this=0x77991180, 
batch=batch@entry=0xf695bc0, next_block_id=next_block_id@entry=0x774e1478, 
eof=eof@entry=0x774e138b)
       at /opt///palo-12/be/src/olap/rowset/segment_reader.cpp:321
   #8  0x0000000000f35489 in _get_block_from_reader (rows_read=0, 
without_filter=false, got_batch=<synthetic pointer>, this=0x774e1340)
       at /opt///palo-12/be/src/olap/rowset/column_data.cpp:623
   #9  doris::ColumnData::_get_block (this=this@entry=0x774e1340, 
without_filter=without_filter@entry=false, rows_read=0) at 
/opt///palo-12/be/src/olap/rowset/column_data.cpp:648
   #10 0x0000000000f36c5b in doris::ColumnData::_seek_to_row 
(this=this@entry=0x774e1340, key=..., find_last_key=<optimized out>, 
is_end_key=is_end_key@entry=false)
       at /opt///palo-12/be/src/olap/rowset/column_data.cpp:305
   #11 0x0000000000f37062 in doris::ColumnData::prepare_block_read 
(this=0x774e1340, start_key=0x148b9fb0, find_start_key=<optimized out>, 
end_key=0x4f0fd9b0, find_end_key=<optimized out>, 
       first_block=first_block@entry=0x13f88e50) at 
/opt///palo-12/be/src/olap/rowset/column_data.cpp:376
   #12 0x0000000000f240e5 in doris::AlphaRowsetReader::_pull_first_block 
(this=0x3b5c6480, merge_ctx=0x13f88e40) at 
/opt///palo-12/be/src/olap/rowset/alpha_rowset_reader.cpp:296
   #13 0x0000000000f24a69 in _pull_next_block (merge_ctx=0x13f88e40, 
this=0x3b5c6480) at 
/opt///palo-12/be/src/olap/rowset/alpha_rowset_reader.cpp:270
   #14 doris::AlphaRowsetReader::_union_block (this=0x3b5c6480, 
block=0xf694598) at 
/opt///palo-12/be/src/olap/rowset/alpha_rowset_reader.cpp:121
   #15 0x0000000000ea51b6 in 
doris::CollectIterator::ChildCtx::_refresh_current_row (this=0xf694540) at 
/opt///palo-12/be/src/olap/reader.cpp:132
   #16 0x0000000000ea1318 in init (this=0xf694540) at 
/opt///palo-12/be/src/olap/reader.cpp:91
   #17 doris::CollectIterator::add_child (this=0xb7a745a0, rs_reader=...) at 
/opt///palo-12/be/src/olap/reader.cpp:205
   #18 0x0000000000ea1d3a in doris::Reader::_capture_rs_readers 
(this=this@entry=0x77459400, read_params=...) at 
/opt///palo-12/be/src/olap/reader.cpp:557
   #19 0x0000000000ea4cc3 in doris::Reader::init (this=0x77459400, 
read_params=...) at /opt///palo-12/be/src/olap/reader.cpp:319
   #20 0x0000000001491a85 in doris::OlapScanner::open 
(this=this@entry=0x886f86c0) at /opt///palo-12/be/src/exec/olap_scanner.cpp:133
   #21 0x0000000001469a0f in doris::OlapScanNode::scanner_thread 
(this=0x7d6e2000, scanner=0x886f86c0) at 
/opt///palo-12/be/src/exec/olap_scan_node.cpp:1219
   #22 0x0000000000f984e5 in operator() (this=0x7fe8c69d57e8) at 
/opt///palo-12/thirdparty/installed/include/boost/function/function_template.hpp:759
   #23 doris::PriorityThreadPool::work_thread (this=0x47165b00, 
thread_id=<optimized out>) at 
/opt///palo-12/be/src/util/priority_thread_pool.hpp:138
   #24 0x0000000001a5d52d in thread_proxy ()
   #25 0x00007fe8dbae2dd5 in start_thread () from /lib64/libpthread.so.0
   #26 0x00007fe8daee802d in clone () from /lib64/libc.so.6
   (gdb) f 4
   #4  doris::StringColumnDirectReader::next_vector 
(this=this@entry=0xe0221fd0, column_vector=column_vector@entry=0x7b3ff8c0, 
size=size@entry=54, mem_pool=<optimized out>, read_bytes=0x77459700)
       at /opt///palo-12/be/src/olap/rowset/column_reader.cpp:219
   219  in /opt///palo-12/be/src/olap/rowset/column_reader.cpp
   (gdb) p string_buffer
   $45 = 0x0
   ```
   
   **Solution 1**
   A quick fix.
   Add a return value check here , end current query if mem_pool returns null.
   
   **Solution 2**
   Change Mem_pool->allocate interface
   1 Return Status instead memory pointer.Return false means allocation 
failed,vice versa.
   2 Using function args to return allocated memory for caller


----------------------------------------------------------------
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.

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