I am trying to find out the reason of crash for one of my Linux application. But I don't know where core is going.
cat /proc/sys/kernel/core_pattern
core.%e.%p
Any Idea?
I am trying to find out the reason of crash for one of my Linux application. But I don't know where core is going.
cat /proc/sys/kernel/core_pattern
core.%e.%p
Any Idea?
Systems using systemd are usually configured to dump cores to
/var/lib/systemd/coredump/
You may use the coredumpctl
command to list core dumps.
See also no-more-coredumps-after-migrating-to-systemd
/var/lib/systemd/coredump/
will not contain any core files unless you have installed systemd-coredump
and then re run the program that crashes.
– Aidan Gallagher
Jun 13 '22 at 13:18
The core dump is written in the current directory of the process at the time of the crash.
Of course core dumps need to be enabled, by default those are usually disabled. Check the output of ulimit -c
, if that's 0 then no core file will be written. Run ulimit -c unlimited
to enable core dumps; this is a per-process setting which is inherited by processes started by that process.
If a core dump should have been generated but you don't know where, then you could start the process again (if it will without crashing immediately), then check its working directory by doing ls -l /proc/$pid/cwd
where $pid
is the process ID of the process. That link will point to the current working directory of that process. Chances are the core dump will be there. Otherwise you need to run find
on the entire system...
/tmp
with filenames likecore.12345
(using the PID). But that was a specialized, one-off product. It's probably worth a look, but don't expect to find anything there. – G-Man Says 'Reinstate Monica' Jun 13 '22 at 16:10