0

There are a number of posts that are similar to my question here ('What changes do I need to make to generate a core dump on a segmentation fault ?') but none of them worked for me.

I have a process, say A running on my ubuntu machine. I want it to generate a core file anytime it hits a segmentation fault. I made sure 'ulimit' is unlimited. In /etc/security/limits.conf I added 2 lines

*         soft    core        unlimited
*         hard    core        unlimited

What else permanent configuration changes do I need to do ? And what changes do I need to make in my program so that it generates a core file when it hits a segmentation fault. Do I need to add code to handle the signal (SIGSEGV) ?

ks1322
  • 33,961
  • 14
  • 109
  • 164
ejohnson
  • 139
  • 1
  • 4
  • 16
  • 1
    You need to read [Unix Signals](http://man7.org/linux/man-pages/man7/signal.7.html) – AstroMax Mar 13 '18 at 00:46
  • How about the system configuration ? Such as the /etc file changes or any kernel settings ? – ejohnson Mar 13 '18 at 01:18
  • If your application is printing Segmentation fault in the error stream and if core is not getting dumped there could be multiple possibilities. Read this [SO post](https://stackoverflow.com/q/7732983/7846010) – AstroMax Mar 13 '18 at 01:21

0 Answers0