-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nvcc crashes when compiling some simple tests #2005
Comments
Some possible workarounds that don't trigger this behavior include: auto x = f();
auto y = std::string("123");
REQUIRE(x == y); and auto x = f();
REQUIRE(x == "123"); On the other hand, this does not work: auto x = f();
REQUIRE(x == std::string("123")); |
Certain REQUIRE statements were causing nvcc (specifically cicc) to crash when compiling. This can be temporarily worked around by introducing temporary variables. See catchorg/Catch2#2005
Is this reproducible on a non-ancient version of NVCC? I'd be happy to file an internal bug against the compiler if that's the case and someone can reduce the test case to a minimum ;) |
I can reproduce it with nvcc 11.0, V11.0.194 (CUDA 11.0.2). The following simple test reproduces it: #define CATCH_CONFIG_MAIN
#include "catch.hpp"
#include <string>
TEST_CASE()
{
REQUIRE(std::string("x") == "x");
} I think this could probably be made even simpler (e.g. using something simpler than |
If the nvidia team provides a reasonable workaround I am willing to merge it, but I am not debugging a segfault in nvcc. @pazner At a glance, the compiler does not like rvalues in
|
Yes, of course that makes sense. Thanks.
It still segfaults without linking and without
This is the simplest example I have found so far: #include "catch.hpp"
struct A
{
int x;
A() : x(10) { }
};
struct B
{
A *a;
B(A *a_) : a(a_) { }
};
TEST_CASE()
{
REQUIRE(B(new A).a->x == 10); // nvcc segfaults
} Interestingly, the following two tests don't trigger the segfault: REQUIRE(A().x == 10); // works
A a;
REQUIRE(B(&a).a->x == 10); // works @griwes, do you think the above example is sufficiently minimal to file an internal bug report? Also I'd be happy to hear if you know of or hear of any workarounds. |
It looks sufficiently minimal (together with the information about it being reproducible without catch's main) for me to run creduce on it once I'm back from vacation early next month and then file a bug, yes ;) (The cases that don't crash cicc are super helpful for creducing it, thanks!) |
Minimized, with creduce, to: struct A {
int x;
A();
};
struct B {
A *a;
B(A *);
};
void d() { A a; __builtin_constant_p(EXPR); } Segfaults with struct A {
A();
};
void d() { __builtin_constant_p(new A); } which is a really nice reproducer, if I say so myself ;> Filed as an internal bug 3123443, "nvcc segfaults when encountering a call to |
If you open up a PR to deactivate the use of |
nvcc
crashes when compiling some simple tests. This looks like it may be a problem withnvcc
, but a workaround or fix in Catch would be great.Reproduction steps
File
test.cu
:Compiling with
nvcc --std=c++11 test.cu
results in:Platform information:
The text was updated successfully, but these errors were encountered: