84

I'm trying to decipher the meaning on the P1...P10 parameters associated with a clr20r3 that is written to the event log when my application experiences an exception.

The best I've been able to find is:

  • P1: the hosting process (e.g. w3wp.exe)
  • P2: the hosting process version (e.g. 6.0.3790.1830)
  • P3: ??? (e.g. 42435be1)
  • P4: the assembly from which the exception was raised (e.g. mrtables.webservice)
  • P5: the assembly version (e.g. 2.1.2.0)
  • P6: ??? (e.g. 4682617f)
  • P7: ??? (e.g. 129)
  • P8: ??? (e.g. 50)
  • P9: the exception type raised (e.g. system.argumentexception)
  • P10: ??? (e.g. NIL)

Googling for clr20r3 provides thousands of sample parameter values, from which someone can try to derive a pattern.

But I'm hoping for documentation on the parameter meanings, as opposed to educated guesses.


Edit: While I can hope for canonical documentation, really I'd be happy to see the exception being thrown, at what line, complete with a stack trace.

Bonus Reading

Ian Boyd
  • 246,734
  • 253
  • 869
  • 1,219
  • Possible duplicate of [Unhandled exception that caused the application to crash with "EventType clr20r3, P1 w3wp.exe" in the log, but no details there](https://stackoverflow.com/questions/1937931/unhandled-exception-that-caused-the-application-to-crash-with-eventtype-clr20r3) – Daniel B Aug 17 '18 at 18:41

2 Answers2

115

P7 and P8 are the important ones to find out where the P9 exception was raised. Use P4 to know what assembly to look for. Run ildasm.exe and open that assembly. File + Dump, tick the "Token values" checkbox, OK and save the .il file somewhere.

Open the file in a text editor. P7 gives you the method token, it starts with 0x06, producing token value "06000129". Search for:

.method /*06000129*/

Which gives you the method name, look up from there to find the .class, that gives you the class name.

P8 gives you the IL offset. From the found .method, look for IL_0050 for the instruction that raised the exception. Mapping it back to your source code is a bit tricky but you'll probably figure it out. Use Reflector if necessary.

In general, write an event handler for AppDomain.UnhandledException to avoid the pain of reverse-engineering these Watson crash buckets. Log the value of e.ExceptionObject.ToString() to get both the exception message and a stack trace.

Noctis
  • 11,507
  • 3
  • 43
  • 82
Hans Passant
  • 922,412
  • 146
  • 1,693
  • 2,536
  • 2
    If the exception occurs in library code, you are likely to need the stack trace anyways to figure out which of your code was on the stack. (Would be nice if Microsoft would modify that dialog to be nicer to .NET.) – Jason Kresowaty Oct 30 '10 at 22:28
  • 1
    In addition to handling UnhandledException, it also helps to try/catch right inside Main, since sometimes the problem happens before the UnhandledException handler is installed. – Mark Lakata Apr 03 '12 at 18:28
  • 1
    I think this is going to save me my friend. I've got an ASP.NET application that's fallen in my lap that keeps crashing the application pool - and an error listing `CLR20R3` with a bunch of those `P` values is getting logged right around the crash time. It may be messy, but it will probably lead me to a solution, but in the end I'm going to have to modify this code and get some real logging going on. – Mike Perrenoud Apr 02 '13 at 10:26
  • 1
    Very useful +10 if I could - in my case it was a StackOverFlow exception and my catch blog didn't execute. – Marc Apr 03 '13 at 17:17
  • 1
    In following this, I have found the function our code is crashing on is an abstract virtual function.. method /*06003452*/ public hidebysig newslot abstract virtual instance int32 Read([in][out] uint8[] buffer, int32 offset, int32 count) cil managed { } // end of method Stream::Read – Steven Scott May 06 '16 at 14:49
84

Here is the information on Watson Buckets

  1. Exe File Name
  2. Exe File assembly version number
  3. Exe File Stamp
  4. Exe file full assembly name
  5. Faulting assembly version
  6. Faulting assembly timestamp
  7. Faulting assembly method def
  8. Faulting method IL Offset within the faulting method
  9. Exception type

And also here is a MSDN article on the same.

Sample:

  Problem Signature 01: devenv.exe
  Problem Signature 02: 11.0.50727.1
  Problem Signature 03: 5011ecaa
  Problem Signature 04: Microsoft.VisualStudio.SharePoint.Project
  Problem Signature 05: 11.0.60226.0
  Problem Signature 06: 512c2dba
  Problem Signature 07: 18a8
  Problem Signature 08: 1d
  Problem Signature 09: System.NullReferenceException
Visual Vincent
  • 18,045
  • 5
  • 28
  • 75
Naveen
  • 4,092
  • 29
  • 31
  • 2
    Would you happen to have a reference link that documents the rest of the watson buckets? The linked article only mentions three of them (and only happens to mention them in passing *"For instance, bucket P4 describes the faulting module, bucket P9 displays the type of exception that went unhandled, and bucket P8 represents the IL offset at which the exception was originally thrown."*) – Ian Boyd Oct 29 '10 at 15:27
  • 2
    I have added a sample about it – Kiquenet Jul 17 '14 at 09:56