Using GDB for coredump

From Rsewiki
Jump to: navigation, search

Enabling core dump

ulimit -c unlimited

Repeat the error to get the core file.

Using the core dump. You need the executable (with debug symbol enabled) and the core file

gdb ./rhd core

Then the message could be:

GNU gdb (Ubuntu 8.1-0ubuntu3.2) 8.1.0.20180409-git
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./rhd...done.
[New LWP 1425]
[New LWP 1421]
[New LWP 1423]
[New LWP 1426]
[New LWP 1420]
[New LWP 1427]
[New LWP 1424]
[New LWP 1422]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `./rhd'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x00007f0db0a68c4d in log_task (not_used=0x0) at rhdlog.c:463        <-------------- this is the interesting part that might help
463               symsCnt = getSymtableSize(c);
[Current thread is 1 (Thread 0x7f0daea61700 (LWP 1425))]

If this is not enough, then a back-trace could be valuable:

(gdb) bt
#0  0x00007f0db0a68c4d in log_task (not_used=0x0) at rhdlog.c:463
#1  0x00007f0db1c196db in start_thread (arg=0x7f0daea61700) at pthread_create.c:463
#2  0x00007f0db1942a3f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

(gdb)

A lot more options are available, ask google or similar.

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox