.NET Debugging for the Production Environment

Slides:



Advertisements
Similar presentations
ACT! “Web” Plugins ACC Webinar (Part 1of 2) Brian Mowka and Jamie Aurand December 2010.
Advertisements

© Leaf Solutions, LLC. All Rights Reserved What’s New in Everett Microsoft.Net V1.1.
® IBM Software Group © 2010 IBM Corporation What’s New in Profiling & Code Coverage RAD V8 April 21, 2011 Kathy Chan
Getting Started with Web Servers, PHP, and the Eclipse PDT Appendix I DAVID M. KROENKE and DAVID J. AUER DATABASE CONCEPTS, 6 th Edition.
1 Introduction to Tool chains. 2 Tool chain for the Sitara Family (but it is true for other ARM based devices as well) A tool chain is a collection of.
11 Getting Started with C# Chapter Objectives You will be able to: 1. Say in general terms how C# differs from C. 2. Create, compile, and run a.
Computing IV Visual C Introduction with OpenCV Example Xinwen Fu.
The In’s and Out’s of the IIS 6.0 Migration Tool The In’s and Out’s of the IIS 6.0 Migration Tool Chris Adams Web Platform Supportability Lead Microsoft.
Lecture Set 2 Part B – Configuring Visual Studio; Configuration Options and The Help System (scan quickly for future reference)
DEV325 Deploying Visual Studio.NET Applications Billy Hollis Author / Consultant.
SQL Server Crash Dump Analysis A brief tour with WinDbg and other ugly tools Pablo Álvarez Doval Debugging & Optimization Team Lead
Reset and Recycle IIS Reset Application Pool Management Error Codes New HTTP Sub-status codes Custom/Detailed Errors Tracing in IIS7 and.
Debugging and Profiling With some help from Software Carpentry resources.
Software Architecture in Practice Practical Exercise in Performance Engineering.
DEV303 ASP.NET: Leveraging Visual Studio.NET For Web Projects Tony Goodhew Product Manager Microsoft Corp.
This is the main tracing and diagnostics presentation. Very important that this be practical and useful information. IT Pro audience is very.
Msdevcon.ru#msdevcon. ИЗ ПЕРВЫХ РУК: ДИАГНОСТИКА ПРИЛОЖЕНИЙ С ПОМОЩЮ ИНСТРУМЕНТОВ VISUAL STUDIO 2012 MAXIM GOLDIN Senior Developer, Microsoft.
Web Development in Microsoft Visual Studio 2013 / 2015.
11 Computers, C#, XNA, and You Session 1.1. Session Overview  Find out what computers are all about ...and what makes a great programmer  Discover.
1 Getting Started with C++ Part 1 Windows. 2 Objective You will be able to create, compile, and run a very simple C++ program on Windows, using Microsoft.
® IBM Software Group © 2006 IBM Corporation Rational Asset Manager v7.2 Using Scripting Tutorial for using command line and scripting using Ant Tasks Carlos.
Install CB 1.8 on Ubuntu. Steps Followed Install Ubuntu (Ubuntu LTS) on Virtual machine – (VMware Workstation) (
Intoduction to Andriod studio Environment With a hello world program.
David M. Kroenke and David J. Auer Database Processing Fundamentals, Design, and Implementation Appendix I: Getting Started with Web Servers, PHP and the.
What's New in Visual Studio 2010 Debugging Brian Peek Senior Consultant, ASPSOFT, Inc. Microsoft MVP - C#
ASP.NET 2.0 Mohammed Abdelhadi Developer.NET Evangelist Microsoft Corporation.
| © 2007 LenovoLenovo Confidential Use WinDBG Tool to Analyze BSOD —— Lenovo Service Support Training.
Cygwin: getting the setup tool
Integrating ArcSight with Enterprise Ticketing Systems
IBM Connections Side by Side/ In Place migration 5.5 / 6.0
Agenda:- DevOps Tools Chef Jenkins Puppet Apache Ant Apache Maven Logstash Docker New Relic Gradle Git.
Stress Free Deployments with Octopus Deploy
Development Environment
Introduction to ASP.NET 2.0
Data Virtualization Tutorial… CORS and CIS
Introduction to .NET Core
PYTHON: AN INTRODUCTION
Brian Leonard ブライアン レオナルド
Create Virtual Directory Windows 8 - IIS 8.5
Jon Galloway | Tech Evangelist Christopher Harrison | Head Geek
Windows Azure Jason Olson, Program Manager 4-142
Environment Manager Troubleshooting and Debugging
CLR MD A New Swiss Army Knife tool for Advanced Debugging
CMPE 152: Compiler Design ANTLR 4 and C++
MonoGame and Windows 8.
User Defined Functions
Computer Architecture “Bomb Lab Hints”
Macrosystems EDDIE: Getting Started + Troubleshooting Tips
This is the cover slide..
Making PowerShell Useful
Developer Patterns to Integrate Silverlight 4.0 with SharePoint 2010
“5 Minutes to WOW”, but HOW?
Microsoft Build /24/2018 4:02 PM © 2016 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY,
.NET Debugging for the Production Environment
.NET Debugging for the Production Environment
Compile, Build, and Debug
Troubleshooting beyond what you understand
Lesson 12.
Microsoft Visual Studio 2010 for Web Deployment
Macrosystems EDDIE: Getting Started + Troubleshooting Tips
Install MySQL Community Server and MySQL Workbench
Build /4/ Diagnosing issues with Windows Phone 8.1 JavaScript apps using Visual Studio Andy Sterland Senior Program
Macrosystems EDDIE: Getting Started + Troubleshooting Tips
Cygwin: getting the setup tool
Introduction to Windbg
Introduction to Windbg – Part2 Symbols
SSMS to Azure Data Studio
Macrosystems EDDIE: Getting Started + Troubleshooting Tips
Introduction to ASP.NET Parts 1 & 2
Jamie Cool Program Manager Microsoft
Presentation transcript:

.NET Debugging for the Production Environment Part 3: WinDbg & SOS OPEN VM BEFORE STARTING THIS SESSION (for demo). Make sure mscordacwks.dll in the Fwk directory and mscordacwks_x86….42.dll in the debuggers directory are mis-named. Brad Linscott Premier Field Engineer ing

Agenda Windbg intro Debugging .NET applications with Windbg A common problem when trying to load SOS In this session, we’ll start with a brief introduction on windbg before we talk about how we can use it to debug .NET applications. And then the focus of today’s talk will be a common problem many folks encounter when they try to start debugging with SOS. If you’re not sure what SOS is, I’ll explain that as well.

WinDbg Intro Part of Debugging Tools for Windows package Free download on Microsoft’s web site Xcopy-deployable Automatable (ADPlus), live, post-mortem (production!) Why use WinDbg/cdb instead of Visual Studio? - So what is WinDbg? It’s one of the many tools included in the Debugging Tools… The package contains several debuggers, and WinDbg is probably the most popular one. It has a very detailed help file that’s really is helpful. Though it’s not likely to help those who haven’t debugged with these debuggers before, it’s geared towards those who have some experience with them, and simply want to expand their proficiency. - It’s a free download from Microsoft’s web site (install the 32-bit debuggers), and their designed to be installed on production servers - I’ve worked with countless customers who have them installed on their production servers. They’re xcopy-deployable, so you can download and install them on a machine with internet access and then x-copy them to the target server; no reboot required. These debuggers are automatable, which makes them a great fit for production. ADPlus is another tool in the Debugging package. It comes in an exe & script format, and it automates the console debugger. These debuggers can be used for live debugs or post-mortem debugging, which comprises the vast majority of our production debugging experience. Which is a good segue to a popular question – “Why use Windbg instead of VS?” Part of the answer lies in the automation of these production debuggers. Also, VS has a large footprint and isn’t installed on prod servers. The more you use windbg & the others, the more you understand their power & simplicity. They provide a great debugging experience.

WinDbg, cont’d Unaware of .NET SOS/psscor2/psscor4 Symbols – needed with managed debugging? Saving your workspace in Windbg - Some more notes about Windbg… like any native debugger, it’s completely unaware of the managed world. It can’t peek into the execution of managed code. In order for it to do that, it needs the help of an extension. A debugging extension is a dll that has a number of “shortcuts”, if you will, to run various debugging commands. There are some extensions whose sole purpose is to provide native debuggers with a way to extract information from managed code. The most popular extension to help with managed debugging is SOS or one of its forms. (Talk about SOS, how it comes with the framework. ) Psscor2 is downloadable from our web site, as is psscor4. I’ll take a brief minute to discuss symbols, b/c they’re a must when debugging native code. (Talk about how they’re needed to resolve stacks.) With managed code, symbols aren’t needed to accomplish the vast majority of your debugging goals, but it’s still a good practice to create them for all release builds and store them on a symbol server. If you do ever need them, they must MATCH So that’s a brief word on symbols, and this is a good time to talk about workspaces. Demo saving symbol path & other settings.

.Debugging .NET apps with WinDbg Command window is “main” window Load sos/psscor2/psscor4 .load <extension name> Now we come to the focus of this session – opening a dump and loading SOS. As stated before, WinDbg can do live debugging or open post-mortem dumps. I’ll walk through a quick sample of opening a dump and loading psscor2. The Command window is the most commonly used window in windbg. There are several other windows including Locals, Stack, and Source windows. If you have your Source path lined up correctly, you can even view source code in windbg. During live debugs, you can also step through code, set bps, etc. Discuss .load vs loadby. When you get the error, go to the next slide.

Common problem loading SOS/psscor2/psscor4 “Failed to load data access dll” Explain that the first arch is the arch of the debugger. 2nd arch is arch of the target exe. Version is version of the fwk.

Common problem loading SOS/psscor2/psscor4 What is the ‘dac’? Common root causes of “failed to load” with sos Download from symbol server Not using the right dac – copy from the target machine Debugger/debuggee architecture mismatch Talk about mscordacwks Talk about how this problem almost never occurs for live debugs, b/c the dac is distributed with the Fwk, and so is going to be on the machine of the debugee. Don’t discuss troubleshooting here – go to next slide for that.

Problem loading SOS/psscor2/psscor4, cont’d Recommended troubleshooting steps: Use .cordll, as suggested Ensure the right dac is used Debugger/debuggee mismatch Flip to the debugger with the error on it. Try running .cordll. Explain that the .cordll command controls managed code debugging for the CLR. We turn on verbose output, unload it, and try to load back the right one. If .cordll doesn’t work, then search the Framework path and Debugger location to see if the right dac is present. I keep a stash in the same folder as windbg itself to reduce the number of times I get this error. The most common root cause is an arch mismatch between the target exe & debugger.

Summary Two simple rules when dumping/debugging managed applications: Dump 32-bit applications with a 32-bit debugger, and open the dump with a 32-bit debugger. Dump 64-bit applications with a 64-bit debugger, and open the dump with a 64-bit debugger. Keeping architectures aligned will eliminate this problem 90% of the time Review the summary. Next time we’ll investigate something a bit more interesting that may help some of you encountering process instability or a performance problem in production.