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/06 19:49:00 UTC

[jira] [Commented] (IMPALA-11230) Crash in partitioned top-N codegen'd code

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

Joe McDonnell commented on IMPALA-11230:
----------------------------------------

The piece of IMPALA-10961 that fixed this are these lines:
{noformat}
  int ALWAYS_INLINE Compare(const TupleRow* lhs, const TupleRow* rhs) const {
-    return Compare(nullptr, nullptr, lhs, rhs);
+    return Compare(
+        ordering_expr_evals_lhs_.data(), ordering_expr_evals_rhs_.data(), lhs, rhs);
  }{noformat}
Passing in nullptr for the two ScalarExprEvaluators causes the problem. The ScalarExprEvaluators are not used by some expression evaluations, so the optimization passes remove them (and the corresponding null dereferences). However, some statements do need the ScalarExprEvaluators, and they crash with a SIGSEGV. This also reproduces easily when running with "--disable_optimization_passes=true"

> Crash in partitioned top-N codegen'd code
> -----------------------------------------
>
>                 Key: IMPALA-11230
>                 URL: https://issues.apache.org/jira/browse/IMPALA-11230
>             Project: IMPALA
>          Issue Type: Bug
>          Components: Backend
>    Affects Versions: Impala 4.1.0
>            Reporter: Joe McDonnell
>            Assignee: Joe McDonnell
>            Priority: Critical
>
> Users reported a crash for a query with the partitioned top-N codegen'd code with the following stack:
> {noformat}
> Crash reason:  SIGSEGV
> Crash address: 0x0
> Process uptime: not availableThread 579 (crashed)
>  0  0x7f2a53d3c555
>     rax = 0x000000002b89df00   rdx = 0x0000000031a7b227
>     rcx = 0x0000000031a7b227   rbx = 0x0000000000000000
>     rsi = 0x0000000000000000   rdi = 0x0000000000000000
>     rbp = 0x000000002b89df00   rsp = 0x00007f2a2a09d2a0
>      r8 = 0x00007f2a2a09d2e8    r9 = 0x0000000034f59260
>     r10 = 0x0000000000000000   r11 = 0x00007f2bacab2590
>     r12 = 0x00007f2a2a09d2e8   r13 = 0x00000000510ea910
>     r14 = 0x0000000000000000   r15 = 0x00000000243c5b01
>     rip = 0x00007f2a53d3c555
>     Found by: given as instruction pointer in context
>  1  impalad!impala::TopNNode::Open(impala::RuntimeState*) [topn-node.cc : 325 + 0xb]
>     rsp = 0x00007f2a2a09d370   rip = 0x00000000018a339e
>     Found by: stack scanning
>  2  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&) [char_traits.h : 310 + 0x9]
>     rsp = 0x00007f2a2a09d3d0   rip = 0x0000000000cf1d01
>     Found by: stack scanning{noformat}
> After some investigation, the following query reproduces the issue on historical Impala releases (such as Impala 4.0):
> {noformat}
> select count(*) from (select row_number() OVER (PARTITION BY l_partkey, l_suppkey ORDER BY CASE WHEN l_shipmode IN ('MAIL', 'AIR') THEN 1 ELSE 0 END DESC) RN FROM tpch.lineitem) c WHERE c.rn = 1;{noformat}
> This issue does not reproduce on the master branch, and we have determined that the commit for IMPALA-10961 fixed this issue.
> This Jira tracks adding test cases for this issue.



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