Skip to content

[BUG] Compiler segmentation fault when calling make_host_vector in certain cases. #18980

@mhaseeb123

Description

@mhaseeb123

Describe the bug
A compiler segmentation fault is encountered when calling cudf::detail::make_host_vector at certain places.

Steps/Code to reproduce bug
Segfault can be reproduced by incorporating this 2 liner change from this commit: b080012 into libcudf and compiling. The compiler will segfault when compiling cudf/src/io/writer_impl.cu where the modified function is used. Here is the output from compiler

FAILED: CMakeFiles/cudf.dir/src/io/orc/writer_impl.cu.o 
/usr/bin/sccache /home/coder/.conda/envs/rapids/bin/nvcc -forward-unknown-to-host-compiler -ccbin=/home/coder/.conda/envs/rapids/bin/x86_64-conda-linux-gnu-c++ -DBS_THREAD_POOL_ENABLE_PAUSE=1 -DCCCL_AVOID_SORT_UNROLL=1 -DCUB_DISABLE_NAMESPACE_MAGIC -DCUB_IGNORE_NAMESPACE_MAGIC_ERROR -DCUDF_KVIKIO_REMOTE_IO -DCUDF_LOG_ACTIVE_LEVEL=RAPIDS_LOGGER_LOG_LEVEL_INFO -DJITIFY_PRINT_LOG=0 -DKVIKIO_CUDA_FOUND -DKVIKIO_CUFILE_BATCH_API_FOUND -DKVIKIO_CUFILE_FOUND -DKVIKIO_CUFILE_STREAM_API_FOUND -DKVIKIO_CUFILE_VERSION_API_FOUND -DKVIKIO_LIBCURL_FOUND -DLIBCUDACXX_ENABLE_EXPERIMENTAL_MEMORY_RESOURCE -DTHRUST_DEVICE_SYSTEM=THRUST_DEVICE_SYSTEM_CUDA -DTHRUST_DISABLE_ABI_NAMESPACE -DTHRUST_FORCE_32_BIT_OFFSET_TYPE=1 -DTHRUST_HOST_SYSTEM=THRUST_HOST_SYSTEM_CPP -DTHRUST_IGNORE_ABI_NAMESPACE_ERROR -DZSTD_STATIC_LINKING_ONLY=0N -Dcudf_EXPORTS -I/home/coder/cudf/cpp/build/conda/cuda-12.8/release/_deps/dlpack-src/include -I/home/coder/cudf/cpp/build/conda/cuda-12.8/release/_deps/jitify-src -I/home/coder/cudf/cpp/include -I/home/coder/cudf/cpp/build/conda/cuda-12.8/release/include -I/home/coder/cudf/cpp/src -I/home/coder/cudf/cpp/build/conda/cuda-12.8/release/_deps/nanoarrow-src/src -I/include -I/home/coder/cudf/cpp/build/conda/cuda-12.8/release/_deps/zstd-src/lib -I/home/coder/cudf/cpp/build/conda/cuda-12.8/release/_deps/cccl-src/lib/cmake/thrust/../../../thrust -I/home/coder/cudf/cpp/build/conda/cuda-12.8/release/_deps/cccl-src/lib/cmake/libcudacxx/../../../libcudacxx/include -I/home/coder/cudf/cpp/build/conda/cuda-12.8/release/_deps/cccl-src/lib/cmake/cub/../../../cub -I/home/coder/cudf/cpp/build/conda/cuda-12.8/release/_deps/rmm-src/cpp/include -I/home/coder/cudf/cpp/build/conda/cuda-12.8/release/_deps/rmm-build/include -I/home/coder/cudf/cpp/build/conda/cuda-12.8/release/_deps/nvtx3-src/c/include -I/home/coder/cudf/cpp/build/conda/cuda-12.8/release/_deps/cuco-src/include -I/home/coder/cudf/cpp/build/conda/cuda-12.8/release/_deps/kvikio-src/cpp/include -I/home/coder/cudf/cpp/build/conda/cuda-12.8/release/_deps/nanoarrow-build/src -I/home/coder/cudf/cpp/build/conda/cuda-12.8/release/_deps/zstd-src/build/cmake/../../lib -isystem /home/coder/.conda/envs/rapids/include -isystem /home/coder/.conda/envs/rapids/targets/x86_64-linux/include -t=1 -Wno-deprecated-gpu-targets -O3 -DNDEBUG -std=c++17 "--generate-code=arch=compute_70,code=[sm_70]" -Xcompiler=-fPIC -Xcompiler=-fvisibility=hidden --expt-extended-lambda --expt-relaxed-constexpr -Werror=all-warnings -Xcompiler=-Wall,-Werror,-Wno-error=deprecated-declarations -diag-suppress=1407 -Xfatbin=-compress-all -Xcompiler -pthread -MD -MT CMakeFiles/cudf.dir/src/io/orc/writer_impl.cu.o -MF CMakeFiles/cudf.dir/src/io/orc/writer_impl.cu.o.d -x cu -c /home/coder/cudf/cpp/src/io/orc/writer_impl.cu -o CMakeFiles/cudf.dir/src/io/orc/writer_impl.cu.o
Segmentation fault (core dumped)

Expected behavior
No segmentation fault when using cuda::detail::make_host_vector

Environment overview (please complete the following information)

  • cuDF branch-25.08
  • CUDA 12.8 Conda devcontainer
  • RDS Lab machine dgx05 (GPU: Tesla V100-SXM2-32GB)

Environment details
See the first comment below

Additional context
Follow up from #18968. I also recently encountered this seg fault while working on #18836 but got around it at the time by allocating a rmm::device_buffer and then using cudf::cuda_memcpy.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions