Uploaded image for project: 'IMPALA'
  1. IMPALA
  2. IMPALA-7459

Query with width_bucket() crashes with Check failed: lhs > 0 && rhs > 0

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Blocker
    • Resolution: Fixed
    • Impala 3.1.0
    • Impala 3.1.0
    • Backend
    • ghx-label-9

    Description

      When running a private exhaustive build, decimal_fuzz_test ran into a case which triggers a DCHECK in MathFunctions::WidthBucketImpl().

      select width_bucket(cast(0.3 as decimal(2,2)), cast(0.3 as decimal(5,3)), cast(732.3 as decimal(4,1)), 271287147);
      
      F0817 05:41:55.601862 15604 math-functions-ir.cc:516] Check failed: lhs > 0 && rhs > 0
      lhs seems to be 0 in this case.
      
      (gdb) bt
      #0  0x00007fc24fecdcc9 in raise () from /lib/x86_64-linux-gnu/libc.so.6
      #1  0x00007fc24fed10d8 in abort () from /lib/x86_64-linux-gnu/libc.so.6
      #2  0x00000000043e02f4 in google::DumpStackTraceAndExit() ()
      #3  0x00000000043d6d4d in google::LogMessage::Fail() ()
      #4  0x00000000043d85f2 in google::LogMessage::SendToLog() ()
      #5  0x00000000043d6727 in google::LogMessage::Flush() ()
      #6  0x00000000043d9cee in google::LogMessageFatal::~LogMessageFatal() ()
      #7  0x000000000306f8fa in impala_udf::BigIntVal impala::MathFunctions::WidthBucketImpl<impala::DecimalValue<int> >(impala_udf::FunctionContext*, impala::DecimalValue<int> const&, impala::DecimalValue<int> const&, impala::DecimalValue<int> const&, impala_udf::IntVal const&)::{lambda(int, int)#1}::operator()(int, int) const (__closure=0x7fc1defbd67f, lhs=0, rhs=271287147) at /kwho-desktop-1/trees/src6/incubator-impala/be/src/exprs/math-functions-ir.cc:516
      #8  0x000000000306fcbe in impala::MathFunctions::WidthBucketImpl<impala::DecimalValue<int> > (ctx=0x75cf680, expr=..., min_range=..., max_range=..., num_buckets=...) at /kwho-desktop-1/trees/src6/incubator-impala/be/src/exprs/math-functions-ir.cc:528
      #9  0x000000000306d286 in impala::MathFunctions::WidthBucket (ctx=0x75cf680, expr=..., min_range=..., max_range=..., num_buckets=...) at /kwho-desktop-1/trees/src6/incubator-impala/be/src/exprs/math-functions-ir.cc:559
      #10 0x0000000003007d8d in impala::ScalarFnCall::InterpretEval<impala_udf::BigIntVal> (this=0xc735f80, eval=0xced49c0, row=0x0) at /kwho-desktop-1/trees/src6/incubator-impala/be/src/exprs/scalar-fn-call.cc:485
      #11 0x0000000002ff84d9 in impala::ScalarFnCall::GetBigIntVal (this=0xc735f80, eval=0xced49c0, row=0x0) at /kwho-desktop-1/trees/src6/incubator-impala/be/src/exprs/scalar-fn-call.cc:572
      #12 0x0000000002fa6e49 in impala::ScalarExprEvaluator::GetValue (this=0xced49c0, expr=..., row=0x0) at /kwho-desktop-1/trees/src6/incubator-impala/be/src/exprs/scalar-expr-evaluator.cc:280
      #13 0x0000000002fa6c2b in impala::ScalarExprEvaluator::GetValue (this=0xced49c0, row=0x0) at /kwho-desktop-1/trees/src6/incubator-impala/be/src/exprs/scalar-expr-evaluator.cc:250
      #14 0x0000000001ebc15d in Java_org_apache_impala_service_FeSupport_NativeEvalExprsWithoutRow (env=0xaaf49f8, caller_class=0x7fc1defbe590, thrift_expr_batch=0x7fc1defbe5a8, thrift_query_ctx_bytes=0x7fc1defbe5a0) at /kwho-desktop-1/trees/src6/incubator-impala/be/src/service/fe-support.cc:237
      #15 0x00007fc23bab4aa8 in ?? ()
      #16 0x000000071e5b0c70 in ?? ()
      #17 0x000000071e5b0bf0 in ?? ()
      #18 0x00007fc1defbe540 in ?? ()
      #19 0x0000000000000000 in ?? ()
      

      Attachments

        Issue Links

          Activity

            People

              joemcdonnell Joe McDonnell
              kwho Michael Ho
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: