SlideShare a Scribd company logo
.NET Debugging Workshop 
#devconnections
SESSION TITLE 
#devconnections 
Sasha Goldshtein 
CTO, Sela Group 
Microsoft C# MVP, Azure MRS 
@goldshtn blog.sashag.net 
#devconnections
.NET DEBUGGING WORKSHOP 
In This Workshop… 
• Debugging issues in production 
environments 
• Automating triage and analysis 
processes 
• Analyzing system and application 
performance 
#devconnections
.NET DEBUGGING WORKSHOP 
Production Debugging 
• Requirements 
– Obtain actionable 
information about 
crashes and errors 
– Obtain accurate 
performance 
information 
• Limitations 
– Can’t install Visual 
Studio 
– Can’t suspend 
production servers 
– Can’t run intrusive 
tools 
#devconnections
.NET DEBUGGING WORKSHOP 
In the DevOps Process… 
• Automatic build (CI) 
• Automatic deployment (CD) 
• Automatic monitoring 
• Automatic error triage and analysis 
• Automatic remediation 
#devconnections
.NET DEBUGGING WORKSHOP 
The Tools 
• Sysinternals Procdump 
• DebugDiag 
• Windows SDK 
– Debugging Tools for Windows 
– Windows Performance Toolkit 
• PerfView 
#devconnections
Dump Files 
#devconnections
.NET DEBUGGING WORKSHOP 
Dump Files 
• A user dump is a snapshot of a running 
process 
• A kernel dump is a snapshot of the entire 
system 
• Dump files are useful for post-mortem 
diagnostics and for production debugging 
– Anytime you can’t attach and start live 
debugging, a dump might help 
#devconnections
.NET DEBUGGING WORKSHOP 
Limitations of Dump Files 
• A dump file is a static snapshot 
– You can’t debug a dump, just analyze it 
– Sometimes a repro is required (or more 
than one repro) 
• Sometimes several dumps must be 
compared 
#devconnections
.NET DEBUGGING WORKSHOP 
Taxonomy of Dumps 
• Crash dumps are dumps generated 
when an application crashes 
• Hang dumps are dumps generated 
on-demand at a specific moment 
• These are just names; the contents of 
the dump files are the same! 
#devconnections
.NET DEBUGGING WORKSHOP 
Generating a Hang Dump 
• Task Manager, right-click 
and choose 
“Create Dump File” 
– Creates a dump in 
%LOCALAPPDATA 
%Temp 
#devconnections
.NET DEBUGGING WORKSHOP 
Procdump 
• Sysinternals utility for creating dumps 
• Examples: 
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 
Procdump -m 1000 -n 5 -s 600 -ma app.exe 
#devconnections
.NET DEBUGGING WORKSHOP 
Windows Error Reporting 
• WER can create dumps automatically 
– HKLMSoftwareMicrosoftWindows 
Windows Error ReportingLocalDumps 
– http://tinyurl.com/localdumps 
• Can be application-specific, not 
system-wide 
#devconnections
.NET DEBUGGING WORKSHOP 
DebugDiag 
• Microsoft tool for 
monitoring and 
dump generation 
– Very suitable for 
ASP.NET 
– Dump analysis 
component 
included 
#devconnections
.NET DEBUGGING WORKSHOP 
Debugging Symbols 
• Debugging symbols link runtime 
memory addresses to function names, 
source file names and line numbers 
– PDB files 
– Required for proper debugging and 
dump analysis 
#devconnections
.NET DEBUGGING WORKSHOP 
Symbols for Microsoft Binaries 
• Microsoft has a public symbol server 
with PDB files for Microsoft binaries 
• Configure _NT_SYMBOL_PATH 
environment variable 
setx _NT_SYMBOL_PATH 
srv*C:symbols*http://msdl.microsoft.com/download/symbols 
#devconnections
.NET DEBUGGING WORKSHOP 
Opening Dump Files 
• Visual Studio can 
open dump files 
– For .NET, CLR 4.0+ 
and VS2010+ 
required 
– VS2013 
recommended 
#devconnections
.NET DEBUGGING WORKSHOP 
Opening Dump Files 
• WinDbg is a free 
lightweight 
debugger 
• No intrinsic .NET 
support, but has 
SOS debugging 
extension 
!analyze -v (CLR 4.0+) 
.loadby sos clr 
!printexception 
!clrstack 
#devconnections
.NET DEBUGGING WORKSHOP 
Configuring LocalDumps 
Obtaining and opening a dump file 
TRY IT OUT 
#devconnections
Automatic Dump Analysis 
#devconnections
.NET DEBUGGING WORKSHOP 
Basic Automation 
• Run WinDbg automatically on a bunch 
of files and log its output: 
@echo off 
for %%f in (.*.dmp) do ( 
echo Launching analysis of file %%f... 
start "Analyzing %%f" "C:Program Files (x86)Windows 
Kits8.1Debuggersx86cdb.exe" -z %%f -c ".logopen %%f.log; 
!analyze -v; .logclose; qd" 
) 
#devconnections
.NET DEBUGGING WORKSHOP 
Basic Automation 
• Parse the results for interesting tokens: 
for %%f in (.*.dmp.log) do ( 
echo In file %%f: 
findstr "EXCEPTION_MESSAGE MANAGED_OBJECT_NAME" %%f 
) 
#devconnections
.NET DEBUGGING WORKSHOP 
ClrMD 
• Text-based analysis of debugger 
command output is very fragile and 
limited 
• ClrMD is a .NET library for analyzing dump 
files (and running processes) 
– A managed API for interacting with the .NET 
debugging runtime (“SOS API”) 
– Distributed through NuGet (search “ClrMD”) 
#devconnections
.NET DEBUGGING WORKSHOP 
ClrMD Basic Classes 
#devconnections 
DDaattaaTTaarrggeett 
CCllrrRRuunnttiimmee CCllrrRRuunnttiimmee 
CCllrrHHeeaapp CCllrrTThhrreeaadd 
CCllrrTTyyppee CCllrrTTyyppee CCllrrTThhrreeaadd
.NET DEBUGGING WORKSHOP 
mscordacwks.dll 
• Managed dump analysis requires 
mscordacwks.dll matching the CLR 
version 
• It can be automatically downloaded 
from the Microsoft symbol server in 
most cases 
#devconnections
.NET DEBUGGING WORKSHOP 
Connecting to a Target 
#devconnections
.NET DEBUGGING WORKSHOP 
Basic Exception Triage 
#devconnections
.NET DEBUGGING WORKSHOP 
Getting stacks from a live process 
TRY IT OUT 
#devconnections
.NET DEBUGGING WORKSHOP 
Inspecting the Heap 
• Enumerate all heap 
objects and statistics 
• Find specific objects 
• Inspect GC 
information (roots, 
finalization queues, 
etc.) 
#devconnections 
ClrHeap 
EnumerateObjects 
GetObjectType 
EnumerateRoots 
ClrType 
GetSize 
EnumerateRefsOfObject 
GetFieldValue
.NET DEBUGGING WORKSHOP 
Wait Information 
• Threads have a list 
of blocking objects, 
which have owner 
threads 
• Wait analysis and 
deadlock detection 
is made possible 
ClrThread 
BlockingObjects 
BlockingObject 
Reason 
Object 
HasSingleOwner 
Owner/Owners 
Waiters 
#devconnections
ETW and PerfView 
#devconnections
.NET DEBUGGING WORKSHOP 
Event Tracing for Windows 
• High-performance facility for emitting 
100K+ log events per second with rich 
payloads and stack trace support 
• Used widely across Windows, .NET, 
drivers, services, third party 
components 
#devconnections
.NET DEBUGGING WORKSHOP 
ETW Participants 
• A provider generates ETW events 
• A controller starts and stops ETW 
collection 
• A consumer logs, analyzes, or 
processes ETW events 
#devconnections
.NET DEBUGGING WORKSHOP 
ETW Scenarios 
• Profile an app in sampling mode 
• Perform wait-time analysis 
• Log disk accesses including stacks 
• Log GC and JIT events 
• Log memory allocation statistics (C++) 
• Custom application event log 
#devconnections
.NET DEBUGGING WORKSHOP 
Custom ETW Events 
#devconnections
.NET DEBUGGING WORKSHOP 
ETW Tools 
• xperf.exe: Command-line tool for ETW 
capturing and processing 
• wpr.exe: Command-line and GUI for end 
users 
• wpa.exe: Visual trace analysis tool 
• PerfView.exe: Visual tool for capturing 
and recording ETW events from 
managed providers and the CLR 
#devconnections
.NET DEBUGGING WORKSHOP 
Capturing a Trace 
• Xperf 
xperf -on DiagEasy 
... 
xperf -d diag.etl 
• WPR 
#devconnections
.NET DEBUGGING WORKSHOP 
What’s In A Trace? 
• A trace is a huge list 
of events 
• Events have multiple 
columns (payload) 
• Useless without 
additional processing 
#devconnections
.NET DEBUGGING WORKSHOP 
Trace Processing with Xperf 
• I/O summary report 
per file 
xperf -i fileio.etl 
-o fileio.csv -a diskio 
-summary 
• Interactive profiling 
report (for a specific 
process) 
xperf -i cpu.etl 
-o cpu.html -symbols 
-a stacks -process 
app.exe -butterfly 
#devconnections
.NET DEBUGGING WORKSHOP 
Managed Stacks 
• To display managed stack traces 
correctly, additional CLR data is required 
• WPR & PerfView take care of this 
automatically 
• If using Xperf, see: 
http:// 
msdn.microsoft.com/en-us/library/windows/desktop/#devconnections
.NET DEBUGGING WORKSHOP 
Collecting file I/O information 
TRY IT OUT 
#devconnections
.NET DEBUGGING WORKSHOP 
Trace Analysis with WPA 
List of 
graphs 
List of 
graphs 
#devconnections 
Graph 
display 
Graph 
display 
Ungrouped 
Ungrouped 
columns 
Grouped columns 
columns 
Grouped 
columns Grouping 
Grouping 
bar 
bar
.NET DEBUGGING WORKSHOP 
Stack Summaries 
• Learn how to read 
stack summaries 
– Group by Stack 
column 
– Expand “hot path”, 
like in profiler 
• Stack resolution 
requires symbols 
(slow) 
#devconnections
.NET DEBUGGING WORKSHOP 
PerfView 
• ETW collection and analysis tool tailored 
for .NET applications (but not only) 
• Can be used as a sampling profiler 
• Can be used as an allocation profiler 
• Can be used for heap snapshot analysis 
#devconnections
.NET DEBUGGING WORKSHOP 
Collecting Data w/ PerfView 
• CLI 
PerfView run app.exe 
• GUI 
#devconnections
.NET DEBUGGING WORKSHOP 
PerfView Collection Options 
Profiling wall-clock 
Profiling wall-clock 
time 
time 
CPU sampling 
profiling 
#devconnections 
File/registry 
accesses 
File/registry 
accesses 
Allocation 
profiling 
Allocation 
profiling 
CPU sampling 
profiling
.NET DEBUGGING WORKSHOP 
PerfView Tables 
Grouping 
options Filtering 
Grouping 
options 
#devconnections 
Filtering 
options 
options 
CCaalll ls tsatacckk t rtereee 
In-trace activity 
highlighter 
In-trace activity 
highlighter
.NET DEBUGGING WORKSHOP 
Memory Leak Analysis 
• PerfView can 
generate heap 
snapshots (smaller 
than a dump), 
analyze, and 
compare them 
• Can also import 
dumps directly 
#devconnections
.NET DEBUGGING WORKSHOP 
Leak analysis with PerfView 
TRY IT OUT 
#devconnections
.NET DEBUGGING WORKSHOP 
Automatic ETW Analysis 
• The TraceEvent 
library provides an 
API for ETW analysis 
– Understands kernel 
and CLR events 
– Supports call stacks 
(incl. managed) 
#devconnections
.NET DEBUGGING WORKSHOP 
Example Analysis Scenarios 
• Monitor the system 
for CLR exceptions 
w/ stacks 
ExceptionTraceData 
• Get a profiling trace 
and look for 
regressions 
TraceLog 
SampledProfileTraceData 
TraceCallStack 
#devconnections
.NET DEBUGGING WORKSHOP 
Summary 
• Production debugging and 
performance investigation is here, and 
entirely possible thanks to dumps and 
ETW traces 
• Integrate automatic error analysis and 
triage into your devops process 
#devconnections
SESSION TITLE 
Rate This Session Now! 
#devconnections 
Rate with Mobile App: 
1. Select the session from the 
Agenda or Speakers menus 
2. Select the Actions tab 
3. Click Rate Session 
Rate Using Our Website: 
1. Register at www.devconnections.com/logintoratesession 
2. Go to www.devconnections.com/ratesession 
3. Select this session from the list and rate it 
Tell Us 
What 
You 
Thought 
of This 
Session 
Be Entered to WIN Prizes!

