Skip to content

[BUG] warpspeed scan causes OOB reads in some Thrust tests #8136

Closed

Description

@bernhardmgruber

QA reports:

 88/350 Test  #88: thrust.cpp.cuda.test.scan ..........................................Subprocess aborted***Exception:   0.36 sec
Testing Device 0: "NVIDIA GeForce RTX 5090"
Running 29 unit tests.
............../host_compiler_testing/COPTer/projects/files/thrust_cpp17/sources/lib/cmake/libcudacxx/../../../libcudacxx/include/cuda/std/array:172: operator[]: block: [0,0,0], thread: [168,0,0] Assertion `out-of-bounds access in std::array<T, N>` failed.
/host_compiler_testing/COPTer/projects/files/thrust_cpp17/sources/lib/cmake/libcudacxx/../../../libcudacxx/include/cuda/std/array:172: operator[]: block: [0,0,0], thread: [170,0,0] Assertion `out-of-bounds access in std::array<T, N>` failed.
/host_compiler_testing/COPTer/projects/files/thrust_cpp17/sources/lib/cmake/libcudacxx/../../../libcudacxx/include/cuda/std/array:172: operator[]: block: [0,0,0], thread: [171,0,0] Assertion `out-of-bounds access in std::array<T, N>` failed.
/host_compiler_testing/COPTer/projects/files/thrust_cpp17/sources/lib/cmake/libcudacxx/../../../libcudacxx/include/cuda/std/array:172: operator[]: block: [0,0,0], thread: [172,0,0] Assertion `out-of-bounds access in std::array<T, N>` failed.
/host_compiler_testing/COPTer/projects/files/thrust_cpp17/sources/lib/cmake/libcudacxx/../../../libcudacxx/include/cuda/std/array:172: operator[]: block: [0,0,0], thread: [173,0,0] Assertion `out-of-bounds access in std::array<T, N>` failed.
/host_compiler_testing/COPTer/projects/files/thrust_cpp17/sources/lib/cmake/libcudacxx/../../../libcudacxx/include/cuda/std/array:172: operator[]: block: [0,0,0], thread: [174,0,0] Assertion `out-of-bounds access in std::array<T, N>` failed.
/host_compiler_testing/COPTer/projects/files/thrust_cpp17/sources/lib/cmake/libcudacxx/../../../libcudacxx/include/cuda/std/array:172: operator[]: block: [0,0,0], thread: [177,0,0] Assertion `out-of-bounds access in std::array<T, N>` failed.
/host_compiler_testing/COPTer/projects/files/thrust_cpp17/sources/lib/cmake/libcudacxx/../../../libcudacxx/include/cuda/std/array:172: operator[]: block: [0,0,0], thread: [178,0,0] Assertion `out-of-bounds access in std::array<T, N>` failed.
/host_compiler_testing/COPTer/projects/files/thrust_cpp17/sources/lib/cmake/libcudacxx/../../../libcudacxx/include/cuda/std/array:172: operator[]: block: [0,0,0], thread: [179,0,0] Assertion `out-of-bounds access in std::array<T, N>` failed.
/host_compiler_testing/COPTer/projects/files/thrust_cpp17/sources/lib/cmake/libcudacxx/../../../libcudacxx/include/cuda/std/array:172: operator[]: block: [0,0,0], thread: [180,0,0] Assertion `out-of-bounds access in std::array<T, N>` failed.
/host_compiler_testing/COPTer/projects/files/thrust_cpp17/sources/lib/cmake/libcudacxx/../../../libcudacxx/include/cuda/std/array:172: operator[]: block: [0,0,0], thread: [182,0,0] Assertion `out-of-bounds access in std::array<T, N>` failed.
/host_compiler_testing/COPTer/projects/files/thrust_cpp17/sources/lib/cmake/libcudacxx/../../../libcudacxx/include/cuda/std/array:172: operator[]: block: [0,0,0], thread: [183,0,0] Assertion `out-of-bounds access in std::array<T, N>` failed.
/host_compiler_testing/COPTer/projects/files/thrust_cpp17/sources/lib/cmake/libcudacxx/../../../libcudacxx/include/cuda/std/array:172: operator[]: block: [0,0,0], thread: [185,0,0] Assertion `out-of-bounds access in std::array<T, N>` failed.
/host_compiler_testing/COPTer/projects/files/thrust_cpp17/sources/lib/cmake/libcudacxx/../../../libcudacxx/include/cuda/std/array:172: operator[]: block: [0,0,0], thread: [186,0,0] Assertion `out-of-bounds access in std::array<T, N>` failed.
/host_compiler_testing/COPTer/projects/files/thrust_cpp17/sources/lib/cmake/libcudacxx/../../../libcudacxx/include/cuda/std/array:172: operator[]: block: [0,0,0], thread: [187,0,0] Assertion `out-of-bounds access in std::array<T, N>` failed.
/host_compiler_testing/COPTer/projects/files/thrust_cpp17/sources/lib/cmake/libcudacxx/../../../libcudacxx/include/cuda/std/array:172: operator[]: block: [0,0,0], thread: [188,0,0] Assertion `out-of-bounds access in std::array<T, N>` failed.
/host_compiler_testing/COPTer/projects/files/thrust_cpp17/sources/lib/cmake/libcudacxx/../../../libcudacxx/include/cuda/std/array:172: operator[]: block: [0,0,0], thread: [224,0,0] Assertion `out-of-bounds access in std::array<T, N>` failed.
/host_compiler_testing/COPTer/projects/files/thrust_cpp17/sources/lib/cmake/libcudacxx/../../../libcudacxx/include/cuda/std/array:172: operator[]: block: [0,0,0], thread: [225,0,0] Assertion `out-of-bounds access in std::array<T, N>` failed.
/host_compiler_testing/COPTer/projects/files/thrust_cpp17/sources/lib/cmake/libcudacxx/../../../libcudacxx/include/cuda/std/array:172: operator[]: block: [0,0,0], thread: [227,0,0] Assertion `out-of-bounds access in std::array<T, N>` failed.
/host_compiler_testing/COPTer/projects/files/thrust_cpp17/sources/lib/cmake/libcudacxx/../../../libcudacxx/include/cuda/std/array:172: operator[]: block: [0,0,0], thread: [229,0,0] Assertion `out-of-bounds access in std::array<T, N>` failed.
/host_compiler_testing/COPTer/projects/files/thrust_cpp17/sources/lib/cmake/libcudacxx/../../../libcudacxx/include/cuda/std/array:172: operator[]: block: [0,0,0], thread: [231,0,0] Assertion `out-of-bounds access in std::array<T, N>` failed.
/host_compiler_testing/COPTer/projects/files/thrust_cpp17/sources/lib/cmake/libcudacxx/../../../libcudacxx/include/cuda/std/array:172: operator[]: block: [0,0,0], thread: [233,0,0] Assertion `out-of-bounds access in std::array<T, N>` failed.
/host_compiler_testing/COPTer/projects/files/thrust_cpp17/sources/lib/cmake/libcudacxx/../../../libcudacxx/include/cuda/std/array:172: operator[]: block: [0,0,0], thread: [235,0,0] Assertion `out-of-bounds access in std::array<T, N>` failed.
/host_compiler_testing/COPTer/projects/files/thrust_cpp17/sources/lib/cmake/libcudacxx/../../../libcudacxx/include/cuda/std/array:172: operator[]: block: [0,0,0], thread: [237,0,0] Assertion `out-of-bounds access in std::array<T, N>` failed.
/host_compiler_testing/COPTer/projects/files/thrust_cpp17/sources/lib/cmake/libcudacxx/../../../libcudacxx/include/cuda/std/array:172: operator[]: block: [0,0,0], thread: [239,0,0] Assertion `out-of-bounds access in std::array<T, N>` failed.
/host_compiler_testing/COPTer/projects/files/thrust_cpp17/sources/lib/cmake/libcudacxx/../../../libcudacxx/include/cuda/std/array:172: operator[]: block: [0,0,0], thread: [241,0,0] Assertion `out-of-bounds access in std::array<T, N>` failed.
/host_compiler_testing/COPTer/projects/files/thrust_cpp17/sources/lib/cmake/libcudacxx/../../../libcudacxx/include/cuda/std/array:172: operator[]: block: [0,0,0], thread: [243,0,0] Assertion `out-of-bounds access in std::array<T, N>` failed.
/host_compiler_testing/COPTer/projects/files/thrust_cpp17/sources/lib/cmake/libcudacxx/../../../libcudacxx/include/cuda/std/array:172: operator[]: block: [0,0,0], thread: [245,0,0] Assertion `out-of-bounds access in std::array<T, N>` failed.
/host_compiler_testing/COPTer/projects/files/thrust_cpp17/sources/lib/cmake/libcudacxx/../../../libcudacxx/include/cuda/std/array:172: operator[]: block: [0,0,0], thread: [247,0,0] Assertion `out-of-bounds access in std::array<T, N>` failed.
/host_compiler_testing/COPTer/projects/files/thrust_cpp17/sources/lib/cmake/libcudacxx/../../../libcudacxx/include/cuda/std/array:172: operator[]: block: [0,0,0], thread: [249,0,0] Assertion `out-of-bounds access in std::array<T, N>` failed.
/host_compiler_testing/COPTer/projects/files/thrust_cpp17/sources/lib/cmake/libcudacxx/../../../libcudacxx/include/cuda/std/array:172: operator[]: block: [0,0,0], thread: [251,0,0] Assertion `out-of-bounds access in std::array<T, N>` failed.
/host_compiler_testing/COPTer/projects/files/thrust_cpp17/sources/lib/cmake/libcudacxx/../../../libcudacxx/include/cuda/std/array:172: operator[]: block: [0,0,0], thread: [253,0,0] Assertion `out-of-bounds access in std::array<T, N>` failed.
/host_compiler_testing/COPTer/projects/files/thrust_cpp17/sources/lib/cmake/libcudacxx/../../../libcudacxx/include/cuda/std/array:172: operator[]: block: [0,0,0], thread: [255,0,0] Assertion `out-of-bounds access in std::array<T, N>` failed.
/host_compiler_testing/COPTer/projects/files/thrust_cpp17/sources/lib/cmake/libcudacxx/../../../libcudacxx/include/cuda/std/array:172: operator[]: block: [0,0,0], thread: [192,0,0] Assertion `out-of-bounds access in std::array<T, N>` failed.
/host_compiler_testing/COPTer/projects/files/thrust_cpp17/sources/lib/cmake/libcudacxx/../../../libcudacxx/include/cuda/std/array:172: operator[]: block: [0,0,0], thread: [193,0,0] Assertion `out-of-bounds access in std::array<T, N>` failed.
/host_compiler_testing/COPTer/projects/files/thrust_cpp17/sources/lib/cmake/libcudacxx/../../../libcudacxx/include/cuda/std/array:172: operator[]: block: [0,0,0], thread: [194,0,0] Assertion `out-of-bounds access in std::array<T, N>` failed.
/host_compiler_testing/COPTer/projects/files/thrust_cpp17/sources/lib/cmake/libcudacxx/../../../libcudacxx/include/cuda/std/array:172: operator[]: block: [0,0,0], thread: [195,0,0] Assertion `out-of-bounds access in std::array<T, N>` failed.
/host_compiler_testing/COPTer/projects/files/thrust_cpp17/sources/lib/cmake/libcudacxx/../../../libcudacxx/include/cuda/std/array:172: operator[]: block: [0,0,0], thread: [198,0,0] Assertion `out-of-bounds access in std::array<T, N>` failed.
/host_compiler_testing/COPTer/projects/files/thrust_cpp17/sources/lib/cmake/libcudacxx/../../../libcudacxx/include/cuda/std/array:172: operator[]: block: [0,0,0], thread: [199,0,0] Assertion `out-of-bounds access in std::array<T, N>` failed.
/host_compiler_testing/COPTer/projects/files/thrust_cpp17/sources/lib/cmake/libcudacxx/../../../libcudacxx/include/cuda/std/array:172: operator[]: block: [0,0,0], thread: [200,0,0] Assertion `out-of-bounds access in std::array<T, N>` failed.
/host_compiler_testing/COPTer/projects/files/thrust_cpp17/sources/lib/cmake/libcudacxx/../../../libcudacxx/include/cuda/std/array:172: operator[]: block: [0,0,0], thread: [201,0,0] Assertion `out-of-bounds access in std::array<T, N>` failed.
/host_compiler_testing/COPTer/projects/files/thrust_cpp17/sources/lib/cmake/libcudacxx/../../../libcudacxx/include/cuda/std/array:172: operator[]: block: [0,0,0], thread: [202,0,0] Assertion `out-of-bounds access in std::array<T, N>` failed.
/host_compiler_testing/COPTer/projects/files/thrust_cpp17/sources/lib/cmake/libcudacxx/../../../libcudacxx/include/cuda/std/array:172: operator[]: block: [0,0,0], thread: [203,0,0] Assertion `out-of-bounds access in std::array<T, N>` failed.
/host_compiler_testing/COPTer/projects/files/thrust_cpp17/sources/lib/cmake/libcudacxx/../../../libcudacxx/include/cuda/std/array:172: operator[]: block: [0,0,0], thread: [205,0,0] Assertion `out-of-bounds access in std::array<T, N>` failed.
/host_compiler_testing/COPTer/projects/files/thrust_cpp17/sources/lib/cmake/libcudacxx/../../../libcudacxx/include/cuda/std/array:172: operator[]: block: [0,0,0], thread: [207,0,0] Assertion `out-of-bounds access in std::array<T, N>` failed.
/host_compiler_testing/COPTer/projects/files/thrust_cpp17/sources/lib/cmake/libcudacxx/../../../libcudacxx/include/cuda/std/array:172: operator[]: block: [0,0,0], thread: [209,0,0] Assertion `out-of-bounds access in std::array<T, N>` failed.
/host_compiler_testing/COPTer/projects/files/thrust_cpp17/sources/lib/cmake/libcudacxx/../../../libcudacxx/include/cuda/std/array:172: operator[]: block: [0,0,0], thread: [211,0,0] Assertion `out-of-bounds access in std::array<T, N>` failed.
/host_compiler_testing/COPTer/projects/files/thrust_cpp17/sources/lib/cmake/libcudacxx/../../../libcudacxx/include/cuda/std/array:172: operator[]: block: [0,0,0], thread: [213,0,0] Assertion `out-of-bounds access in std::array<T, N>` failed.
/host_compiler_testing/COPTer/projects/files/thrust_cpp17/sources/lib/cmake/libcudacxx/../../../libcudacxx/include/cuda/std/array:172: operator[]: block: [0,0,0], thread: [215,0,0] Assertion `out-of-bounds access in std::array<T, N>` failed.
/host_compiler_testing/COPTer/projects/files/thrust_cpp17/sources/lib/cmake/libcudacxx/../../../libcudacxx/include/cuda/std/array:172: operator[]: block: [0,0,0], thread: [217,0,0] Assertion `out-of-bounds access in std::array<T, N>` failed.
/host_compiler_testing/COPTer/projects/files/thrust_cpp17/sources/lib/cmake/libcudacxx/../../../libcudacxx/include/cuda/std/array:172: operator[]: block: [0,0,0], thread: [219,0,0] Assertion `out-of-bounds access in std::array<T, N>` failed.
/host_compiler_testing/COPTer/projects/files/thrust_cpp17/sources/lib/cmake/libcudacxx/../../../libcudacxx/include/cuda/std/array:172: operator[]: block: [0,0,0], thread: [221,0,0] Assertion `out-of-bounds access in std::array<T, N>` failed.
/host_compiler_testing/COPTer/projects/files/thrust_cpp17/sources/lib/cmake/libcudacxx/../../../libcudacxx/include/cuda/std/array:172: operator[]: block: [0,0,0], thread: [223,0,0] Assertion `out-of-bounds access in std::array<T, N>` failed.
terminate called after throwing an instance of 'thrust::_V_300400_SM_1200::system::system_error'
  what():  inclusive_scan failed to synchronize: cudaErrorAssert: device-side assert triggered

See NVBug5999870. They use an unreleased nvcc newer than 13.2, but I see the same issue with nvcc 13.2 on RTX 5090 in this branch #7565 (which has the same SASS as main, but different host code). I can't reproduce it on main. Maybe the CI did not catch it cause it uses an RTX PRO 6000.

Activity

  1. moved this from Todo to In Progress in CCCLon Mar 23, 2026
  2. gonidelis commented on Mar 23, 2026

    @gonidelis
    Member

    I was able to catch it locally with my RTX PRO 6000.

  3. miscco commented on Mar 24, 2026

    @miscco
    Contributor

    I was able to catch it locally with my RTX PRO 6000.

    Image

  4. moved this from In Progress to In Review in CCCLon Mar 24, 2026
  5. moved this from In Review to In Progress in CCCLon Mar 26, 2026
  6. moved this from In Progress to In Review in CCCLon Mar 26, 2026
  7. bernhardmgruber commented on Mar 26, 2026

    @bernhardmgruber
    ContributorAuthor

    The bug still reproduces after applying this diff to reduce compilation-time:

    diff --git a/thrust/testing/scan.cu b/thrust/testing/scan.cu
    index 26a6520d04..02c74d9728 100644
    --- a/thrust/testing/scan.cu
    +++ b/thrust/testing/scan.cu
    @@ -15,7 +15,7 @@
     #include <numeric>
     
     #include <unittest/unittest.h>
    -
    +#if 0
     template <class Vector>
     void TestScanSimple()
     {
    @@ -467,15 +467,14 @@ void TestScanWithLargeTypes()
     {
       _TestScanWithLargeTypes<int, 1>();
     
    -#if !defined(__QNX__)
    +#  if !defined(__QNX__)
       _TestScanWithLargeTypes<int, 8>();
       _TestScanWithLargeTypes<int, 64>();
    -#else
    +#  else
       KNOWN_FAILURE;
    -#endif
    +#  endif
     }
     DECLARE_UNITTEST(TestScanWithLargeTypes);
    -
     template <typename T>
     struct plus_mod3
     {
    @@ -534,7 +533,7 @@ void TestInclusiveScanWithConstAccumulator()
       ASSERT_EQUAL(data, (Vector{0, 1, 0, 1, 0, 0, 1}));
     }
     DECLARE_INTEGRAL_VECTOR_UNITTEST(TestInclusiveScanWithConstAccumulator);
    -
    +#endif
     struct only_set_when_expected_it
     {
       long long expected;
    @@ -629,6 +628,7 @@ void TestInclusiveScanWithBigIndexes()
     
     DECLARE_UNITTEST(TestInclusiveScanWithBigIndexes);
     
    +#if 0
     void TestExclusiveScanWithBigIndexesHelper(int magnitude)
     {
       thrust::constant_iterator<long long> begin(1);
    @@ -700,7 +700,7 @@ void TestScanWithUserDefinedTypeAndInit()
       }
     }
     DECLARE_UNITTEST(TestScanWithUserDefinedTypeAndInit);
    -
    +#endif
     // Represents a permutation as a tuple of integers, see also: https://en.wikipedia.org/wiki/Permutation
     // We need a distinct type (instead of an alias) for operator<< to be found via ADL
     struct permutation_t : ::cuda::std::array<int, 5>
    @@ -789,7 +789,7 @@ void TestInclusiveScanWithNonCommutativeOp()
           {4, 0, 2, 1, 3}}));
     }
     DECLARE_UNITTEST(TestInclusiveScanWithNonCommutativeOp);
    -
    +#if 0
     // Adapted from issue: https://github.com/NVIDIA/cccl/issues/6317
     void TestScanBug6317()
     {
    @@ -934,3 +934,4 @@ void TestScanEdgeCases()
       }
     }
     DECLARE_UNITTEST(TestScanEdgeCases);
    +#endif
  8. moved this from In Review to In Progress in CCCLon Mar 26, 2026
  9. moved this from In Progress to In Review in CCCLon Mar 26, 2026
  10. moved this from In Review to Done in CCCLon Apr 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

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