You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@impala.apache.org by "Jim Apple (Code Review)" <ge...@cloudera.org> on 2017/04/01 13:25:11 UTC

[Impala-ASF-CR] IMPALA-5031: Remove undefined behavior: left shift into the sign bit

Jim Apple has uploaded a new change for review.

  http://gerrit.cloudera.org:8080/6528

Change subject: IMPALA-5031: Remove undefined behavior: left shift into the sign bit
......................................................................

IMPALA-5031: Remove undefined behavior: left shift into the sign bit

Shifting large positive signed values is undefined when the result is
not "representable in the corresponding unsigned type of the result
type". Left shift of unsigned values is always defined. See the C++14
standard, section 5.8 [expr.shift], paragraph 2.

Change-Id: I748697cf503e9e717a6e95250c2cbbf031c6352d
---
M be/src/exprs/bit-byte-functions-ir.cc
1 file changed, 3 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/28/6528/1
-- 
To view, visit http://gerrit.cloudera.org:8080/6528
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I748697cf503e9e717a6e95250c2cbbf031c6352d
Gerrit-PatchSet: 1
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Jim Apple <jb...@apache.org>

[Impala-ASF-CR] IMPALA-5031: Remove undefined behavior: left shift into the sign bit

Posted by "Tim Armstrong (Code Review)" <ge...@cloudera.org>.
Tim Armstrong has posted comments on this change.

Change subject: IMPALA-5031: Remove undefined behavior: left shift into the sign bit
......................................................................


Patch Set 1:

(2 comments)

Thanks for fixing this!

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

Line 151:   return (static_cast<std::make_unsigned_t<T>>(v) << shift)
> In ExprTest.BitByteBuiltins:
There's an implicit conversion back to the signed return type. I think it would be clearer if that was explicit.


Line 170:   return static_cast<std::make_unsigned_t<T>>(v) << shift;
> In ExprTest.BitByteBuiltins:
Same here


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I748697cf503e9e717a6e95250c2cbbf031c6352d
Gerrit-PatchSet: 1
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Jim Apple <jb...@apache.org>
Gerrit-Reviewer: Jim Apple <jb...@apache.org>
Gerrit-Reviewer: Lars Volker <lv...@cloudera.com>
Gerrit-Reviewer: Tim Armstrong <ta...@cloudera.com>
Gerrit-HasComments: Yes

[Impala-ASF-CR] IMPALA-5031: Remove undefined behavior: left shift of large signed

Posted by "Jim Apple (Code Review)" <ge...@cloudera.org>.
Jim Apple has submitted this change and it was merged.

Change subject: IMPALA-5031: Remove undefined behavior: left shift of large signed
......................................................................


IMPALA-5031: Remove undefined behavior: left shift of large signed

Shifting large positive signed values is undefined when the result is
not "representable in the corresponding unsigned type of the result
type". Left shift of unsigned values is always defined. See the C++14
standard, section 5.8 [expr.shift], paragraph 2.

Change-Id: I748697cf503e9e717a6e95250c2cbbf031c6352d
Reviewed-on: http://gerrit.cloudera.org:8080/6528
Tested-by: Impala Public Jenkins
Reviewed-by: Jim Apple <jb...@apache.org>
---
M be/src/exprs/bit-byte-functions-ir.cc
1 file changed, 5 insertions(+), 5 deletions(-)

Approvals:
  Impala Public Jenkins: Verified
  Jim Apple: Looks good to me, approved



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

Gerrit-MessageType: merged
Gerrit-Change-Id: I748697cf503e9e717a6e95250c2cbbf031c6352d
Gerrit-PatchSet: 4
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Jim Apple <jb...@apache.org>
Gerrit-Reviewer: Impala Public Jenkins
Gerrit-Reviewer: Jim Apple <jb...@apache.org>
Gerrit-Reviewer: Lars Volker <lv...@cloudera.com>
Gerrit-Reviewer: Tim Armstrong <ta...@cloudera.com>

[Impala-ASF-CR] IMPALA-5031: Remove undefined behavior: left shift of large signed

