Temporarily enabling a coredump for testing

Hi all, I'm running Zorin 15.3 Core version & have a program which has an intermittent crash to the desktop, I've spoken with the developer & they'd like to see a coredump of the program

I've tried

open terminal
cd program folder
ulimit -c unlimited
./program
use program until it crashes

/proc/sys/kernel/core_pattern is "core" so I'm expecting a file called "core" or possibly "core.{pidnumber}" to appear in the program folder but no new files appear

I have write access to the programs folder & I've even searched the entire disk with no joy

So obviously I'm doing something wrong and the coredump isn't being generated, any suggestions ?

I believe in LTS versions of Ubuntu which Zorin is based upon, core dumping is disabled.
But you can enable it by entering this command into the terminal

sudo systemctl enable apport
1 Like

Thanks for the help, tried that & got the message

Failed to enable unit: Unit file apport.service does not exist.

Do I need to install this somehow ?

To enable core dumps try:

ulimit -S -c unlimited

If you want to enable core dump permanently, add following line in /etc/security/limits.conf to update system limit:

* soft core unlimited

To disable:

ulimit -S -c 0

Default location is /usr/libexec/abrt-hook-ccpp

We can change this location using sysctl command

sudo sysctl -w kernel.core_pattern=/coredumps/core-%e-%s-%u-%g-%p-%t

This command will update core_pattern file: /proc/sys/kernel/core_pattern with new location.

3 Likes

@337harvey Okidoki, thanks for the help

I tried

ulimit -S -c unlimited

Ran the program to a crash and didn't get a coredump in the current directory or in /usr/libexec/abrt-hook-ccppul

/proc/sys/kernel/core_pattern contains

core

Which as I understand it will cause the crash dump to be put in the current directory and have the name "core" which I'm fine with, I don't want to move it anywhere

I don't want to enable core dumps permanently, just this one time

It's beginning to look like core dumping isn't just disabled, it's not installed, though I have no idea how to check for this

OK I've done some digging

Firstly Zorin 15.3 Core is a systemd system so I think I need coredumpctl to access any dumps

It wasn't on my system so I installed this using

sudo apt install systemd-coredump

I tested things by writing a small program ( see Understand and configure core dumps on Linux - Linux Audit for reference)

crash.c contains

int main()
{
return 1/0;
}

compiled this with gcc -o crash crash.c & then ran it

ulimit -S -c unlimited
./crash

which gave the following Floating point exception (core dumped)

And lo coredumpctl list shows there is a dump file YESSSSS :grinning:

So I tried this with the program that's giving me grief

And there's no dump file :angry:

So the program is managing to crash without producing a dump despite the developer assuring me a dump file will be created

I'm going to inform them of this, this issue can be closed, thanks to everyone for their help

2 Likes

If I can ask...

All this began from trying to get a core dump in order to troubelshoot an initial issue.
What was the initial issue?

It may be worth starting a new thread on that...

@Aravisian
It's specific to the actual program, I run it & tell it to do a list of things, it gets about halfway through & I get dumped to the desktop

The coredump is needed so the developer can debug their program

But as Zorin disables coredumps by default I needed to make sure I could produce one when needed, especially as I seem to be the only one with this issue

At least I've eliminated Zorin as the reason there's no dump

It may be the actual program that is not dumping, then?
337harvey's post above outlines the process; it works on my copy of Zorin OS 16.

@Aravisian I tried the methods 337harvey sugested, either the program isn't dumping or something is preventing the dump being produced.

I've verified my system will produce a dump of a test program, so it's capable of handling a core dump

But frustratingly I can't get a core dump from the program I want a core dump of

So I'm going to start looking at the things that can prevent a core dump being produced

1 Like

I understand. Without knowing the program or more about it, we cannot help try to diagnose it. But perhaps that program has a support desk as well with regular users who can give some input.

1 Like