Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 6 days ago.
Improve this question
I have project, that builds and runs inside of docker container on my machine, and it works without any errors. I work with video and everything works as expected. But when I build it with fsanitize, it throws:
ERROR: CUDA initialization failure with error 2. Please check your CUDA installation: http://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html
terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc
Flags that use:
set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fno-omit-frame-pointer -fsanitize=address")
set (CMAKE_LINKER_FLAGS_DEBUG "${CMAKE_LINKER_FLAGS_DEBUG} -fno-omit-frame-pointer -fsanitize=address")
CUDA is installed both on host computer and inside of container. Any ideas?
Related
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 28 days ago.
Improve this question
I am compiling LLVM and Clang from source but getting the following error when it tries to link lib/libclang-cpp.so.14git:-
/usr/bin/ld.gold: internal error in open, at ../../gold/descriptors.cc:99
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
I am using Gold Linker and my GCC version is 9.3.0. The LLVM branch is that of LLVM-12 (llvmorg-12.0.0). Earlier I was using LLD linker but that was causing memory overflow, after switching to Gold memory does not overflow but it still fails.
System specs:-
16GB RAM
512GB NVMe SSD
i7 10th Gen 8-cores
Also my swap size is 4GB. I have tried using lesser cores too, but the error still persists.
Any help would be appreciated. Thanks.
P.S:- I am an absolute noob when it comes to LLVM.strong text
I finally figured this out. I was getting the same error, but building a different project.
Turns out that gold is bad at reporting errors. The actual issue is that the OS is running out of file descriptors. In my case it was set to 1024 (you can check with ulimit -n) but a large linking job needed more than that.
If you bump the number of file descriptors then gold works just fine.
# I choose 65536, you can change this number
ulimit -n 65536
Why do I say gold is bad at reporting errors? Because if you force it to run on multithreaded mode (it defaults to single threaded) then it properly reports:
/usr/bin/ld.gold: fatal error: out of file descriptors and couldn't close any
Which is a more useful message.
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 3 years ago.
Improve this question
I got a segfault when running my program. Then I googled my question and tried to follow steps from https://www.gnu.org/software/gcc/bugs/segfault.html.
I did not configure GCC with --enable-checking then my first question is -
1) is it necessary to configure it and compile with -v -da -Q ?
But I always do compile with flags such as -g -o0. After running the program in GDB with arguments I get this:
2) I can not print variables after segfault, is it okay ?
3) How to figure out the line of my source code where segfault happens ?
Then I googled my question and tried to follow steps from > https://www.gnu.org/software/gcc/bugs/segfault.html.
These are the steps for GCC developers to follow when GCC itself crashes while compiling your program.
These are not the steps you should follow when debugging a crash in the program itself.
Instead, read this.
How to figure out the line of my source code where segfault happens ?
GDB told you the line: it's common/search.cpp line 172.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
Can someone tell me how to debug segmentation fault in linux VIA AFS. I would appreciate if someone could refer me command. I am able to run my code via compiler but not on when i give command g++ -o file1 file2.cpp----> ./file----->segmentation fault
Compile the program with the -g option
g++ -g -o file1 file2.cpp
Then execute the executable created with gdb.
gdb file1
Once you see the seg fault issue bt, this will give you the stack.
frame <frame number> you can see the details about the particular stack.
Happy debugging.
Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 8 years ago.
Improve this question
i have a c++ program contained in a single file, movie2serial.cpp. i am compiling the program using g++ with the following command:
g++ -std=c++0x -lstdc++ -lpthread -lboost_system movie2serial.cpp -o movie2serial
this produces an executable called movie2serial. on Debian Wheezy (running on a Raspberry Pi) i have no trouble running this executable. however, i just tried to compile the same program on OSX, using the same call to g++. i tried ./movie2serial and open ./movie2serial from the appropriate directory but these commands just return the following error:
open: No such file or directory
when i run file ./movie2serial it returns this:
./movie2serial: Mach-O 64-bit executable x86_64
why can't i execute my program?
Looks like your compilation failed.
Try executing the command below and check whether you have a file named movie2serial.
ls -al
When I try to compile using the command line options that you have given, it gives me the following error with -lboost_system.
ld: library not found for -lboost_system
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I have compiled C++ project using cmake utility on Red hat Linux 4.1.2.
gcc version: 4.1
When I try to run object file using following command I got an exception:
./GCVMP ../../dat/settlingsUnix/MPSettings.xml
exception : Fatal Error: æ¹¥åSä
I am not able to understand root cause.
Please help me in this regard.
I suspect that the "Fatal Error:" portion is something printed by your code. It's supposed to be followed by a message explaining the error, but the message passed is corrupted, and so junk is printed.
Have you tried compiling the program with -ggdb running it under gdb? Here's a good starter on how to use the debugger: http://www.ibm.com/developerworks/library/l-gdb/