13

When I execute a program that I work on, it fails with the following message:

...
Aborted (core dumped)

However, no core dump is created. Core dumps were written previously, and I don't remember that I changed anything related to it.

When I run ulimit -a I get back,

$ ulimit -a
core file size          (blocks, -c) unlimited
...

Other points,

  • I verified that my user can create files in the current directory.
  • I read about /proc/sys/fs/suid_dumpable. Currently, it is set to 0 on my machine. I tried to change it to 1 or 2 but no difference.
  • I also tried to execute the program as root, but that did not make a difference either.

Unfortunately, I don't remember when I could produce the last successful core-dump.

2 Answers 2

8

From the docs on coredump.conf,

To disable a configuration file supplied by the vendor, the recommended way is to place a symlink to /dev/null in the configuration directory in /etc/, with the same filename as the vendor configuration file.

sudo ln -s /dev/null /etc/sysctl.d/coredump.conf
sudo systemd-sysctl 

Since systemd, things are managed differently.

4
  • Wow, you are right! Not long ago I switched to systemd. sudo systemd-coredumpctl shows all the missing core dumps. Your solution worked but only after a system reboot. Feb 17, 2013 at 20:08
  • 1
    systemd's systemd-sysctl.service just runs sysctl at the proper point of boot, and handles rerunning it by hand on changes. And don't go creating/overwriting configuration files without investigating what they are for and their contents.
    – vonbrand
    Feb 17, 2013 at 22:51
  • 2
    The file seems to be renamed to 50-coredump.conf, in order to apply the settings in the current boot, I had to run change the sysctl setting manually, see stackoverflow.com/q/2065912/427545.
    – Lekensteyn
    Nov 15, 2013 at 9:52
  • 3
    To restore the default , do not set an empty string, use this instead: sysctl -w kernel.core_pattern="core"
    – Lekensteyn
    Nov 15, 2013 at 10:05
2

You might want to use the coredumpctl command to either retrieve your core dump or run gdb on it. That's the 'systemd approved' method of dealing with them. :-/

In a certain sense, it's sort of nice that systemd is capturing all of these things because it will erase them automatically after while, and it also makes it easy to upload crash dumps for bug reports.

But, it was a jarring change with little in the way of notification or hints for people who knew how coredumps worked before systemd got involved. Even dropping a file named 'core.pid.txt' with instructions to use coredumpctl to get your coredump as well as how to turn off the creation of the .txt files would've been a big help, even though those would've also littered the filesystem for awhile.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.