Applies to .NET 4.7 applications.
Right click on dmp, "open with" -> windbg.
Run command:
.cordll -ve -u -l
(that automatically loads SOS extension)
To get list of threads, with nice stack traces (that you can copy paste to your friends):
~*e!clrstack
(I'm not kidding, that's the command).
A blocking/deadlocked thread may look like this:
OS Thread Id: 0x33ec (359)
Child SP IP Call Site
000000c7eb17da20 00007ffd11b267c4 [GCFrame: 000000c7eb17da20]
000000c7eb17db48 00007ffd11b267c4 [HelperMethodFrame_1OBJ: 000000c7eb17db48] System.Threading.Monitor.ObjWait(Boolean, Int32, System.Object)
000000c7eb17dc60 00007ffc9397ce48 System.Threading.ManualResetEventSlim.Wait(Int32, System.Threading.CancellationToken)
000000c7eb17dcf0 00007ffc97210e9b System.Threading.Tasks.Task.SpinThenBlockingWait(Int32, System.Threading.CancellationToken)
000000c7eb17dd60 00007ffc97210d01 System.Threading.Tasks.Task.InternalWait(Int32, System.Threading.CancellationToken)
000000c7eb17de30 00007ffc972dea6f System.Threading.Tasks.Task.Wait(Int32, System.Threading.CancellationToken)
...
You can switch to thread 359 by typing:
~359s
Now that the thread is active, you can run commands like:
- "!clrstack" to print the stack again
- "!clrstack -a" for the same, but with some param variables (probably broken though)
- "!dso" to 'dump stack objects', i.e. see objects that have been pushed to stack. You can click on addresses to drill deeper into objects etc.
Other commands:
- "!DumpHeap -stat" for heap statistics (sorted by size used)