You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@impala.apache.org by lv...@apache.org on 2018/03/05 03:34:50 UTC

impala git commit: IMPALA-6601: fix ASAN issue in row-batch-serialize-test

Repository: impala
Updated Branches:
  refs/heads/master 161cbe30f -> 3302abaa3


IMPALA-6601: fix ASAN issue in row-batch-serialize-test

Constructing a StringValue with a std::string requires
that the std::string remain valid for as long as the
StringValue is valid. row-batch-serialize-test's
TestRowBatchLimits uses a temporary string value that
does not have the lifetime needed. When the memory is
reused, ASAN complains.

This changes TestRowBatchLimits to use strings with an
appropriate lifetime. The test now runs successfully
under ASAN.

Change-Id: I553b004f165be1d8027e3804852f357fa9843f7d
Reviewed-on: http://gerrit.cloudera.org:8080/9488
Reviewed-by: Lars Volker <lv...@cloudera.com>
Tested-by: Impala Public Jenkins


Project: http://git-wip-us.apache.org/repos/asf/impala/repo
Commit: http://git-wip-us.apache.org/repos/asf/impala/commit/3302abaa
Tree: http://git-wip-us.apache.org/repos/asf/impala/tree/3302abaa
Diff: http://git-wip-us.apache.org/repos/asf/impala/diff/3302abaa

Branch: refs/heads/master
Commit: 3302abaa32cf3290cb038fbc1dbd0a821f5cbbc7
Parents: 161cbe3
Author: Joe McDonnell <jo...@cloudera.com>
Authored: Sun Mar 4 14:49:05 2018 -0800
Committer: Impala Public Jenkins <im...@gerrit.cloudera.org>
Committed: Mon Mar 5 02:56:14 2018 +0000

----------------------------------------------------------------------
 be/src/runtime/row-batch-serialize-test.cc | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/impala/blob/3302abaa/be/src/runtime/row-batch-serialize-test.cc
----------------------------------------------------------------------
diff --git a/be/src/runtime/row-batch-serialize-test.cc b/be/src/runtime/row-batch-serialize-test.cc
index f6a048d..b6a0009 100644
--- a/be/src/runtime/row-batch-serialize-test.cc
+++ b/be/src/runtime/row-batch-serialize-test.cc
@@ -141,17 +141,20 @@ class RowBatchSerializeTest : public testing::Test {
 
     // Write string #1
     SlotDescriptor* string1_desc = tuple_desc->slots()[1];
-    StringValue sv1(string(string1_size, 'a'));
+    string string1(string1_size, 'a');
+    StringValue sv1(string1);
     RawValue::Write(&sv1, tuple, string1_desc, batch->tuple_data_pool());
 
     // Write string #2
     SlotDescriptor* string2_desc = tuple_desc->slots()[2];
-    StringValue sv2(string(string2_size, 'a'));
+    string string2(string2_size, 'a');
+    StringValue sv2(string2);
     RawValue::Write(&sv2, tuple, string2_desc, batch->tuple_data_pool());
 
     // Write string #3
     SlotDescriptor* string3_desc = tuple_desc->slots()[3];
-    StringValue sv3(string(string3_size, 'a'));
+    string string3(string3_size, 'a');
+    StringValue sv3(string3);
     RawValue::Write(&sv3, tuple, string3_desc, batch->tuple_data_pool());
 
     // Done with this row