You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In C++ arrow it can currently occur that uninitialized data created by the builders is written to IPC memory. The goal of this issue is to identify these cases and set the memory to zero.
Note that most of these cases have already been identified by valgrind and fixed in the past.
Some of the considerations and benefits are discussed in this github PR: #397
Wes McKinney / @wesm: @pcmoritz independent of the discussion about the standard memory format in the linked PR, I agree that we have an option (perhaps the default and only option) to always zero out memory in the C++ implementation.
From a quick scan of the array builders, it appears we are not zeroing the memory for the offsets in ListBuilder::Resize. I don't see anything else at a glance. Seems like this should be reproducible in a test case that fails with some probability (deterministic failure might be difficult because it's UB).
I made zero-initialization the default (it also seems to be the default for the other builders), let me know if you prefer it to be optional. Is there a reason why it is not already done?
Wes McKinney / @wesm:
No, it is simply an oversight. Since we run the unit test suite with valgrind we would have seen this if we had any test cases which examine the padding region.
Philipp Moritz / @pcmoritz:
Thanks, that makes sense! As a result of the PR, the Ray determinism test pass on the latest Arrow version. So the subset of Arrow we are using seems to be deterministic now.
Activity
asfimport commentedon Mar 20, 2017
Wes McKinney / @wesm:
@pcmoritz independent of the discussion about the standard memory format in the linked PR, I agree that we have an option (perhaps the default and only option) to always zero out memory in the C++ implementation.
From a quick scan of the array builders, it appears we are not zeroing the memory for the offsets in
ListBuilder::Resize. I don't see anything else at a glance. Seems like this should be reproducible in a test case that fails with some probability (deterministic failure might be difficult because it's UB).asfimport commentedon Mar 20, 2017
Wes McKinney / @wesm:
To fix this, I recommend adding an option to
arrow::BufferBuilderat https://github.com/apache/arrow/blob/master/cpp/src/arrow/buffer.h#L163.asfimport commentedon Mar 20, 2017
Philipp Moritz / @pcmoritz:
Thanks @wesm, I created a PR #405
I made zero-initialization the default (it also seems to be the default for the other builders), let me know if you prefer it to be optional. Is there a reason why it is not already done?
asfimport commentedon Mar 20, 2017
Wes McKinney / @wesm:
No, it is simply an oversight. Since we run the unit test suite with valgrind we would have seen this if we had any test cases which examine the padding region.
asfimport commentedon Mar 20, 2017
Philipp Moritz / @pcmoritz:
Thanks, that makes sense! As a result of the PR, the Ray determinism test pass on the latest Arrow version. So the subset of Arrow we are using seems to be deterministic now.
asfimport commentedon Mar 20, 2017
Uwe Korn / @xhochy:
Issue resolved by pull request 405
#405