More Related Content

What's hot

Who’s afraid of WinDbg
Who’s afraid of WinDbgWho’s afraid of WinDbg
Who’s afraid of WinDbg
Dror Helper
 
Devel::NYTProf v3 - 200908 (OUTDATED, see 201008)
Devel::NYTProf v3 - 200908 (OUTDATED, see 201008)Devel::NYTProf v3 - 200908 (OUTDATED, see 201008)
Devel::NYTProf v3 - 200908 (OUTDATED, see 201008)
Tim Bunce
 
You didnt see it’s coming? "Dawn of hardened Windows Kernel"
You didnt see it’s coming? "Dawn of hardened Windows Kernel" You didnt see it’s coming? "Dawn of hardened Windows Kernel"
You didnt see it’s coming? "Dawn of hardened Windows Kernel"
Peter Hlavaty
 
Racing with Droids
Racing with DroidsRacing with Droids
Racing with Droids
Peter Hlavaty
 
When is something overflowing
When is something overflowingWhen is something overflowing
When is something overflowing
Peter Hlavaty
 
USENIX ATC 2017: Visualizing Performance with Flame Graphs
USENIX ATC 2017: Visualizing Performance with Flame GraphsUSENIX ATC 2017: Visualizing Performance with Flame Graphs
USENIX ATC 2017: Visualizing Performance with Flame Graphs
Brendan Gregg
 
Guardians of your CODE
Guardians of your CODEGuardians of your CODE
Guardians of your CODE
Peter Hlavaty
 
Vulnerability desing patterns
Vulnerability desing patternsVulnerability desing patterns
Vulnerability desing patterns
Peter Hlavaty
 
Back to the CORE
Back to the COREBack to the CORE
Back to the CORE
Peter Hlavaty
 
Building Observable Applications w/ Node.js -- BayNode Meetup, March 2014
Building Observable Applications w/ Node.js -- BayNode Meetup, March 2014Building Observable Applications w/ Node.js -- BayNode Meetup, March 2014
Building Observable Applications w/ Node.js -- BayNode Meetup, March 2014
Yunong Xiao
 
Windows Kernel Exploitation : This Time Font hunt you down in 4 bytes
Windows Kernel Exploitation : This Time Font hunt you down in 4 bytesWindows Kernel Exploitation : This Time Font hunt you down in 4 bytes
Windows Kernel Exploitation : This Time Font hunt you down in 4 bytes
Peter Hlavaty
 
Security research over Windows #defcon china
Security research over Windows #defcon chinaSecurity research over Windows #defcon china
Security research over Windows #defcon china
Peter Hlavaty
 
Rainbow Over the Windows: More Colors Than You Could Expect
Rainbow Over the Windows: More Colors Than You Could ExpectRainbow Over the Windows: More Colors Than You Could Expect
Rainbow Over the Windows: More Colors Than You Could Expect
Peter Hlavaty
 
Modern Evasion Techniques
Modern Evasion TechniquesModern Evasion Techniques
Modern Evasion Techniques
Jason Lang
 
Hacking - high school intro
Hacking - high school introHacking - high school intro
Hacking - high school intro
Peter Hlavaty
 
Process injection - Malware style
Process injection - Malware styleProcess injection - Malware style
Process injection - Malware style
Sander Demeester
 
How Safe is your Link ?
How Safe is your Link ?How Safe is your Link ?
How Safe is your Link ?
Peter Hlavaty
 
Mesa and Its Debugging
Mesa and Its DebuggingMesa and Its Debugging
Mesa and Its Debugging
GlobalLogic Ukraine
 
CNIT 126 2: Malware Analysis in Virtual Machines & 3: Basic Dynamic Analysis
CNIT 126 2: Malware Analysis in Virtual Machines & 3: Basic Dynamic AnalysisCNIT 126 2: Malware Analysis in Virtual Machines & 3: Basic Dynamic Analysis
CNIT 126 2: Malware Analysis in Virtual Machines & 3: Basic Dynamic Analysis
Sam Bowne
 
How We Test Linux
How We Test LinuxHow We Test Linux
How We Test Linux
GlobalLogic Ukraine
 

What's hot (20)

Who’s afraid of WinDbg
Who’s afraid of WinDbgWho’s afraid of WinDbg
Who’s afraid of WinDbg
 
Devel::NYTProf v3 - 200908 (OUTDATED, see 201008)
Devel::NYTProf v3 - 200908 (OUTDATED, see 201008)Devel::NYTProf v3 - 200908 (OUTDATED, see 201008)
Devel::NYTProf v3 - 200908 (OUTDATED, see 201008)
 
You didnt see it’s coming? "Dawn of hardened Windows Kernel"
You didnt see it’s coming? "Dawn of hardened Windows Kernel" You didnt see it’s coming? "Dawn of hardened Windows Kernel"
You didnt see it’s coming? "Dawn of hardened Windows Kernel"
 
Racing with Droids
Racing with DroidsRacing with Droids
Racing with Droids
 
When is something overflowing
When is something overflowingWhen is something overflowing
When is something overflowing
 
USENIX ATC 2017: Visualizing Performance with Flame Graphs
USENIX ATC 2017: Visualizing Performance with Flame GraphsUSENIX ATC 2017: Visualizing Performance with Flame Graphs
USENIX ATC 2017: Visualizing Performance with Flame Graphs
 
Guardians of your CODE
Guardians of your CODEGuardians of your CODE
Guardians of your CODE
 
Vulnerability desing patterns
Vulnerability desing patternsVulnerability desing patterns
Vulnerability desing patterns
 
Back to the CORE
Back to the COREBack to the CORE
Back to the CORE
 
Building Observable Applications w/ Node.js -- BayNode Meetup, March 2014
Building Observable Applications w/ Node.js -- BayNode Meetup, March 2014Building Observable Applications w/ Node.js -- BayNode Meetup, March 2014
Building Observable Applications w/ Node.js -- BayNode Meetup, March 2014
 
Windows Kernel Exploitation : This Time Font hunt you down in 4 bytes
Windows Kernel Exploitation : This Time Font hunt you down in 4 bytesWindows Kernel Exploitation : This Time Font hunt you down in 4 bytes
Windows Kernel Exploitation : This Time Font hunt you down in 4 bytes
 
Security research over Windows #defcon china
Security research over Windows #defcon chinaSecurity research over Windows #defcon china
Security research over Windows #defcon china
 
Rainbow Over the Windows: More Colors Than You Could Expect
Rainbow Over the Windows: More Colors Than You Could ExpectRainbow Over the Windows: More Colors Than You Could Expect
Rainbow Over the Windows: More Colors Than You Could Expect
 
Modern Evasion Techniques
Modern Evasion TechniquesModern Evasion Techniques
Modern Evasion Techniques
 
Hacking - high school intro
Hacking - high school introHacking - high school intro
Hacking - high school intro
 
Process injection - Malware style
Process injection - Malware styleProcess injection - Malware style
Process injection - Malware style
 
How Safe is your Link ?
How Safe is your Link ?How Safe is your Link ?
How Safe is your Link ?
 
Mesa and Its Debugging
Mesa and Its DebuggingMesa and Its Debugging
Mesa and Its Debugging
 
CNIT 126 2: Malware Analysis in Virtual Machines & 3: Basic Dynamic Analysis
CNIT 126 2: Malware Analysis in Virtual Machines & 3: Basic Dynamic AnalysisCNIT 126 2: Malware Analysis in Virtual Machines & 3: Basic Dynamic Analysis
CNIT 126 2: Malware Analysis in Virtual Machines & 3: Basic Dynamic Analysis
 
How We Test Linux
How We Test LinuxHow We Test Linux
How We Test Linux
 

Similar to .NET Debugging Workshop

PAC 2019 virtual Christoph NEUMÜLLER
PAC 2019 virtual Christoph NEUMÜLLERPAC 2019 virtual Christoph NEUMÜLLER
PAC 2019 virtual Christoph NEUMÜLLER
Neotys
 
Docker presentasjon java bin
Docker presentasjon java binDocker presentasjon java bin
Docker presentasjon java bin
Olve Hansen
 
Hot to build continuously processing for 24/7 real-time data streaming platform?
Hot to build continuously processing for 24/7 real-time data streaming platform?Hot to build continuously processing for 24/7 real-time data streaming platform?
Hot to build continuously processing for 24/7 real-time data streaming platform?
GetInData
 
Atlanta Jenkins Area Meetup October 22nd 2015
Atlanta Jenkins Area Meetup October 22nd 2015Atlanta Jenkins Area Meetup October 22nd 2015
Atlanta Jenkins Area Meetup October 22nd 2015
Kurt Madel
 
introduction to node.js
introduction to node.jsintroduction to node.js
introduction to node.js
orkaplan
 
Jenkins Pipelines Advanced
Jenkins Pipelines AdvancedJenkins Pipelines Advanced
Jenkins Pipelines Advanced
Oliver Lemm
 
2 万林涛
2 万林涛2 万林涛
2 万林涛
Jiang Shang
 
J1 2015 "Debugging Java Apps in Containers: No Heavy Welding Gear Required"
J1 2015 "Debugging Java Apps in Containers: No Heavy Welding Gear Required"J1 2015 "Debugging Java Apps in Containers: No Heavy Welding Gear Required"
J1 2015 "Debugging Java Apps in Containers: No Heavy Welding Gear Required"
Daniel Bryant
 
Surge2012
Surge2012Surge2012
Surge2012
davidapacheco
 
Raffaele Rialdi
Raffaele RialdiRaffaele Rialdi
Raffaele Rialdi
CodeFest
 
DIY Java Profiling
DIY Java ProfilingDIY Java Profiling
DIY Java Profiling
Roman Elizarov
 
Exploring Java Heap Dumps (Oracle Code One 2018)
Exploring Java Heap Dumps (Oracle Code One 2018)Exploring Java Heap Dumps (Oracle Code One 2018)
Exploring Java Heap Dumps (Oracle Code One 2018)
Ryan Cuprak
 
Our Puppet Story (GUUG FFG 2015)
Our Puppet Story (GUUG FFG 2015)Our Puppet Story (GUUG FFG 2015)
Our Puppet Story (GUUG FFG 2015)
DECK36
 
SenchaCon 2016: Develop, Test & Deploy with Docker - Jonas Schwabe
SenchaCon 2016: Develop, Test & Deploy with Docker - Jonas Schwabe SenchaCon 2016: Develop, Test & Deploy with Docker - Jonas Schwabe
SenchaCon 2016: Develop, Test & Deploy with Docker - Jonas Schwabe
Sencha
 
Performance Benchmarking: Tips, Tricks, and Lessons Learned
Performance Benchmarking: Tips, Tricks, and Lessons LearnedPerformance Benchmarking: Tips, Tricks, and Lessons Learned
Performance Benchmarking: Tips, Tricks, and Lessons Learned
Tim Callaghan
 
¡El mejor lenguaje para automatizar pruebas!
¡El mejor lenguaje para automatizar pruebas!¡El mejor lenguaje para automatizar pruebas!
¡El mejor lenguaje para automatizar pruebas!
Antonio Robres Turon
 
