Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Application crashes, but no core dump generated

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?

like image 374
Thangaraj Avatar asked Jan 16 '13 07:01

Thangaraj


1 Answers

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
like image 71
vonbrand Avatar answered Sep 28 '22 00:09

vonbrand