Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8451009
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T11:07:21+00:00 2026-06-10T11:07:21+00:00

My understanding is based on this long, but fantastic, article which supports the behavior

  • 0

My understanding is based on this long, but fantastic, article which supports the behavior listed in the C# specification.

The CLI standard (EMCA-335) shows that if there is no suitable catch, the runtime should terminate immediately. The .NET runtime does not do this, instead it seems to lean toward the behavior of the C# specification (EMCA-334).

First, I find it strange that a language specification is appears to be defining framework behavior. Secondly, They seem to contradict.

  • Do they contradict each other, or am I getting the wrong meaning of the document?
  • Does a runtime have to go about exception handling in this way to be compliant with the standard?

As an optional question, which one is the “correct” one, as in, if I were to write my own implementation of the CLI which one should I use? Note that EMCA-335 (CLI) document was updated two months ago, where EMCA-334 (C#) was updated back in 2006.


ECMA-335 Partition I Section 12.4.2.5

  • When an exception occurs, the CLI searches the array for the first protected block that
    • Protects a region including the current instruction pointer and
    • Is a catch handler block and
    • Whose filter wishes to handle the exception
  • If a match is not found in the current method, the calling method is searched, and so on. If no match is found the CLI will dump a stack trace and abort the program.

  • If a match is found, the CLI walks the stack back to the point just located, but this time calling the finally and fault handlers. It then starts the corresponding exception handler.

C# Specification §15.9.5 and §15.10 (§8.9.5 and §8.10 on MSDN)

The main difference between it and the CLI standard, is that whether or not a catch block is found, the application will not just exist, but will still unwind the stack, and take care of finally handlers.

I would suggest reading the standard itself to get a better meaning of this, since below is a very crude summary. It outlines step-by-step how a try statement is executed with each possible scenario.

  • In the function that raises the exception:
    • Looks for a matching catch clause in each try statement
      • Executes the catch statement if it exists
    • A finally block is executed if it exists
  • If there was no handler, the above steps are repeated in the calling function
  • If the exception processing terminates all function member invocations in the current thread, indicating that the thread has no handler for the exception, then the thread is itself terminated. The impact of such termination is implementation-defined.
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T11:07:22+00:00Added an answer on June 10, 2026 at 11:07 am

    I think this might just be a matter of a vague wording.

    If a match is not found in the current method, the calling method is searched, and so on. If no match is found the CLI will dump a stack trace and abort the program.

    Okay, that’s true in C#. We all know that if we don’t have a catch then an exception will bring down our program.

    If a match is found, the CLI walks the stack back to the point just located, but this time calling the finally and fault handlers. It then starts the corresponding exception handler.

    And that matches what we know from C# too. If there are some finally (we don’t get to see fault) blocks to deal with as we go up the stack from the exception being thrown until our catch block, they get processed, but it stops there and goes no further up the stack.

    A lot hangs on how we read the “If” that starts that second excerpt I just quoted. You’re reading it as “if … then … otherwise no such thing”. It could be read though as the first excerpt identifying the point in the stack that will be walked to: If there was a catch, then it’s walked to that point. If there is no catch, then it’s walked to the very top of the stack and we get a dump and abort. The finally handlers (and fault handlers) still get called, but the point is not that of a matching catch handler.

    Your reading is the most literal, and mine the one that stretches things a bit. However, mine does match with the description of finally elsewhere in the same standard, most closely

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This question probably is based on my lack of understanding of the role of
I'm having difficulty understanding variable shadowing in JavaScript based on scopes. Consider this small
I'm not understanding this behavior. Maybe someone can explain to me why my current
I know this could be a very long topic and endless, but because I'm
Does Gmail support RFC 821? I know it is using ESMTP. Based on understanding
Normally ( Based on my understanding ) i have to follow a lot of
Based on my understanding of the Java language, static variables can be initialized in
My understanding is that Java's implementation of regular expressions is based on Perl's. However,
I've been working with some ExternalDataExchange - based communication in WF recently. My understanding
It is my understanding that expression templates will break on ranged based for in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.