Versions: running Ubuntu 8.04, gdb 6.8, valgrind 3.3.1. Using the --db-attach=yes feature of Valgrind, I try to view the traceback info and all I receive is "?? in ()" for a couple of lines, like so: 0x040ba990 in ?? () from /lib/ld-linux.so.2 (gdb) bt #0 0x040ba990 in ?? () from /lib/ld-linux.so.2 #1 0x4b4a4948 in ?? () #2 0x4f4e4d4c in ?? () #3 0x53525150 in ?? () #4 0x57565554 in ?? () #5 0x5b5a5958 in ?? () #6 0x5f5e5d5c in ?? () #7 0x63626160 in ?? () #8 0x67666564 in ?? () #9 0x040891ac in ?? () #10 0x04123ff4 in ?? () #11 0xbef5f5c8 in ?? () #12 0x040ba944 in calloc@plt () from /lib/ld-linux.so.2 #13 0x04126598 in ?? () #14 0xffffffff in ?? () #15 0x0401aff4 in ?? () #16 0x0404bad8 in ?? () #17 0x0401d8c8 in ?? () #18 0xbef5f5b0 in ?? () I have discovered that if I recompile gdb 6.8 with the CXXFLAGs=-fno-omit-frame-pointer turned on and recompile valgrind 3.3.1, then it is able to attach correctly, giving useful traceback information. I checked the bug database and found similar output issues from other valgrind users, but no one seemed to receive this output based on this particular problem. Have you come across this before?
Here is a simple test program that will cause this behavior on a default Ubuntu 7.10 system: #include <iostream> struct A { A() { } int i; int j; }; void printA(A* p_a) { std::cout << p_a->i << std::endl; } int main() { A* a = new A(); printA(a); return 0; }
We often have GDB attaching problems, it would be good to improve this situation, or at least document better the limitations.
The --db-attach feature is deprecated as of valgrind 3.10.0. It will be removed in the next valgrind feature release. The built-in GDB server capabilities are superior and should be used instead. Therefore, this bug will not be fixed.