.Net debugging 2017

Tess Ferrandez
Tess FerrandezPrincipal Software Engineer at Microsoft
.NET
DEBUGGING
@TessFerrandez
Microsoft
Crashes
Performance Issues
Memory Leaks
Issues that we can’t step by step debug
@TessFerrandez
MEMORY
DUMPS
User-mode dump
Snapshot of a process and the memory
it addresses
@TessFerrandez
Threads call stacks, stack objects
Modules dlls, exes
.NET Heap .net objects, sizes, info
@TessFerrandez
GATHERING
MEMORY DUMPS
TASK MANAGER
@TessFerrandez
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
DEBUG DIAG
GUI tool to generate dumps based on rules
and analyze dumps for common .net issues
@TessFerrandez
ANALYZING
MEMORY DUMPS
WINDBG
Native debugger
Installed with WDK and Debugging tools for
Windows
@TessFerrandez
@TessFerrandez
DEBUG DIAG
VISUAL STUDIO
@TessFerrandez
CRASHES
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
WHO
DUNNIT?
Unhandled Exception – 2nd chance
StackOverflowException
OutOfMemoryException
ExecutionEngineException
Kill or recycle
1 Check the event viewer
2 Capture dump on crash
3 Look at the faulting stack
@TessFerrandez
PERFORMANCE
ISSUES
App is not responding
Requests take too long
How long should they take?
CPU is going hey-wire
WHO
DUNNIT?
LOW CPU
Waiting for an external resource
Deadlock
HIGH CPU
Busy, Tight loop
High CPU in GC
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
MEMORY
LEAKS
OutOfMemoryExceptions
Slow response times
Due to GC activities
Memory increase in perfmon or task manager
WHO
DUNNIT?
Cache or Session State
Static / Pinned
Blocked Finalizer
Assembly Leak
Native Leak
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
AUTOMATION
CLRMD
@TessFerrandez
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
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
.NET
DEBUGGING
@TessFerrandez
Microsoft
1 of 30

Recommended

C# to python by
C# to pythonC# to python
C# to pythonTess Ferrandez
2.4K views91 slides
Debugging performance issues, memory issues and crashes in .net applications rev by
Debugging performance issues, memory issues and crashes in .net applications revDebugging performance issues, memory issues and crashes in .net applications rev
Debugging performance issues, memory issues and crashes in .net applications revTess Ferrandez
527 views18 slides
Common asp.net production issues rev by
Common asp.net production issues revCommon asp.net production issues rev
Common asp.net production issues revTess Ferrandez
187 views24 slides
CSI .net core - debugging .net applications by
CSI .net core - debugging .net applicationsCSI .net core - debugging .net applications
CSI .net core - debugging .net applicationsTess Ferrandez
872 views37 slides
Debugging .NET apps by
Debugging .NET appsDebugging .NET apps
Debugging .NET appsTess Ferrandez
948 views34 slides
Writing malware while the blue team is staring at you by
Writing malware while the blue team is staring at youWriting malware while the blue team is staring at you
Writing malware while the blue team is staring at youRob Fuller
2K views60 slides

More Related Content

What's hot

Crash dump analysis - experience sharing by
Crash dump analysis - experience sharingCrash dump analysis - experience sharing
Crash dump analysis - experience sharingJames Hsieh
22K views61 slides
Attacker Ghost Stories (CarolinaCon / Area41 / RVASec) by
Attacker Ghost Stories (CarolinaCon / Area41 / RVASec)Attacker Ghost Stories (CarolinaCon / Area41 / RVASec)
Attacker Ghost Stories (CarolinaCon / Area41 / RVASec)Rob Fuller
5.3K views57 slides
Introducing PS>Attack: An offensive PowerShell toolkit by
Introducing PS>Attack: An offensive PowerShell toolkitIntroducing PS>Attack: An offensive PowerShell toolkit
Introducing PS>Attack: An offensive PowerShell toolkitjaredhaight
2.6K views34 slides
44CON 2014 - Breaking AV Software by
44CON 2014 - Breaking AV Software44CON 2014 - Breaking AV Software
44CON 2014 - Breaking AV Software44CON
2.6K views146 slides
Batch File Programming by
Batch File ProgrammingBatch File Programming
Batch File ProgrammingFrz Khan
2K views155 slides
44CON London 2015 - 15-Minute Linux Incident Response Live Analysis by
44CON London 2015 - 15-Minute Linux Incident Response Live Analysis44CON London 2015 - 15-Minute Linux Incident Response Live Analysis
44CON London 2015 - 15-Minute Linux Incident Response Live Analysis44CON
992 views40 slides

What's hot(20)

