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] Add a build flag for the undefined behavior sanitizer, aka "ubsan".
Date Thu, 17 Nov 2016 20:07:05 GMT
Jim Apple has posted comments on this change.

Change subject: Add a build flag for the undefined behavior sanitizer, aka "ubsan".
......................................................................


Patch Set 1:

(1 comment)

http://gerrit.cloudera.org:8080/#/c/5082/1/be/CMakeLists.txt
File be/CMakeLists.txt:

Line 40: #  -fwrapv: force signed integer arithmetic operations to wrap
> What are some examples of where we overflow signed ints?
/home/jbapple/Impala/be/src/gutil/strings/numbers.cc:954:17: runtime error: signed integer
overflow: 42 * 100000000 cannot be represented in type 'int'
    #0 0x2b30a5f3ecfd in FastUInt32ToBufferLeft(unsigned int, char*) /home/jbapple/Impala/be/src/gutil/strings/numbers.cc:954:17
    #1 0x2b30a5f3fb7e in FastUInt64ToBufferLeft(unsigned long long, char*) /home/jbapple/Impala/be/src/gutil/strings/numbers.cc:1037:24
    #2 0x2b30a5f3e3ac in FastInt64ToBufferLeft(long long, char*) /home/jbapple/Impala/be/src/gutil/strings/numbers.cc:1080:10
    #3 0x9cf0f8 in strings::internal::SubstituteArg::SubstituteArg(long) /home/jbapple/Impala/be/src/gutil/strings/substitute.h:106:35
    #4 0x2b309d7988a3 in impala::HdfsAvroScanner::SetStatusValueOverflow(impala::TErrorCode::type,
long, long) /home/jbapple/Impala/be/src/exec/hdfs-avro-scanner.cc:677:53
    #5 0x2b309d7be0bc in impala::HdfsAvroScanner::ReadAvroString(impala::PrimitiveType, unsigned
char**, unsigned char*, bool, void*, impala::MemPool*) /home/jbapple/Impala/be/src/exec/hdfs-avro-scanner-ir.cc:241:7
    #6 0x7e2e47 in void impala::HdfsAvroScannerTest::TestReadAvroType<impala::StringValue,
bool (impala::HdfsAvroScanner::*)(impala::PrimitiveType, unsigned char**, unsigned char*,
bool, void*, impala::MemPool*), impala::PrimitiveType>(bool (impala::HdfsAvroScanner::*)(impala::PrimitiveType,
unsigned char**, unsigned char*, bool, void*, impala::MemPool*), impala::PrimitiveType, unsigned
char*, long, impala::StringValue, int, impala::TErrorCode::type) /home/jbapple/Impala/be/src/exec/hdfs-avro-scanner-test.cc:85:20
    #7 0x7c9a66 in impala::HdfsAvroScannerTest::TestReadAvroString(unsigned char*, long, impala::StringValue,
int, impala::TErrorCode::type) /home/jbapple/Impala/be/src/exec/hdfs-avro-scanner-test.cc:179:5
    #8 0x7bab3d in impala::HdfsAvroScannerTest_StringLengthOverflowTest_Test::TestBody() /home/jbapple/Impala/be/src/exec/hdfs-avro-scanner-test.cc:348:5





/home/jbapple/Impala/be/src/exprs/expr-test.cc:819:36: runtime error: signed integer overflow:
-9223372036854775807 + -9223372036854775807 cannot be represented in type 'long'
    #0 0xb901cd in void impala::ExprTest::TestFixedResultTypeOps<long, long, long>(long,
long, impala::ColumnType const&) /home/jbapple/Impala/be/src/exprs/expr-test.cc:819:36
    #1 0x80be58 in impala::ExprTest_ArithmeticExprs_Test::TestBody() /home/jbapple/Impala/be/src/exprs/expr-test.cc:1180:3







/home/jbapple/Impala/be/src/exprs/expr-test.cc:823:36: runtime error: signed integer overflow:
-9223372036854775807 * -9223372036854775807 cannot be represented in type 'long'
    #0 0xb90783 in void impala::ExprTest::TestFixedResultTypeOps<long, long, long>(long,
long, impala::ColumnType const&) /home/jbapple/Impala/be/src/exprs/expr-test.cc:823:36
    #1 0x80be58 in impala::ExprTest_ArithmeticExprs_Test::TestBody() /home/jbapple/Impala/be/src/exprs/expr-test.cc:1180:3







/home/jbapple/Impala/be/src/exprs/expr-test.cc:821:36: runtime error: signed integer overflow:
-9223372036854775807 - 9223372036854775807 cannot be represented in type 'long'
    #0 0xb9049d in void impala::ExprTest::TestFixedResultTypeOps<long, long, long>(long,
long, impala::ColumnType const&) /home/jbapple/Impala/be/src/exprs/expr-test.cc:821:36
    #1 0x80c1a5 in impala::ExprTest_ArithmeticExprs_Test::TestBody() /home/jbapple/Impala/be/src/exprs/expr-test.cc:1184:3


[ RUN      ] ExprTest.MathConversionFunctions
/home/jbapple/Impala/be/src/exprs/math-functions-ir.cc:370:24: runtime error: signed integer
overflow: 2 * 4738381338321616896 cannot be repr
esented in type 'long'





/home/jbapple/Impala/be/src/exprs/math-functions-ir.cc:371:13: runtime error: signed integer
overflow: 4738381338321616896 * 36 cannot be represented in type 'long'
    #0 0x2b1855eb2f88 in impala::MathFunctions::DecimalInBaseToDecimal(long, signed char,
long*) /home/jbapple/Impala/be/src/exprs/math-functions-ir.cc:371:13
    #1 0x2b1855eb2bb3 in impala::MathFunctions::ConvInt(impala_udf::FunctionContext*, impala_udf::BigIntVal
const&, impala_udf::TinyIntVal const&, impala_udf::TinyIntVal const&) /home/jbapple/Impala/be/src/exprs/math-functions-ir.cc:293:10
    #2 0x2b18560f4152 in impala_udf::StringVal impala::ScalarFnCall::InterpretEval<impala_udf::StringVal>(impala::ExprContext*,
impala::TupleRow const*) /home/jbapple/Impala/be/src/exprs/scalar-fn-call.cc:579:580
    #3 0x2b185602e0d5 in impala::ScalarFnCall::GetStringVal(impala::ExprContext*, impala::TupleRow
const*) /home/jbapple/Impala/be/src/exprs/scalar-fn-call.cc:685:44
    #4 0x2b1855e03f1c in impala::ExprContext::GetValue(impala::Expr*, impala::TupleRow const*)
/home/jbapple/Impala/be/src/exprs/expr-context.cc:277:33
    #5 0x2b1855e025cc in impala::ExprContext::GetValue(impala::TupleRow const*) /home/jbapple/Impala/be/src/exprs/expr-context.cc:228:10
    #6 0x2b18516a7dff in void impala::Tuple::MaterializeExprs<false, false>(impala::TupleRow*,
impala::TupleDescriptor const&, impala::ExprContext* const*, impala::MemPool*, impala::StringValue**,
int*, int*) /home/jbapple/Impala/be/src/runtime/tuple.cc:219:17
    #7 0x2b1853cff87e 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/jbapple/Impala/be/src/runtime/tuple.h:153:5
    #8 0x2b1853d127f4 in impala::UnionNode::MaterializeExprs(std::vector<impala::ExprContext*,
std::allocator<impala::ExprContext*> > const&, impala::TupleRow*, unsigned char*,
impala::RowBatch*) /home/jbapple/Impala/be/src/exec/union-node.cc:200:3
    #9 0x2b1853d0d599 in impala::UnionNode::GetNext(impala::RuntimeState*, impala::RowBatch*,
bool*) /home/jbapple/Impala/be/src/exec/union-node.cc:178:7
    #10 0x2b185151ee75 in impala::PlanFragmentExecutor::ExecInternal() /home/jbapple/Impala/be/src/runtime/plan-fragment-executor.cc:361:16
    #11 0x2b185151da0a in impala::PlanFragmentExecutor::Exec() /home/jbapple/Impala/be/src/runtime/plan-fragment-executor.cc:336:14
    #12 0x2b185760f228 in impala::FragmentMgr::FragmentExecState::Exec() /home/jbapple/Impala/be/src/service/fragment-exec-state.cc:59:5
    #13 0x2b1857647804 in impala::FragmentMgr::FragmentThread(impala::TUniqueId) /home/jbapple/Impala/be/src/service/fragment-mgr.cc:86:3
    #14 0x2b18576c78f1 in boost::_mfi::mf1<void, impala::FragmentMgr, impala::TUniqueId>::operator()(impala::FragmentMgr*,
impala::TUniqueId) const /opt/Impala-Toolchain/boost-1.57.0/include/boost/bind/mem_fn_template.hpp:165:16
    #15 0x2b18576c7622 in void boost::_bi::list2<boost::_bi::value<impala::FragmentMgr*>,
