Update arrow to include uninitialized memory fixes (#2371)

This commit is contained in:
Philipp Moritz 2018-07-11 05:52:02 -07:00 committed by Robert Nishihara
parent 450b11f1d6
commit 4dadc60968
2 changed files with 2 additions and 34 deletions

View file

@ -1,30 +0,0 @@
diff --git a/cpp/src/arrow/memory_pool.cc b/cpp/src/arrow/memory_pool.cc
index 34bd600e..3ef32090 100644
--- a/cpp/src/arrow/memory_pool.cc
+++ b/cpp/src/arrow/memory_pool.cc
@@ -53,6 +53,7 @@ Status AllocateAligned(int64_t size, uint8_t** out) {
ss << "malloc of size " << size << " failed";
return Status::OutOfMemory(ss.str());
}
+ memset(*out, 0, size);
#elif defined(ARROW_JEMALLOC)
*out = reinterpret_cast<uint8_t*>(mallocx(
std::max(static_cast<size_t>(size), kAlignment), MALLOCX_ALIGN(kAlignment)));
@@ -75,6 +76,7 @@ Status AllocateAligned(int64_t size, uint8_t** out) {
ss << "invalid alignment parameter: " << kAlignment;
return Status::Invalid(ss.str());
}
+ memset(*out, 0, size);
#endif
return Status::OK();
}
@@ -124,6 +126,9 @@ class DefaultMemoryPool : public MemoryPool {
DCHECK(out);
// Copy contents and release old memory chunk
memcpy(out, *ptr, static_cast<size_t>(std::min(new_size, old_size)));
+ if (new_size > old_size) {
+ memset(out + old_size, 0, static_cast<size_t>(new_size - old_size));
+ }
#ifdef _MSC_VER
_aligned_free(*ptr);
#else

View file

@ -68,12 +68,10 @@ if [[ ! -d $TP_DIR/../python/ray/pyarrow_files/pyarrow || \
pushd $TP_DIR/build/arrow
git fetch origin master
# The PR for this commit is https://github.com/apache/arrow/pull/2224. We
# The PR for this commit is https://github.com/apache/arrow/pull/2235. We
# include the link here to make it easier to find the right commit because
# Arrow often rewrites git history and invalidates certain commits.
git checkout 010c87402071d715e6fd0c3d22a0b13820b9aed5
git apply $TP_DIR/scripts/arrow-zero-fill.patch
git checkout fa08ddfbe8ada173b2c621172e176f159ce3b728
cd cpp
if [ ! -d "build" ]; then