apache / doris

Apache Doris is an easy-to-use, high performance and unified analytics database.
https://doris.apache.org
Apache License 2.0
12.66k stars 3.27k forks source link

[Bug of DOE]be accidental crashed #3984

Closed BabySid closed 4 years ago

BabySid commented 4 years ago

Describe the bug be.out shows as below (But it did not recur)

*** Aborted at 1593418720 (unix time) try "date -d @1593418720" if you are using GNU date ***
PC: @          0x14a46b3 doris::EsPredicate::build_disjuncts_list()
*** SIGSEGV (@0x60) received by PID 24304 (TID 0x7fd9b1f87700) from PID 96; stack trace: ***
    @     0x7fd9ef617340 (unknown)
    @          0x14a46b3 doris::EsPredicate::build_disjuncts_list()
    @          0x14a5848 doris::EsPredicate::build_disjuncts_list()
    @          0x149d1bc doris::EsHttpScanNode::build_conjuncts_list()
    @          0x149e2ef doris::EsHttpScanNode::open()
    @          0x14158c9 doris::HashJoinNode::open()
    @          0x14158c9 doris::HashJoinNode::open()
    @          0x14158c9 doris::HashJoinNode::open()
    @          0x14d76d7 doris::PartitionedAggregationNode::open()
    @          0x101b4bb doris::PlanFragmentExecutor::open_internal()
    @          0x101bbdc doris::PlanFragmentExecutor::open()
    @           0xfb00e7 doris::FragmentExecState::execute()
    @           0xfb1ba6 doris::FragmentMgr::exec_actual()
    @           0xfb8834 boost::detail::function::void_function_obj_invoker0<>::invoke()
    @           0xf84825 doris::PriorityThreadPool::work_thread()
    @          0x1a3479d thread_proxy
    @     0x7fd9ef3ccdd5 start_thread
    @     0x7fd9ef6df02d __clone

gdb core palo_be

(gdb) bt
#0  0x00000000014a46b3 in _Alloc_hider (__a=..., __dat=<optimized out>, this=<optimized out>) at /usr/include/c++/7.3.0/bits/basic_string.h:149
#1  basic_string (__str=..., this=0x7fd9b1f810d0) at /usr/include/c++/7.3.0/bits/basic_string.h:439
#2  doris::EsPredicate::build_disjuncts_list (this=0x8160f50, conjunct=0x1c89a800) at /root/incubator-doris/be/src/exec/es/es_predicate.cpp:310
#3  0x00000000014a5848 in doris::EsPredicate::build_disjuncts_list (this=<optimized out>) at /root/incubator-doris/be/src/exec/es/es_predicate.cpp:187
#4  0x000000000149d1bc in doris::EsHttpScanNode::build_conjuncts_list (this=this@entry=0x36069f80) at /root/incubator-doris/be/src/exec/es_http_scan_node.cpp:101
#5  0x000000000149e2ef in doris::EsHttpScanNode::open (this=0x36069f80, state=<optimized out>) at /root/incubator-doris/be/src/exec/es_http_scan_node.cpp:134
#6  0x00000000014158c9 in doris::HashJoinNode::open (this=0xa5de000, state=0x15ef6a00) at /root/incubator-doris/be/src/exec/hash_join_node.cpp:339
#7  0x00000000014158c9 in doris::HashJoinNode::open (this=0x16619500, state=0x15ef6a00) at /root/incubator-doris/be/src/exec/hash_join_node.cpp:339
#8  0x00000000014158c9 in doris::HashJoinNode::open (this=0x15fb7880, state=0x15ef6a00) at /root/incubator-doris/be/src/exec/hash_join_node.cpp:339
#9  0x00000000014d76d7 in doris::PartitionedAggregationNode::open (this=0x16b44c00, state=0x15ef6a00) at /root/incubator-doris/be/src/exec/partitioned_aggregation_node.cc:265
#10 0x000000000101b4bb in doris::PlanFragmentExecutor::open_internal (this=this@entry=0x1c9b8070) at /root/incubator-doris/be/src/runtime/plan_fragment_executor.cpp:275
#11 0x000000000101bbdc in doris::PlanFragmentExecutor::open (this=this@entry=0x1c9b8070) at /root/incubator-doris/be/src/runtime/plan_fragment_executor.cpp:259
#12 0x0000000000fb00e7 in doris::FragmentExecState::execute (this=0x1c9b8000) at /root/incubator-doris/be/src/runtime/fragment_mgr.cpp:212
#13 0x0000000000fb1ba6 in doris::FragmentMgr::exec_actual(std::shared_ptr<doris::FragmentExecState>, std::function<void (doris::PlanFragmentExecutor*)>) (this=0x7f0fc00, exec_state=..., cb=...)
    at /root/incubator-doris/be/src/runtime/fragment_mgr.cpp:399
#14 0x0000000000fb8834 in operator() (a2=<error reading variable: access outside bounds of object referenced via synthetic pointer>, a1=..., p=<optimized out>, this=<optimized out>)
    at /var/local/thirdparty/installed/include/boost/bind/mem_fn_template.hpp:280
#15 operator()<boost::_mfi::mf2<void, doris::FragmentMgr, std::shared_ptr<doris::FragmentExecState>, std::function<void(doris::PlanFragmentExecutor*)> >, boost::_bi::list0> (a=<synthetic pointer>, f=..., this=<optimized out>)
    at /var/local/thirdparty/installed/include/boost/bind/bind.hpp:398
#16 operator() (this=<optimized out>) at /var/local/thirdparty/installed/include/boost/bind/bind.hpp:1294
#17 boost::detail::function::void_function_obj_invoker0<boost::_bi::bind_t<void, boost::_mfi::mf2<void, doris::FragmentMgr, std::shared_ptr<doris::FragmentExecState>, std::function<void (doris::PlanFragmentExecutor*)> >, boost::_bi::list3<boost::_bi::value<doris::FragmentMgr*>, boost::_bi::value<std::shared_ptr<doris::FragmentExecState> >, boost::_bi::value<std::function<void (doris::PlanFragmentExecutor*)> > > >, void>::invoke(boost::detail::function::function_buffer&) (function_obj_ptr=...) at /var/local/thirdparty/installed/include/boost/function/function_template.hpp:159
#18 0x0000000000f84825 in operator() (this=0x7fd9b1f837e8) at /var/local/thirdparty/installed/include/boost/function/function_template.hpp:759
#19 doris::PriorityThreadPool::work_thread (this=0x7f0fc80, thread_id=<optimized out>) at /root/incubator-doris/be/src/util/priority_thread_pool.hpp:138
#20 0x0000000001a3479d in thread_proxy ()
#21 0x00007fd9ef3ccdd5 in start_thread () from /lib64/libpthread.so.0
#22 0x00007fd9ef6df02d in clone () from /lib64/libc.so.6
(gdb) f 2
#2  doris::EsPredicate::build_disjuncts_list (this=0x8160f50, conjunct=0x1c89a800) at /root/incubator-doris/be/src/exec/es/es_predicate.cpp:310
310     /root/incubator-doris/be/src/exec/es/es_predicate.cpp: No such file or directory.
(gdb) p *conjunct
$1 = {_vptr.Expr = 0x269bd90 <vtable for doris::ScalarFnCall+16>, static _s_get_constant_symbol_prefix = 0x2697a2e "_ZN4doris4Expr12get_constant", _cache_entry = 0x0, _node_type = doris::TExprNodeType::FUNCTION_CALL, 
  _opcode = TExprOpcode::INVALID_OPCODE, _is_slotref = false, _type = {type = doris::TYPE_BOOLEAN, len = -1, static MAX_VARCHAR_LENGTH = 65355, static MAX_CHAR_LENGTH = 255, static MAX_CHAR_INLINE_LENGTH = 128, precision = -1, 
    scale = -1, static MAX_PRECISION = 38, static MAX_SCALE = 38, static MAX_DECIMAL4_PRECISION = 9, static MAX_DECIMAL8_PRECISION = 18, 
    children = {<std::_Vector_base<doris::TypeDescriptor, std::allocator<doris::TypeDescriptor> >> = {
        _M_impl = {<std::allocator<doris::TypeDescriptor>> = {<__gnu_cxx::new_allocator<doris::TypeDescriptor>> = {<No data fields>}, <No data fields>}, _M_start = 0x0, _M_finish = 0x0, _M_end_of_storage = 0x0}}, <No data fields>}, 
    field_names = {<std::_Vector_base<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >> = {
        _M_impl = {<std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >> = {<__gnu_cxx::new_allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >> = {<No data fields>}, <No data fields>}, _M_start = 0x0, _M_finish = 0x0, _M_end_of_storage = 0x0}}, <No data fields>}}, _children = {<std::_Vector_base<doris::Expr*, std::allocator<doris::Expr*> >> = {
      _M_impl = {<std::allocator<doris::Expr*>> = {<__gnu_cxx::new_allocator<doris::Expr*>> = {<No data fields>}, <No data fields>}, _M_start = 0x19bd8488, _M_finish = 0x19bd8490, 
        _M_end_of_storage = 0x19bd8490}}, <No data fields>}, _output_scale = -1, _output_column = -1, _fn = {_vptr.TFunction = 0x2707338 <vtable for doris::TFunction+16>, name = {
      _vptr.TFunctionName = 0x27072c0 <vtable for doris::TFunctionName+16>, db_name = {static npos = 18446744073709551615, 
        _M_dataplus = {<std::allocator<char>> = {<__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data fields>}, _M_p = 0x1c89a8a0 ""}, _M_string_length = 0, {_M_local_buf = '\000' <repeats 15 times>, 
          _M_allocated_capacity = 0}}, function_name = {static npos = 18446744073709551615, _M_dataplus = {<std::allocator<char>> = {<__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data fields>}, 
          _M_p = 0xcbe94a0 "is_not_null_pred"}, _M_string_length = 16, {_M_local_buf = "\036", '\000' <repeats 14 times>, _M_allocated_capacity = 30}}, __isset = {db_name = false}}, 
    binary_type = doris::TFunctionBinaryType::BUILTIN, arg_types = {<std::_Vector_base<doris::TTypeDesc, std::allocator<doris::TTypeDesc> >> = {
        _M_impl = {<std::allocator<doris::TTypeDesc>> = {<__gnu_cxx::new_allocator<doris::TTypeDesc>> = {<No data fields>}, <No data fields>}, _M_start = 0x177909c0, _M_finish = 0x177909e8, 
          _M_end_of_storage = 0x177909e8}}, <No data fields>}, ret_type = {_vptr.TTypeDesc = 0x2707220 <vtable for doris::TTypeDesc+16>, types = {<std::_Vector_base<doris::TTypeNode, std::allocator<doris::TTypeNode> >> = {
          _M_impl = {<std::allocator<doris::TTypeNode>> = {<__gnu_cxx::new_allocator<doris::TTypeNode>> = {<No data fields>}, <No data fields>}, _M_start = 0x1f2d50e0, _M_finish = 0x1f2d5130, 
            _M_end_of_storage = 0x1f2d5130}}, <No data fields>}, __isset = {types = true}}, has_var_args = false, comment = {static npos = 18446744073709551615, 
      _M_dataplus = {<std::allocator<char>> = {<__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data fields>}, _M_p = 0x1c89a938 ""}, _M_string_length = 0, {_M_local_buf = '\000' <repeats 15 times>, 
        _M_allocated_capacity = 0}}, signature = {static npos = 18446744073709551615, _M_dataplus = {<std::allocator<char>> = {<__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data fields>}, 
        _M_p = 0xcbe9020 "is_not_null_pred(BIGINT)"}, _M_string_length = 24, {_M_local_buf = "\036", '\000' <repeats 14 times>, _M_allocated_capacity = 30}}, hdfs_location = {static npos = 18446744073709551615, 
      _M_dataplus = {<std::allocator<char>> = {<__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data fields>}, _M_p = 0x1c89a978 ""}, _M_string_length = 0, {_M_local_buf = '\000' <repeats 15 times>, 
        _M_allocated_capacity = 0}}, scalar_fn = {_vptr.TScalarFunction = 0x27072e8 <vtable for doris::TScalarFunction+16>, symbol = {static npos = 18446744073709551615, 
        _M_dataplus = {<std::allocator<char>> = {<__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data fields>}, 
          _M_p = 0x1784a770 "_ZN5doris15IsNullPredicate11is_not_nullIN9doris_udf9BigIntValEEENS2_10BooleanValEPNS2_15FunctionContextERKT_"}, _M_string_length = 108, {_M_local_buf = "l", '\000' <repeats 14 times>, 
          _M_allocated_capacity = 108}}, prepare_fn_symbol = {static npos = 18446744073709551615, _M_dataplus = {<std::allocator<char>> = {<__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data fields>}, 
          _M_p = 0x1c89a9c0 ""}, _M_string_length = 0, {_M_local_buf = '\000' <repeats 15 times>, _M_allocated_capacity = 0}}, close_fn_symbol = {static npos = 18446744073709551615, 
        _M_dataplus = {<std::allocator<char>> = {<__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data fields>}, _M_p = 0x1c89a9e0 ""}, _M_string_length = 0, {_M_local_buf = '\000' <repeats 15 times>, 
          _M_allocated_capacity = 0}}, __isset = {prepare_fn_symbol = false, close_fn_symbol = false}}, aggregate_fn = {_vptr.TAggregateFunction = 0x2707310 <vtable for doris::TAggregateFunction+16>, intermediate_type = {
        _vptr.TTypeDesc = 0x2707220 <vtable for doris::TTypeDesc+16>, types = {<std::_Vector_base<doris::TTypeNode, std::allocator<doris::TTypeNode> >> = {
            _M_impl = {<std::allocator<doris::TTypeNode>> = {<__gnu_cxx::new_allocator<doris::TTypeNode>> = {<No data fields>}, <No data fields>}, _M_start = 0x0, _M_finish = 0x0, _M_end_of_storage = 0x0}}, <No data fields>}, 
        __isset = {types = false}}, update_fn_symbol = {static npos = 18446744073709551615, _M_dataplus = {<std::allocator<char>> = {<__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data fields>}, _M_p = 0x1c89aa38 ""}, 
        _M_string_length = 0, {_M_local_buf = '\000' <repeats 15 times>, _M_allocated_capacity = 0}}, init_fn_symbol = {static npos = 18446744073709551615, 
        _M_dataplus = {<std::allocator<char>> = {<__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data fields>}, _M_p = 0x1c89aa58 ""}, _M_string_length = 0, {_M_local_buf = '\000' <repeats 15 times>, 
          _M_allocated_capacity = 0}}, serialize_fn_symbol = {static npos = 18446744073709551615, _M_dataplus = {<std::allocator<char>> = {<__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data fields>}, 
          _M_p = 0x1c89aa78 ""}, _M_string_length = 0, {_M_local_buf = '\000' <repeats 15 times>, _M_allocated_capacity = 0}}, merge_fn_symbol = {static npos = 18446744073709551615, 
        _M_dataplus = {<std::allocator<char>> = {<__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data fields>}, _M_p = 0x1c89aa98 ""}, _M_string_length = 0, {_M_local_buf = '\000' <repeats 15 times>, 
          _M_allocated_capacity = 0}}, finalize_fn_symbol = {static npos = 18446744073709551615, _M_dataplus = {<std::allocator<char>> = {<__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data fields>}, 
          _M_p = 0x1c89aab8 ""}, _M_string_length = 0, {_M_local_buf = '\000' <repeats 15 times>, _M_allocated_capacity = 0}}, get_value_fn_symbol = {static npos = 18446744073709551615, 
        _M_dataplus = {<std::allocator<char>> = {<__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data fields>}, _M_p = 0x1c89aad8 ""}, _M_string_length = 0, {_M_local_buf = '\000' <repeats 15 times>, 
          _M_allocated_capacity = 0}}, remove_fn_symbol = {static npos = 18446744073709551615, _M_dataplus = {<std::allocator<char>> = {<__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data fields>}, 
          _M_p = 0x1c89aaf8 ""}, _M_string_length = 0, {_M_local_buf = '\000' <repeats 15 times>, _M_allocated_capacity = 0}}, is_analytic_only_fn = false, __isset = {update_fn_symbol = false, init_fn_symbol = false, 
        serialize_fn_symbol = false, merge_fn_symbol = false, finalize_fn_symbol = false, get_value_fn_symbol = false, remove_fn_symbol = false, is_analytic_only_fn = true}}, id = 0, checksum = {static npos = 18446744073709551615, 
      _M_dataplus = {<std::allocator<char>> = {<__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data fields>}, _M_p = 0x1c89ab28 ""}, _M_string_length = 0, {_M_local_buf = '\000' <repeats 15 times>, 
        _M_allocated_capacity = 0}}, __isset = {comment = false, signature = true, hdfs_location = false, scalar_fn = true, aggregate_fn = false, id = true, checksum = false}}, _fn_context_index = 5, 
  _constant_val = {<std::__shared_ptr<doris_udf::AnyVal, (__gnu_cxx::_Lock_policy)2>> = {<std::__shared_ptr_access<doris_udf::AnyVal, (__gnu_cxx::_Lock_policy)2, false, false>> = {<No data fields>}, _M_ptr = 0x0, _M_refcount = {
        _M_pi = 0x0}}, <No data fields>}, _vector_compute_fn = 0x0, _fn_ctx_idx = -1, _fn_ctx_idx_start = 0, _fn_ctx_idx_end = 0}
