Application crashes, but no core dump generated

Thangaraj picture Thangaraj · Jan 16, 2013 · Viewed 13.1k times · Source

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 incorporated setrlimit 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?

Answer

vonbrand picture vonbrand · Jan 20, 2013

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