Crash dump analysis - experience sharing by James Hsieh
Crash dump analysis - experience sharingCrash dump analysis - experience sharing
Crash dump analysis - experience sharing
James Hsieh22K views
Attacker Ghost Stories (CarolinaCon / Area41 / RVASec) by Rob Fuller
Attacker Ghost Stories (CarolinaCon / Area41 / RVASec)Attacker Ghost Stories (CarolinaCon / Area41 / RVASec)
Attacker Ghost Stories (CarolinaCon / Area41 / RVASec)
Rob Fuller5.3K views
Introducing PS>Attack: An offensive PowerShell toolkit by jaredhaight
Introducing PS>Attack: An offensive PowerShell toolkitIntroducing PS>Attack: An offensive PowerShell toolkit
Introducing PS>Attack: An offensive PowerShell toolkit
jaredhaight2.6K views
44CON 2014 - Breaking AV Software by 44CON
44CON 2014 - Breaking AV Software44CON 2014 - Breaking AV Software
44CON 2014 - Breaking AV Software
44CON2.6K views
Batch File Programming by Frz Khan
Batch File ProgrammingBatch File Programming
Batch File Programming
Frz Khan2K views
44CON London 2015 - 15-Minute Linux Incident Response Live Analysis by 44CON
44CON London 2015 - 15-Minute Linux Incident Response Live Analysis44CON London 2015 - 15-Minute Linux Incident Response Live Analysis
44CON London 2015 - 15-Minute Linux Incident Response Live Analysis
44CON992 views
Red Gate .NET Reflector 8.2.0.7 by WendyLogan6
Red Gate .NET Reflector 8.2.0.7Red Gate .NET Reflector 8.2.0.7
Red Gate .NET Reflector 8.2.0.7
WendyLogan6389 views
Defending Your Network by Adam Getchell
Defending Your NetworkDefending Your Network
Defending Your Network
Adam Getchell10.6K views
Database honeypot by design by qqlan
Database honeypot by designDatabase honeypot by design
Database honeypot by design
qqlan6.6K views
Indicators of compromise: From malware analysis to eradication by Michael Boman
Indicators of compromise: From malware analysis to eradicationIndicators of compromise: From malware analysis to eradication
Indicators of compromise: From malware analysis to eradication
Michael Boman1.4K views
Hacking with Remote Admin Tools (RAT) by Zoltan Balazs
 Hacking with Remote Admin Tools (RAT) Hacking with Remote Admin Tools (RAT)
Hacking with Remote Admin Tools (RAT)
Zoltan Balazs49.8K views
Incorporating PowerShell into your Arsenal with PS>Attack by jaredhaight
Incorporating PowerShell into your Arsenal with PS>AttackIncorporating PowerShell into your Arsenal with PS>Attack
Incorporating PowerShell into your Arsenal with PS>Attack
jaredhaight848 views
Csi dot net (Hardcore .NET production debugging) by Jonne Kats
Csi dot net (Hardcore .NET production debugging)Csi dot net (Hardcore .NET production debugging)
Csi dot net (Hardcore .NET production debugging)
Jonne Kats487 views
Экспресс-анализ вредоносов / Crowdsourced Malware Triage by Positive Hack Days
Экспресс-анализ вредоносов / Crowdsourced Malware TriageЭкспресс-анализ вредоносов / Crowdsourced Malware Triage
Экспресс-анализ вредоносов / Crowdsourced Malware Triage
Positive Hack Days985 views
Pwning with powershell by jaredhaight
Pwning with powershellPwning with powershell
Pwning with powershell
jaredhaight2.1K views
Anton Chuvakin on Discovering That Your Linux Box is Hacked by Anton Chuvakin
Anton Chuvakin on Discovering That Your Linux Box is HackedAnton Chuvakin on Discovering That Your Linux Box is Hacked
Anton Chuvakin on Discovering That Your Linux Box is Hacked
Anton Chuvakin2.2K views

Similar to .Net debugging 2017

Large Scale Crash Dump Analysis with SuperDump by
Large Scale Crash Dump Analysis with SuperDumpLarge Scale Crash Dump Analysis with SuperDump
Large Scale Crash Dump Analysis with SuperDumpChristoph Neumüller
5.1K views33 slides
the productive programer: mechanics by
the productive programer: mechanicsthe productive programer: mechanics
the productive programer: mechanicselliando dias
704 views119 slides
6.Temp & Rand by
6.Temp & Rand6.Temp & Rand
6.Temp & Randphanleson
407 views34 slides
High Availability in 37 Easy Steps by
High Availability in 37 Easy StepsHigh Availability in 37 Easy Steps
High Availability in 37 Easy StepsTim Serong
6.7K views37 slides
Joxean Koret - Database Security Paradise [Rooted CON 2011] by
Joxean Koret - Database Security Paradise [Rooted CON 2011]Joxean Koret - Database Security Paradise [Rooted CON 2011]
Joxean Koret - Database Security Paradise [Rooted CON 2011]RootedCON
2K views70 slides
Drupal Efficiency using open source technologies from Sun by
Drupal Efficiency using open source technologies from SunDrupal Efficiency using open source technologies from Sun
Drupal Efficiency using open source technologies from Sunsmattoon
786 views34 slides

