Posted inInformation Technology

Finding Your Core Dumps

core dump

Admit it, you and every other developer hates debugging other developer’s code, especially when it core dumps. Can it get any worse than hearing them say “works for me” when it dumps 100% of the time for you? Regular readers of this blog will know I’ve written about core dumps before. I’ve written about Ubuntu too many times to count. If some other Linux desktop distro would actually test with Nvidia drivers prior to shipping I would most definitely use them.

core dump

Where did my core dump go?

The Nanny State has gotten to be too much to deal with. Ubuntu/Canonical thinks nothing of including software that launches hundreds, possibly thousands of threads which are never or rarely used. God forbid something would want to write to the disk or the screen though! QtCreator had this inexplicable change some time ago, turned off debug output because, who would ever want to see debug output in an IDE? Rather than figure out proper core dump file management, Ubuntu/Canonical simply took it away from users. The Nanny State rides again!

For those who want to cut and paste

sudo nano /etc/security/limits.conf

Change the bottom of the file to have the two lines shown in white. The default for mere mortal users is 0.

Note: on Linux Mint 21.3 and probably many others your file will look like this.

Everybody says to log out then back in. I always reboot. Why? So all root processes now have unlimited instead of just the new ones. Never know when what you are running will secretly run a few things as root. After you bounce the box, open a terminal and try the following.

Verify apport is running

Lots of old and incorrect documentation online saying this isn’t supported. Perhaps at some point that was true, just not true today.

Lots of people are online telling you to check this.

If you happen to keep a copy of this handy, it might be of some use.

Avoid all of the misdirection

I cannot tell you now many posts I stumble into telling people to look in /var/crash. The system stuff goes there sometimes, yes. Your application that you wrote and are testing will not land in that paradise.

Where your core dumps go

That’s correct people. Your dumps will be in /var/lib/apport/coredump if you have everything configured correctly. They will not pollute /var/crash.

With Great Limits Comes Great Responsibility

Now that you know where they are, be sure to purge this directory ever so often. Don’t be a stubborn fool trying to run something that keeps crashing with a core dump and not clean this up. Your fantabulous spacious disk will fill up fast.

Those three dump files took up a lot of space!

Linux Mint Doesn’t Use Apport

It might well be only Ubuntu that uses Apport. Mint and most other distros use systemd. You generally don’t have to make certain it is running. Your core dumps can be found here.

These are not in a form directly GDB can recognize, at least from inside Emacs. You can read one of the manpages for coredumpctl but, here is the thumbnail.

coredumpctl gdb 13362

If you look at the list of files you will notices 13362 is one of the dot separated numbers. It’s the PID the process had. For more information on Emacs read my latest book on Emacs.

Roland Hughes started his IT career in the early 1980s. He quickly became a consultant and president of Logikal Solutions, a software consulting firm specializing in OpenVMS application and C++/Qt touchscreen/embedded Linux development. Early in his career he became involved in what is now called cross platform development. Given the dearth of useful books on the subject he ventured into the world of professional author in 1995 writing the first of the "Zinc It!" book series for John Gordon Burke Publisher, Inc.

A decade later he released a massive (nearly 800 pages) tome "The Minimum You Need to Know to Be an OpenVMS Application Developer" which tried to encapsulate the essential skills gained over what was nearly a 20 year career at that point. From there "The Minimum You Need to Know" book series was born.

Three years later he wrote his first novel "Infinite Exposure" which got much notice from people involved in the banking and financial security worlds. Some of the attacks predicted in that book have since come to pass. While it was not originally intended to be a trilogy, it became the first book of "The Earth That Was" trilogy:
Infinite Exposure
Lesedi - The Greatest Lie Ever Told
John Smith - Last Known Survivor of the Microsoft Wars

When he is not consulting Roland Hughes posts about technology and sometimes politics on his blog. He also has regularly scheduled Sunday posts appearing on the Interesting Authors blog.