boost::_bi::value<impala::TUniqueId> >::operator()<boost::_mfi::mf1<void, impala::FragmentMgr,
impala::TUniqueId>, boost::_bi::list0>(boost::_bi::type<void>, boost::_mfi::mf1<void,
impala::FragmentMgr, impala::TUniqueId>&, boost::_bi::list0&, int) /opt/Impala-Toolchain/boost-1.57.0/include/boost/bind/bind.hpp:313:9
    #16 0x2b18576c724b in boost::_bi::bind_t<void, boost::_mfi::mf1<void, impala::FragmentMgr,
impala::TUniqueId>, boost::_bi::list2<boost::_bi::value<impala::FragmentMgr*>,
boost::_bi::value<impala::TUniqueId> > >::operator()() /opt/Impala-Toolchain/boost-1.57.0/include/boost/bind/bind_template.hpp:20:16
    #17 0x2b18576c6509 in boost::detail::function::void_function_obj_invoker0<boost::_bi::bind_t<void,
boost::_mfi::mf1<void, impala::FragmentMgr, impala::TUniqueId>, boost::_bi::list2<boost::_bi::value<impala::FragmentMgr*>,
boost::_bi::value<impala::TUniqueId> > >, void>::invoke(boost::detail::function::function_buffer&)
/opt/Impala-Toolchain/boost-1.57.0/include/boost/function/function_template.hpp:153:11
    #18 0x2b184fcbdbd4 in boost::function0<void>::operator()() const /opt/Impala-Toolchain/boost-1.57.0/include/boost/function/function_template.hpp:766:14
    #19 0x2b184fcb7bb0 in impala::Thread::SuperviseThread(std::string const&, std::string
const&, boost::function<void ()>, impala::Promise<long>*) /home/jbapple/Impala/be/src/util/thread.cc:317:3
    #20 0x2b184fcd84b3 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) /opt/Impala-Toolchain/boost-1.57.0/include/boost/bind/bind.hpp:457:9
    #21 0x2b184fcd7ddb 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()() /opt/Impala-Toolchain/boost-1.57.0/include/boost/bind/bind_template.hpp:20:16
    #22 0x2b184fcd6825 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() /opt/Impala-Toolchain/boost-1.57.0/include/boost/thread/detail/thread.hpp:116:17
    #23 0xf5dee9 in thread_proxy (/home/jbapple/Impala/be/build/debug/exprs/expr-test+0xf5dee9)






/home/jbapple/Impala/be/src/util/string-parser.h:205:13: runtime error: signed integer overflow:
0x4b3b4ca85a86c47a098a223fffffffff * 10 cannot be represented in type '__int128'
    #0 0x85ef08 in impala::DecimalValue<__int128> impala::StringParser::StringToDecimal<__int128>(char
const*, int, int, int, impala::StringParser::ParseResult*) /home/jbapple/Impala/be/src/util/string-parser.h:205:13
    #1 0x81b1fc in impala::DecimalValue<__int128> impala::StringParser::StringToDecimal<__int128>(char
const*, int, impala::ColumnType const&, impala::StringParser::ParseResult*) /home/jbapple/Impala/be/src/util/string-parser.h:111:12
    #2 0x812897 in void impala::VerifyParse<__int128>(std::string const&, impala::ColumnType
const&, impala::DecimalValue<__int128> const&, impala::StringParser::ParseResult)
/home/jbapple/Impala/be/src/runtime/decimal-test.cc:51:25
    #3 0x7e4003 in impala::StringToDecimal_LargeDecimals_Test::TestBody() /home/jbapple/Impala/be/src/runtime/decimal-test.cc:347:3








[ RUN      ] QueryOptions.SetFilterWait
/home/jbapple/Impala/be/src/service/query-options-test.cc:76:207: runtime error: signed integer
overflow: 2147483647 + 1 cannot be represented in type 'int'
    #0 0x7ba55f in QueryOptions_SetFilterWait_Test::TestBody() /home/jbapple/Impala/be/src/service/query-options-test.cc:76:207


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I88c7234bd7c5eb7404490a0913d90470c10835e7
Gerrit-PatchSet: 1
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Jim Apple <jbapple@cloudera.com>
Gerrit-Reviewer: Dan Hecht <dhecht@cloudera.com>
Gerrit-Reviewer: Jim Apple <jbapple@cloudera.com>
Gerrit-Reviewer: Tim Armstrong <tarmstrong@cloudera.com>
Gerrit-HasComments: Yes

Mime
View raw message