From 61794aaef64d1eb918910817799e66d51d2d6cda Mon Sep 17 00:00:00 2001 From: Vukasin Milovanovic Date: Tue, 14 Dec 2021 13:13:12 -0800 Subject: [PATCH] Fix a memcheck error in ORC writer (#9896) Follow up of https://github.com/rapidsai/cudf/pull/9808 Skips some kernels when input columns are empty to avoid OOB memory access. Authors: - Vukasin Milovanovic (https://github.com/vuule) Approvers: - Devavret Makkar (https://github.com/devavret) - Nghia Truong (https://github.com/ttnghia) - David Wendt (https://github.com/davidwendt) URL: https://github.com/rapidsai/cudf/pull/9896 --- cpp/src/io/orc/writer_impl.cu | 1 + 1 file changed, 1 insertion(+) diff --git a/cpp/src/io/orc/writer_impl.cu b/cpp/src/io/orc/writer_impl.cu index a7a767585e6..c1eb9891229 100644 --- a/cpp/src/io/orc/writer_impl.cu +++ b/cpp/src/io/orc/writer_impl.cu @@ -1018,6 +1018,7 @@ std::vector writer::impl::gather_stripes( hostdevice_2dvector* enc_streams, hostdevice_2dvector* strm_desc) { + if (segmentation.num_stripes() == 0) { return {}; } std::vector stripes(segmentation.num_stripes()); for (auto const& stripe : segmentation.stripes) { for (size_t col_idx = 0; col_idx < enc_streams->size().first; col_idx++) {