Application crashes, but no core dump generated
Many current systems are configured so they don't leave core dumps (the average user doesn't know what to do with them).
- Make sure you start the process where it can dump core (writable directory, enough space; I'm not sure if a directory change in the process might interfere here)
- Make sure to give the "ulimit -c unlimited" in the same shell starting the process
- If the program is SUID or SGID, the kernel will refuse to make it dump core for security reasons, take a look at this question for guidance
Thangaraj
Updated on June 05, 2022Comments
-
Thangaraj almost 2 years
I have an issue where my application keeps on dumping core after few day/weeks, but unfortunately, generates no core dump.
We tried to set
ulimit -c unlimited
with no success, so we incorporatedsetrlimit
functionality in the code itself, but had no luck with that approach either. And, on top of that, we added MALLOC_CHECK_ too.Interestingly, when we tried to initiate a manual core dump (using
kill -ABRT <pid>
), it did generate a core dump.I could see the following message in
/var/log/message
kernel: [2302077.396021] myapp[22140]: segfault at 54552e42 ip 00000000f773f36f sp 00000000fffdc48c error 4 in ld-2.11.3.so[f7727000+1f000]
Environment: sles11
Any suggestions on how to make the application generate core dumps more reliably?
-
kbickar about 10 yearsAlso worth checking the file /proc/sys/kernal/core_pattern to see where the corefiles will be put. /etc/sysctl.conf has a similar one but can be set more permanently.