finally block is not executed after StackOverflowException

  • Thread starter Thread starter Vladimir Arkhipov
  • Start date Start date
V

Vladimir Arkhipov

Hi,
I noticed that finally block is not executed once I got
StackOverflowException.
Is that a known feature or a bug?
 
Vladimir,
Porbably that is becase the stack is full and no stack frame is created.
This makes impossible CLR to find your finally block. StackOverflowException
is very extreme error so don't expect that you can recover gracefully from
this one. Normally it shouldn't happen if your code is ok.
 
This is hum... by design in the current version the CLR .
This exception is being thrown when there are only two more pages left free
on the stack, the CLR as opted to unwind the current context instead of to
continue and take the risk the OS aborts the process when the last stack
page gets full.
Not sure if/how whidbey will handle this.


Willy.
 
This is hum... by design in the current version the CLR .
This exception is being thrown when there are only two more pages left free
on the stack, the CLR as opted to unwind the current context instead of to
continue and take the risk the OS aborts the process when the last stack
page gets full.
Not sure if/how whidbey will handle this.


Willy.


I'd have thought that a Stack Overflow exception is always a bug (I can't
think of an occasion where it would not be). Given that, I think whatever
the runtime does is fairly reasonable....
 
Back
Top