October 18, 2018

Where the hell are my core files ?

So I have some badly coded C program (no, I didn't write it) and I am getting the message:
Segmentation fault (core dumped)
I type "ls -lrt" and no core file? Yes the directory is writeable.

It turns out there is some weird inscrutable magic now. The thing to do to sort of get a clue is:

cat /proc/sys/kernel/core_pattern
|/usr/lib/systemd/systemd-coredump %P %u %g %s %t %c %e
There is no telling what this does or where files may be going. Allegedly there is information about this in "man 5 core", but anything involving systemd gets me running screaming out of the room. A fine workaround is this:
echo "core" > /proc/sys/kernel/core_pattern
After this, I run my buggy program and find in the same directory the file "core.12382". Thank goodness.
Have any comments? Questions? Drop me a line!

Adventures in Computing / tom@mmto.org