impala-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jim Apple (Code Review)" <ger...@cloudera.org>
Subject [Impala-ASF-CR] IMPALA-5031: Remove undefined behavior: left shift of negative values
Date Sun, 26 Mar 2017 15:13:23 GMT
Jim Apple has posted comments on this change.

Change subject: IMPALA-5031: Remove undefined behavior: left shift of negative values
......................................................................


Patch Set 1:

(4 comments)

http://gerrit.cloudera.org:8080/#/c/6491/1/be/src/exec/read-write-util.cc
File be/src/exec/read-write-util.cc:

Line 96:   uint32_t uinteger = (static_cast<uint32_t>(integer) << 1) ^ (integer
>> 31);
Backtrace:

    /home/ubuntu/Impala/be/src/exec/read-write-util.cc:96:32: runtime error: left shift of
negative value -2147483648
    #0 0x2b3594e16150 in impala::ReadWriteUtil::PutZInt(int, unsigned char*) /home/ubuntu/Impala/be/src/exec/read-write-util.cc:96:32
    #1 0x7add56 in impala::TestZInt(int) /home/ubuntu/Impala/be/src/exec/zigzag-test.cc:42:14
    #2 0x7b0b57 in impala::ZigzagTest_Basic_Test::TestBody() /home/ubuntu/Impala/be/src/exec/zigzag-test.cc:83:3
    #3 0x189e512 in void testing::internal::HandleExceptionsInMethodIfSupported<testing::Test,
void>(testing::Test*, void (testing::Test::*)(), char const*) (/home/ubuntu/Impala/be/build/debug/exec/zigzag-test+0x189e512)
    #4 0x1895089 in testing::Test::Run() (/home/ubuntu/Impala/be/build/debug/exec/zigzag-test+0x1895089)
    #5 0x18951d7 in testing::TestInfo::Run() (/home/ubuntu/Impala/be/build/debug/exec/zigzag-test+0x18951d7)
    #6 0x18952b4 in testing::TestCase::Run() (/home/ubuntu/Impala/be/build/debug/exec/zigzag-test+0x18952b4)
    #7 0x1896537 in testing::internal::UnitTestImpl::RunAllTests() (/home/ubuntu/Impala/be/build/debug/exec/zigzag-test+0x1896537)
    #8 0x1896812 in testing::UnitTest::Run() (/home/ubuntu/Impala/be/build/debug/exec/zigzag-test+0x1896812)
    #9 0x7b3271 in main /home/ubuntu/Impala/be/src/exec/zigzag-test.cc:166:156
    #10 0x2b359f9fdf44 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21f44)
    #11 0x78b0a1 in _start (/home/ubuntu/Impala/be/build/debug/exec/zigzag-test+0x78b0a1)


Line 113:   uint64_t ulongint = (static_cast<uint64_t>(longint) << 1) ^ (longint
>> 63);
Backtrace:

    /home/ubuntu/Impala/be/src/exec/read-write-util.cc:113:32: runtime error: left shift of
negative value -9223372036854775808
    #0 0x2b3594e163d9 in impala::ReadWriteUtil::PutZLong(long, unsigned char*) /home/ubuntu/Impala/be/src/exec/read-write-util.cc:113:32
    #1 0x7af178 in impala::TestZLong(long) /home/ubuntu/Impala/be/src/exec/zigzag-test.cc:58:14
    #2 0x7b0c59 in impala::ZigzagTest_Basic_Test::TestBody() /home/ubuntu/Impala/be/src/exec/zigzag-test.cc:88:3
    #3 0x189e512 in void testing::internal::HandleExceptionsInMethodIfSupported<testing::Test,
void>(testing::Test*, void (testing::Test::*)(), char const*) (/home/ubuntu/Impala/be/build/debug/exec/zigzag-test+0x189e512)
    #4 0x1895089 in testing::Test::Run() (/home/ubuntu/Impala/be/build/debug/exec/zigzag-test+0x1895089)
    #5 0x18951d7 in testing::TestInfo::Run() (/home/ubuntu/Impala/be/build/debug/exec/zigzag-test+0x18951d7)
    #6 0x18952b4 in testing::TestCase::Run() (/home/ubuntu/Impala/be/build/debug/exec/zigzag-test+0x18952b4)
    #7 0x1896537 in testing::internal::UnitTestImpl::RunAllTests() (/home/ubuntu/Impala/be/build/debug/exec/zigzag-test+0x1896537)
    #8 0x1896812 in testing::UnitTest::Run() (/home/ubuntu/Impala/be/build/debug/exec/zigzag-test+0x1896812)
    #9 0x7b3271 in main /home/ubuntu/Impala/be/src/exec/zigzag-test.cc:166:156
    #10 0x2b359f9fdf44 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21f44)
    #11 0x78b0a1 in _start (/home/ubuntu/Impala/be/build/debug/exec/zigzag-test+0x78b0a1)


http://gerrit.cloudera.org:8080/#/c/6491/1/be/src/exec/zigzag-test.cc
File be/src/exec/zigzag-test.cc:

Line 101:     TestZLong((static_cast<uint64_t>(value) << 32) | value);
Backtrace:

    /home/ubuntu/Impala/be/src/exec/zigzag-test.cc:101:44: runtime error: left shift of negative
value -869531757
    #0 0x7b0e5a in impala::ZigzagTest_Basic_Test::TestBody() /home/ubuntu/Impala/be/src/exec/zigzag-test.cc:101:44
    #1 0x189e512 in void testing::internal::HandleExceptionsInMethodIfSupported<testing::Test,
void>(testing::Test*, void (testing::Test::*)(), char const*) (/home/ubuntu/Impala/be/build/debug/exec/zigzag-test+0x189e512)
    #2 0x1895089 in testing::Test::Run() (/home/ubuntu/Impala/be/build/debug/exec/zigzag-test+0x1895089)
    #3 0x18951d7 in testing::TestInfo::Run() (/home/ubuntu/Impala/be/build/debug/exec/zigzag-test+0x18951d7)
    #4 0x18952b4 in testing::TestCase::Run() (/home/ubuntu/Impala/be/build/debug/exec/zigzag-test+0x18952b4)
    #5 0x1896537 in testing::internal::UnitTestImpl::RunAllTests() (/home/ubuntu/Impala/be/build/debug/exec/zigzag-test+0x1896537)
    #6 0x1896812 in testing::UnitTest::Run() (/home/ubuntu/Impala/be/build/debug/exec/zigzag-test+0x1896812)
    #7 0x7b3271 in main /home/ubuntu/Impala/be/src/exec/zigzag-test.cc:166:156
    #8 0x2b359f9fdf44 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21f44)
    #9 0x78b0a1 in _start (/home/ubuntu/Impala/be/build/debug/exec/zigzag-test+0x78b0a1)


http://gerrit.cloudera.org:8080/#/c/6491/1/be/src/exprs/bit-byte-functions-ir.cc
File be/src/exprs/bit-byte-functions-ir.cc:

Line 161
Backtrace:

    /home/ubuntu/Impala/be/src/exprs/bit-byte-functions-ir.cc:161:52: runtime error: left
shift of negative value -128
    #0 0x2b02fd43313b in signed char impala::RotateRightImpl<signed char>(signed char,
int) /home/ubuntu/Impala/be/src/exprs/bit-byte-functions-ir.cc:161:52
    #1 0x2b02fd432fe1 in impala::BitByteFunctions::RotateRight(impala_udf::FunctionContext*,
impala_udf::TinyIntVal const&, impala_udf::IntVal const&) /home/ubuntu/Impala/be/src/exprs/bit-byte-functions-ir.cc:191:185
    #2 0x2b02fd7c530b in impala_udf::TinyIntVal impala::ScalarFnCall::InterpretEval<impala_udf::TinyIntVal>(impala::ExprContext*,
impala::TupleRow const*) /home/ubuntu/Impala/be/src/exprs/scalar-fn-call.cc:492:376
    #3 0x2b02fd7a0954 in impala::ScalarFnCall::GetTinyIntVal(impala::ExprContext*, impala::TupleRow
const*) /home/ubuntu/Impala/be/src/exprs/scalar-fn-call.cc:550:44
    #4 0x2b02fd55c03e in impala::ExprContext::GetValue(impala::Expr*, impala::TupleRow const*)
/home/ubuntu/Impala/be/src/exprs/expr-context.cc:240:34
    #5 0x2b02fd55baec in impala::ExprContext::GetValue(impala::TupleRow const*) /home/ubuntu/Impala/be/src/exprs/expr-context.cc:228:10
    #6 0x2b02f8abbcdf in void impala::Tuple::MaterializeExprs<false, false>(impala::TupleRow*,
impala::TupleDescriptor const&, impala::ExprContext* const*, impala::MemPool*, impala::StringValue**,
int*, int*) /home/ubuntu/Impala/be/src/runtime/tuple.cc:219:17
    #7 0x2b02fb30c41e in void impala::Tuple::MaterializeExprs<false, false>(impala::TupleRow*,
impala::TupleDescriptor const&, std::vector<impala::ExprContext*, std::allocator<impala::ExprContext*>
> const&, impala::MemPool*, std::vector<impala::StringValue*, std::allocator<impala::StringValue*>
>*, int*) /home/ubuntu/Impala/be/src/runtime/tuple.h:151:5
    #8 0x2b02fb31f394 in impala::UnionNode::MaterializeExprs(std::vector<impala::ExprContext*,
std::allocator<impala::ExprContext*> > const&, impala::TupleRow*, unsigned char*,
impala::RowBatch*) /home/ubuntu/Impala/be/src/exec/union-node.cc:200:3
    #9 0x2b02fb31a139 in impala::UnionNode::GetNext(impala::RuntimeState*, impala::RowBatch*,
bool*) /home/ubuntu/Impala/be/src/exec/union-node.cc:178:7
    #10 0x2b02f890f561 in impala::PlanFragmentExecutor::ExecInternal() /home/ubuntu/Impala/be/src/runtime/plan-fragment-executor.cc:360:16
    #11 0x2b02f890dfed in impala::PlanFragmentExecutor::Exec() /home/ubuntu/Impala/be/src/runtime/plan-fragment-executor.cc:337:14
    #12 0x2b02f885064a in impala::FragmentInstanceState::Exec() /home/ubuntu/Impala/be/src/runtime/fragment-instance-state.cc:68:7
    #13 0x2b02f892eb6c in impala::QueryExecMgr::ExecFInstance(impala::FragmentInstanceState*)
/home/ubuntu/Impala/be/src/runtime/query-exec-mgr.cc:110:3
    #14 0x2b02f893449e in boost::_mfi::mf1<void, impala::QueryExecMgr, impala::FragmentInstanceState*>::operator()(impala::QueryExecMgr*,
impala::FragmentInstanceState*) const /home/ubuntu/Impala/toolchain/boost-1.57.0-p1/include/boost/bind/mem_fn_template.hpp:165:16
    #15 0x2b02f89342f8 in void boost::_bi::list2<boost::_bi::value<impala::QueryExecMgr*>,
boost::_bi::value<impala::FragmentInstanceState*> >::operator()<boost::_mfi::mf1<void,
impala::QueryExecMgr, impala::FragmentInstanceState*>, boost::_bi::list0>(boost::_bi::type<void>,
boost::_mfi::mf1<void, impala::QueryExecMgr, impala::FragmentInstanceState*>&, boost::_bi::list0&,
int) /home/ubuntu/Impala/toolchain/boost-1.57.0-p1/include/boost/bind/bind.hpp:313:9
    #16 0x2b02f8933fab in boost::_bi::bind_t<void, boost::_mfi::mf1<void, impala::QueryExecMgr,
impala::FragmentInstanceState*>, boost::_bi::list2<boost::_bi::value<impala::QueryExecMgr*>,
boost::_bi::value<impala::FragmentInstanceState*> > >::operator()() /home/ubuntu/Impala/toolchain/boost-1.57.0-p1/include/boost/bind/bind_template.hpp:20:16
    #17 0x2b02f8933389 in boost::detail::function::void_function_obj_invoker0<boost::_bi::bind_t<void,
boost::_mfi::mf1<void, impala::QueryExecMgr, impala::FragmentInstanceState*>, boost::_bi::list2<boost::_bi::value<impala::QueryExecMgr*>,
boost::_bi::value<impala::FragmentInstanceState*> > >, void>::invoke(boost::detail::function::function_buffer&)
/home/ubuntu/Impala/toolchain/boost-1.57.0-p1/include/boost/function/function_template.hpp:153:11
    #18 0x2b02f70085d4 in boost::function0<void>::operator()() const /home/ubuntu/Impala/toolchain/boost-1.57.0-p1/include/boost/function/function_template.hpp:766:14
    #19 0x2b02f6ff9710 in impala::Thread::SuperviseThread(std::string const&, std::string
const&, boost::function<void ()>, impala::Promise<long>*) /home/ubuntu/Impala/be/src/util/thread.cc:325:3
    #20 0x2b02f7021783 in void boost::_bi::list4<boost::_bi::value<std::string>,
boost::_bi::value<std::string>, boost::_bi::value<boost::function<void ()>
>, boost::_bi::value<impala::Promise<long>*> >::operator()<void (*)(std::string
const&, std::string const&, boost::function<void ()>, impala::Promise<long>*),
boost::_bi::list0>(boost::_bi::type<void>, void (*&)(std::string const&,
std::string const&, boost::function<void ()>, impala::Promise<long>*), boost::_bi::list0&,
int) /home/ubuntu/Impala/toolchain/boost-1.57.0-p1/include/boost/bind/bind.hpp:457:9
    #21 0x2b02f70210ab in boost::_bi::bind_t<void, void (*)(std::string const&, std::string
const&, boost::function<void ()>, impala::Promise<long>*), boost::_bi::list4<boost::_bi::value<std::string>,
boost::_bi::value<std::string>, boost::_bi::value<boost::function<void ()>
>, boost::_bi::value<impala::Promise<long>*> > >::operator()() /home/ubuntu/Impala/toolchain/boost-1.57.0-p1/include/boost/bind/bind_template.hpp:20:16
    #22 0x2b02f701faf5 in boost::detail::thread_data<boost::_bi::bind_t<void, void (*)(std::string
const&, std::string const&, boost::function<void ()>, impala::Promise<long>*),
boost::_bi::list4<boost::_bi::value<std::string>, boost::_bi::value<std::string>,
boost::_bi::value<boost::function<void ()> >, boost::_bi::value<impala::Promise<long>*>
> > >::run() /home/ubuntu/Impala/toolchain/boost-1.57.0-p1/include/boost/thread/detail/thread.hpp:116:17
 
    #23 0xfaa189 in thread_proxy (/home/ubuntu/Impala/be/build/debug/exprs/expr-test+0xfaa189)
    #24 0x2b0305c5e183 in start_thread (/lib/x86_64-linux-gnu/libpthread.so.0+0x8183)  
    #25 0x2b0305f6e37c in clone (/lib/x86_64-linux-gnu/libc.so.6+0xfa37c)
    
    [       OK ] ExprTest.BitByteBuiltins (1049 ms)


-- 
To view, visit http://gerrit.cloudera.org:8080/6491
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I9d965c3950a878c0a41b374d51bbe2e5705b3360
Gerrit-PatchSet: 1
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Jim Apple <jbapple-impala@apache.org>
Gerrit-Reviewer: Jim Apple <jbapple-impala@apache.org>
Gerrit-Reviewer: Tim Armstrong <tarmstrong@cloudera.com>
Gerrit-HasComments: Yes

Mime
View raw message