Posted by "Jim Apple (Code Review)" <ge...@cloudera.org>.
Jim Apple has posted comments on this change.

Change subject: IMPALA-5031: Remove undefined behavior: left shift of large signed
......................................................................


Patch Set 3: Code-Review+2

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I748697cf503e9e717a6e95250c2cbbf031c6352d
Gerrit-PatchSet: 3
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Jim Apple <jb...@apache.org>
Gerrit-Reviewer: Impala Public Jenkins
Gerrit-Reviewer: Jim Apple <jb...@apache.org>
Gerrit-Reviewer: Lars Volker <lv...@cloudera.com>
Gerrit-Reviewer: Tim Armstrong <ta...@cloudera.com>
Gerrit-HasComments: No

[Impala-ASF-CR] IMPALA-5031: Remove undefined behavior: left shift of large signed

Posted by "Jim Apple (Code Review)" <ge...@cloudera.org>.
Jim Apple has posted comments on this change.

Change subject: IMPALA-5031: Remove undefined behavior: left shift of large signed
......................................................................


Patch Set 2:

(2 comments)

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

Line 151:   return static_cast<T>((static_cast<std::make_unsigned_t<T>>(v) << shift)
> There's an implicit conversion back to the signed return type. I think it w
Done


Line 170: }
> Same here
Done


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I748697cf503e9e717a6e95250c2cbbf031c6352d
Gerrit-PatchSet: 2
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Jim Apple <jb...@apache.org>
Gerrit-Reviewer: Jim Apple <jb...@apache.org>
Gerrit-Reviewer: Lars Volker <lv...@cloudera.com>
Gerrit-Reviewer: Tim Armstrong <ta...@cloudera.com>
Gerrit-HasComments: Yes

[Impala-ASF-CR] IMPALA-5031: Remove undefined behavior: left shift of large signed

Posted by "Jim Apple (Code Review)" <ge...@cloudera.org>.
Jim Apple has posted comments on this change.

Change subject: IMPALA-5031: Remove undefined behavior: left shift of large signed
......................................................................


Patch Set 3:

carry +2

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I748697cf503e9e717a6e95250c2cbbf031c6352d
Gerrit-PatchSet: 3
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Jim Apple <jb...@apache.org>
Gerrit-Reviewer: Jim Apple <jb...@apache.org>
Gerrit-Reviewer: Lars Volker <lv...@cloudera.com>
Gerrit-Reviewer: Tim Armstrong <ta...@cloudera.com>
Gerrit-HasComments: No

[Impala-ASF-CR] IMPALA-5031: Remove undefined behavior: left shift of large signed

Posted by "Impala Public Jenkins (Code Review)" <ge...@cloudera.org>.
Impala Public Jenkins has posted comments on this change.

Change subject: IMPALA-5031: Remove undefined behavior: left shift of large signed
......................................................................


Patch Set 3:

Build started: http://jenkins.impala.io:8080/job/gerrit-verify-dryrun/480/

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I748697cf503e9e717a6e95250c2cbbf031c6352d
Gerrit-PatchSet: 3
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Jim Apple <jb...@apache.org>
Gerrit-Reviewer: Impala Public Jenkins
Gerrit-Reviewer: Jim Apple <jb...@apache.org>
Gerrit-Reviewer: Lars Volker <lv...@cloudera.com>
Gerrit-Reviewer: Tim Armstrong <ta...@cloudera.com>
Gerrit-HasComments: No

[Impala-ASF-CR] IMPALA-5031: Remove undefined behavior: left shift of large signed

Posted by "Tim Armstrong (Code Review)" <ge...@cloudera.org>.
Tim Armstrong has posted comments on this change.

Change subject: IMPALA-5031: Remove undefined behavior: left shift of large signed
......................................................................


Patch Set 2: Code-Review+2

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I748697cf503e9e717a6e95250c2cbbf031c6352d
Gerrit-PatchSet: 2
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Jim Apple <jb...@apache.org>
Gerrit-Reviewer: Jim Apple <jb...@apache.org>
Gerrit-Reviewer: Lars Volker <lv...@cloudera.com>
Gerrit-Reviewer: Tim Armstrong <ta...@cloudera.com>
Gerrit-HasComments: No

[Impala-ASF-CR] IMPALA-5031: Remove undefined behavior: left shift into the sign bit

Posted by "Jim Apple (Code Review)" <ge...@cloudera.org>.
Jim Apple has posted comments on this change.

Change subject: IMPALA-5031: Remove undefined behavior: left shift into the sign bit
......................................................................


Patch Set 1:

(2 comments)

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

Line 151:   return (static_cast<std::make_unsigned_t<T>>(v) << shift)
In ExprTest.BitByteBuiltins:

    /home/ubuntu/Impala/be/src/exprs/bit-byte-functions-ir.cc:151:13: runtime error: left shift of 4611686018427387904 by 2 places cannot be represented in type 'long'
    #0 0x2ac0edaf65e2 in long impala::RotateLeftImpl<long>(long, int) /home/ubuntu/Impala/be/src/exprs/bit-byte-functions-ir.cc:151:13
    #1 0x2ac0edaf6494 in impala::BitByteFunctions::RotateLeft(impala_udf::FunctionContext*, impala_udf::BigIntVal const&, impala_udf::IntVal const&) /home/ubuntu/Impala/be/src/exprs/bit-byte-functions-ir.cc:192:180
    #2 0x2ac0eded87df in impala_udf::BigIntVal impala::ScalarFnCall::InterpretEval<impala_udf::BigIntVal>(impala::ExprContext*, impala::TupleRow const*) /home/ubuntu/Impala/be/src/exprs/scalar-fn-call.cc:492:376
    #3 0x2ac0ede634ef in impala::ScalarFnCall::GetBigIntVal(impala::ExprContext*, impala::TupleRow const*) /home/ubuntu/Impala/be/src/exprs/scalar-fn-call.cc:574:44
    #4 0x2ac0edc1f8c1 in impala::ExprContext::GetValue(impala::Expr*, impala::TupleRow const*) /home/ubuntu/Impala/be/src/exprs/expr-context.cc:258:33
    #5 0x2ac0edc1e97c in impala::ExprContext::GetValue(impala::TupleRow const*) /home/ubuntu/Impala/be/src/exprs/expr-context.cc:228:10
    #6 0x2ac0e90bdabf 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 0x2ac0eb96d7be 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 0x2ac0eb989924 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:273:3
    #9 0x2ac0eb982d40 in impala::UnionNode::GetNextConst(impala::RuntimeState*, impala::RowBatch*) /home/ubuntu/Impala/be/src/exec/union-node.cc:230:5
    #10 0x2ac0eb984a92 in impala::UnionNode::GetNext(impala::RuntimeState*, impala::RowBatch*, bool*) /home/ubuntu/Impala/be/src/exec/union-node.cc:259:31
    #11 0x2ac0e8eff3b1 in impala::PlanFragmentExecutor::ExecInternal() /home/ubuntu/Impala/be/src/runtime/plan-fragment-executor.cc:360:16
    #12 0x2ac0e8efde3d in impala::PlanFragmentExecutor::Exec() /home/ubuntu/Impala/be/src/runtime/plan-fragment-executor.cc:337:14
    #13 0x2ac0e8e40b4a in impala::FragmentInstanceState::Exec() /home/ubuntu/Impala/be/src/runtime/fragment-instance-state.cc:68:7
    #14 0x2ac0e8f1e67c in impala::QueryExecMgr::ExecFInstance(impala::FragmentInstanceState*) /home/ubuntu/Impala/be/src/runtime/query-exec-mgr.cc:110:3
    #15 0x2ac0e8f23fbe 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
    #16 0x2ac0e8f23e18 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
    #17 0x2ac0e8f23acb 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
    #18 0x2ac0e8f22ea9 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
    #19 0x2ac0e7565914 in boost::function0<void>::operator()() const /home/ubuntu/Impala/toolchain/boost-1.57.0-p1/include/boost/function/function_template.hpp:766:14
    #20 0x2ac0e7556a50 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
    #21 0x2ac0e757eac3 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
    #22 0x2ac0e757e3eb 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
    #23 0x2ac0e757ce35 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
    #24 0xfa8ba9 in thread_proxy (/home/ubuntu/Impala/be/build/debug/exprs/expr-test+0xfa8ba9)
    #25 0x2ac0f6325183 in start_thread (/lib/x86_64-linux-gnu/libpthread.so.0+0x8183)
    #26 0x2ac0f663537c in clone (/lib/x86_64-linux-gnu/libc.so.6+0xfa37c)


Line 170:   return static_cast<std::make_unsigned_t<T>>(v) << shift;
In ExprTest.BitByteBuiltins:

    /home/ubuntu/Impala/be/src/exprs/bit-byte-functions-ir.cc:169:12: runtime error: left shift of 1073741824 by 2 places cannot be represented in type 'int'
    #0 0x2ac0edaf81c8 in int impala::ShiftLeftImpl<int>(int, int) /home/ubuntu/Impala/be/src/exprs/bit-byte-functions-ir.cc:169:12
    #1 0x2ac0edaf80ce in impala::BitByteFunctions::ShiftLeft(impala_udf::FunctionContext*, impala_udf::IntVal const&, impala_udf::IntVal const&) /home/ubuntu/Impala/be/src/exprs/bit-byte-functions-ir.cc:199:167
    #2 0x2ac0edebd19b in impala_udf::IntVal impala::ScalarFnCall::InterpretEval<impala_udf::IntVal>(impala::ExprContext*, impala::TupleRow const*) /home/ubuntu/Impala/be/src/exprs/scalar-fn-call.cc:492:376
    #3 0x2ac0ede62c74 in impala::ScalarFnCall::GetIntVal(impala::ExprContext*, impala::TupleRow const*) /home/ubuntu/Impala/be/src/exprs/scalar-fn-call.cc:566:44
    #4 0x2ac0edc1f571 in impala::ExprContext::GetValue(impala::Expr*, impala::TupleRow const*) /home/ubuntu/Impala/be/src/exprs/expr-context.cc:252:30
    #5 0x2ac0edc1e97c in impala::ExprContext::GetValue(impala::TupleRow const*) /home/ubuntu/Impala/be/src/exprs/expr-context.cc:228:10
    #6 0x2ac0e90bdabf 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 0x2ac0eb96d7be 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 0x2ac0eb989924 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:273:3
    #9 0x2ac0eb982d40 in impala::UnionNode::GetNextConst(impala::RuntimeState*, impala::RowBatch*) /home/ubuntu/Impala/be/src/exec/union-node.cc:230:5
    #10 0x2ac0eb984a92 in impala::UnionNode::GetNext(impala::RuntimeState*, impala::RowBatch*, bool*) /home/ubuntu/Impala/be/src/exec/union-node.cc:259:31
    #11 0x2ac0e8eff3b1 in impala::PlanFragmentExecutor::ExecInternal() /home/ubuntu/Impala/be/src/runtime/plan-fragment-executor.cc:360:16
    #12 0x2ac0e8efde3d in impala::PlanFragmentExecutor::Exec() /home/ubuntu/Impala/be/src/runtime/plan-fragment-executor.cc:337:14
    #13 0x2ac0e8e40b4a in impala::FragmentInstanceState::Exec() /home/ubuntu/Impala/be/src/runtime/fragment-instance-state.cc:68:7
    #14 0x2ac0e8f1e67c in impala::QueryExecMgr::ExecFInstance(impala::FragmentInstanceState*) /home/ubuntu/Impala/be/src/runtime/query-exec-mgr.cc:110:3
    #15 0x2ac0e8f23fbe 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
    #16 0x2ac0e8f23e18 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
    #17 0x2ac0e8f23acb 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
    #18 0x2ac0e8f22ea9 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
    #19 0x2ac0e7565914 in boost::function0<void>::operator()() const /home/ubuntu/Impala/toolchain/boost-1.57.0-p1/include/boost/function/function_template.hpp:766:14
    #20 0x2ac0e7556a50 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
    #21 0x2ac0e757eac3 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
    #22 0x2ac0e757e3eb 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
    #23 0x2ac0e757ce35 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
    #24 0xfa8ba9 in thread_proxy (/home/ubuntu/Impala/be/build/debug/exprs/expr-test+0xfa8ba9)
    #25 0x2ac0f6325183 in start_thread (/lib/x86_64-linux-gnu/libpthread.so.0+0x8183)
    #26 0x2ac0f663537c in clone (/lib/x86_64-linux-gnu/libc.so.6+0xfa37c)

