getting stacktrace from core dump

user391986 picture user391986 · Apr 21, 2011 · Viewed 48.6k times · Source

How can I get a stack trace from a core dump file? The file is about 14 mb and is generated after my application exits saying "segmentation fault"

I'm on Red Hat 5.5

Answer

sehe picture sehe · Apr 21, 2011
gdb /usr/bin/myapp.binary corefile

Then, use one of:

(gdb) bt
(gdb) bt full
(gdb) info threads
(gdb) thread apply all bt
(gdb) thread apply all bt full

Note that installing debug symbols for the related libraries will help