Here's a sample session on running Windbg in a test cloud. One afternoon, we kept getting the following email messages saying a service crashes:
"BGWatchdog64.exe" crashed on TK1MSG1061705. See d:/Data/MsgrDumps/TK1MSG1061705_BGWatchdog64.exe_2006-09-15_14-49-21-82.dmp on TK1MSG1061705 for more info.
That is an old problem. The BG Watchdog failed to handle an exception and the unhandled exception caused the crash. To fix the bug, we need to know more about this exception, using the following steps:
1. Log on to machine "TK1MSG1061705" (See related wiki pages on how to access a testing cloud)
2. Open a cmd window, and cd to "d:/Data/MsgrDumps"
3. Start windbg by running "c:/Debuggers/windbg.exe /z TK1MSG1061705_BGWatchdog64.exe_2006-09-15_14-49-21-82.dmp"
4. Load Psscor extension DLL (what's that?) using ".load psscor2" in Windbg. You can download Psscor2.dll from http://toolbox/sites/22153/ and copy them to "c:/Debuggers". (See related wiki pages on how to copy files to a testing cloud)
5. Display all exceptions using Psscor command "!dae".
After step 5, we found the name, message, and stack trace of the unhandled exception, which is sufficient to identify the bug.
Tips:
1. If ".load" doesn't work, you might need to give the full path (including .dll suffix) of the Psscor extension DLL
2. For help on Psscor commands, use "!help"
These are the common commands that would help debugging dumps.
-
Loading symbols/Dlls
-
.sympath //symbols/symbols
Sets the symbols path to the symbol share.
-
.load C:/WINDOWS/Microsoft.NET/Framework64/v2.0.50727/sos.dll
-
.load C:/WINDOWS/Microsoft.NET/Framework64/v2.0.50727/mscorwks.dll
Load the dlls for SOS (for managed debugging) and .NET libraries
-
-
Dumping call-stacks
-
!threads
-
!eestack
-
~*e !CLRStack
-
~*kb
-
-
Dumping heap
-
!dumpheap
-
!dumpheap -stat
-
!eeheap -gc
-
-
Dumping objects
-
!dumpheap -type <type name>
-
!dumpobj <object address>
-
!dumparray <object address>
-
Interesting articles about debugging managed processes
http://blogs.msdn.com/yunjin/archive/2005/08/25/456355.aspx
http://blogs.msdn.com/tess/archive/2005/12/20/505862.aspx
http://blogs.msdn.com/tess/archive/2006/10/16/net-hang-debugging-walkthrough.aspx