473,383 Members | 1,813 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

finally block is not executed after StackOverflowException

Hi,
I noticed that finally block is not executed once I got
StackOverflowException.
Is that a known feature or a bug?
Nov 16 '05 #1
3 3655
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.

--

Stoitcho Goutsev (100) [C# MVP]
"Vladimir Arkhipov" <Vl*****************@bayer.com> wrote in message
news:Or*************@TK2MSFTNGP10.phx.gbl...
Hi,
I noticed that finally block is not executed once I got
StackOverflowException.
Is that a known feature or a bug?

Nov 16 '05 #2
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.

"Vladimir Arkhipov" <Vl*****************@bayer.com> wrote in message
news:Or*************@TK2MSFTNGP10.phx.gbl...
Hi,
I noticed that finally block is not executed once I got
StackOverflowException.
Is that a known feature or a bug?

Nov 16 '05 #3
On 21 Jul 2004 21:19, "Willy Denoyette [MVP]" wrote:
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....

--
Simon Smith
simon dot s at ghytred dot com
www.ghytred.com/NewsLook - NNTP Client for Outlook
Nov 16 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Vince C. | last post by:
Hi. Just one question: if I call Response.End() in an ASP server-side JavaScript catch() block *and* I have a finally{} block, will the latter be skipped or will it still be executed? The...
16
by: Ken | last post by:
What is the purpose of a finally block in try-catch- finally? I am confused because, if I am reading the definition correctly, this block seems unnecessary. Consider the following from the Visual...
3
by: Brian | last post by:
Is it possible to have more than one try/catch/finally block within a method? Also, if the code never enters the try block of code, is the finally block executed? I have a try block in a branch...
8
by: Z D | last post by:
Hi, I was wondering what's the point of "finally" is in a try..catch..finally block? Isn't it the same to put the code that would be in the "finally" section right after the try/catch block?...
16
by: Chris | last post by:
Hi, regarding exception-handling : why put code in a 'finally' block, and not just after a 'catch'-block --> Example using 'finally ' : try { OpenFile();
24
by: Dave | last post by:
Maybe I'm missing something here, but I can't see the purpose of the 'finally' keyword. What is the difference between: try { doSomething() } catch { handleError(); }
11
by: Daylor | last post by:
hi. let say i have this code: -------------------------- try if x=10 then y =1 if x=200 then goto finally catch
7
by: Sean Kirkpatrick | last post by:
I got caught with my pants down the other day when trying to explain Try...Catch...Finally and things didn't work as I had assumed. Perhaps someone can explain to me the purpose of Finally. I've...
3
by: Arnaud Diederen | last post by:
Hello, I've been looking in the archives but found no interesting answer to my problem. I was wondering why the following code does not work in IE 5; I'd expect an alert showing 'In finally!',...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.