More Related Content Similar to .Net debugging 2017 (20) More from Tess Ferrandez (14) .Net debugging 20175. Threads call stacks, stack objects
Modules dlls, exes
.NET Heap .net objects, sizes, info
@TessFerrandez
8. PROCDUMP
Light-weight, no-install utility for generating
dumps
Procdump –ma app.exe app.dmp
Procdump –ma –h app.exe hang.dmp
Procdump –ma –e app.exe crash.dmp
Procdump –ma –c 90 app.exe cpu.dmp
@TessFerrandez
9. DEBUG DIAG
GUI tool to generate dumps based on rules
and analyze dumps for common .net issues
@TessFerrandez
15. When I open an email with a pdf attachement that is
larger than 2 MB, a message box saying Unknown Error
shows up and then the process exits
Tess!!! the internet e-thingy is not working anymore
17. 1 Check the event viewer
2 Capture dump on crash
3 Look at the faulting stack
@TessFerrandez
19. App is not responding
Requests take too long
How long should they take?
CPU is going hey-wire
21. 1 Determine if it is high or low CPU
2 Capture one or more dumps
3 Look at all stacks
If you can repro in test, consider profiling
@TessFerrandez
25. 1 Capture multiple dumps
2 Compare to see what objects are leaking
3 Find out why they are still around
For native leaks, use leaktracking in debug diag
@TessFerrandez
28. DataTarget target = DataTarget.LoadCrashDump(@"TheApp.dmp");
target.SymbolLocator.SymbolCache = @"c:symbols";
target.SymbolLocator.SymbolPath = "http://msdl.microsoft.com/download/symbols";
var runtime = target.ClrVersions[0].CreateRuntime();
Console.WriteLine("Is Server GC: {0}", runtime.ServerGC);
Console.WriteLine("Number of heaps: {0}", runtime.HeapCount);
Console.WriteLine("Number of threads: {0}", runtime.Threads.Count);
@TessFerrandez
29. foreach (var thread in runtime.Threads) {
var e = thread.CurrentException;
if (e != null) {
Console.WriteLine("Thread {0}", thread.ManagedThreadId);
Console.WriteLine("t{0} - {1}", e.Type.Name, e.Message);
foreach (var frame in e.StackTrace) {
Console.WriteLine("t" + frame.DisplayString);
}
}
}
@TessFerrandez