Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to analyze core dump

After application[rtorrent] crashed, it produced core file, 250MB.

Caught Segmentation fault, dumping stack:B] [Port: 58940][U 0/0] [D 0/10] [H 1/32] [S 72/75/768] [F 0/128]
Stack dump not enabled.
Aborted (core dumped)

What I need is to analyze and see the stack trace, to have clue why rtorrent is crashing so often.

like image 924
Pablo Avatar asked Jan 10 '12 16:01

Pablo


People also ask

How do I analyze core dump files?

With a core file, we can use the debugger (GDB) to inspect the state of the process at the moment it was terminated and to identify the line of code that caused the problem. That's a situation where a core dump file could be produced, but it's not by default.

How do I open a core dump file?

Use one of the options: Select Run | Open Core Dump from the main menu or call this action from Help | Find Action ( Ctrl+Shift+A ). If there are no Core Dump Debug configurations in the project, the Open Core Dump dialog will be shown right away. Otherwise, select New Core Dump from the popup menu.


1 Answers

gdb should be able to analyse the core:

gdb /path/to/binary/rtorrent /path/to/coredump/rtorrent.core

type where to see stack trace.

To see more: compile rtorrent with debug symbols, run, wait crash and analyse dump with gdb (in this case you can see exact place where crash occurs).

UPD One note, rtorrent is build on top of libtorrent as I know, so, you have to rebuild both library and application with debug symbols in order to get full information.

like image 170
4ndrew Avatar answered Oct 10 '22 15:10

4ndrew