Introduction to jenkins
Introduction to jenkinsIntroduction to jenkins
Introduction to jenkins
Abe Diaz
 
Performance analysis and troubleshooting using DTrace
Performance analysis and troubleshooting using DTracePerformance analysis and troubleshooting using DTrace
Performance analysis and troubleshooting using DTrace
Graeme Jenkinson
 
Web a Quebec - JS Debugging
Web a Quebec - JS DebuggingWeb a Quebec - JS Debugging
Web a Quebec - JS Debugging
Rami Sayar
 
Here Be Dragons – Advanced JavaScript Debugging
Here Be Dragons – Advanced JavaScript DebuggingHere Be Dragons – Advanced JavaScript Debugging
Here Be Dragons – Advanced JavaScript Debugging
FITC
 

Similar to .NET Debugging Workshop (20)

PAC 2019 virtual Christoph NEUMÜLLER
PAC 2019 virtual Christoph NEUMÜLLERPAC 2019 virtual Christoph NEUMÜLLER
PAC 2019 virtual Christoph NEUMÜLLER
 
Docker presentasjon java bin
Docker presentasjon java binDocker presentasjon java bin
Docker presentasjon java bin
 
Hot to build continuously processing for 24/7 real-time data streaming platform?
Hot to build continuously processing for 24/7 real-time data streaming platform?Hot to build continuously processing for 24/7 real-time data streaming platform?
Hot to build continuously processing for 24/7 real-time data streaming platform?
 
Atlanta Jenkins Area Meetup October 22nd 2015
Atlanta Jenkins Area Meetup October 22nd 2015Atlanta Jenkins Area Meetup October 22nd 2015
Atlanta Jenkins Area Meetup October 22nd 2015
 
introduction to node.js
introduction to node.jsintroduction to node.js
introduction to node.js
 
Jenkins Pipelines Advanced
Jenkins Pipelines AdvancedJenkins Pipelines Advanced
Jenkins Pipelines Advanced
 
2 万林涛
2 万林涛2 万林涛
2 万林涛
 
J1 2015 "Debugging Java Apps in Containers: No Heavy Welding Gear Required"
J1 2015 "Debugging Java Apps in Containers: No Heavy Welding Gear Required"J1 2015 "Debugging Java Apps in Containers: No Heavy Welding Gear Required"
J1 2015 "Debugging Java Apps in Containers: No Heavy Welding Gear Required"
 
Surge2012
Surge2012Surge2012
Surge2012
 
Raffaele Rialdi
Raffaele RialdiRaffaele Rialdi
Raffaele Rialdi
 
DIY Java Profiling
DIY Java ProfilingDIY Java Profiling
DIY Java Profiling
 
Exploring Java Heap Dumps (Oracle Code One 2018)
Exploring Java Heap Dumps (Oracle Code One 2018)Exploring Java Heap Dumps (Oracle Code One 2018)
Exploring Java Heap Dumps (Oracle Code One 2018)
 
Our Puppet Story (GUUG FFG 2015)
Our Puppet Story (GUUG FFG 2015)Our Puppet Story (GUUG FFG 2015)
Our Puppet Story (GUUG FFG 2015)
 
SenchaCon 2016: Develop, Test & Deploy with Docker - Jonas Schwabe
SenchaCon 2016: Develop, Test & Deploy with Docker - Jonas Schwabe SenchaCon 2016: Develop, Test & Deploy with Docker - Jonas Schwabe
SenchaCon 2016: Develop, Test & Deploy with Docker - Jonas Schwabe
 
Performance Benchmarking: Tips, Tricks, and Lessons Learned
Performance Benchmarking: Tips, Tricks, and Lessons LearnedPerformance Benchmarking: Tips, Tricks, and Lessons Learned
Performance Benchmarking: Tips, Tricks, and Lessons Learned
 
¡El mejor lenguaje para automatizar pruebas!
¡El mejor lenguaje para automatizar pruebas!¡El mejor lenguaje para automatizar pruebas!
¡El mejor lenguaje para automatizar pruebas!
 
Introduction to jenkins
Introduction to jenkinsIntroduction to jenkins
Introduction to jenkins
 
Performance analysis and troubleshooting using DTrace
Performance analysis and troubleshooting using DTracePerformance analysis and troubleshooting using DTrace
Performance analysis and troubleshooting using DTrace
 
Web a Quebec - JS Debugging
Web a Quebec - JS DebuggingWeb a Quebec - JS Debugging
Web a Quebec - JS Debugging
 
Here Be Dragons – Advanced JavaScript Debugging
Here Be Dragons – Advanced JavaScript DebuggingHere Be Dragons – Advanced JavaScript Debugging
Here Be Dragons – Advanced JavaScript Debugging
 

More from Sasha Goldshtein

Modern Linux Tracing Landscape
Modern Linux Tracing LandscapeModern Linux Tracing Landscape
Modern Linux Tracing Landscape
Sasha Goldshtein
 
The Next Linux Superpower: eBPF Primer
The Next Linux Superpower: eBPF PrimerThe Next Linux Superpower: eBPF Primer
The Next Linux Superpower: eBPF Primer
Sasha Goldshtein
 
Staring into the eBPF Abyss
Staring into the eBPF AbyssStaring into the eBPF Abyss
Staring into the eBPF Abyss
Sasha Goldshtein
 
Visual Studio 2015 and the Next .NET Framework
Visual Studio 2015 and the Next .NET FrameworkVisual Studio 2015 and the Next .NET Framework
Visual Studio 2015 and the Next .NET Framework
Sasha Goldshtein
 
Swift: Apple's New Programming Language for iOS and OS X
Swift: Apple's New Programming Language for iOS and OS XSwift: Apple's New Programming Language for iOS and OS X
Swift: Apple's New Programming Language for iOS and OS X
Sasha Goldshtein
 
