All articles

Inspect Linux core dumps with coredumpctl

5 minutes read


Linux publication

Share this article

𝕏✉

Illustration for Inspect Linux core dumps with coredumpctl

A core dump is a snapshot of a process at the moment it crashed. On systems using systemd-coredump, coredumpctl gives you an index of those crashes and a controlled route into the stored data.12

Find the right crash

Start with a narrow time range:

coredumpctl list --since today

You can filter by executable, command name, PID, user ID, signal, or journal fields. A PID alone can be reused over time, so pair it with the timestamp, boot, executable path, and command name before selecting a record.1

For one executable:

coredumpctl list /usr/bin/example
coredumpctl info /usr/bin/example

info shows metadata such as signal, executable, command line, user, group, boot ID, and whether the core is present. Stored metadata can remain even when retention policy has removed the core itself.1

Export a selected core

After identifying an unambiguous record:

coredumpctl dump 12345 --output=core.12345

Replace 12345 with the selector you verified. Store the file on an encrypted filesystem with restrictive permissions. Core dumps can include passwords, tokens, customer data, encryption material, and any other bytes present in process memory.2

Open the debugger

coredumpctl debug 12345

The useful first commands in GDB are often:

thread apply all bt full
info sharedlibrary
info registers

A stack full of unresolved addresses usually means the debugger cannot find matching symbols. Install debug information built for the exact executable and library versions from the crash. A similarly named current package is not necessarily good enough.

When no core is available

Check the coredump handler’s log messages and configuration. There is no plain systemd-coredump.service: the kernel hands each crash to systemd-coredump.socket, which starts a separate instance of the systemd-coredump@.service template to process it.2 Filter by the handler’s syslog identifier, or by a unit glob, so every instance matches:

journalctl -b -t systemd-coredump --no-pager
journalctl -b -u 'systemd-coredump@*' --no-pager
systemctl cat systemd-coredump.socket
cat /etc/systemd/coredump.conf 2>/dev/null

Storage policy, size limits, process resource limits, container boundaries, and application-specific crash handlers can all affect whether a usable core reaches systemd-coredump.2

[!CAUTION] Treat every core dump as sensitive. Do not attach one to a public issue or send it to a third party until you have reviewed the disclosure risk and received authorization.

Sources and further reading
  1. coredumpctl
  2. systemd-coredump