Windbg and Dump Analysis: Ahmet Mithat Bostanci Microsoft, GTSC Iis/Web Development Support
Windbg and Dump Analysis: Ahmet Mithat Bostanci Microsoft, GTSC Iis/Web Development Support
Offline debugging
Collecting dump files with specific tools for different scenarios
Analysing in WinDBG.
Live debugging
Attaching a process
Using breakpoints, catching exceptions, dumping the process
out to a file, etc... when necessary.
Debugging Scenarios
Slow performance
Web site is responsive but slow.
Hang
Web site is unresponsive.
Crash
Exceptions
Exceptions and ASP.NET
Crash
Web site or a specific page / method is throwing
exceptions but not crashing the w3wp.exe process,
first chance exceptions.
Web site is crashing - w3wp.exe is crashing. Second
chance exceptions.
When do we NOT need WinDBG?
Minidump
Contains only selected parts of the memory used by the
process.
Fulldump
Contains the full copy of the process memory. Size of the
fulldump is somewhat equal to the virtual memory used by the
process.
This is the dump type we are interested in most of the times.
What a dump contains
ADPlus
Part of Debugging Tools For Windows
Command line
adplus -hang -pn w3wp.exe
adplus -crash –iis
Debug Diagnostic Tool
GUI based
Easy to configure and use
ProcDump
Command line
Specific for high CPU usage but can be used for collecting manuel dumps as well
procdump.exe -c 80 -s 30 -n 5 -ma NNNN >procdump.log
Task manager
Can be used to collect manuel dump
Right click and create userdump
Only on Win 7 and Win 2008
32bit vs 64bit
Symbol server
http://msdl.microsoft.com/download/symbols
Setting symbol server in WinDBG
srv*c:\symbols\public*http://msdl.microsoft.com/download/
symbols
Symbols are downloaded to the local folder when
needed.
Commands in WinDBG
WinDBG commands
Mostly used in unmanaged debugging.
Extensions
DLL files
Command sets for specific debugging requirements
Extensions
Vertarget
Shows information about the system on which you are debugging
Lm
Displays loaded module information
~
Lists all OS threads
~Ns
Switch to thread #N
K
Shows unmanaged call stack of the thread switched.
.hh
Opens help file
.reload /f
Forces to reload the symbols.
!runaway
Shows the thread’s CPU time
Some PSSCOR2 commands
!DumpAllExceptions (!dae)
Shows managed exceptions thrown.
!DumpDataTables
Shows data tables objects in memory. Useful when debugging memory issues.
!DumpColumnNames (!dcn)
Prints out the column names for a data table given.
!ASPXPages
Shows ASPX pages running on all threads.
!threadpool
Shows ASP.NET thread pool information including the requests in the queue and the current CPU usage of OS.
!FindDebugTrue
Shows the web applications running in debug mode.
!FindDebugModules
Shows the modules built in debug mode.
!SaveAllModules (!sam)
Saves the all modules in the process. Useful when using the reflector to get the code from dump file.
!eeversion
Prints the .NET framework version. Useful when checking the fixes or service packs installed.
!help
!help <command>
Toolbox
http://blogs.msdn.com/tess/ (İngilizce)
http://blogs.msdn.com/amb/
http://blogs.msdn.com/farukceliktr/
http://blogs.msdn.com/cenkiscan/
http://www.codeproject.com/KB/debug/windbg_pa
rt1.aspx
http://www.cengizhan.com/
Q&A