From c39c6881ebbf7466a6dd504f10663978e3e494fd Mon Sep 17 00:00:00 2001 From: Robert Maynard Date: Thu, 5 Oct 2023 09:52:51 -0400 Subject: [PATCH] cudf::detail::pinned_allocator doesn't throw from `deallocate` Fixes #14165 The deallocate function is called by the `pinned_host_vector`. Throwing from destructors is bad since they can't be caught, and generally get converted into runtime sig aborts. --- cpp/include/cudf/detail/utilities/pinned_host_vector.hpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cpp/include/cudf/detail/utilities/pinned_host_vector.hpp b/cpp/include/cudf/detail/utilities/pinned_host_vector.hpp index 9e2b85ea129..fa9b2cbfa18 100644 --- a/cpp/include/cudf/detail/utilities/pinned_host_vector.hpp +++ b/cpp/include/cudf/detail/utilities/pinned_host_vector.hpp @@ -169,7 +169,12 @@ class pinned_allocator { * It is the responsibility of the caller to destroy * the objects stored at \p p. */ - __host__ inline void deallocate(pointer p, size_type /*cnt*/) { CUDF_CUDA_TRY(cudaFreeHost(p)); } + __host__ inline void deallocate(pointer p, size_type /*cnt*/) + { + auto dealloc_worked = cudaFreeHost(p); + (void)dealloc_worked; + assert(status__ == cudaSuccess); + } /** * @brief This method returns the maximum size of the \c cnt parameter