Similar to .Net debugging 2017(20)

the productive programer: mechanics by elliando dias
the productive programer: mechanicsthe productive programer: mechanics
the productive programer: mechanics
elliando dias704 views
6.Temp & Rand by phanleson
6.Temp & Rand6.Temp & Rand
6.Temp & Rand
phanleson407 views
High Availability in 37 Easy Steps by Tim Serong
High Availability in 37 Easy StepsHigh Availability in 37 Easy Steps
High Availability in 37 Easy Steps
Tim Serong6.7K views
Joxean Koret - Database Security Paradise [Rooted CON 2011] by RootedCON
Joxean Koret - Database Security Paradise [Rooted CON 2011]Joxean Koret - Database Security Paradise [Rooted CON 2011]
Joxean Koret - Database Security Paradise [Rooted CON 2011]
RootedCON2K views
Drupal Efficiency using open source technologies from Sun by smattoon
Drupal Efficiency using open source technologies from SunDrupal Efficiency using open source technologies from Sun
Drupal Efficiency using open source technologies from Sun
smattoon786 views
Introductiontoasp netwindbgdebugging-100506045407-phpapp01 by Camilo Alvarez Rivera
Introductiontoasp netwindbgdebugging-100506045407-phpapp01Introductiontoasp netwindbgdebugging-100506045407-phpapp01
Introductiontoasp netwindbgdebugging-100506045407-phpapp01
Drupal Efficiency - Coding, Deployment, Scaling by smattoon
Drupal Efficiency - Coding, Deployment, ScalingDrupal Efficiency - Coding, Deployment, Scaling
Drupal Efficiency - Coding, Deployment, Scaling
smattoon1K views
Static and Dynamic Analysis at Ning by ZendCon
Static and Dynamic Analysis at NingStatic and Dynamic Analysis at Ning
Static and Dynamic Analysis at Ning
ZendCon2.4K views
Angels And Daemons by Vishnu Gopal
Angels And DaemonsAngels And Daemons
Angels And Daemons
Vishnu Gopal4.3K views
Advanced windows debugging by chrisortman
Advanced windows debuggingAdvanced windows debugging
Advanced windows debugging
chrisortman1.1K views
Advanced administration and problem determination by solarisyougood
Advanced administration and problem determinationAdvanced administration and problem determination
Advanced administration and problem determination
solarisyougood471 views
Version Control in Machine Learning + AI (Stanford) by Anand Sampat
Version Control in Machine Learning + AI (Stanford)Version Control in Machine Learning + AI (Stanford)
Version Control in Machine Learning + AI (Stanford)
Anand Sampat489 views
Tuning parallelcodeonsolaris005 by dflexer
Tuning parallelcodeonsolaris005Tuning parallelcodeonsolaris005
Tuning parallelcodeonsolaris005
dflexer521 views
How We Analyzed 1000 Dumps in One Day - Dina Goldshtein, Brightsource - DevOp... by DevOpsDays Tel Aviv
How We Analyzed 1000 Dumps in One Day - Dina Goldshtein, Brightsource - DevOp...How We Analyzed 1000 Dumps in One Day - Dina Goldshtein, Brightsource - DevOp...
How We Analyzed 1000 Dumps in One Day - Dina Goldshtein, Brightsource - DevOp...

More from Tess Ferrandez

funwithalgorithms.pptx by
funwithalgorithms.pptxfunwithalgorithms.pptx
funwithalgorithms.pptxTess Ferrandez
46 views62 slides
Perf by design by
Perf by designPerf by design
Perf by designTess Ferrandez
156 views185 slides
Fun421 stephens by
Fun421 stephensFun421 stephens
Fun421 stephensTess Ferrandez
156 views36 slides
Facenet - Paper Review by
Facenet - Paper ReviewFacenet - Paper Review
Facenet - Paper ReviewTess Ferrandez
3.3K views43 slides
AI and Ethics - We are the guardians of our future by
AI and Ethics - We are the guardians of our futureAI and Ethics - We are the guardians of our future
AI and Ethics - We are the guardians of our futureTess Ferrandez
1.1K views71 slides
Deep learning and computer vision by
Deep learning and computer visionDeep learning and computer vision
Deep learning and computer visionTess Ferrandez
2.2K views83 slides

More from Tess Ferrandez(10)

AI and Ethics - We are the guardians of our future by Tess Ferrandez
AI and Ethics - We are the guardians of our futureAI and Ethics - We are the guardians of our future
AI and Ethics - We are the guardians of our future
Tess Ferrandez1.1K views
Deep learning and computer vision by Tess Ferrandez
Deep learning and computer visionDeep learning and computer vision
Deep learning and computer vision
Tess Ferrandez2.2K views
A practical guide to deep learning by Tess Ferrandez
A practical guide to deep learningA practical guide to deep learning
A practical guide to deep learning
Tess Ferrandez5.5K views
Notes from Coursera Deep Learning courses by Andrew Ng by Tess Ferrandez
Notes from Coursera Deep Learning courses by Andrew NgNotes from Coursera Deep Learning courses by Andrew Ng
Notes from Coursera Deep Learning courses by Andrew Ng
Tess Ferrandez346.4K views
A developers guide to machine learning by Tess Ferrandez
A developers guide to machine learningA developers guide to machine learning
A developers guide to machine learning
Tess Ferrandez16K views
My bot has a personality disorder by Tess Ferrandez
My bot has a personality disorderMy bot has a personality disorder
My bot has a personality disorder
Tess Ferrandez4.2K views

Recently uploaded

SAP FOR TYRE INDUSTRY.pdf by
SAP FOR TYRE INDUSTRY.pdfSAP FOR TYRE INDUSTRY.pdf
SAP FOR TYRE INDUSTRY.pdfVirendra Rai, PMP
19 views3 slides
DSD-INT 2023 - Delft3D User Days - Welcome - Day 3 - Afternoon by
DSD-INT 2023 - Delft3D User Days - Welcome - Day 3 - AfternoonDSD-INT 2023 - Delft3D User Days - Welcome - Day 3 - Afternoon
DSD-INT 2023 - Delft3D User Days - Welcome - Day 3 - AfternoonDeltares
11 views43 slides
How to Install and Activate Email-Researcher by
How to Install and Activate Email-ResearcherHow to Install and Activate Email-Researcher
How to Install and Activate Email-ResearchereGrabber
19 views8 slides
How to Make the Most of Regression and Unit Testing.pdf by
How to Make the Most of Regression and Unit Testing.pdfHow to Make the Most of Regression and Unit Testing.pdf
How to Make the Most of Regression and Unit Testing.pdfAbhay Kumar
10 views9 slides
Cycleops - Automate deployments on top of bare metal.pptx by
Cycleops - Automate deployments on top of bare metal.pptxCycleops - Automate deployments on top of bare metal.pptx
Cycleops - Automate deployments on top of bare metal.pptxThanassis Parathyras
30 views12 slides
DSD-INT 2023 Dam break simulation in Derna (Libya) using HydroMT_SFINCS - Prida by
DSD-INT 2023 Dam break simulation in Derna (Libya) using HydroMT_SFINCS - PridaDSD-INT 2023 Dam break simulation in Derna (Libya) using HydroMT_SFINCS - Prida
DSD-INT 2023 Dam break simulation in Derna (Libya) using HydroMT_SFINCS - PridaDeltares
17 views9 slides

Recently uploaded(20)

DSD-INT 2023 - Delft3D User Days - Welcome - Day 3 - Afternoon by Deltares
DSD-INT 2023 - Delft3D User Days - Welcome - Day 3 - AfternoonDSD-INT 2023 - Delft3D User Days - Welcome - Day 3 - Afternoon
DSD-INT 2023 - Delft3D User Days - Welcome - Day 3 - Afternoon
Deltares11 views
How to Install and Activate Email-Researcher by eGrabber
How to Install and Activate Email-ResearcherHow to Install and Activate Email-Researcher
How to Install and Activate Email-Researcher
eGrabber19 views
How to Make the Most of Regression and Unit Testing.pdf by Abhay Kumar
How to Make the Most of Regression and Unit Testing.pdfHow to Make the Most of Regression and Unit Testing.pdf
How to Make the Most of Regression and Unit Testing.pdf
Abhay Kumar10 views
Cycleops - Automate deployments on top of bare metal.pptx by Thanassis Parathyras
Cycleops - Automate deployments on top of bare metal.pptxCycleops - Automate deployments on top of bare metal.pptx
Cycleops - Automate deployments on top of bare metal.pptx
DSD-INT 2023 Dam break simulation in Derna (Libya) using HydroMT_SFINCS - Prida by Deltares
DSD-INT 2023 Dam break simulation in Derna (Libya) using HydroMT_SFINCS - PridaDSD-INT 2023 Dam break simulation in Derna (Libya) using HydroMT_SFINCS - Prida
DSD-INT 2023 Dam break simulation in Derna (Libya) using HydroMT_SFINCS - Prida
Deltares17 views
El Arte de lo Possible by Neo4j
El Arte de lo PossibleEl Arte de lo Possible
El Arte de lo Possible
Neo4j34 views
.NET Developer Conference 2023 - .NET Microservices mit Dapr – zu viel Abstra... by Marc Müller
.NET Developer Conference 2023 - .NET Microservices mit Dapr – zu viel Abstra....NET Developer Conference 2023 - .NET Microservices mit Dapr – zu viel Abstra...
.NET Developer Conference 2023 - .NET Microservices mit Dapr – zu viel Abstra...
Marc Müller35 views
DSD-INT 2023 SFINCS Modelling in the U.S. Pacific Northwest - Parker by Deltares
DSD-INT 2023 SFINCS Modelling in the U.S. Pacific Northwest - ParkerDSD-INT 2023 SFINCS Modelling in the U.S. Pacific Northwest - Parker
DSD-INT 2023 SFINCS Modelling in the U.S. Pacific Northwest - Parker
Deltares8 views
Upgrading Incident Management with Icinga - Icinga Camp Milan 2023 by Icinga
Upgrading Incident Management with Icinga - Icinga Camp Milan 2023Upgrading Incident Management with Icinga - Icinga Camp Milan 2023
Upgrading Incident Management with Icinga - Icinga Camp Milan 2023
Icinga36 views
DSD-INT 2023 Thermobaricity in 3D DCSM-FM - taking pressure into account in t... by Deltares
DSD-INT 2023 Thermobaricity in 3D DCSM-FM - taking pressure into account in t...DSD-INT 2023 Thermobaricity in 3D DCSM-FM - taking pressure into account in t...
DSD-INT 2023 Thermobaricity in 3D DCSM-FM - taking pressure into account in t...
Deltares9 views
Consulting for Data Monetization Maximizing the Profit Potential of Your Data... by Flexsin
Consulting for Data Monetization Maximizing the Profit Potential of Your Data...Consulting for Data Monetization Maximizing the Profit Potential of Your Data...
Consulting for Data Monetization Maximizing the Profit Potential of Your Data...
Flexsin 15 views
DSD-INT 2023 HydroMT model building and river-coast coupling in Python - Bove... by Deltares
DSD-INT 2023 HydroMT model building and river-coast coupling in Python - Bove...DSD-INT 2023 HydroMT model building and river-coast coupling in Python - Bove...
DSD-INT 2023 HydroMT model building and river-coast coupling in Python - Bove...
Deltares15 views
SUGCON ANZ Presentation V2.1 Final.pptx by Jack Spektor
SUGCON ANZ Presentation V2.1 Final.pptxSUGCON ANZ Presentation V2.1 Final.pptx
SUGCON ANZ Presentation V2.1 Final.pptx
Jack Spektor21 views
Unmasking the Dark Art of Vectored Exception Handling: Bypassing XDR and EDR ... by Donato Onofri
Unmasking the Dark Art of Vectored Exception Handling: Bypassing XDR and EDR ...Unmasking the Dark Art of Vectored Exception Handling: Bypassing XDR and EDR ...
Unmasking the Dark Art of Vectored Exception Handling: Bypassing XDR and EDR ...
Donato Onofri643 views
DSD-INT 2023 Delft3D FM Suite 2024.01 1D2D - Beta testing programme - Geertsema by Deltares
DSD-INT 2023 Delft3D FM Suite 2024.01 1D2D - Beta testing programme - GeertsemaDSD-INT 2023 Delft3D FM Suite 2024.01 1D2D - Beta testing programme - Geertsema
DSD-INT 2023 Delft3D FM Suite 2024.01 1D2D - Beta testing programme - Geertsema
Deltares12 views
MariaDB stored procedures and why they should be improved by Federico Razzoli
MariaDB stored procedures and why they should be improvedMariaDB stored procedures and why they should be improved
MariaDB stored procedures and why they should be improved
Applying Platform Engineering Thinking to Observability.pdf by Natan Yellin
Applying Platform Engineering Thinking to Observability.pdfApplying Platform Engineering Thinking to Observability.pdf
Applying Platform Engineering Thinking to Observability.pdf
Natan Yellin12 views

.Net debugging 2017