Skip to content

Commit

Permalink
Fix the GDS read/write segfault/bus error when the cuFile policy is s…
Browse files Browse the repository at this point in the history
…et to GDS or ALWAYS (#17122)

When `LIBCUDF_CUFILE_POLICY` is set to `GDS` or `ALWAYS`, cuDF uses an internal implementation to call the cuFile API and harness the GDS feature. Recent tests with these two settings were unsuccessful due to program crash. Specifically, for the `PARQUET_READER_NVBENCH`'s `parquet_read_io_compression` benchmark:

- GDS write randomly crashed with segmentation fault (SIGSEGV).
- GDS read randomly crashed with bus error (SIGBUS).
- At the time of crash, stack frame is randomly corrupted.

The root cause is the use of dangling reference, which occurs when a variable is captured by reference by nested lambdas. This PR performs a hotfix that turns out to be a 1-char change.

Authors:
  - Tianyu Liu (https://github.com/kingcrimsontianyu)

Approvers:
  - David Wendt (https://github.com/davidwendt)
  - Nghia Truong (https://github.com/ttnghia)
  - Bradley Dice (https://github.com/bdice)

URL: #17122
  • Loading branch information
kingcrimsontianyu authored Oct 18, 2024
1 parent b891722 commit 6ca721c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cpp/src/io/utilities/file_io_utilities.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ std::vector<std::future<ResultT>> make_sliced_tasks(
std::vector<std::future<ResultT>> slice_tasks;
std::transform(slices.cbegin(), slices.cend(), std::back_inserter(slice_tasks), [&](auto& slice) {
return pool.submit_task(
[&] { return function(ptr + slice.offset, slice.size, offset + slice.offset); });
[=] { return function(ptr + slice.offset, slice.size, offset + slice.offset); });
});
return slice_tasks;
}
Expand Down

0 comments on commit 6ca721c

Please sign in to comment.