7

I've read this article trying to find : "Which exceptions terminates the entire process" ( iis , so basically the application pool terminates - w3wp.exe)

I already know (from my experience) that :

  • StackOverflow exceptions does terminates
  • Outofmemory exceptions also terminates

I already read Hans' answer here which redirects to SSCLI20 source code where he gave an example of the code :

TerminateProcess(GetCurrentProcess(), COR_E_STACKOVERFLOW);

So I downloaded the SSCLI20 and searched for more of TerminateProcess(GetCurrentProcess()...

And found those entries :

enter image description here

But I'm not sure that this is the whole list , and even if so - it is notvery clear.

Question

Where can I find the complete list of exceptions which terminates the process ?

Sabuncu
  • 5,095
  • 5
  • 55
  • 89
Royi Namir
  • 144,742
  • 138
  • 468
  • 792
  • You'd also look at the relevant CLR host. ASP.NET and SQL Server implement special rules. – usr May 19 '14 at 15:07
  • 1
    My two cents: Any exception that is unhandled in a `Thread` will terminate the process. – Sriram Sakthivel May 19 '14 at 15:12
  • Why do you need this? Which problem are you solving? For example, knowing that SO will terminate your program doesn't actually help you to prevent it (unless you carefully rethink each and every line of code...), as you cannot catch it?.. – Lanorkin May 19 '14 at 15:15
  • 1
    @Lanorkin Learning won't hurt you I think. May be he is interested to learn. Curiosity! – Sriram Sakthivel May 19 '14 at 15:16
  • Lanorakun thats not the question. Outofrange exception wont shutdown the iis while stackoverflow does shutdown . That is my question . Which exception shutdown . Nothing more nothing less – Royi Namir May 19 '14 at 15:17
  • @SriramSakthivel sure it is, and I upvote the question - but maybe real problem is interesting, too ) – Lanorkin May 19 '14 at 15:17
  • 2
    Those who work with iis production knows exactly what im talking about – Royi Namir May 19 '14 at 15:20
  • If this is IIS 7 or above, not only can it be a type of exception, but the number of unhandled exceptions in a given time period. Under the application pools advanced settings, Rapid-Fail Protection, if turned on, will kill the process. – Josh May 19 '14 at 16:58

2 Answers2

4

Found it.
Richter to the rescue.

The professional term is called : corrupted state exceptions (CSE'e)

Corrupted State Exceptions (CSE): These are the exceptions which cannot be caught. Behind the scene Environment's FailFast method throws one of these exceptions. Hence, it cannot be caught and your application ends with an unhandled exception.

From book :

enter image description here

more :

enter image description here

important :

Note: Even with the attribute HandleProcessCorruptedStateExceptions, we cannot handle the following exceptions, for a given reason:

  • StackOverflowException - As this is a hardware failure and there is no more stack available for further processing (Thanks Abel Braaksma for pointing this out).

  • ExecutionEngineException - It occurs because of heap memory corruption and hence cannot be handled further (Reference).

Another helpful link via Abhishek Sur :

http://dailydotnettips.com/2013/09/23/corruptedstateexceptions-in-net-a-way-to-handle/

Sabuncu
  • 5,095
  • 5
  • 55
  • 89
Royi Namir
  • 144,742
  • 138
  • 468
  • 792
1

Use Microsoft's Debug Diagnostic Tool

Take a look at http://support.microsoft.com/kb/919789/en-us which explains all the necessary steps in detail.

Other exeptions which causes crash 1. Access Denied' exception 2. Bit rate throttling 3. InvalidOperationException other than the above which you posted.

  • Thanks for comment. Does the tool provide a list of CSE's ? – Royi Namir May 21 '14 at 11:50
  • Yes, This tool provides the complete info of crash. –  May 21 '14 at 11:53
  • Im not interesting of find the exception after the crash. this I already know from event log. I want to know (as my question states ) --`Which exception terminates process (iis's w3wp)?` – Royi Namir May 21 '14 at 11:54