(gdb) p *this
$2 = {_context = 0xa690780, _disjuncts_num = 0, _tuple_desc = 0x1784b650, _disjuncts = {<std::_Vector_base<doris::ExtPredicate*, std::allocator<doris::ExtPredicate*> >> = {
      _M_impl = {<std::allocator<doris::ExtPredicate*>> = {<__gnu_cxx::new_allocator<doris::ExtPredicate*>> = {<No data fields>}, <No data fields>}, _M_start = 0x0, _M_finish = 0x0, _M_end_of_storage = 0x0}}, <No data fields>}, 
  _es_query_status = {_state = 0x0}, _pool = 0xa40ae40, _field_context = {_M_t = {
      _M_impl = {<std::allocator<std::_Rb_tree_node<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >> = {<__gnu_cxx::new_allocator<std::_Rb_tree_node<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >> = {<No data fields>}, <No data fields>}, <std::_Rb_tree_key_compare<std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >> = {
          _M_key_compare = {<std::binary_function<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool>> = {<No data fields>}, <No data fields>}}, <std::_Rb_tree_header> = {_M_header = {_M_color = std::_S_red, _M_parent = 0x0, _M_left = 0x8160f98, _M_right = 0x8160f98}, _M_node_count = 0}, <No data fields>}}}}

this->_disjuncts is empty so it can be inferred that the function get_slot_desc returns null

wuyunfeng commented 4 years ago

I guess we should add the checking nullptr logic for slot_desc