Jim Apple has posted comments on this change.
Change subject: IMPALA-5031: remove undefined behavior: call to strncmp with
nullptr
..
Patch Set 1:
(1 comment)
http://gerrit.cloudera.org:8080/#/c/6767/1/be/src/runtime/string-value.inline.h
File be/src/runtime/string-value.inline.h:
Line 59: const int result = len > 0 ? strncmp(s1, s2, len) : 0;
Example backtrace:
/home/ubuntu/Impala/be/src/runtime/string-value.inline.h:60:24: runtime
error: null pointer passed as argument 1, which is declared to never be null
/usr/include/string.h:148:58: note: nonnull attribute specified here
#0 0x7f72c79c6b6b in impala::StringCompare(char const*, int, char const*,
int, int) /home/ubuntu/Impala/be/src/runtime/string-value.inline.h:60:16
#1 0x7f72c79c9dba in impala::StringValue::Eq(impala::StringValue const&)
const /home/ubuntu/Impala/be/src/runtime/string-value.inline.h:82:10
#2 0x7f72c33268a9 in impala::RawValue::Eq(void const*, void const*,
impala::ColumnType const&)
/home/ubuntu/Impala/be/src/runtime/raw-value.inline.h:71:14
#3 0x7f72c335f282 in bool
impala::HashTableCtx::Equals(impala::TupleRow const*, unsigned char
const*, unsigned char const*) const
/home/ubuntu/Impala/be/src/exec/hash-table.cc:228:10
#4 0x7f72c33623da in bool
impala::HashTableCtx::Equals(impala::TupleRow const*) const
/home/ubuntu/Impala/be/src/exec/hash-table.h:454:12
#5 0x7f72c33623da in long
impala::HashTable::Probe(impala::HashTable::Bucket*, long,
impala::HashTableCtx*, unsigned int, bool*)
/home/ubuntu/Impala/be/src/exec/hash-table.inline.h:71
#6 0x7f72c3ad7beb in
impala::HashTable::InsertInternal(impala::HashTableCtx*)
/home/ubuntu/Impala/be/src/exec/hash-table.inline.h:100:24
#7 0x7f72c3ad7568 in impala::HashTable::Insert(impala::HashTableCtx*,
impala::BufferedTupleStream::RowIdx const&, impala::TupleRow*)
/home/ubuntu/Impala/be/src/exec/hash-table.inline.h:115:20
#8 0x7f72c3ad69f9 in
impala::PhjBuilder::Partition::InsertBatch(impala::TPrefetchMode::type,
impala::HashTableCtx*, impala::RowBatch*,
std::vector > const&)
/home/ubuntu/Impala/be/src/exec/partitioned-hash-join-builder-ir.cc:102:35
#9 0x7f72c3aaa402 in impala::PhjBuilder::Partition::BuildHashTable(bool*)
/home/ubuntu/Impala/be/src/exec/partitioned-hash-join-builder.cc:687:32
#10 0x7f72c3a9c158 in
impala::PhjBuilder::BuildHashTablesAndPrepareProbeStreams()
/home/ubuntu/Impala/be/src/exec/partitioned-hash-join-builder.cc:374:31
#11 0x7f72c3a98db4 in impala::PhjBuilder::FlushFinal(impala::RuntimeState*)
/home/ubuntu/Impala/be/src/exec/partitioned-hash-join-builder.cc:222:29
#12 0x7f72c30dd627 in impala::Status
impala::BlockingJoinNode::SendBuildInputToSink(impala::RuntimeState*,
impala::DataSink*) /home/ubuntu/Impala/be/src/exec/blocking-join-node.cc:294:31
#13 0x7f72c30d2fb8 in
impala::BlockingJoinNode::ProcessBuildInputAsync(impala::RuntimeState*,
impala::DataSink*, impala::Promise*)
/home/ubuntu/Impala/be/src/exec/blocking-join-node.cc:154:11
#14 0x7f72c30efaa2 in boost::_mfi::mf3*>::operator()(impala::BlockingJoinNode*,
impala::RuntimeState*, impala::DataSink*, impala::Promise*)
const
/home/ubuntu/Impala/toolchain/boost-1.57.0-p1/include/boost/bind/mem_fn_template.hpp:393:16
#15 0x7f72c30ef8ee in void
boost::_bi::list4,
boost::_bi::value, boost::_bi::value,
boost::_bi::value*>
>::operator()*>,
boost::_bi::list0>(boost::_bi::type, boost::_mfi::mf3*>&, boost::_bi::list0&, int)
/home/ubuntu/Impala/toolchain/boost-1.57.0-p1/include/boost/bind/bind.hpp:457:9
#16 0x7f72c30ef27b in boost::_bi::bind_t*>,
boost::_bi::list4,
boost::_bi::value, boost::_bi::value,
boost::_bi::value*> > >::operator()()
/home/ubuntu/Impala/toolchain/boost-1.57.0-p1/include/boost/bind/bind_template.hpp:20:16
#17 0x7f72c30ee649 in
boost::detail::function::void_function_obj_invoker0*>,
boost::_bi::list4,
boost::_bi::value, boost::_bi::value,
boost::_bi::value*> > >,
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 0x7f72c798cdd4 in boost::function0::operator()() const
/home/ubuntu/Impala/toolchain/boost-1.57.0-p1/include/boost/function/function_template.hpp:766:14
#19 0x7f72c797df10 in impala::Thread::SuperviseThread(std::string const&,
std::string const&, boost::function, impala::Promise*)
/home/ubuntu/Impala/be/src/util/thread.cc:325:3
#20 0x7f72c79a5f83 in void
boost::_bi::list4,
boost::_bi::value, boost::_bi::value >,
boost::_bi::value*> >::operator(), impala::Promise*),
boost::_bi::list0>(boost::_bi::type, void (*&)(std::string const&,
std::string const&, boost::function, impala::Promise*),
boost::_bi::list0&, int)
/home/ubuntu/Impala/toolchain/boost-1.57.0-p1/include/boost/bind/bind.hpp:457:9
#21 0x7f72c79a58ab in boost::_bi::bind_t, impala::Promise*),
boost::_bi::lis