You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues-all@impala.apache.org by "Joe McDonnell (Jira)" <ji...@apache.org> on 2022/04/04 17:51:00 UTC

[jira] [Commented] (IMPALA-11222) Use -fno-omit-frame-pointer for LLVM IR generation

    [ https://issues.apache.org/jira/browse/IMPALA-11222?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17516982#comment-17516982 ] 

Joe McDonnell commented on IMPALA-11222:
----------------------------------------

Example with "-fno-omit-frame-pointer":
{noformat}
Thread 499 (crashed)
 0  0x7f4227e8c883
    rax = 0x00000000158de960   rdx = 0x0000000000000001
    rcx = 0x0000000000000000   rbx = 0x00000000158de960
    rsi = 0x0000000000000000   rdi = 0x000000000b813000
    rbp = 0x00007f413ad563c0   rsp = 0x00007f413ad56330
     r8 = 0x00000000004f0000    r9 = 0xffffffffffffe000
    r10 = 0x00007f413ad563b0   r11 = 0x0000000000000001
    r12 = 0x00007f413ad56388   r13 = 0x000000000bc6e400
    r14 = 0x00007f413ad565b0   r15 = 0x00000000158de960
    rip = 0x00007f4227e8c883
    Found by: given as instruction pointer in context
 1  impalad!impala::TopNNode::Open(impala::RuntimeState*) [topn-node.cc : 325 + 0xb]
    rbp = 0x00007f413ad56580   rsp = 0x00007f413ad563d0
    rip = 0x00000000018935fe
    Found by: previous frame's frame pointer
 2  impalad!impala::FragmentInstanceState::Open() [fragment-instance-state.cc : 426 + 0x11]
    rbx = 0x000000000d9638e0   rbp = 0x00007f413ad56740
    rsp = 0x00007f413ad56590   r12 = 0x00007f413ad56650
    r13 = 0x000000000db3cd00   r14 = 0x00007f413ad565b0
    r15 = 0x0000000010cd8000   rip = 0x000000000129dc53
    Found by: call frame info
 3  impalad!impala::FragmentInstanceState::Exec() [fragment-instance-state.cc : 95 + 0xf]
    rbx = 0x000000000d9638e0   rbp = 0x00007f413ad56800
    rsp = 0x00007f413ad56750   r12 = 0x00007f413ad56848
    r13 = 0x000000000df99800   r14 = 0x00007f413ad56790
    r15 = 0x0000000010cd8000   rip = 0x000000000129fb2d
    Found by: call frame info
 4  impalad!impala::QueryState::ExecFInstance(impala::FragmentInstanceState*) [query-state.cc : 955 + 0x19]
    rbx = 0x00007f413ad56870   rbp = 0x00007f413ad568d0
    rsp = 0x00007f413ad56810   r12 = 0x000000000d9638e0
    r13 = 0x00007f413ad56850   r14 = 0x000000000637d5d0
    r15 = 0x0000000010cd8000   rip = 0x0000000001225ad1
    Found by: call frame info
 5  impalad!impala::Thread::SuperviseThread(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> > const&, boost::function<void ()>, impala::ThreadDebugInfo const*, impala::Promise<long, (impala::PromiseMode)0>*) [function_template.hpp : 763 + 0x7]
    rbx = 0x00007f413ad56960   rbp = 0x00007f413ad56bd0
    rsp = 0x00007f413ad568e0   r12 = 0x00007f413ad56940
    r13 = 0x0000000006d25680   r14 = 0x00007f4257bd0070
    r15 = 0x00007f413b556e78   rip = 0x000000000170ffb2
    Found by: call frame info
 6  impalad!boost::detail::thread_data<boost::_bi::bind_t<void, void (*)(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> > const&, boost::function<void ()>, impala::ThreadDebugInfo const*, impala::Promise<long, (impala::PromiseMode)0>*), boost::_bi::list5<boost::_bi::value<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, boost::_bi::value<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, boost::_bi::value<boost::function<void ()> >, boost::_bi::value<impala::ThreadDebugInfo*>, boost::_bi::value<impala::Promise<long, (impala::PromiseMode)0>*> > > >::run() [bind.hpp : 531 + 0xc]
    rbx = 0x000000000ef41340   rbp = 0x00007f413ad56c30
    rsp = 0x00007f413ad56be0   r12 = 0x00007f413ad56be0
    r13 = 0x000000000170fcb0   r14 = 0x00007f413b557960
    r15 = 0x00007f413b556e40   rip = 0x00000000017114ab
    Found by: call frame info
 7  impalad!thread_proxy + 0xa1
    rbx = 0x0000000000000000   rbp = 0x000000000ef41340
    rsp = 0x00007f413ad56c40   r12 = 0x00007f413ad56d40
    r13 = 0x0000000011271940   r14 = 0x000000000ef41340
    r15 = 0x00007f413b556ab0   rip = 0x0000000001fad491
    Found by: call frame info
 8  libpthread-2.27.so!start_thread + 0xdb
    rbx = 0x0000000000000000   rbp = 0x0000000000000000
    rsp = 0x00007f413ad56c80   r12 = 0x00007f413ad56d40
    r13 = 0x0000000000000000   r14 = 0x000000000ef41340
    r15 = 0x00007f413b556ab0   rip = 0x00007f4257bc86db
    Found by: call frame info
 9  libc-2.27.so + 0x12161f
    rbx = 0x00007f413ad57700   rbp = 0x0000000000000000
    rsp = 0x00007f413ad56d40   r12 = 0x00007f413ad56d40
    r13 = 0x0000000000000000   r14 = 0x000000000ef41340
    r15 = 0x00007f413b556ab0   rip = 0x00007f425445e61f
    Found by: call frame info{noformat}

> Use -fno-omit-frame-pointer for LLVM IR generation
> --------------------------------------------------
>
>                 Key: IMPALA-11222
>                 URL: https://issues.apache.org/jira/browse/IMPALA-11222
>             Project: IMPALA
>          Issue Type: Improvement
>          Components: Backend
>    Affects Versions: Impala 4.1.0
>            Reporter: Joe McDonnell
>            Priority: Major
>
> When there is a crash in codegen'd code, the minidump's stack trace often does not cleanly hook up with the regular code that called into codegen. It can sometimes find the first frame through stack scanning, but then it often also finds garbage:
> {noformat}
> Thread 499 (crashed)
>  0  0x7fd40930df9c
>     rax = 0x00000000048d1d80   rdx = 0x0000000000000001
>     rcx = 0x0000000000000000   rbx = 0x000000000cf83960
>     rsi = 0x0000000000000000   rdi = 0x000000000ab04000
>     rbp = 0x0000000000000000   rsp = 0x00007fd31c1dc340
>      r8 = 0x00000000001d0000    r9 = 0xffffffffffffe000
>     r10 = 0x00007fd31c1dc3b0   r11 = 0x0000000000000001
>     r12 = 0x00000000034a34f0   r13 = 0x000000000c613800
>     r14 = 0x000000000cf83960   r15 = 0x000000000c613a98
>     rip = 0x00007fd40930df9c
>     Found by: given as instruction pointer in context
>  1  linux-gate.so + 0xc30
>     rsp = 0x00007fd31c1dc350   rip = 0x00007ffd41f73c30
>     Found by: stack scanning
>  2  impalad!impala::TopNNode::Open(impala::RuntimeState*) [topn-node.cc : 325 + 0xb]
>     rsp = 0x00007fd31c1dc3d0   rip = 0x00000000018935fe
>     Found by: stack scanning
>  3  impalad!std::pair<std::_Rb_tree_iterator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, bool> std::_Rb_tree<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::_Identity<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::less<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_insert_unique<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> > const&) [stl_tree.h : 2049 + 0x1]
>     rsp = 0x00007fd31c1dc430   rip = 0x0000000000cd5d01
>     Found by: stack scanning{noformat}
> If we add "-fno-omit-frame-pointer" to the LLVM IR compilation (i.e. CLANG_IR_CXX_FLAGS), the minidump cleanly resolves the connection to the regular code. This would be very useful for debugging and performance tracing work.
> A basic small scale TPC-H (42) on parquet shows no regression. We should double-check performance impacts. Unless there is a clear performance problem, we should add "-fno-omit-frame-pointer".



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-all-unsubscribe@impala.apache.org
For additional commands, e-mail: issues-all-help@impala.apache.org