CLR MD A New Swiss Army Knife tool for Advanced Debugging

Slides:



Advertisements
Similar presentations
Advanced Troubleshooting with Debug Diagnostics on IIS 6
Advertisements

Dynamic Analysis of Windows Phone 7 apps Behrang Fouladi, SensePost.
Using.NET Platform Note: Most of the material of these slides have been taken & extended from Nakov’s excellent overview for.NET framework, MSDN and wikipedia.
.NET Debugging for the Production Environment Part 1: Diagnosing application issues Brad Linscott Premier Field Engineering.
1 SDMX Reference Infrastructure (SDMX-RI) Work in progress, status and plans Bengt-Åke Lindblad, Adam Wroński Eurostat Eurostat Unit B3 – IT and standards.
Advanced Troubleshooting with Debug Diagnostics on IIS 6 Draft 2.5 5/13/06 NameTitleGroup Microsoft Corporation.
11 How to detect and avoid memory and resources leaks in.NET applications Fabrice MARGUERIE Independent.NET expert Microsoft MVP metaSapiens / Tuneo.
Visual Studio 2010 SharePoint Developer Tools. Developer Tools for SharePoint  Familiar VS Experience  Build, Debug, Deploy SharePoint projects  Visual.
Thank you SPSKC15 sponsors!. SharePoint 2013 Search Service Application (SSA) Ambar Nirgudkar Software Engineer
Creating and Running Your First C# Program Svetlin Nakov Telerik Corporation
Using Microsoft SharePoint to Develop Workflow and Business Process Automation Ted Perrotte National Practice Manager, Quilogy, Microsoft Office SharePoint.
Print Verifier Ashwin Needamangala Senior Test Development Lead Documents and Printing Team
Microsoft ® Official Course Monitoring and Troubleshooting Custom SharePoint Solutions SharePoint Practice Microsoft SharePoint 2013.
Min Kwan Park Test Tech Lead Visual C# QA team. Fail fast To-Dos for fail fast Analyze issues Information for further action Q&A Agenda.
Introduction to SharePoint Development with VS2010 Paul Yuknewicz Lead Program Manager
W INDOWS BLUE SCREEN OF DEATH AFTER CRASH DEBUGGING Alex Mclean Amy Valley Derek Visch.
ESB Guidance 2.0 Kevin Gock
HOW-TO | CIF CONSULT | Redouane BELBAHRI Informatica Create a crash dump using “Debug Diag”
Hands-On Microsoft Windows Server 2008 Chapter 1 Introduction to Windows Server 2008.
Lesley Bross, August 29, 2010 ArcGIS 10 add-in glossary.
Ideas to Improve SharePoint Usage 4. What are these 4 Ideas? 1. 7 Steps to check SharePoint Health 2. Avoid common Deployment Mistakes 3. Analyze SharePoint.
Exploiting Windows 2000 Kyle Marsh Software Design Engineer Windows Evangelism Microsoft Corporation
Chapter 3.5 Memory and I/O Systems. 2 Memory Management Memory problems are one of the leading causes of bugs in programs (60-80%) MUCH worse in languages.
What’s TSP ? Code : STM#340 STM#340: What’s TSP ?
INDUSTRIAL PROJECT (234313) ULTRASOUND SCANNER EMBEDDED ONLINE PROFILER Students: Liat Peterfreund, Hagay Myr Supervisor: Mr. Tomer Gal (GE Healthcare)
PHP on Windows Improvements in PHP-Microsoft Interoperability Brian Swan PHP Developer Outreach,
Installing, Configuring And Troubleshooting Coldfusion Mark A Kruger CFG Ryan Stille CF Webtools.
SQL Server Crash Dump Analysis A brief tour with WinDbg and other ugly tools Pablo Álvarez Doval Debugging & Optimization Team Lead
What’s new in Kentico CMS 5.0 Michal Neuwirth Product Manager Kentico Software.
Eclipse 24-Apr-17.
OWx2 Online Workspace Whizzes Share, Collaborate, Communicate A look inside team portals and web office environments Maria Morales, Betsy Dugas, Kathrine.
Separating the Interface from the Engine: Creating Custom Add-in Tasks for SAS Enterprise Guide ® Peter Eberhardt Fernwood Consulting Group Inc.
Ben Watson Principal Software Engineer Shared Platform Group, Application Services Group, Microsoft Author, Writing High-Performance.NET Code.
Msdevcon.ru#msdevcon. ИЗ ПЕРВЫХ РУК: ДИАГНОСТИКА ПРИЛОЖЕНИЙ С ПОМОЩЮ ИНСТРУМЕНТОВ VISUAL STUDIO 2012 MAXIM GOLDIN Senior Developer, Microsoft.
Windows ® 2000 Debugging André Vachon Development Lead Windows Debuggers Microsoft Corporation.
Summer Project Marama2008 By Robert and Johnson. What is Marama? Marama is an Eclipses based toolset permits rapid specification of notational elements,
Win32 Programming Lesson 19: Introduction to DLLs.
® IBM Software Group © 2006 IBM Corporation Rational Asset Manager v7.2 Using Scripting Tutorial for using command line and scripting using Ant Tasks Carlos.
Windows NT ® Security Management: Extending Windows NT 5.0 Security Management Tools, Part 2 Praerit Garg Program Manager Windows NT Security Microsoft.
July 22, 2001Introduction to.NET1 Introduction to.NET Framework Gholamali Semsarzadeh July 2001.
1 Advanced.Net Debugging Using Visual Studio, R# and OzCode IT Week, Summer 2015.
Sitecore upgrades The Past, The Present, The Future.
SQL Database Management
Introduction ITEC 420.
Jim Fawcett CSE775 – Distributed Objects Spring 2017
Introduction to ASP.NET 2.0
CARA 3.10 Major New Features
6.916 Lecture Thursday, October 19, 2000 Jim Miller (Microsoft)
Crash Dump Analysis - Santosh Kumar Singh.
Data Virtualization Tutorial: XSLT and Streaming Transformations
Chapter 10: Managed Exception Monitoring
AVR-GCC Programming Using C Development Tools to program your Arduino Microcontrollers. Presented by: Charles Norona November 17th, 2011 C. Norona,
Introduction Enosis Learning.
MonoGame and Windows 8.
May 23-24, 2012 Microsoft.
Introduction Enosis Learning.
.NET Debugging for the Production Environment
PerfView Measure and Improve Your App’s Performance for Free
Debugging Discussion [troubleshooting][managed][Native]
.NET Debugging for the Production Environment
.NET Debugging for the Production Environment
12/1/2018 1:01 PM P4032 System Performance Is a Feature – Understanding System Health Through Telemetry - a continuation of Real-time sentiment built on.
Lecture Topics: 11/1 General Operating System Concepts Processes
Dynamics AX Upgrades Microsoft Dynamics AX 2009
Module 10: Implementing Managed Code in the Database
Cross-OS Development Platform Contents Application Common Operating Environment (AppCOE): An eclipse based IDE for development of C/C++ applications.
Introduction to Windbg
Windows Forms in Visual Studio 2005: An in-depth look at key features
CS Introduction to Operating Systems
Presentation transcript:

