Every time, my application crash a core dump file is not generated. I remember that few days ago, on another server it was generated. I\'m running the app u
In centos,if you are not root account to generate core file: you must be set the account has a root privilege or login root account:
vim /etc/security/limits.conf
account soft core unlimited
account hard core unlimited
then if you in login shell with securecrt or other:
logout and then relogin
Also, check to make sure you have enough disk space on /var/core
or wherever your core dumps get written. If the partition is almos full or at 100% disk usage then that would be the problem. My core dumps average a few gigs so you should be sure to have at least 5-10 gig available on the partition.
Just in case someone else stumbles on this. I was running someone else's code - make sure they are not handling the signal, so they can gracefully exit. I commented out the handling, and got the core dump.
This link contains a good checklist why core dumps are not generated:
exit()
instead of using the core dump handler.Remember if you are starting the server from a service, it will start a different bash session so the ulimit won't be effective there. Try to put this in your script itself:
ulimit -c unlimited
For the record, on Debian 9 Stretch (systemd
), I had to install the package systemd-coredump
. Afterwards, core dumps were generated in the folder /var/lib/systemd/coredump
.
Furthermore, these coredumps are compressed in the lz4
format. To decompress, you can use the package liblz4-tool
like this: lz4 -d FILE
.
To be able to debug the decompressed coredump using gdb
, I also had to rename the utterly long filename into something shorter...