当(CUDA 7.5的)nvcc / cudafe++崩溃并出现段错误时,我该怎么办?



我今天正在编译一些相关的CUDA代码,突然,我得到了:

nvcc foo.cu -dc -o foo.o -m64 --std c++11 -gencode arch=compute_30,code=compute_30  -I/usr/local/cuda/include  -I/path/to/includes 
Segmentation fault (core dumped)

这是关于Debian Stretch的CUDA 7.5和GCC 4.9.3。触发segfault的代码实际上并没有使用Boost和CUB。

运行gdb,我得到:

...
Reading symbols from /usr/local/cuda/bin/cudafe++...(no debugging symbols found)...done.
[New LWP 26725]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `cudafe++ --allow_managed --m64 --gnu_version=40903 --c++11 --parse_templates --'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x0000000000458b48 in ?? ()
(gdb) bt
#0  0x0000000000458b48 in ?? ()
#1  0x0000000000447989 in ?? ()
#2  0x0000000000449a77 in ?? ()
#3  0x0000000000444d6b in ?? ()
#4  0x00000000004467f1 in ?? ()
#5  0x0000000000446bd5 in ?? ()
#6  0x00000000004536e7 in ?? ()
#7  0x0000000000446c95 in ?? ()
#8  0x00000000004536e7 in ?? ()
#9  0x0000000000446c95 in ?? ()
#10 0x0000000000448403 in ?? ()
#11 0x000000000040b042 in ?? ()
#12 0x00007f3637c17610 in __libc_start_main (main=0x40af50, argc=14, argv=0x7ffd24a32058, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7ffd24a32048) at libc-start.c:291
#13 0x0000000000401769 in ?? ()
#14 0x00007ffd24a32048 in ?? ()
#15 0x000000000000001c in ?? ()
#16 0x000000000000000e in ?? ()
#17 0x00007ffd24a33e7b in ?? ()
#18 0x00007ffd24a33e84 in ?? ()
#19 0x00007ffd24a33e94 in ?? ()
#20 0x00007ffd24a33e9a in ?? ()
#21 0x00007ffd24a33eae in ?? ()
#22 0x00007ffd24a33eb6 in ?? ()
#23 0x00007ffd24a33ec8 in ?? ()
#24 0x00007ffd24a33ed3 in ?? ()
#25 0x00007ffd24a33ee5 in ?? ()
#26 0x00007ffd24a33f16 in ?? ()
#27 0x00007ffd24a33f27 in ?? ()
#28 0x00007ffd24a33f56 in ?? ()
#29 0x00007ffd24a33f6c in ?? ()
#30 0x00007ffd24a33f9b in ?? ()
#31 0x0000000000000000 in ?? ()

所以这不是很有用。我该怎么做才能避免这种混乱?或者弄清楚为什么会发生这种事?

编辑:我刚刚注意到这个类似的问题,但还没有答案。

崩溃的原因似乎是未能防止using关键字的不当使用。这是一个非MCVE(我稍后可能会将其制作成MCVE):

enum class foo : bool { foolish = false, snafu = true };
template <typename T> class bar {
public:
    using foo::foolish;
    using foo::snafu;
}

这是不正确的C++,应该会让编译器发出错误,但由于某种原因,可能是由于与该代码段中没有的更多代码组合,这并没有发生。相反,cudafe++被欺骗接受了这一点,变得困惑和崩溃。

正如@talonmies所建议的,我们将尝试向nVIDIA提交一份适当的错误报告。。。

编辑:现在很难复制:-(

最新更新