title: Linux: handling a segmentation fault and getting a core dump
body: <p>When my application crashes with a segmentation fault I'd like to get a core dump from the system. I do that by configuring before hand</p>
  
  <pre><code>ulimit -c unlimited
  </code></pre>
  
  <p>I would also like to have an indication in my application logs that a segmentation fault has occured. I do that by using <a href="http://man7.org/linux/man-pages/man2/sigaction.2.html" rel="noreferrer"><code>sigaction()</code></a>. If I do that however, the signal does not reach its default handling and a core dump is not saved.</p>
  
  <p>How can I have both the system core dump an a log line from my own signal handler at the same time?</p>