Skip to content

Commit

Permalink
Fix memcheck error in get_dremel_data (#11903)
Browse files Browse the repository at this point in the history
Fixes logic that applies offsets to nested column children to not write past the end of the offsets vector.

This error was found by the nightly builds and could be recreated using
```
compute-sanitizer --tool memcheck gtests/PARQUET_TEST --gtest_filter=ParquetReaderTest.NestedByteArray --rmm_mode=cuda
```

Authors:
  - David Wendt (https://github.com/davidwendt)

Approvers:
  - Karthikeyan (https://github.com/karthikeyann)
  - Vukasin Milovanovic (https://github.com/vuule)
  - Tobias Ribizel (https://github.com/upsj)

URL: #11903
  • Loading branch information
davidwendt authored Oct 12, 2022
1 parent 8b5ab23 commit 3226859
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions cpp/src/lists/dremel.cu
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ dremel_data get_dremel_data(column_view h_col,
cudf::detail::device_single_thread(
[offset_at_level = d_column_offsets.data(),
end_idx_at_level = d_column_ends.data(),
level_max = d_column_offsets.size(),
col = *d_col] __device__() {
auto curr_col = col;
size_type off = curr_col.offset();
Expand All @@ -239,9 +240,11 @@ dremel_data get_dremel_data(column_view h_col,
if (curr_col.type().id() == type_id::LIST) {
off = curr_col.child(lists_column_view::offsets_column_index).element<size_type>(off);
end = curr_col.child(lists_column_view::offsets_column_index).element<size_type>(end);
offset_at_level[level] = off;
end_idx_at_level[level] = end;
++level;
if (level < level_max) {
offset_at_level[level] = off;
end_idx_at_level[level] = end;
++level;
}
curr_col = curr_col.child(lists_column_view::child_column_index);
} else {
curr_col = curr_col.child(0);
Expand Down

0 comments on commit 3226859

Please sign in to comment.