I have this output when trying to debug
Program received signal SIGSEGV, Segmentation fault 0x43989029 in
std::string::compare (this=0x88fd430, __str=@0xbfff9060) at
/home/devsw/tmp/objdir/i686-pc-linux-gnu/libstdc++-v3/include/bits/char_traits.h:253253 { return memcmp(__s1, __s2, __n); }
Current language: auto; currently c++
Using valgrind I getting this output
==12485== Process terminating with default action of signal 11 (SIGSEGV)
==12485== Bad permissions for mapped region at address 0x0
==12485== at 0x1: (within path_to_my_executable_file/executable_file)
You don’t need to use Valgrind, in fact you want to use the GNU DeBugger (GDB).
If you run the application via gdb (
gdb path_to_my_executable_file/executable_file) and you’ve compiled the application with debugging enabled (-gor-ggdbfor GNU C/C++ compilers), you can start the application (viaruncommand at the gdb prompt) and once you arrive at the SegFault, do a backtrace (bt) to see what part of your program calledstd::string::comparewhich died.Example (C):
So the error I’m interested in is located on crash.c line 5.
Good luck.