Thursday, November 18, 2010

Decoding clr20r3 .NET exception – using mono cecil

I have often seen Devs trying to figure out the cause of the app crash without a memory dump. The only information that is available to analyze is the Windows Error Reporting message in the event viewer which would have “Event Name: CLR20r3″ along with Watson bucket information like this.
Fault bucket , type 0
Event Name: CLR20r3
Response: Not available
Cab Id: 0
Problem signature:
P1: unhandledexception.exe
P3: 4ce1e0f1
P4: LibraryCode
P6: 4ce1e0f1
P7: 7
P8: 1f
P9: System.NullReferenceException
I will demonstrate the steps in identifying the code that caused the app to crash with the above information.Here is the explanation on the Watson Bucket items

  • P1: unhandledexception.exe – is the Exe File Name
  • P2: – is the Exe File assembly version number
  • P3:4ce1e0f1- is the Exe File Stamp
  • P4:LibraryCode- is the Faulting full assembly name
  • P5: is the Faulting assembly version
  • P6:4ce1e0f1- is the Faulting assembly timestamp
  • P7:7- is the Faulting assembly method def
  • P8:1f-  is Faulting method IL Offset within the faulting method
  • P9:System.NullReferenceException- is Exception type that was thrown
Here is the LibraryCode that is mentioned in P4 of the watson bucket
The most important items in the above watson bucket are 4,7 ,8 and 9. The item 4 is the assembly that was responsible for the crash which is “LibraryCode”. The item 7 is methoddef that threw the exception which is “7″. To identify the method we would have to dump the IL and here is the command to do that.

Read more: Naveen's Blog