Accelerated Windows Memory Dump Analysis Public
Accelerated Windows Memory Dump Analysis Public
Dump Analysis
Dmitry Vostokov
Memory Dump Analysis Services
WinDbg Commands
Day 2
Kernel Memory Dumps
Complete Memory Dumps
Kernel Space
80000000
7FFFFFFF
User Space
00000000
Kernel Space
80000000
7FFFFFFF
user32
user32.dll
Notepad.exe
Notepad
00000000
Driver
Driver.sys
Kernel Space
Ntoskrnl.exe
nt
80000000
7FFFFFFF
User Space
00000000
Driver
Kernel Space
80000000
7FFFFFFF
user32
Notepad
00000000
Driver
WinDbg Commands
Kernel Space lmv command lists modules
and their description
nt
80000000
7FFFFFFF
user32
Notepad
00000000
Driver
MEMORY.DMP
Kernel Space
nt
80000000
7FFFFFFF
user32
WinDbg Commands
Notepad
00000000
WinDbg Commands
Driver
.process switches between
process virtual spaces (kernel
space part remains the same)
Kernel Space
nt
80000000
7FFFFFFF MEMORY.DMP
user32 user32
Notepad
Calc
00000000
ApplicationA
WinDbg Commands
TID
306 Kernel Space Kernel/Complete dumps:
~<n>s switches between
processors
.thread switches between
nt
threads
ntdll
user32
ApplicationA
nt Kernel dumps:
TID
204 !thread
Complete dumps:
!teb for user space
ntdll
!thread for kernel space
user32
Data:
dc / dps / dpp / dpa / dpu
User Stack for TID 102
ApplicationA
}
...
WinDbg Commands
FunctionB()
{
Return address Module!FunctionC+130 ... 0:000> k
FunctionC(); Module!FunctionD
...
} Module!FunctionC+130
FunctionC()
Module!FunctionB+220
{ Module!FunctionA+110
Return address Module!FunctionB+220 ...
FunctionD();
...
}
Module!FunctionA
Module!FunctionB
Return address Module!FunctionA+110
Module!FunctionC
Module!FunctionD
FunctionC()
{
Return address Module+32220 ... No symbols for Module
FunctionD();
...
} WinDbg Commands
Module+22000
0:000> k
Resumes from address Saves return address Module+0
Module+22110 Module+22110 Module+43130
Module+32220
Module+32000
Return address Module+22110 Module+22110
Resumes from address Saves return address
Module+32220 Module+32220
Module+43000
Module+54000
ApplicationA
NULL pointer
M00000000
TID TID
102 204
ApplicationA
Problem Resolution
Debugging Strategy
Checklist: http://www.dumpanalysis.org/blog/index.php/2007/06/20/crash-
dump-analysis-checklist/
Patterns: http://www.dumpanalysis.org/blog/index.php/crash-dump-
analysis-patterns/
Exercise Transcripts:
Removed from public preview version
Exercises P1-P13
Thread 1
(owns)
Thread 2
(owns)
Thread 2
Critical Section
000000013fd7eee0
Thread 1
(waiting)
Exercises K1-K5
Exercises C1-C2
WinDbg Commands
Context switch switching to a different process
context:
.process /r /p
WinDbg Commands
dump all stack traces:
!process 0 ff
User Space
View commands
Dump everything or selected processes and threads (context changes automatically)
Switch commands
Switch to a specific process or thread for a fine-grain analysis
!process 0 1f
The same as the previous command but without PEB information (more secure)
!thread <address> ff
Shows thread information and stack trace
!thread <address> f6
The same as the previous command but shows the first 3 parameters for every function
.thread <address>
Switches to a specified thread. Assumes the current process context
Now we can use commands like k*
.thread /r /p <address>
The same as the previous command but makes the thread process context current and reloads
symbol files for user space:
[...]
Thread Thread
830f9990 832be6d8
Thread (waiting)
83336a00
(owns)
Mutant
00a9b7c0
Thread
886ee030
(owns)
Thread
Thread 83336a00
886ee030 (waiting)
Critical Section
00a9b7a8
Thread
832be6d8
(owns)
http://www.dumpanalysis.org/blog/index.php/
pattern-cooperation/