Hi,
nvcc 3.0 segfaults when trying to compile this minimal code sample (stripped down from the actual code I was working with):
[codebox]#include
class test {
static const std::setstd::string tset;
};
std::string tstrings = { “foo”, “bar”, “baz” };
const std::setstd::string test::tset( tstrings, tstrings+3 );
int main() {
return 0;
}[/codebox]
Here’s the output of nvcc -v
[codebox]#$ SPACE=
#$ MODE=DEVICE
#$ CUDART=cudart
#$ HERE=/usr/local/cuda/bin
#$ THERE=/usr/local/cuda/bin
#$ TARGET_SIZE=64
#$ TOP=/usr/local/cuda/bin/…
#$ LD_LIBRARY_PATH=/usr/local/cuda/bin/…/lib:/usr/local/cuda/bin/…/extools/lib
#$ PATH=/usr/local/cuda/bin/…/open64/bin:/usr/local/cuda/bin/…/bin:/usr/local/cuda/bin:/usr/local/cuda/cudaprof/bin:/usr/NX/bin:/NOBACKUP/frat/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
#$ INCLUDES=“-I/usr/local/cuda/bin/…/include” “-I/usr/local/cuda/bin/…/include/cudart”
#$ LIBRARIES= “-L/usr/local/cuda/bin/…/lib64” -lcudart
#$ CUDAFE_FLAGS=
#$ OPENCC_FLAGS=
#$ PTXAS_FLAGS=
#$ gcc -D__CUDA_ARCH__=100 -E -x c++ -DCUDA_FLOAT_MATH_FUNCTIONS -DCUDA_NO_SM_11_ATOMIC_INTRINSICS -DCUDA_NO_SM_12_ATOMIC_INTRINSICS -DCUDA_NO_SM_13_DOUBLE_INTRINSICS “-I/usr/local/cuda/bin/…/include” “-I/usr/local/cuda/bin/…/include/cudart” -I. -D__CUDACC__ -C -include “cuda_runtime.h” -m64 -o “/tmp/tmpxft_00005deb_00000000-4_test.cpp1.ii” “test.cu”
#$ cudafe --m64 --gnu_version=40401 --diag_error=host_device_limited_call --diag_error=ms_asm_decl_not_allowed -tused --no_remove_unneeded_entities --gen_c_file_name “/tmp/tmpxft_00005deb_00000000-1_test.cudafe1.c” --stub_file_name “/tmp/tmpxft_00005deb_00000000-1_test.cudafe1.stub.c” --stub_header_file_name “/tmp/tmpxft_00005deb_00000000-1_test.cudafe1.stub.h” --gen_device_file_name “/tmp/tmpxft_00005deb_00000000-1_test.cudafe1.gpu” --include_file_name “/tmp/tmpxft_00005deb_00000000-3_test.fatbin.c” “/tmp/tmpxft_00005deb_00000000-4_test.cpp1.ii”
Segmentation fault
–error 0x8b --[/codebox]
I verified this behavior on 2 machines:
[*]Ubuntu 8.04, kernel 2.6.24-24-server #1 SMP Wed Apr 15 15:41:09 UTC 2009 x86_64 GNU/Linux
[*]nvcc 3.0, V0.2.1221
[*]gcc 4.2.4
[*]Ubuntu 9.10, kernel 2.6.31-21-generic #59-Ubuntu SMP Wed Mar 24 07:28:27 UTC 2010 x86_64 GNU/Linux
[*]nvcc 3.0, V0.2.1221
[*]gcc 4.4.1
The very same code compiles just fine with g++ (tested both gcc 4.2.4 and 4.4.1).
I couldn’t test on CUDA 3.1 yet, but this appears like a severe bug to me.
Florian