C# Everywhere: Cross-Platform Mobile Apps with Xamarin
C# Everywhere: Cross-Platform Mobile Apps with XamarinC# Everywhere: Cross-Platform Mobile Apps with Xamarin
C# Everywhere: Cross-Platform Mobile Apps with Xamarin
Sasha Goldshtein
 
Modern Backends for Mobile Apps
Modern Backends for Mobile AppsModern Backends for Mobile Apps
Modern Backends for Mobile Apps
Sasha Goldshtein
 
Performance and Debugging with the Diagnostics Hub in Visual Studio 2013
Performance and Debugging with the Diagnostics Hub in Visual Studio 2013Performance and Debugging with the Diagnostics Hub in Visual Studio 2013
Performance and Debugging with the Diagnostics Hub in Visual Studio 2013
Sasha Goldshtein
 
Introduction to RavenDB
Introduction to RavenDBIntroduction to RavenDB
Introduction to RavenDB
Sasha Goldshtein
 
State of the Platforms
State of the PlatformsState of the Platforms
State of the Platforms
Sasha Goldshtein
 
Delivering Millions of Push Notifications in Minutes
Delivering Millions of Push Notifications in MinutesDelivering Millions of Push Notifications in Minutes
Delivering Millions of Push Notifications in Minutes
Sasha Goldshtein
 
Building Mobile Apps with a Mobile Services .NET Backend
Building Mobile Apps with a Mobile Services .NET BackendBuilding Mobile Apps with a Mobile Services .NET Backend
Building Mobile Apps with a Mobile Services .NET Backend
Sasha Goldshtein
 
Building iOS and Android Apps with Mobile Services
Building iOS and Android Apps with Mobile ServicesBuilding iOS and Android Apps with Mobile Services
Building iOS and Android Apps with Mobile Services
Sasha Goldshtein
 
Task and Data Parallelism
Task and Data ParallelismTask and Data Parallelism
Task and Data Parallelism
Sasha Goldshtein
 
What's New in C++ 11?
What's New in C++ 11?What's New in C++ 11?
What's New in C++ 11?
Sasha Goldshtein
 
Attacking Web Applications
Attacking Web ApplicationsAttacking Web Applications
Attacking Web Applications
Sasha Goldshtein
 
Windows Azure Mobile Services
Windows Azure Mobile ServicesWindows Azure Mobile Services
Windows Azure Mobile Services
Sasha Goldshtein
 
First Steps in Android Development
First Steps in Android DevelopmentFirst Steps in Android Development
First Steps in Android Development
Sasha Goldshtein
 
First Steps in iOS Development
First Steps in iOS DevelopmentFirst Steps in iOS Development
First Steps in iOS Development
Sasha Goldshtein
 
JavaScript, Meet Cloud: Node.js on Windows Azure
JavaScript, Meet Cloud: Node.js on Windows AzureJavaScript, Meet Cloud: Node.js on Windows Azure
JavaScript, Meet Cloud: Node.js on Windows Azure
Sasha Goldshtein
 

More from Sasha Goldshtein (20)

Modern Linux Tracing Landscape
Modern Linux Tracing LandscapeModern Linux Tracing Landscape
Modern Linux Tracing Landscape
 
The Next Linux Superpower: eBPF Primer
The Next Linux Superpower: eBPF PrimerThe Next Linux Superpower: eBPF Primer
The Next Linux Superpower: eBPF Primer
 
Staring into the eBPF Abyss
Staring into the eBPF AbyssStaring into the eBPF Abyss
Staring into the eBPF Abyss
 
Visual Studio 2015 and the Next .NET Framework
Visual Studio 2015 and the Next .NET FrameworkVisual Studio 2015 and the Next .NET Framework
Visual Studio 2015 and the Next .NET Framework
 
Swift: Apple's New Programming Language for iOS and OS X
Swift: Apple's New Programming Language for iOS and OS XSwift: Apple's New Programming Language for iOS and OS X
Swift: Apple's New Programming Language for iOS and OS X
 
C# Everywhere: Cross-Platform Mobile Apps with Xamarin
C# Everywhere: Cross-Platform Mobile Apps with XamarinC# Everywhere: Cross-Platform Mobile Apps with Xamarin
C# Everywhere: Cross-Platform Mobile Apps with Xamarin
 
Modern Backends for Mobile Apps
Modern Backends for Mobile AppsModern Backends for Mobile Apps
Modern Backends for Mobile Apps
 
Performance and Debugging with the Diagnostics Hub in Visual Studio 2013
Performance and Debugging with the Diagnostics Hub in Visual Studio 2013Performance and Debugging with the Diagnostics Hub in Visual Studio 2013
Performance and Debugging with the Diagnostics Hub in Visual Studio 2013
 
Introduction to RavenDB
Introduction to RavenDBIntroduction to RavenDB
Introduction to RavenDB
 
State of the Platforms
State of the PlatformsState of the Platforms
State of the Platforms
 
Delivering Millions of Push Notifications in Minutes
Delivering Millions of Push Notifications in MinutesDelivering Millions of Push Notifications in Minutes
Delivering Millions of Push Notifications in Minutes
 
Building Mobile Apps with a Mobile Services .NET Backend
Building Mobile Apps with a Mobile Services .NET BackendBuilding Mobile Apps with a Mobile Services .NET Backend
Building Mobile Apps with a Mobile Services .NET Backend
 
Building iOS and Android Apps with Mobile Services
Building iOS and Android Apps with Mobile ServicesBuilding iOS and Android Apps with Mobile Services
Building iOS and Android Apps with Mobile Services
 
Task and Data Parallelism
Task and Data ParallelismTask and Data Parallelism
Task and Data Parallelism
 
What's New in C++ 11?
What's New in C++ 11?What's New in C++ 11?
What's New in C++ 11?
 
Attacking Web Applications
Attacking Web ApplicationsAttacking Web Applications
Attacking Web Applications
 
Windows Azure Mobile Services
Windows Azure Mobile ServicesWindows Azure Mobile Services
Windows Azure Mobile Services
 
First Steps in Android Development
First Steps in Android DevelopmentFirst Steps in Android Development
First Steps in Android Development
 
First Steps in iOS Development
First Steps in iOS DevelopmentFirst Steps in iOS Development
First Steps in iOS Development
 
JavaScript, Meet Cloud: Node.js on Windows Azure
JavaScript, Meet Cloud: Node.js on Windows AzureJavaScript, Meet Cloud: Node.js on Windows Azure
JavaScript, Meet Cloud: Node.js on Windows Azure
 

Recently uploaded

The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
Product School
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
DianaGray10
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Jeffrey Haguewood
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
Frank van Harmelen
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
Product School
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
UiPathCommunity
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
Product School
 
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
g2nightmarescribd
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 

Recently uploaded (20)

The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 

.NET Debugging Workshop

  • 1. .NET Debugging Workshop #devconnections
  • 2. SESSION TITLE #devconnections Sasha Goldshtein CTO, Sela Group Microsoft C# MVP, Azure MRS @goldshtn blog.sashag.net #devconnections
  • 3. .NET DEBUGGING WORKSHOP In This Workshop… • Debugging issues in production environments • Automating triage and analysis processes • Analyzing system and application performance #devconnections
  • 4. .NET DEBUGGING WORKSHOP Production Debugging • Requirements – Obtain actionable information about crashes and errors – Obtain accurate performance information • Limitations – Can’t install Visual Studio – Can’t suspend production servers – Can’t run intrusive tools #devconnections
  • 5. .NET DEBUGGING WORKSHOP In the DevOps Process… • Automatic build (CI) • Automatic deployment (CD) • Automatic monitoring • Automatic error triage and analysis • Automatic remediation #devconnections
  • 6. .NET DEBUGGING WORKSHOP The Tools • Sysinternals Procdump • DebugDiag • Windows SDK – Debugging Tools for Windows – Windows Performance Toolkit • PerfView #devconnections
  • 8. .NET DEBUGGING WORKSHOP Dump Files • A user dump is a snapshot of a running process • A kernel dump is a snapshot of the entire system • Dump files are useful for post-mortem diagnostics and for production debugging – Anytime you can’t attach and start live debugging, a dump might help #devconnections
  • 9. .NET DEBUGGING WORKSHOP Limitations of Dump Files • A dump file is a static snapshot – You can’t debug a dump, just analyze it – Sometimes a repro is required (or more than one repro) • Sometimes several dumps must be compared #devconnections
  • 10. .NET DEBUGGING WORKSHOP Taxonomy of Dumps • Crash dumps are dumps generated when an application crashes • Hang dumps are dumps generated on-demand at a specific moment • These are just names; the contents of the dump files are the same! #devconnections
  • 11. .NET DEBUGGING WORKSHOP Generating a Hang Dump • Task Manager, right-click and choose “Create Dump File” – Creates a dump in %LOCALAPPDATA %Temp #devconnections
  • 12. .NET DEBUGGING WORKSHOP Procdump • Sysinternals utility for creating dumps • Examples: 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 Procdump -m 1000 -n 5 -s 600 -ma app.exe #devconnections
  • 13. .NET DEBUGGING WORKSHOP Windows Error Reporting • WER can create dumps automatically – HKLMSoftwareMicrosoftWindows Windows Error ReportingLocalDumps – http://tinyurl.com/localdumps • Can be application-specific, not system-wide #devconnections
  • 14. .NET DEBUGGING WORKSHOP DebugDiag • Microsoft tool for monitoring and dump generation – Very suitable for ASP.NET – Dump analysis component included #devconnections
  • 15. .NET DEBUGGING WORKSHOP Debugging Symbols • Debugging symbols link runtime memory addresses to function names, source file names and line numbers – PDB files – Required for proper debugging and dump analysis #devconnections
  • 16. .NET DEBUGGING WORKSHOP Symbols for Microsoft Binaries • Microsoft has a public symbol server with PDB files for Microsoft binaries • Configure _NT_SYMBOL_PATH environment variable setx _NT_SYMBOL_PATH srv*C:symbols*http://msdl.microsoft.com/download/symbols #devconnections
  • 17. .NET DEBUGGING WORKSHOP Opening Dump Files • Visual Studio can open dump files – For .NET, CLR 4.0+ and VS2010+ required – VS2013 recommended #devconnections
  • 18. .NET DEBUGGING WORKSHOP Opening Dump Files • WinDbg is a free lightweight debugger • No intrinsic .NET support, but has SOS debugging extension !analyze -v (CLR 4.0+) .loadby sos clr !printexception !clrstack #devconnections
  • 19. .NET DEBUGGING WORKSHOP Configuring LocalDumps Obtaining and opening a dump file TRY IT OUT #devconnections
  • 20. Automatic Dump Analysis #devconnections
  • 21. .NET DEBUGGING WORKSHOP Basic Automation • Run WinDbg automatically on a bunch of files and log its output: @echo off for %%f in (.*.dmp) do ( echo Launching analysis of file %%f... start "Analyzing %%f" "C:Program Files (x86)Windows Kits8.1Debuggersx86cdb.exe" -z %%f -c ".logopen %%f.log; !analyze -v; .logclose; qd" ) #devconnections
  • 22. .NET DEBUGGING WORKSHOP Basic Automation • Parse the results for interesting tokens: for %%f in (.*.dmp.log) do ( echo In file %%f: findstr "EXCEPTION_MESSAGE MANAGED_OBJECT_NAME" %%f ) #devconnections
  • 23. .NET DEBUGGING WORKSHOP ClrMD • Text-based analysis of debugger command output is very fragile and limited • ClrMD is a .NET library for analyzing dump files (and running processes) – A managed API for interacting with the .NET debugging runtime (“SOS API”) – Distributed through NuGet (search “ClrMD”) #devconnections
  • 24. .NET DEBUGGING WORKSHOP ClrMD Basic Classes #devconnections DDaattaaTTaarrggeett CCllrrRRuunnttiimmee CCllrrRRuunnttiimmee CCllrrHHeeaapp CCllrrTThhrreeaadd CCllrrTTyyppee CCllrrTTyyppee CCllrrTThhrreeaadd
  • 25. .NET DEBUGGING WORKSHOP mscordacwks.dll • Managed dump analysis requires mscordacwks.dll matching the CLR version • It can be automatically downloaded from the Microsoft symbol server in most cases #devconnections
  • 26. .NET DEBUGGING WORKSHOP Connecting to a Target #devconnections
  • 27. .NET DEBUGGING WORKSHOP Basic Exception Triage #devconnections
  • 28. .NET DEBUGGING WORKSHOP Getting stacks from a live process TRY IT OUT #devconnections
  • 29. .NET DEBUGGING WORKSHOP Inspecting the Heap • Enumerate all heap objects and statistics • Find specific objects • Inspect GC information (roots, finalization queues, etc.) #devconnections ClrHeap EnumerateObjects GetObjectType EnumerateRoots ClrType GetSize EnumerateRefsOfObject GetFieldValue
  • 30. .NET DEBUGGING WORKSHOP Wait Information • Threads have a list of blocking objects, which have owner threads • Wait analysis and deadlock detection is made possible ClrThread BlockingObjects BlockingObject Reason Object HasSingleOwner Owner/Owners Waiters #devconnections
  • 31. ETW and PerfView #devconnections
  • 32. .NET DEBUGGING WORKSHOP Event Tracing for Windows • High-performance facility for emitting 100K+ log events per second with rich payloads and stack trace support • Used widely across Windows, .NET, drivers, services, third party components #devconnections
  • 33. .NET DEBUGGING WORKSHOP ETW Participants • A provider generates ETW events • A controller starts and stops ETW collection • A consumer logs, analyzes, or processes ETW events #devconnections
  • 34. .NET DEBUGGING WORKSHOP ETW Scenarios • Profile an app in sampling mode • Perform wait-time analysis • Log disk accesses including stacks • Log GC and JIT events • Log memory allocation statistics (C++) • Custom application event log #devconnections
  • 35. .NET DEBUGGING WORKSHOP Custom ETW Events #devconnections
  • 36. .NET DEBUGGING WORKSHOP ETW Tools • xperf.exe: Command-line tool for ETW capturing and processing • wpr.exe: Command-line and GUI for end users • wpa.exe: Visual trace analysis tool • PerfView.exe: Visual tool for capturing and recording ETW events from managed providers and the CLR #devconnections
  • 37. .NET DEBUGGING WORKSHOP Capturing a Trace • Xperf xperf -on DiagEasy ... xperf -d diag.etl • WPR #devconnections
  • 38. .NET DEBUGGING WORKSHOP What’s In A Trace? • A trace is a huge list of events • Events have multiple columns (payload) • Useless without additional processing #devconnections
  • 39. .NET DEBUGGING WORKSHOP Trace Processing with Xperf • I/O summary report per file xperf -i fileio.etl -o fileio.csv -a diskio -summary • Interactive profiling report (for a specific process) xperf -i cpu.etl -o cpu.html -symbols -a stacks -process app.exe -butterfly #devconnections
  • 40. .NET DEBUGGING WORKSHOP Managed Stacks • To display managed stack traces correctly, additional CLR data is required • WPR & PerfView take care of this automatically • If using Xperf, see: http:// msdn.microsoft.com/en-us/library/windows/desktop/#devconnections
  • 41. .NET DEBUGGING WORKSHOP Collecting file I/O information TRY IT OUT #devconnections
  • 42. .NET DEBUGGING WORKSHOP Trace Analysis with WPA List of graphs List of graphs #devconnections Graph display Graph display Ungrouped Ungrouped columns Grouped columns columns Grouped columns Grouping Grouping bar bar
  • 43. .NET DEBUGGING WORKSHOP Stack Summaries • Learn how to read stack summaries – Group by Stack column – Expand “hot path”, like in profiler • Stack resolution requires symbols (slow) #devconnections
  • 44. .NET DEBUGGING WORKSHOP PerfView • ETW collection and analysis tool tailored for .NET applications (but not only) • Can be used as a sampling profiler • Can be used as an allocation profiler • Can be used for heap snapshot analysis #devconnections
  • 45. .NET DEBUGGING WORKSHOP Collecting Data w/ PerfView • CLI PerfView run app.exe • GUI #devconnections
  • 46. .NET DEBUGGING WORKSHOP PerfView Collection Options Profiling wall-clock Profiling wall-clock time time CPU sampling profiling #devconnections File/registry accesses File/registry accesses Allocation profiling Allocation profiling CPU sampling profiling
  • 47. .NET DEBUGGING WORKSHOP PerfView Tables Grouping options Filtering Grouping options #devconnections Filtering options options CCaalll ls tsatacckk t rtereee In-trace activity highlighter In-trace activity highlighter
  • 48. .NET DEBUGGING WORKSHOP Memory Leak Analysis • PerfView can generate heap snapshots (smaller than a dump), analyze, and compare them • Can also import dumps directly #devconnections
  • 49. .NET DEBUGGING WORKSHOP Leak analysis with PerfView TRY IT OUT #devconnections
  • 50. .NET DEBUGGING WORKSHOP Automatic ETW Analysis • The TraceEvent library provides an API for ETW analysis – Understands kernel and CLR events – Supports call stacks (incl. managed) #devconnections
  • 51. .NET DEBUGGING WORKSHOP Example Analysis Scenarios • Monitor the system for CLR exceptions w/ stacks ExceptionTraceData • Get a profiling trace and look for regressions TraceLog SampledProfileTraceData TraceCallStack #devconnections
  • 52. .NET DEBUGGING WORKSHOP Summary • Production debugging and performance investigation is here, and entirely possible thanks to dumps and ETW traces • Integrate automatic error analysis and triage into your devops process #devconnections
  • 53. SESSION TITLE Rate This Session Now! #devconnections Rate with Mobile App: 1. Select the session from the Agenda or Speakers menus 2. Select the Actions tab 3. Click Rate Session Rate Using Our Website: 1. Register at www.devconnections.com/logintoratesession 2. Go to www.devconnections.com/ratesession 3. Select this session from the list and rate it Tell Us What You Thought of This Session Be Entered to WIN Prizes!