
How does you system dump crash information>
cat /proc/sys/kernel/core_pattern
|/usr/share/apport/apport -p%p -s%s -c%c -d%d -P%P -u%u -g%g -F%F -- %
In this case, it sends crash information into Apport for automated crash reporting and analysis, rather than leaving a plain binary file.
How to dump crash information into a file?
sudo sysctl -w kernel.core_pattern=core
writes raw core dumps to files named “core”.
If you want to get back the setting, use below command.
sudo sysctl -w kernel.core_pattern='|/usr/share/apport/apport -p%p -s%s -c%c -d%d -P%P -u%u -g%g -F%F -- %E'
How to analyze core file
gdb /path/to/program core
/path/to/program: crashed executed program
core : generated core file
How to analyze core file in gdb
- bt → Backtrace (the call stack at the time of the crash)
- info locals → View local variables
- list → Display the corresponding source code lines (if debugging information is available)