What does the GDB backtrace message "0x0000000000000000 in ?? ()" mean?

Shane Breatnach picture Shane Breatnach · Sep 23, 2008 · Viewed 13.5k times · Source

What does it mean when it gives a backtrace with the following output?

#0  0x00000008009c991c in pthread_testcancel () from /lib/libpthread.so.2
#1  0x00000008009b8120 in sigaction () from /lib/libpthread.so.2
#2  0x00000008009c211a in pthread_mutexattr_init () from /lib/libpthread.so.2
#3  0x0000000000000000 in ?? ()

The program has crashed with a standard signal 11, segmentation fault. My application is a multi-threaded FastCGI C++ program running on FreeBSD 6.3, using pthread as the threading library.

It has been compiled with -g and all the symbol tables for my source are loaded, according to info sources.

As is clear, none of my actual code appears in the trace but instead the error seems to originate from standard pthread libraries. In particular, what is ?? () ????

EDIT: eventually tracked the crash down to a standard invalid memory access in my main code. Doesn't explain why the stack trace was corrupted, but that's a question for another day :)

Answer

DGentry picture DGentry · Sep 23, 2008

gdb wasn't able to extract the proper return address from pthread_mutexattr_init; it got an address of 0. The "??" is the result of looking up address 0 in the symbol table. It cannot find a symbolic name, so it prints a default "??"

Unfortunately right offhand I don't know why it could not extract the correct return address.