-
Notifications
You must be signed in to change notification settings - Fork 928
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] off-by-one in parquet writer fragment offset calc #13431
Comments
We can't switch to an inclusive scan because the |
Note that I changed the scan to initialise |
ahh...missed that. |
Fixes #13431 Authors: - Ed Seidl (https://github.com/etseidl) Approvers: - Nghia Truong (https://github.com/ttnghia) - Divye Gala (https://github.com/divyegala) - Vukasin Milovanovic (https://github.com/vuule) URL: #13434
Describe the bug
In src/io/parquet/writer_impl.cu, there is this bit of code that fills up a fragment_offsets vector (introduced in #12685)
However, AFAICT,
frags_per_column
only hasnum_columns
entries, so this exscan is UB becausefrags_per_column.data() + num_columns + 1
is two-past-the-end.Steps/Code to reproduce bug
Compile and run under valgrind:
Expected behavior
No out-of-bounds access.
If I understand this bit of code correctly, it is trying to produce an offsets array of length
num_columns + 1
from a size array of lengthnum_columns
where the final entry should be the sum of all sizes (i.e. aninclusive_scan
of thesize
array preceded by0
).So I think this patch DTRT:
But there may be a more idiomatic way.
cc @etseidl, @ttnghia
The text was updated successfully, but these errors were encountered: