Where does ubuntu 14.04 drop core files?

19

5

I have enabled a unlimited core file size using ulimit:

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

I believe I have triggered a core dump but I can't locate the core file in my home, var/... etc...

Do you know where Ubuntu configures the core dump location?

jcalfee314

Posted 2014-12-05T19:08:24.383

Reputation: 593

@djf the OP didn't specify what program was causing core dumps. It may not be programmers code. It may be Unity for all we know. – Rich Homolka – 2015-01-26T23:48:45.397

1How is this a SuperUser question? This is about running a debugger which only programmers use. This should be migrated back to SO. – Homer6 – 2018-03-01T05:04:19.717

Answers

6

I think this is a more Linux kernel thing than a specific Ubuntu thing. Check out

cat /proc/sys/kernel/core_pattern

Check out the core file man page

Rich Homolka

Posted 2014-12-05T19:08:24.383

Reputation: 27 121

13That does not tell you where it puts the file. The question named Ubuntu 14.04. It is not clear at all by following the command in /proc/sys/kernel/core_pattern where one would find the file. – jcalfee314 – 2015-02-20T01:49:08.700

1For me, that core_pattern kernel pseudofile references a program called 'apport'... which has no man page nor much helpful output. So still searching for my dumped cores. :( – gojomo – 2015-06-09T14:34:47.290

1apport is the standard linux desktop core handler it reports back to your distro usually. – kkron – 2015-09-09T02:16:48.630

How to open this folder? cd /usr/share/apport/apport don't work. – mrgloom – 2016-02-09T20:04:38.067

31

By default, the Ubuntu kernel is configured to use apport to log coredumps. You can override this by overwriting /proc/sys/kernel/core_pattern, check the "Naming of core dump files" section in man core for details. For example:

echo '/tmp/core.%e.%p.%t' | sudo tee /proc/sys/kernel/core_pattern

Apport writes core dumps to /var/crash/_path_to_program.userid.crash, BUT it will only do so for applications installed from the main ubuntu apt repositories.

More info on apport: https://wiki.ubuntu.com/Apport

maccam94

Posted 2014-12-05T19:08:24.383

Reputation: 411

To write core dumps for non-package programs as well, create a file named ~/.config/apport/settings with the following contents:

[main] unpackaged=true – greuze – 2018-10-31T09:01:26.907

Modifying the /proc/sys/kernel/core_pattern does not work for me in Ubuntu 18.04 – greuze – 2018-10-31T09:03:37.140

1

On Ubuntu 16.04.3 LTS, my core dump was located at:

/var/lib/systemd/coredump/core.application-name.0.24d47e89526c4c7e90953998d2c33d1e.19672.1516049424000000000000

So, to run it in gdb, you can run:

apt install gdb gdb /path/to/your/binary/application-name /var/lib/systemd/coredump/core.application-name.0.24d47e89526c4c7e90953998d2c33d1e.19672.1516049424000000000000

Homer6

Posted 2014-12-05T19:08:24.383

Reputation: 458