Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix memory read/write error in concatenate_lists_ignore_null (#8978)
Reference #8883 Running `cuda-memcheck` on `LISTS_TEST` found a read error in the `cudf::lists::detail::concatenate_lists_ignore_null()` utility. This function is using `thrust::transform` to build the output offsets values and executes from 0 to `num_rows+1`. The device lambda included logic to update a temporary `uint8` vector with validity value (0 or 1) for each row. Unfortunately, this required reading offset values at `idx` and `idx+1` which would fail when `idx==num_rows` since `idx+1` would be out-of-bounds for the input offsets in this case. Also, the `validities[idx]` statement would fail on write since `idx==num_rows` is past the end of this vector as well. Finally, the temporary `validities` vector was passed to `cudf::detail::valid_if` utility to turn it into a bitmask. Since 2 kernels are used to create the output lists column, the temporary `validities` vector is not required since the `valid_if` utility can take a device predicate to build the bitmask instead. The code logic for determine validity was therefore moved from the `transform` call to the `valid_if` predicate instead. This keeps the same number of kernels without the need for the temporary buffer and fixes the out-of-bounds memory access. Authors: - David Wendt (https://github.com/davidwendt) Approvers: - Karthikeyan (https://github.com/karthikeyann) - Mark Harris (https://github.com/harrism) URL: #8978
- Loading branch information