Skip to content

[BUG]: Invalid __global__ read in CUB's device_batch_copy test #1898

Closed

Description

@alliepiper

Is this a duplicate?

Type of Bug

Silent Failure

Component

CUB

Describe the bug

https://github.com/NVIDIA/cccl/actions/runs/9606424817/job/26497170531?pr=1879

  	compute-sanitizer --tool memcheck --check-device-heap yes --leak-check full --padding 512 --track-stream-ordered-races all --check-warpgroup-mma yes --require-cuda-init no --check-exit-code yes --error-exitcode 1 --nvtx true /home/coder/cccl/build/cuda12.4-gcc13/cub-cpp17/bin/cub.cpp17.test.device_batch_copy
  ========= COMPUTE-SANITIZER
  Using device 0: Tesla V100-PCIE-32GB (PTX version 700, SM700, 80 SMs, 32086 free / 32494 total MB physmem, 898.048 GB/s @ 877000 kHz mem clock, ECC on)
  ========= Invalid __global__ read of size 4 bytes
  =========     at void thrust::THRUST_200500_600_700_800_NS::cuda_cub::__uninitialized_copy::functor<thrust::THRUST_200500_600_700_800_NS::device_ptr<object_with_non_trivial_ctor>, thrust::THRUST_200500_600_700_800_NS::pointer<object_with_non_trivial_ctor, thrust::THRUST_200500_600_700_800_NS::cuda_cub::tag, thrust::THRUST_200500_600_700_800_NS::use_default, thrust::THRUST_200500_600_700_800_NS::use_default>>::operator ()<long>(T1)+0x1b0 in /home/coder/cccl/thrust/thrust/system/cuda/detail/uninitialized_copy.h:80
  =========     by thread (0,0,0) in block (0,0,0)
  =========     Address 0x7fc595e00018 is out of bounds
  =========     and is 1 bytes after the nearest allocation at 0x7fc595e00000 of size 24 bytes
  =========     Device Frame:void cub::CUB_200500_600_700_800_NS::detail::for_each::agent_block_striped_t<cub::CUB_200500_600_700_800_NS::detail::for_each::policy_t<(int)256, (int)2>, long, thrust::THRUST_200500_600_700_800_NS::cuda_cub::__uninitialized_copy::functor<thrust::THRUST_200500_600_700_800_NS::device_ptr<object_with_non_trivial_ctor>, thrust::THRUST_200500_600_700_800_NS::pointer<object_with_non_trivial_ctor, thrust::THRUST_200500_600_700_800_NS::cuda_cub::tag, thrust::THRUST_200500_600_700_800_NS::use_default, thrust::THRUST_200500_600_700_800_NS::use_default>>>::consume_tile<(bool)0>(int, int)+0x1b0 in /home/coder/cccl/cub/cub/agent/agent_for.cuh:75
  =========     Device Frame:void cub::CUB_200500_600_700_800_NS::detail::for_each::static_kernel<cub::CUB_200500_600_700_800_NS::detail::for_each::policy_hub_t::policy_350_t, long, thrust::THRUST_200500_600_700_800_NS::cuda_cub::__uninitialized_copy::functor<thrust::THRUST_200500_600_700_800_NS::device_ptr<object_with_non_trivial_ctor>, thrust::THRUST_200500_600_700_800_NS::pointer<object_with_non_trivial_ctor, thrust::THRUST_200500_600_700_800_NS::cuda_cub::tag, thrust::THRUST_200500_600_700_800_NS::use_default, thrust::THRUST_200500_600_700_800_NS::use_default>>>(T2, T3)+0x120 in /home/coder/cccl/cub/cub/device/dispatch/dispatch_for.cuh:155
  =========     Saved host backtrace up to driver entry point at kernel launch time
  =========     Host Frame: [0x2ef36f]
  =========                in /usr/lib/x86_64-linux-gnu/libcuda.so.1
  =========     Host Frame:libcudart_static_4d8b33a106dceb3c07a56e26de61f2d53bb62a68 [0x2cd6d]
  =========                in /home/coder/cccl/build/cuda12.4-gcc13/cub-cpp17/bin/cub.cpp17.test.device_batch_copy
  =========     Host Frame:cudaLaunchKernel [0x904ad]
  =========                in /home/coder/cccl/build/cuda12.4-gcc13/cub-cpp17/bin/cub.cpp17.test.device_batch_copy
  =========     Host Frame:object_with_non_trivial_ctor* thrust::THRUST_200500_600_700_800_NS::cuda_cub::__copy::cross_system_copy_n<thrust::THRUST_200500_600_700_800_NS::cuda_cub::tag, thrust::THRUST_200500_600_700_800_NS::system::cpp::detail::tag, thrust::THRUST_200500_600_700_800_NS::device_ptr<object_with_non_trivial_ctor>, long, object_with_non_trivial_ctor*>(thrust::THRUST_200500_600_700_800_NS::cuda_cub::execution_policy<thrust::THRUST_200500_600_700_800_NS::cuda_cub::tag>&, thrust::THRUST_200500_600_700_800_NS::system::cpp::detail::execution_policy<thrust::THRUST_200500_600_700_800_NS::system::cpp::detail::tag>&, thrust::THRUST_200500_600_700_800_NS::device_ptr<object_with_non_trivial_ctor>, long, object_with_non_trivial_ctor*, cuda::std::__4::integral_constant<bool, false>) [clone .constprop.0] [clone .isra.0] [0xf216]
  =========                in /home/coder/cccl/build/cuda12.4-gcc13/cub-cpp17/bin/cub.cpp17.test.device_batch_copy
  =========     Host Frame:nontrivial_constructor_test() [0x10a23]
  =========                in /home/coder/cccl/build/cuda12.4-gcc13/cub-cpp17/bin/cub.cpp17.test.device_batch_copy
  =========     Host Frame:main [0xe190]
  =========                in /home/coder/cccl/build/cuda12.4-gcc13/cub-cpp17/bin/cub.cpp17.test.device_batch_copy
  =========     Host Frame: [0x23a8f]
  =========                in /usr/lib/x86_64-linux-gnu/libc.so.6
  =========     Host Frame:__libc_start_main [0x23b48]
  =========                in /usr/lib/x86_64-linux-gnu/libc.so.6
  =========     Host Frame:_start [0xe6d4]
  =========                in /home/coder/cccl/build/cuda12.4-gcc13/cub-cpp17/bin/cub.cpp17.test.device_batch_copy

How to Reproduce

compute-sanitizer --tool memcheck --check-device-heap yes --leak-check full --padding 512 --track-stream-ordered-races all --check-warpgroup-mma yes --require-cuda-init no --check-exit-code yes --error-exitcode 1 --nvtx true /home/coder/cccl/build/cuda12.4-gcc13/cub-cpp17/bin/cub.cpp17.test.device_batch_copy

Expected behavior

No diagnostics emitted.

Reproduction link

No response

Operating System

No response

nvidia-smi output

No response

NVCC version

No response

Activity

  1. added a commit that references this issue on Nov 4, 2024
    b1ba287
  2. moved this from Todo to In Review in CCCLon Nov 4, 2024
  3. added 2 commits that reference this issue on Nov 4, 2024
    9e94f61
    3bf56cc
  4. added a commit that references this issue on Nov 5, 2024
    d55bfd5
  5. moved this from In Review to Done in CCCLon Nov 5, 2024
  6. added a commit that references this issue on Nov 6, 2024
    1476c23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    • Status
      Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions