Re: How to recover from a EXCEPTION_STACK_OVERFLOW?



Hallo Aurelien!

- modifying ESP by hand (risky)

static LONG __stdcall CrashHandlerExceptionFilter(EXCEPTION_POINTERS* pExPtrs)
{
if (pExPtrs->ExceptionRecord->ExceptionCode == EXCEPTION_STACK_OVERFLOW)
{
static char MyStack[1024*128]; // be sure that we have enought space...
// it assumes that DS and SS are the same!!! (this is the case for Win32)
// change the stack only if the selectors are the same (this is the case for Win32)
//__asm push offset MyStack[1024*128];
//__asm pop esp;
__asm mov eax,offset MyStack[1024*128];
__asm mov esp,eax;
}

// TODO: ...
}
.



Relevant Pages

  • Re: Who could tell me why the error address isnt the same?
    ... I use vc6.0,and when I set active project configuration to Win32 Debug,and ... What actually happened is that the strcpy was writing outside of the memory occupied by, into the rest of the stack. ... The difference between Debug and Release is that Debug build puts some extra data on the stack to help you debug easily. ...
    (microsoft.public.vc.mfc)
  • Re: Why no language improvements?
    ... its not in the win32 compiler. ... the /Win32/ compiler doesn't have stack based objects, ... +AD4- You dont know what a copy constructor is yet you feel compelled to ...
    (borland.public.delphi.non-technical)
  • Re: Crash-Diagnose
    ... eigentlich reproduzieren sollte, weil die Anweisungen 1:1 so durchlaufen werden, wie es in der Anwendung selbst ablief, als es Probleme gemacht hat. ... // change the stack only if the selectors are the same (this is the case for Win32) ...
    (microsoft.public.de.vc)
  • Re: Who could tell me why the error address isnt the same?
    ... the stack is completely different. ... When a program is compiled in debug mode, it uses the debug heap, the debug libraries, and ... learn this is to study the output from compilers). ... I use vc6.0,and when I set active project configuration to Win32 Debug,and ...
    (microsoft.public.vc.mfc)
  • Re: Thread Stacks
    ... >I conclude therefore that the correct solution is to specify the ... >reserved linear stack size for each individual thread at create ... What, then, is the purpose of the dwStackSize parameter to the Win32 ... >maintain a pool of previously used stack ranges to save continuously ...
    (comp.arch)