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
From the discussion at #41335 (comment), the arrow::util::TempVectorStack memory initialization (by filling 0xFFs [1]) seems not very useful in the sense that:
If it is supposed to be work with the guards [2] at the edge of each stack frame, the guards are only checked in debug mode (note it is using ARROW_DCHECK) [3], making filling 0xFFs unnecessary in non-debug mode. And the debug-only guarding itself can fully leverage more decent memory poisoning strategy such as ASAN [4].
If it is for non-debug mode too, then it might be unnecessary because the stack users are not assuming the stack memory to be initially filled with any particular content.
We may want to refine this by removing unnecessary memory initialization and/or using ASAN's manual memory poisoning.
### Rationale for this change
See #41460. And reduce the overhead of current manual poisoning (filling the entire stack space with `0xFF`s) that happens even in release mode.
### What changes are included in this PR?
Use ASAN API to replace the current manual poisoning of the temp vector stack memory.
### Are these changes tested?
Wanted to add cases to assert that ASAN poison/unpoison is functioning. However I found it too tricky to catch an ASAN error because ASAN directly uses signals that are hard to interoperate in C++/gtest. So I just manually checked poisoning is working in my local, e.g. by intentionally not unpoisoning the allocated buffer and seeing ASAN unhappy.
Just leveraging existing cases that use temp stack such as acero tests, which should cover this change well.
### Are there any user-facing changes?
None.
* GitHub Issue: #41460
Authored-by: Ruoxi Sun <[email protected]>
Signed-off-by: Felipe Oliveira Carvalho <[email protected]>
…ache#41695)
### Rationale for this change
See apache#41460. And reduce the overhead of current manual poisoning (filling the entire stack space with `0xFF`s) that happens even in release mode.
### What changes are included in this PR?
Use ASAN API to replace the current manual poisoning of the temp vector stack memory.
### Are these changes tested?
Wanted to add cases to assert that ASAN poison/unpoison is functioning. However I found it too tricky to catch an ASAN error because ASAN directly uses signals that are hard to interoperate in C++/gtest. So I just manually checked poisoning is working in my local, e.g. by intentionally not unpoisoning the allocated buffer and seeing ASAN unhappy.
Just leveraging existing cases that use temp stack such as acero tests, which should cover this change well.
### Are there any user-facing changes?
None.
* GitHub Issue: apache#41460
Authored-by: Ruoxi Sun <[email protected]>
Signed-off-by: Felipe Oliveira Carvalho <[email protected]>
Describe the enhancement requested
From the discussion at #41335 (comment), the
arrow::util::TempVectorStack
memory initialization (by filling0xFF
s [1]) seems not very useful in the sense that:ARROW_DCHECK
) [3], making filling0xFF
s unnecessary in non-debug mode. And the debug-only guarding itself can fully leverage more decent memory poisoning strategy such as ASAN [4].We may want to refine this by removing unnecessary memory initialization and/or using ASAN's manual memory poisoning.
[1]
arrow/cpp/src/arrow/compute/util.h
Line 95 in e4f3146
[2]
arrow/cpp/src/arrow/compute/util.h
Lines 117 to 118 in e4f3146
[3]
arrow/cpp/src/arrow/compute/util.cc
Lines 52 to 57 in e4f3146
[4] https://github.com/google/sanitizers/wiki/AddressSanitizerManualPoisoning
Component(s)
C++
The text was updated successfully, but these errors were encountered: