Note that there are some explanatory texts on larger screens.

plurals
  1. POHow can I guarantee catching a EXCEPTION_STACK_OVERFLOW structured exception in C++ under Visual Studio 2005?
    primarykey
    data
    text
    <h3>Background</h3> <ul> <li>I have an application with a <em>Poof-Crash</em>[<em>1</em>]. I'm fairly certain it is due to a blown stack. </li> <li>The application is Multi-Threaded. </li> <li>I am compiling with "<code>Enable C++ Exceptions: Yes With SEH Exceptions (/EHa)</code>".</li> <li>I have written an SE Translator function and called <code>_set_se_translator()</code> with it.</li> <li>I have written functions for and setup <code>set_terminate()</code> and <code>set_unexpected()</code>.</li> <li>To get the Stack Overflow, I must run in release mode, under heavy load, for several days. Running under a debugger is not an option as the application can't perform fast enough to achieve the runtime necessary to see the issue.</li> <li>I can simulate the issue by adding infinite recursion on execution of one of the functions, and thus test the catching of the <code>EXCEPTION_STACK_OVERFLOW</code> exception.</li> <li>I have WinDBG setup as the crash dump program, and get good information for all other crash issues but <strong>not this one</strong>. The crash dump will only contain one thread, which is 'Sleep()'ing. All other threads have exited.</li> </ul> <h3>The Question</h3> <p>None of the things I've tried has resulted in picking up the <code>EXCEPTION_STACK_OVERFLOW</code> exception. </p> <p>Does anyone know how to guarantee getting a a chance at this exception during runtime in release mode?</p> <h3>Definitions</h3> <ol> <li><em>Poof-Crash</em>: The application crashes by going "poof" and disappearing without a trace.</li> </ol> <p><em>(Considering the name of this site, I'm kind of surprised this question isn't on here already!)</em></p> <h3>Notes</h3> <ol> <li>An answer was posted briefly about adjusting the stack size to potentially force the issue sooner and allow catching it with a debugger. That is a clever thought, but unfortunately, I don't believe it would help. The issue is likely caused by a corner case leading to infinite recursion. Shortening the stack would not expose the issue any sooner and would likely cause an unrelated crash in validly deep code. Nice idea though, and thanks for posting it, even if you did remove it.</li> </ol>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload