I have a process in Linux that\'s getting a segmentation fault. How can I tell it to generate a core dump when it fails?
Ubuntu 19.04
All other answers themselves didn't help me. But the following sum up did the job
Create ~/.config/apport/settings
with the following content:
[main]
unpackaged=true
(This tells apport to also write core dumps for custom apps)
check: ulimit -c
. If it outputs 0, fix it with
ulimit -c unlimited
Just for in case restart apport:
sudo systemctl restart apport
Crash files are now written in /var/crash/
. But you cannot use them with gdb. To use them with gdb, use
apport-unpack
Further information:
core_pattern
. Be aware, that that file might get overwritten by the apport service on restarting.ulimit -c
value might get changed automatically while you're trying other answers of the web. Be sure to check it regularly during setting up your core dump creation.References: