[ 
https://issues.apache.org/jira/browse/IMPALA-12575?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17790442#comment-17790442
 ] 

ASF subversion and git services commented on IMPALA-12575:
----------------------------------------------------------

Commit 6e90dafcf4b8528061c5ae20933e112c355da834 in impala's branch 
refs/heads/master from Zoltan Borok-Nagy
[ https://gitbox.apache.org/repos/asf?p=impala.git;h=6e90dafcf ]

IMPALA-12575: test_executor_group_num_queries_executing_metric fails in UBSAN 
build

test_executor_group_num_queries_executing_metric fails in UBSAN builds
with the Small String Optimization. It fails because it is possible to
invoke Smallify() on a StringValue where ptr is nullptr and len = 0. In
this case we call 'memcpy(rep.small_rep.buf, nullptr, 0)' internally
which is undefined behavior according to the specs. The memcpy we use
doesn't do any harm though.

This patch substitutes mempcy() to Ubsan::MemCpy() which does null
checking and only invokes memcpy() if neither of its arguments are
nulls.

There are other memcpy() invocations in SmallableString, but these
only make sense if neither of their arguments are nulls, so it's
good to have UBSAN-validation for them.

Testing:
 * tested in UBSAN build
 * added backend test for this case

Change-Id: Id937b9a975ac657e63ddb848e8c61eee75cfe17d
Reviewed-on: http://gerrit.cloudera.org:8080/20726
Tested-by: Impala Public Jenkins <[email protected]>
Reviewed-by: Csaba Ringhofer <[email protected]>


> test_executor_group_num_queries_executing_metric fails in UBSAN build
> ---------------------------------------------------------------------
>
>                 Key: IMPALA-12575
>                 URL: https://issues.apache.org/jira/browse/IMPALA-12575
>             Project: IMPALA
>          Issue Type: Bug
>            Reporter: Zoltán Borók-Nagy
>            Assignee: Zoltán Borók-Nagy
>            Priority: Major
>              Labels: broken-build
>
> test_executor_group_num_queries_executing_metric fails in UBSAN builds.
> The test started to fail after Small String Optimization (IMPALA-12373) was 
> merged, since then it fails consistently.
> Error Message
> {noformat}
> AssertionError: Expected single pid but found 12462, 13670
> {noformat}
> Stacktrace
> {noformat}
> custom_cluster/test_executor_groups.py:519: in 
> test_executor_group_num_queries_executing_metric
>     self.cluster.impalads[-1].kill()
> common/impala_cluster.py:431: in kill
>     LOG.info('Killing %s with signal %s' % (self, signal))
> common/impala_cluster.py:371: in __str__
>     return "<%s PID: %s (%s)>" % (self.__class_name(), self.__get_pid(),
> common/impala_cluster.py:401: in __get_pid
>     assert len(pids) < 2, "Expected single pid but found %s" % ", 
> ".join(map(str, pids))
> E   AssertionError: Expected single pid but found 12462, 13670
> {noformat}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to