Wednesday, August 18, 2010

Windbg: investigating exceptions

The sequence shown below is:

1) !dumpheap -type Exception
2) !dumpheap -type System.Runtime.InteropServices.COMException
3) !pe 0000000006a58fb8
4) !do 0000000006a58fb8 (for some specific fields that !pe won't show)

0:000> !dumpheap -type Exception
Address MT Size
0000000006961048 000007fef3336b30 136
00000000069610d0 000007fef3336c40 136
0000000006961158 000007fef3336d50 136
00000000069611e0 000007fef3336e60 136
0000000006961268 000007fef3336e60 136
0000000006a29a90 000007fef3340298 24
0000000006a29ac0 000007fef3340310 24
0000000006a58fb8 000007fef335c580 136
0000000006ac4390 000007fef335c580 136
total 9 objects
Statistics:
MT Count TotalSize Class Name
000007fef3340310 1 24 System.Text.DecoderExceptionFallback
000007fef3340298 1 24 System.Text.EncoderExceptionFallback
000007fef3336d50 1 136 System.ExecutionEngineException
000007fef3336c40 1 136 System.StackOverflowException
000007fef3336b30 1 136 System.OutOfMemoryException
000007fef335c580 2 272 System.Runtime.InteropServices.COMException
000007fef3336e60 2 272 System.Threading.ThreadAbortException
Total 9 objects

0:000> !dumpheap -type System.Runtime.InteropServices.COMException
Address MT Size
0000000006a58fb8 000007fef335c580 136
0000000006ac4390 000007fef335c580 136
total 2 objects
Statistics:
MT Count TotalSize Class Name
000007fef335c580 2 272 System.Runtime.InteropServices.COMException
Total 2 objects

0:000> !do 0000000006a58fb8
Name: System.Runtime.InteropServices.COMException
MethodTable: 000007fef335c580
EEClass: 000007fef2f4a2f8
Size: 136(0x88) bytes
(C:\Windows\assembly\GAC_64\mscorlib\2.0.0.0__b77a5c561934e089\mscorlib.dll)
Fields:
MT Field Offset Type VT Attr Value Name
000007fef3336758 40000b5 8 System.String 0 instance 0000000000000000 _className
000007fef3334b00 40000b6 10 ...ection.MethodBase 0 instance 0000000000000000 _exceptionMethod
000007fef3336758 40000b7 18 System.String 0 instance 0000000000000000 _exceptionMethodString
000007fef3336758 40000b8 20 System.String 0 instance 0000000006a591d8 _message
000007fef332dd78 40000b9 28 ...tions.IDictionary 0 instance 0000000000000000 _data
000007fef3336a20 40000ba 30 System.Exception 0 instance 0000000000000000 _innerException
000007fef3336758 40000bb 38 System.String 0 instance 0000000006a59268 _helpURL
000007fef3336048 40000bc 40 System.Object 0 instance 0000000006a59328 _stackTrace
000007fef3336758 40000bd 48 System.String 0 instance 0000000000000000 _stackTraceString
000007fef3336758 40000be 50 System.String 0 instance 0000000000000000 _remoteStackTraceString
000007fef333d9c8 40000bf 70 System.Int32 1 instance 0 _remoteStackIndex
000007fef3336048 40000c0 58 System.Object 0 instance 0000000000000000 _dynamicMethods
000007fef333d9c8 40000c1 74 System.Int32 1 instance -2146824040 _HResult
000007fef3336758 40000c2 60 System.String 0 instance 0000000006a592a8 _source
000007fef3339160 40000c3 68 System.IntPtr 1 instance 0 _xptrs
000007fef333d9c8 40000c4 78 System.Int32 1 instance -532459699 _xcode

0:000> !pe 0000000006a58fb8
Exception object: 0000000006a58fb8
Exception type: System.Runtime.InteropServices.COMException
Message: This command is not available because no document is open.
InnerException: <none>
StackTrace (generated):
SP IP Function
000000000013A200 0000000000000001 Microsoft_Office_Interop_Word!Microsoft.Office.Interop.Word.ApplicationClass.get_ActiveDocument()+0x2
000000000013A2F0 000007FF00222F6E Ms_Ddue_DdueWord!Microsoft.Ddue.DdueWordAuthoring.WordHelper.GetActiveDocument(Microsoft.Office.Interop.Word.Application)+0xce

StackTraceString: <none>
HResult: 800a1098


See here for more details.

No comments: