title: Crashing C++ application including ada dll does not generate core dump
body: <p>How do I get a C++ application including a loaded ada shared library to generate a core dump <strong>when crashing</strong>?</p>
  
  <p>I have a C++ application which loads a ada shared library, inside the ada code I get a stack overflow error which causes program termination along with the console output:</p>
  
  <pre><code>raised STORAGE ERROR
  </code></pre>
  
  <p>No core dump file is generated even thou I have issued a "ulimit -c unlimited" before starting the application.</p>
  
  <p>Same thing happens if I send a kill <strong>SIGSEGV</strong>  to the application.</p>
  
  <p>Sending kill <strong>SIGSEGV</strong> to another application that does not use the ada dll generates a core dump file just the way I want it to.</p>
  
  <p>Found some information here: <a href="http://objectmix.com/ada/301203-gnat-fstack-check-does-work.html" rel="nofollow noreferrer">http://objectmix.com/ada/301203-gnat-fstack-check-does-work.html</a></p>
  
  <p>UPDATED!
  As mentioned by Adrien, there is no contradiction, <strong>-s</strong> sets the stack limit while <strong>-c</strong> sets the core file limit.</p>
  
  <p>Still the problem remains. I checked the flags when building the ada library and the <strong>fstack-check</strong> flag was not set, so it should generate a core dump.</p>
  
  <p><strike>Althou I haven't tried it yet, it seems somewhat strange.
  It mentions the -fstack-check compiler option + setting the GNAT_STACK_LIMIT variable but at the same time refers to the ulimit command which seems like a contradiction, setting "ulimit -c " is the only way I know of getting a core dump to be generated at the time of crash, if this infers with the fstack-check option then we have a catch 22.</strike></p>