Search code examples
asp.netiiscrashwindbgcrash-dumps

Loading external DLL into WinDBG


I'm new to WinDBG and trying to analyze a mini crash dump file generated by IIS 8.0 for an ASP.Net web application. I can see that there are some calls which repeat themselves over and over and are causing a stack overflow. Here are those calls:

000000350eccaa00 000007fdc466c6e3 System.IO.__Error.WinIOError(Int32, System.String)
000000350eccaa50 000007fdc386e706 System.IO.FileStream.Init(System.String, System.IO.FileMode, System.IO.FileAccess, Int32, Boolean, System.IO.FileShare, Int32, System.IO.FileOptions, SECURITY_ATTRIBUTES, System.String, Boolean, Boolean, Boolean)
000000350eccab40 000007fdc387a466 System.IO.FileStream..ctor(System.String, System.IO.FileMode, System.IO.FileAccess, System.IO.FileShare, Int32, System.IO.FileOptions, System.String, Boolean, Boolean, Boolean)
000000350eccabf0 000007fdc38793e2 System.IO.StreamWriter..ctor(System.String, Boolean, System.Text.Encoding, Int32, Boolean)
000000350eccaca0 000007fdc3879306 System.IO.StreamWriter..ctor(System.String, Boolean, System.Text.Encoding, Int32)
000000350eccace0 000007fdc38fe262 System.IO.StreamWriter..ctor(System.String, Boolean)
000000350eccad50 000007fdc4143d1f System.IO.File.AppendText(System.String)
000000350eccad90 000007fd65519778 Custom.External.dll!Unknown
000000350eccae00 000007fd6551826f Custom.External.dll!Unknown
000000350eccae70 000007fd6550e465 Custom.External.dll!Unknown
000000350eccaf10 000007fd6550e92e Custom.External.dll!Unknown
000000350eccaf50 000007fd65519873 Custom.External.dll!Unknown
000000350ecccf28 000007fdc4c9feb5 [HelperMethodFrame: 000000350ecccf28] 

As you can see, the Custom.External.dll calls displays no info about which functions are being called. How can I load this DLL into WinDBG so that it can properly debug those calls?


Solution

  • This doesn't look like a stack overflow. A stack overflow usually needs more than 5 calls on the stack (as long as the stack was not filled by something else before). From the method name, it looks like an IOException. To get the type of the exception, type

    ~#s; *** Switch to the thread with the exception
    .exr -1; *** Native exception info
    .loadby sos clr; *** Load .NET extension
    !pe; *** Use .NET extension to get .NET exception info
    !clrstack; *** Might differ from the stack in the exception
    

    Other than that, you might not have symbols for the external DLL. If it's a third party library, you can't do a lot against it. If it's your own DLL, put your PDBs into a directory (not where you store MS symbols) and do

    .sympath+ c:\mydirectory
    .reload
    

    Then execute the commands again and see whether the situation improved.