coredumpctl: Finding a Binary Crash
What is coredumpctl and how it works
When a binary crashes with SEGV, the kernel can save a core dump — a snapshot of process memory at the moment of the crash. In systemd-based distributions, coredumpctl handles collecting, storing, and searching these dumps. It’s a wrapper around systemd-coredump, which stores dumps in /var/lib/systemd/coredump/ and indexes metadata through journald.
Requires systemd-coredump and an active journald. In minimal containers without systemd, this tool is unavailable.
Installation is trivial for most distributions:
After installation, verify that kernel.core_pattern points to a pipe into systemd-coredump:
If it shows core.%e.%p, dumps are written to files and coredumpctl won’t see them.
Listing dumps: coredumpctl list
The base command prints all saved crashes:
Output contains columns: MESSAGE ID, TIMESTAMP, PID, UID, GID, COMM, EXE, COREFILE.
Use --no-pager for scripts, --json=short for parsing, -n for only the latest entry.
Key flags for list:
| Flag | Purpose |
|---|---|
-n N | Last N entries |
-1 | Only the latest single entry |
--since TIMESTAMP | Starting from date |
--until TIMESTAMP | Until date |
-u USER | By UID |
--exe PATTERN | By binary path |
--debug | Show service dumps |
Crash details: coredumpctl info
For a single dump, info gives everything needed before pulling the file:
Where 1234 is the process PID or number from list. Output includes:
- the signal that caused the crash (SIGSEGV, SIGABRT, etc.)
- timestamp
- executable path
- core file size
MESSAGE ID— correlation with journald
Extracting the core file: coredumpctl dump
The extracted file can be piped directly into gdb or saved to disk:
--output=- writes to stdout. If the core file is large (gigabytes), the pipe may block — better to write to disk.
Filtering and searching by binary, PID, time
In production, dumps accumulate by the dozens, and searching by PID is impractical. coredumpctl supports multiple filters at once:
For scripts and automation, JSON output is convenient:
Practical examples for debugging crashes
A typical debugging cycle looks like this:
If dumps don’t appear, check coredumpctl list and journalctl -u systemd-coredump. A common cause: LimitCORE in the systemd unit is set to 0, or kernel.core_pattern isn’t configured as a pipe.
For persistent monitoring, add to the unit file:
then restart the service. After that, coredumpctl will see all crashes.