brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: coredumpctl list shows every program that crashed on your Linux box

Linux
~/tips/tip-linux-coredumpctl-list-crashes

coredumpctl list --since today

See which programs crashed, when, and with which signal, all from the journal.

When a program crashes with a segfault, systemd’s coredump handler catches it on many distributions. coredumpctl is how you look at what it caught.

coredumpctl list --since today

Every line is one crash: the time, the PID, the user, the signal that killed it, whether a core file is still present, and the path of the program. SIGSEGV is the classic segfault and SIGABRT usually means the program stopped itself after a failed check.

For the details of the most recent crash, or of one program:

coredumpctl info
coredumpctl info nginx

That prints the command line, the time, the size of the core and, when debug symbols are available, a short stack trace. Even without symbols, the function names in the trace often hint at which library was involved. coredumpctl debug opens the core in a debugger, gdb by default, if you want to dig further.

I find it useful for the question whether a service restarted because it crashed or because something stopped it.

It only works when systemd-coredump is set up as the kernel’s core handler. On some systems, such as Ubuntu with Apport, crashes go elsewhere, and the list stays empty. Core files are stored under /var/lib/systemd/coredump and cleaned up after a while, so the list can show crashes whose core is already gone. Cores can contain passwords and other data from memory, so be careful who you share them with.

Further reading: coredumpctl(1) manual page, coredump.conf(5) manual page

More Linux tips a2query -m rewrite renice -n 10 -p 4242 cat config.yml | xsel -ib xvfb-run -a your-program --some-flag dpkg --get-selections > packages.txt All Linux tips (261) All topics

Link