arrow icon indicating copy to clipboard operation
arrow copied to clipboard

[C++][Compute] A latent bug may caused by validity-buffer pre-allocation in ScalarExecutor with NullHandling::INTERSECTION

Open ZhangHuiGui opened this issue 8 months ago • 9 comments

Describe the bug, including details regarding any error messages, version, and platform.

For now, the validity-buffer for output-data may not be preallocated with NullHandling::INTERSECTION according the input-data's NullGeneration. https://github.com/apache/arrow/blob/fecd207e5dd553d226046f9d7bc5cd1a05529781/cpp/src/arrow/compute/exec.cc#L943-L951

We've talked about this in https://github.com/apache/arrow/pull/41975#discussion_r1638523247.

If null_handling is INTERSECTION the function might want to follow a single code path that uses the pre-allocated buffer to put the result of the bitmaps intersection.

If some future implementations of kernel function believe that INTERSECTION mode must pre-allocate a validity-buffer, and rely on this to build their own logic, then the current ScalarExecutor pre-allocation strategy for validity-buffer in INTERSECTION mode may cause potential SIGSEGV problems.

Component(s)

C++

ZhangHuiGui avatar Jun 25 '24 02:06 ZhangHuiGui