No core-dumps after recent upgrades to systemd?

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.

Answers:

Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.

Method 1

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.

Method 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.


All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x