CLR MD A New Swiss Army Knife tool for Advanced Debugging Kamran Bilgrami

Agenda Lots of Demos Production Debugging Methodology & Challenges CLR Memory Diagnostics (CLR MD) What, Why, Where, How Lots of Demos

What is Production Debugging

Bugs Lifecycle

Production Debugging - Goals Find Actionable information Fast Constrained Environment Limited Access to Client DCs Can’t run intrusive tools

Dump file based approach Free Dump Analysis Tools from Microsoft DebugDiag PerfView Windbg These are extremely useful tools, not always provide root cause. Without additional help (extensibility points)

Real Life Example Extremely slow Web Portal IIS consuming High Memory Dump file collected Dump file Analysis DebugDiag PerfView Windbg

Where CLR MD fits in puzzle Extending existing tools Custom Analysis Rules for DebugDiag Extension Dlls for Windbg Beyond Production Debugging Write your own tools for analysis

What is CLR Memory Diagnostics (CLR MD) APIs for programmatically inspecting a .NET live process or crash dump A.K.A CLR Managed Debugger Microsoft.Diagnostics.Runtime.dll Open Source Still in Beta (0.8.31) Microsoft does not recommend for production use

CLR MD Features Be Mindful of these features during live debugging Memory Diagnostics Walk the GC Heaps Walk Roots in the Process Walk threads in the process to get call stacks Walk AppDomain Lot more Be Mindful of these features during live debugging

CLR MD Object Model DataTarget ClrModule ClrRuntime ClrType ClrHandle ClrStackFrame ClrHeap ClrInterface

DataTarget DataTarget for Extension Dll Represents a crash dump file or a live process that you want to debug. DataTarget for a Crash dump DataTarget target = DataTarget.LoadCrashDump(@"c:\Dumps\myProcess.dmp"); DataTarget for Live Process DataTarget target = DataTarget. AttachToProcess(processId, timeout); DataTarget for Extension Dll DataTarget target = DataTarget.CreateFromDebuggerInterface(IDebugClient);

ClrRuntime Represents data for a CLR version present in a process. Few key properties ServerGC (true/false) HeapCount Threads AppDomains

Writing an Extension Dll – 1/2 Create a Class Library Project Dependencies CLR MD ( Install-Package Microsoft.Diagnostics.Runtime –Pre ) Unmanaged Export (Install-Package UnmanagedExports )

Writing an Extension Dll – 2/2 One-time setup code Function Exports Stream for output IDebugClient DataTarget ClrRuntime

Creating Extension dll

Extending DebugDiag DebugDiag offers extensibility mechanism using .NET Requires to implement one or more DebugDiag API Interfaces

DebugDiag API Interfaces Description IAnalysisRuleMetadata Used for providing classifications for Analysis Rules IMultiDumpRule Executed once per each memory dump when a series of dumps are selected. Could be used for analyzing the increase in memory usage between multiple dump files. IHangDumpRule Executed once per memory dump being analyzed. Used for items on the heap, or deadlocks/blocking involving multiple threads. IHangThreadRule Executed once per thread in each dump being analyzed. Could be used for checking anything thread-specific, such as call stacks or stack objects IExceptionThreadRule Executed on dumps where the context is set to a thread with an Exception. Could be used for Checking a faulting thread for a specific call stack and exception type.

Writing Custom DebugDiag Rule Create a Class Library Project Dependencies CLR MD (DebugDiag Installation Folder ) DebugDiag.DotNet.dll (DebugDiag Installation Folder) Implement one or more interfaces

Custom DebugDiag Rule

Beyond Production Debugging

Useful Links Defrag Tools – DebugDiags Series https://channel9.msdn.com/Shows/Defrag-Tools/Defrag-Tools-124-DebugDiag-Part-4 Defrag Tools – Writing CLR Debugger Extension https://channel9.msdn.com/Shows/Defrag-Tools/Defrag-Tools-109-Writing-a-CLR- Debugger-Extension-Part-1 My contact id: kamran@windowsdebugging.com