Skip to content

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

@ZhangHuiGui

Description

@ZhangHuiGui

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.

} else if (kernel_->null_handling == NullHandling::INTERSECTION) {
elide_validity_bitmap_ = true;
for (const auto& arg : args) {
auto null_gen = NullGeneralization::Get(arg) == NullGeneralization::ALL_VALID;
// If not all valid, this becomes false
elide_validity_bitmap_ = elide_validity_bitmap_ && null_gen;
}
validity_preallocated_ = !elide_validity_bitmap_;

We've talked about this in #41975 (comment).

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++

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions