Gdb: how to get full backtrace when fglrx_dri.so segfaults?

I am experiencing segmentation errors in the fglrx dri library when running my own Qt-based OpenGL application. The return path I get from gdb (with dbg characters set for Qt and my own application):

Thread 1 (Thread 0xb7fd9720 (LWP 1809)): #0 0x06276705 in ?? () from /usr/lib/fglrx/dri/fglrx_dri.so #1 0x000020dc in ?? () #2 0x000020d9 in ?? () #3 0x00000000 in ?? () 

I do not see where from my code I call the fglrx function, which causes a segmentation error. How can I extend this backtrace to fully see it from the main () function all the way to the fglrx dri library?

edit: confirmation of my own application is built using debug symbols:

 Reading symbols from /home/user/fglrx crash/crashtest-build-desktop-Qt_4_8_1__Qt-4_8_1__Debug/crashtest...done. (gdb) br main Breakpoint 1 at 0x804996d: file ../program/main.cpp, line 21. (gdb) run Starting program: /home/user/fglrx crash/crashtest-build-desktop-Qt_4_8_1__Qt-4_8_1__Debug/crashtest [Thread debugging using libthread_db enabled] Breakpoint 1, main (argc=1, argv=0xbffff2a4) at ../program/main.cpp:21 21 QApplication a(argc, argv); (gdb) bt #0 main (argc=1, argv=0xbffff2a4) at ../program/main.cpp:21 (gdb) n [New Thread 0xb7d2bb70 (LWP 2475)] [New Thread 0xb752ab70 (LWP 2476)] 22 QMainWindow w; (gdb) bt #0 main (argc=1, argv=0xbffff2a4) at ../program/main.cpp:22 (gdb) s QFlags<Qt::WindowType>::QFlags (this=0xbffff164) at /usr/local/Trolltech/Qt-4.8.1/include/QtCore/qglobal.h:2284 2284 Q_DECL_CONSTEXPR inline QFlags(Zero = 0) : i(0) {} (gdb) bt #0 QFlags<Qt::WindowType>::QFlags (this=0xbffff164) at /usr/local/Trolltech/Qt-4.8.1/include/QtCore/qglobal.h:2284 #1 0x080499a4 in main (argc=1, argv=0xbffff2a4) at ../program/main.cpp:22 
+4
source share
2 answers

You must also generate debug symbols for your own binary. Compile the application using the GCC -g option. It is also recommended to disable optimization for debugging; to do this, use the flag GCC -O0 .

0
source

The simple and terrible answer is you cannot. According to Graham AMD Seller , the driver is compiled with the -fomit-frame-pointer flag , which confuses gdb if it is deeper down the stack.

0
source

All Articles