and

    /home/ubuntu/Impala/be/src/exprs/bit-byte-functions-ir.cc:169:12: runtime error: left shift of 4611686018427387904 by 2 places cannot be represented in type 'long'
    #0 0x2ac0edaf85a9 in long impala::ShiftLeftImpl<long>(long, int) /home/ubuntu/Impala/be/src/exprs/bit-byte-functions-ir.cc:169:12
    #1 0x2ac0edaf8494 in impala::BitByteFunctions::ShiftLeft(impala_udf::FunctionContext*, impala_udf::BigIntVal const&, impala_udf::IntVal const&) /home/ubuntu/Impala/be/src/exprs/bit-byte-functions-ir.cc:200:179
    #2 0x2ac0eded87df in impala_udf::BigIntVal impala::ScalarFnCall::InterpretEval<impala_udf::BigIntVal>(impala::ExprContext*, impala::TupleRow const*) /home/ubuntu/Impala/be/src/exprs/scalar-fn-call.cc:492:376
    #3 0x2ac0ede634ef in impala::ScalarFnCall::GetBigIntVal(impala::ExprContext*, impala::TupleRow const*) /home/ubuntu/Impala/be/src/exprs/scalar-fn-call.cc:574:44
    #4 0x2ac0edc1f8c1 in impala::ExprContext::GetValue(impala::Expr*, impala::TupleRow const*) /home/ubuntu/Impala/be/src/exprs/expr-context.cc:258:33
    #5 0x2ac0edc1e97c in impala::ExprContext::GetValue(impala::TupleRow const*) /home/ubuntu/Impala/be/src/exprs/expr-context.cc:228:10
    #6 0x2ac0e90bdabf 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 0x2ac0eb96d7be 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 0x2ac0eb989924 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:273:3
    #9 0x2ac0eb982d40 in impala::UnionNode::GetNextConst(impala::RuntimeState*, impala::RowBatch*) /home/ubuntu/Impala/be/src/exec/union-node.cc:230:5
    #10 0x2ac0eb984a92 in impala::UnionNode::GetNext(impala::RuntimeState*, impala::RowBatch*, bool*) /home/ubuntu/Impala/be/src/exec/union-node.cc:259:31
    #11 0x2ac0e8eff3b1 in impala::PlanFragmentExecutor::ExecInternal() /home/ubuntu/Impala/be/src/runtime/plan-fragment-executor.cc:360:16
    #12 0x2ac0e8efde3d in impala::PlanFragmentExecutor::Exec() /home/ubuntu/Impala/be/src/runtime/plan-fragment-executor.cc:337:14
    #13 0x2ac0e8e40b4a in impala::FragmentInstanceState::Exec() /home/ubuntu/Impala/be/src/runtime/fragment-instance-state.cc:68:7
    #14 0x2ac0e8f1e67c in impala::QueryExecMgr::ExecFInstance(impala::FragmentInstanceState*) /home/ubuntu/Impala/be/src/runtime/query-exec-mgr.cc:110:3
    #15 0x2ac0e8f23fbe 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
    #16 0x2ac0e8f23e18 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
    #17 0x2ac0e8f23acb 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
    #18 0x2ac0e8f22ea9 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
    #19 0x2ac0e7565914 in boost::function0<void>::operator()() const /home/ubuntu/Impala/toolchain/boost-1.57.0-p1/include/boost/function/function_template.hpp:766:14
    #20 0x2ac0e7556a50 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
    #21 0x2ac0e757eac3 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
    #22 0x2ac0e757e3eb 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
    #23 0x2ac0e757ce35 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
    #24 0xfa8ba9 in thread_proxy (/home/ubuntu/Impala/be/build/debug/exprs/expr-test+0xfa8ba9)
    #25 0x2ac0f6325183 in start_thread (/lib/x86_64-linux-gnu/libpthread.so.0+0x8183)
    #26 0x2ac0f663537c in clone (/lib/x86_64-linux-gnu/libc.so.6+0xfa37c)


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

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

[Impala-ASF-CR] IMPALA-5031: Remove undefined behavior: left shift of large signed

Posted by "Jim Apple (Code Review)" <ge...@cloudera.org>.
Hello Lars Volker,

I'd like you to reexamine a change.  Please visit

    http://gerrit.cloudera.org:8080/6528

to look at the new patch set (#2).

Change subject: IMPALA-5031: Remove undefined behavior: left shift of large signed
......................................................................

IMPALA-5031: Remove undefined behavior: left shift of large signed

Shifting large positive signed values is undefined when the result is
not "representable in the corresponding unsigned type of the result
type". Left shift of unsigned values is always defined. See the C++14
standard, section 5.8 [expr.shift], paragraph 2.

Change-Id: I748697cf503e9e717a6e95250c2cbbf031c6352d
---
M be/src/exprs/bit-byte-functions-ir.cc
1 file changed, 5 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/28/6528/2
-- 
To view, visit http://gerrit.cloudera.org:8080/6528
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I748697cf503e9e717a6e95250c2cbbf031c6352d
Gerrit-PatchSet: 2
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Jim Apple <jb...@apache.org>
Gerrit-Reviewer: Jim Apple <jb...@apache.org>
Gerrit-Reviewer: Lars Volker <lv...@cloudera.com>
Gerrit-Reviewer: Tim Armstrong <ta...@cloudera.com>

[Impala-ASF-CR] IMPALA-5031: Remove undefined behavior: left shift of large signed

Posted by "Impala Public Jenkins (Code Review)" <ge...@cloudera.org>.
Impala Public Jenkins has posted comments on this change.

Change subject: IMPALA-5031: Remove undefined behavior: left shift of large signed
......................................................................


Patch Set 3:

Build started: http://jenkins.impala.io:8080/job/gerrit-verify-dryrun/475/

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I748697cf503e9e717a6e95250c2cbbf031c6352d
Gerrit-PatchSet: 3
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Jim Apple <jb...@apache.org>
Gerrit-Reviewer: Impala Public Jenkins
Gerrit-Reviewer: Jim Apple <jb...@apache.org>
Gerrit-Reviewer: Lars Volker <lv...@cloudera.com>
Gerrit-Reviewer: Tim Armstrong <ta...@cloudera.com>
Gerrit-HasComments: No

[Impala-ASF-CR] IMPALA-5031: Remove undefined behavior: left shift of large signed

Posted by "Impala Public Jenkins (Code Review)" <ge...@cloudera.org>.
Impala Public Jenkins has posted comments on this change.

Change subject: IMPALA-5031: Remove undefined behavior: left shift of large signed
......................................................................


Patch Set 3: Verified+1

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I748697cf503e9e717a6e95250c2cbbf031c6352d
Gerrit-PatchSet: 3
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Jim Apple <jb...@apache.org>
Gerrit-Reviewer: Impala Public Jenkins
Gerrit-Reviewer: Jim Apple <jb...@apache.org>
Gerrit-Reviewer: Lars Volker <lv...@cloudera.com>
Gerrit-Reviewer: Tim Armstrong <ta...@cloudera.com>
Gerrit-HasComments: No

[Impala-ASF-CR] IMPALA-5031: Remove undefined behavior: left shift into the sign bit

Posted by "Jim Apple (Code Review)" <ge...@cloudera.org>.
Jim Apple has posted comments on this change.

Change subject: IMPALA-5031: Remove undefined behavior: left shift into the sign bit
......................................................................


Patch Set 1:

> Out of curiosity, how did you find these?

http://releases.llvm.org/3.8.0/tools/clang/docs/UndefinedBehaviorSanitizer.html

https://github.com/apache/incubator-impala/commit/93eb8ccbedda060af01dccbb452c28d8f2072115

http://jenkins.impala.io:8080/job/ubuntu-14.04-from-scratch/1072/

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I748697cf503e9e717a6e95250c2cbbf031c6352d
Gerrit-PatchSet: 1
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Jim Apple <jb...@apache.org>
Gerrit-Reviewer: Jim Apple <jb...@apache.org>
Gerrit-Reviewer: Lars Volker <lv...@cloudera.com>
Gerrit-Reviewer: Tim Armstrong <ta...@cloudera.com>
Gerrit-HasComments: No

[Impala-ASF-CR] IMPALA-5031: Remove undefined behavior: left shift of large signed

Posted by "Jim Apple (Code Review)" <ge...@cloudera.org>.
Jim Apple has posted comments on this change.

Change subject: IMPALA-5031: Remove undefined behavior: left shift of large signed
......................................................................


Patch Set 3:

Flaky build failure:
    [ERROR] Failed to execute goal on project impala-frontend: Could not resolve dependencies for project org.apache.impala:impala-frontend:jar:0.1-SNAPSHOT: Could not transfer artifact org.apache.hadoop:hadoop-hdfs:jar:2.6.0-cdh5.12.0-20170419.121450-64 from/to cdh.snapshots.repo (https://repository.cloudera.com/content/repositories/snapshots): GET request of: org/apache/hadoop/hadoop-hdfs/2.6.0-cdh5.12.0-SNAPSHOT/hadoop-hdfs-2.6.0-cdh5.12.0-20170419.121450-64.jar from cdh.snapshots.repo failed: SSL peer shut down incorrectly -> [Help 1]

Trying again...

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I748697cf503e9e717a6e95250c2cbbf031c6352d
Gerrit-PatchSet: 3
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Jim Apple <jb...@apache.org>
Gerrit-Reviewer: Impala Public Jenkins
Gerrit-Reviewer: Jim Apple <jb...@apache.org>
Gerrit-Reviewer: Lars Volker <lv...@cloudera.com>
Gerrit-Reviewer: Tim Armstrong <ta...@cloudera.com>
Gerrit-HasComments: No

[Impala-ASF-CR] IMPALA-5031: Remove undefined behavior: left shift of large signed

Posted by "Jim Apple (Code Review)" <ge...@cloudera.org>.
Jim Apple has posted comments on this change.

Change subject: IMPALA-5031: Remove undefined behavior: left shift of large signed
......................................................................


Patch Set 2:

There are 16 open blocker bugs right now, so I'm going to hold off on submitting this for a few days.

<https://issues.apache.org/jira/issues/?jql=project%20%3D%20IMPALA%20AND%20issuetype%20%3D%20Bug%20AND%20status%20in%20(Open%2C%20%22In%20Progress%22%2C%20Reopened)%20AND%20priority%20%3D%20Blocker>

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I748697cf503e9e717a6e95250c2cbbf031c6352d
Gerrit-PatchSet: 2
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Jim Apple <jb...@apache.org>
Gerrit-Reviewer: Jim Apple <jb...@apache.org>
Gerrit-Reviewer: Lars Volker <lv...@cloudera.com>
Gerrit-Reviewer: Tim Armstrong <ta...@cloudera.com>
Gerrit-HasComments: No

[Impala-ASF-CR] IMPALA-5031: Remove undefined behavior: left shift into the sign bit

Posted by "Lars Volker (Code Review)" <ge...@cloudera.org>.
Lars Volker has posted comments on this change.

Change subject: IMPALA-5031: Remove undefined behavior: left shift into the sign bit
......................................................................


Patch Set 1: Code-Review+1

Out of curiosity, how did you find these?

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I748697cf503e9e717a6e95250c2cbbf031c6352d
Gerrit-PatchSet: 1
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Jim Apple <jb...@apache.org>
Gerrit-Reviewer: Jim Apple <jb...@apache.org>
Gerrit-Reviewer: Lars Volker <lv...@cloudera.com>
Gerrit-Reviewer: Tim Armstrong <ta...@cloudera.com>
Gerrit-HasComments: No