Catch2
Catch2 copied to clipboard
Catch2 v3.3.1 + MSVC + CUDA 12 cause ICE
Describe the bug While trying to upgrade our test infrastructure from Catch2 v3.2.1 to v3.3.1 (did not test v3.3.0) I noticed that our Windows CI fails with the following message:
D:\a\alpaka\alpaka\test\integ\zeroDimBuffer\src\zeroDimBuffer.cpp(56): internal error : assertion failed: alloc_copy_of_pending_pragma: copied pragma has source sequence entry (pragma.c, line 526 in alloc_copy_of_pending_pragma) [D:\a\alpaka\alpaka\build\test\integ\zeroDimBuffer\zeroDimBufferTest.vcxproj]
This happens multiple times for different test cases. A quick investigation showed that this always occurs inside a TEMPLATE_LIST_TEST_CASE() for the first occurrence of CHECK() or REQUIRE().
Expected behavior A successful compilation of the test case.
Reproduction steps I didn't have time yet to come up with a small reproducer outside our code base. Feel free to look at our CI log here.
Platform information:
- OS: Windows Server 2022
- Compiler+version: nvcc v12.0.76 + MSVC 19.34.31937.0
- Catch version: v3.3.1
Additional context Possibly related to #2626. Probably a NVCC compiler bug.
I think you'd be better served opening up this issue against nvcc with nvidia.
@griwes I am under the impression that nvcc 12 is not ancient, so you might be interested. 😃
It seems that Catch2 v3.3.2 fixed this somehow, I can no longer reproduce this.
Ah, sorry for the noise. I looked at the wrong test cases...
Sure, but I still think you should open the issue with nvcc upstream.
I finally had the time to investigate a bit more. Since the issue persists in CUDA 12.1 I opened an issue on NVIDIA's bug tracker (NVIDIA ID 4160692). Reproducer:
#include <catch2/catch_template_test_macros.hpp>
#include <catch2/catch_test_macros.hpp>
#include <tuple>
using MyTypes = std::tuple<int, char, float>;
TEMPLATE_LIST_TEST_CASE("Template test case with test types specified inside std::tuple", "[template][list]", MyTypes)
{
REQUIRE(sizeof(TestType) > 0);
}
Error message:
catch2_error\main.cu(9): internal error : assertion failed: alloc_copy_of_pending_pragma: copied pragma has source sequence entry (pragma.c, line 526 in alloc_copy_of_pending_pragma)
do { ; Catch::AssertionHandler catchAssertionHandler( "REQUIRE"_catch_sr, ::Catch::SourceLineInfo( "catch2_error\\main.cu", static_cast<std::size_t>( 9 ) ), "sizeof(TestType) > 0"_catch_sr, Catch::ResultDisposition::Normal ); try { __pragma(nv_diagnostic push ) catchAssertionHandler.handleExpr( Catch::Decomposer() <= sizeof(TestType) > 0 ); __pragma(nv_diagnostic pop ) } catch(...) { catchAssertionHandler.handleUnexpectedInflightException(); } catchAssertionHandler.complete(); } while( (void)0, (false) && static_cast<const bool&>( !!(sizeof(TestType) > 0) ) );
^
1 catastrophic error detected in the compilation of "catch2_error/main.cu".
Compilation aborted.
main.cu
CUDACOMPILE : nvcc error : 'cudafe++' died with status 0xC0000409
NVIDIA were able to reproduce the issue and are now looking into it.