This is an automated email from the ASF dual-hosted git repository.
apitrou pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow.git
The following commit(s) were added to refs/heads/master by this push:
new 4cb4849 ARROW-14305: [C++][Compute] Fixing Valgrind errors in hash
join node tests
4cb4849 is described below
commit 4cb484940441de9cc0533dfcec22090b2c2a7b0a
Author: michalursa <[email protected]>
AuthorDate: Wed Oct 13 11:54:01 2021 +0200
ARROW-14305: [C++][Compute] Fixing Valgrind errors in hash join node tests
On verifying contents of the Boolean column output from hash join test,
Valgrind reported uninitialized data access.
I added clearing of an output bit vector for Boolean column before decoding.
This seems to have fixed Valgrind errors.
Closes #11395 from michalursa/ARROW-14305-hash-join-valgrind
Authored-by: michalursa <[email protected]>
Signed-off-by: Antoine Pitrou <[email protected]>
---
cpp/src/arrow/compute/kernels/row_encoder.cc | 1 +
1 file changed, 1 insertion(+)
diff --git a/cpp/src/arrow/compute/kernels/row_encoder.cc
b/cpp/src/arrow/compute/kernels/row_encoder.cc
index 4f61022..63bff8c 100644
--- a/cpp/src/arrow/compute/kernels/row_encoder.cc
+++ b/cpp/src/arrow/compute/kernels/row_encoder.cc
@@ -115,6 +115,7 @@ Result<std::shared_ptr<ArrayData>>
BooleanKeyEncoder::Decode(uint8_t** encoded_b
ARROW_ASSIGN_OR_RAISE(auto key_buf, AllocateBitmap(length, pool));
uint8_t* raw_output = key_buf->mutable_data();
+ memset(raw_output, 0, BitUtil::BytesForBits(length));
for (int32_t i = 0; i < length; ++i) {
auto& encoded_ptr = encoded_bytes[i];
BitUtil::SetBitTo(raw_output, i, encoded_ptr[0] != 0);