473,698 Members | 2,628 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

finally block is not executed after StackOverflowEx ception

Hi,
I noticed that finally block is not executed once I got
StackOverflowEx ception.
Is that a known feature or a bug?
Nov 16 '05 #1
3 3678
Vladimir,
Porbably that is becase the stack is full and no stack frame is created.
This makes impossible CLR to find your finally block. StackOverflowEx ception
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******** *****@TK2MSFTNG P10.phx.gbl...
Hi,
I noticed that finally block is not executed once I got
StackOverflowEx ception.
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******** *****@TK2MSFTNG P10.phx.gbl...
Hi,
I noticed that finally block is not executed once I got
StackOverflowEx ception.
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
6672
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 reason is I place instructions to close an ADO connection in finally blocks whenever I need to close a DB connection. I also have instructions that I execute in a catch() block whenever an error occurs. These instructions clear the Response buffer,...
16
7941
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 Studio documentation. In the first foo(), the statement in the finally block will execute even though there is an exception in the try block. In the second foo(), I took the statement out of the finally block but it should still execute since it...
3
4825
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 of a switch statement and I only want the finally to execute if the branch of the switch statement is executed.
8
2733
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? (ie, forget the finally block and just end the try/catch and put the code after the try/catch block). Or does the "finally" construct add some additional functionality?
16
2082
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
2166
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
5191
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
1720
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 looked at several texts that I have and none of them address this specific point. If I call some method that throws an exception in my routine Foo, sub foo call bar <- throws an exception do something else <- never get here
3
4573
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!', but I keep getting an IE error dialog.. Has anyone any idea why that is so? (the code works in mozilla :) )
0
8683
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8610
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8902
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8873
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6528
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4372
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4623
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2339
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2007
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.