9 Working With Core Dumps
Core dumps contain crash information for userspace applications and services running on
Oracle Linux. They can be generated on demand by using a debugger, or the
systemd-coredump
service can be configured to generate them
automatically in the event of a process stopping prematurely.
Core dumps contain a log summary of the crash event that typically includes the process
ID, owner, termination signal, and a stack trace. For more information, see the
systemd-coredump(8)
manual pages.
The coredumpctl
command can be used to review core dumps that have been
written to the system journal or saved as a file. For more information, see the
coredumpctl(1)
manual pages.
To learn more about Systemd, the daemon that initializes the system and manages running services in Oracle Linux, see Oracle Linux 8: Managing Core System Configuration.
Enabling Core Dumps
Core dumps aren't enabled by default, so you must configure Systemd to generate them.
-
Create the
/etc/systemd/system.conf.d/10-enable-coredumps.conf
configuration file and add the following content:DumpCore=yes DefaultLimitCORE=infinity
-
Restart the
systemd
daemon to apply the change without restarting Oracle Linux:sudo systemctl daemon-reload
Configuring Core Dumps
To adjust the scope of the data captured in Systemd core dumps and define where Systemd
stores them, change the /etc/systemd/coredump.conf
configuration file.
For more information, see the coredump.conf(5)
manual pages.
Before running the coredumpctl
command, remove any core dump size limits
that apply to the current shell session:
sudo ulimit -c unlimited
For more information about the ulimit
command, see the
ulimit(1)
manual pages.
Analyzing Core Dumps
-
Use the
coredumpctl
command to list the core dumps that are available on the system:coredumpctl list
-
To review more information about the core dumps stored for a particular application, specify the executable as an option:
coredumpctl list executable-path
-
To review all the core dumps that are stored for a failed process on the system, specify the process ID instead:
coredumpctl list process-id
Exporting Core Dumps
-
To export the core dump for bug reporting purposes, specify the process ID and output file when you run the
coredumpctl dump
command:coredumpctl dump process-id -o output-file
-
Optionally, you can export an SOS report with extra information about the system. For more information, see Working With the sos Command.
-
On the same system or a different one, install the
gdb
package and then step through a core dump with the GNU Debugger by using thecoredumpctl debug
command:sudo dnf install gdb
coredumpctl debug process-id
For more information about the coredumpctl
command, see the coredumpctl(1)
manual pages.