SQL Server Crash Dump Analysis A brief tour with WinDbg and other ugly tools Pablo Álvarez Doval Debugging & Optimization Team Lead

Slides:



Advertisements
Similar presentations
Slide 19-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 19.
Advertisements

Windows XP Kernel Architecture Mike Karlsven James Farrer Jason Smith.
An Overview Of Windows NT System Student: Yifan Yang Student ID:
ESafe Reporter V3.0 eSafe Learning and Certification Program February 2007.
Windows 2000 System Architecture (continued) Computing Department, Lancaster University, UK.
1 Module 1 The Windows NT 4.0 Environment. 2  Overview The Microsoft Operating System Family Windows NT Architecture Overview Workgroups and Domains.
计算机系 信息处理实验室 Leture1 concepts and tools 2005 Spring 陈香兰.
© Neeraj Suri EU-NSF ICT March 2006 Budapesti Műszaki és Gazdaságtudományi Egyetem Méréstechnika és Információs Rendszerek Tanszék Zoltán Micskei
Case Study: Windows 2000 Part I Will Richards CPSC 550 Spring 2001.
1 Case Study 2: Windows 2000 Chapter History of windows Programming windows System structure 11.4 Processes and threads in.
2: OS Structures 1 Jerry Breecher OPERATING SYSTEMS STRUCTURES.
Home: Phones OFF Please Unix Kernel Parminder Singh Kang Home:
CS533 Concepts of Operating Systems Class 3 Integrated Task and Stack Management.
OS Organization. OS Requirements Provide resource abstractions –Process abstraction of CPU/memory use Address space Concurrency Thread abstraction of.
Slide 3-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 3 Operating System Organization.
Slide 3-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 3.
© Neeraj Suri EU-NSF ICT March 2006 Budapesti Műszaki és Gazdaságtudományi Egyetem Méréstechnika és Információs Rendszerek Tanszék Zoltán Micskei
SQL Server 2008 Basmah AlQadheeb-213 MIS What is a Database ? A database is a collection of Data that is organized so that it can easily be accessed,
Windows Server 2008 R2 CSIT 320 (Blum) 1. Server Consolidation – Today’s chips have enhanced capabilities compared to those of the past. In particular.
Windows NT Operating System Junhua Duan Junhua Duan Aug. 26th, 1999 Aug. 26th, 1999.
2 Debugging Performance Issues, Memory Issues and Crashes in.net Applications Tess Ferrandez - Norlander Support Escalation Engineer Microsoft Session.
Windows Debugging Demystified
Programming mobile devices Part II Programming Symbian devices with Symbian C++
Windows Operating System Internals - by David A. Solomon and Mark E. Russinovich with Andreas Polze Unit OS4: Scheduling and Dispatch 4.6. Demos.
W INDOWS BLUE SCREEN OF DEATH AFTER CRASH DEBUGGING Alex Mclean Amy Valley Derek Visch.
Ceng Operating Systems 11-1 Chapter 11 : Case Study - Win 2000 History of windows 2000 Programming windows 2000 System structure Processes and threads.
Chapter 8 Windows Outline Programming Windows 2000 System structure Processes and threads in Windows 2000 Memory management The Windows 2000 file.
Debugging Print And Imaging Drivers. Print driver team philosophy on driver quality There are tools to detect violations Wrongful development assumptions.
MODERN OPERATING SYSTEMS Third Edition ANDREW S. TANENBAUM Chapter 11 Case Study 2: Windows Vista Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall,
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 2: System Structures.
Windows Operating System Internals - by David A. Solomon and Mark E. Russinovich with Andreas Polze Unit OS3: Concurrency 3.5. Lab Slides & Lab Manual.
Kernel, processes and threads Windows and Linux. Windows Architecture Operating system design Modified microkernel Layered Components HAL Interacts with.
Windows NT and Real-Time? Reading: “Inside Microsoft Windows 2000”, (Solomon, Russinovich, Microsoft Programming Series) “Real-Time Systems and Microsoft.
2. Introduction to the Visual Studio.NET IDE. Chapter Outline Overview of the Visual Studio.NET IDE Overview of the Visual Studio.NET IDE Menu Bar and.
C/C++ Tools & Methodology demonstration He Zongjian School of Software Engineering Tongji University.
A+ Guide to Managing and Maintaining Your PC Fifth Edition Chapter 13 Understanding and Installing Windows 2000 and Windows NT.
DEV339 Best Practices for Debugging Visual Studio.NET Applications Keith Pleas Architect, Guided Design
Windows 2000 Course Summary Computing Department, Lancaster University, UK.
Windows NT Operating System. Windows NT Models Layered Model Client/Server Model Object Model Symmetric Multiprocessing.
Hardware process When the computer is powered up, it begins to execute fetch-execute cycle for the program that is stored in memory at the boot strap entry.
Advanced Design and System Patterns The Microkernel Pattern.
CE Operating Systems Lecture 3 Overview of OS functions and structure.
Unit OS11: Performance Evaluation Lab Manual.
MCTS Guide to Microsoft Windows Vista Chapter 12 Application Support.
Win32 Programming Lesson 14: Introducing Windows Memory (C Rox…)
DEV303 ASP.NET: Leveraging Visual Studio.NET For Web Projects Tony Goodhew Product Manager Microsoft Corp.
UNIX & Windows NT Name: Jing Bai ID: Date:8/28/00.
Hardware process When the computer is powered up, it begins to execute fetch-execute cycle for the program that is stored in memory at the boot strap entry.
Windows ® 2000 Debugging André Vachon Development Lead Windows Debuggers Microsoft Corporation.
Chapter Eleven Windows XP Professional Application Support.
Bootable Programs Building an O/S. Basic Requirements of any O/S Respond to interrupts (all kinds) Preserve user environment Protect users and self from.
Discover, Master, InfluenceSlide 1 Debugging the World Starting with the CLR Corneliu I. Tusnea Senior Consultant, Readify It works on my machine!
| © 2007 LenovoLenovo Confidential Use WinDBG Tool to Analyze BSOD —— Lenovo Service Support Training.
WORKING OF SCHEDULER IN OS
Introduction to Operating Systems Concepts
Computer System Structures
Introduction to Kernel
CASE STUDY 1: Linux and Android
Unit OS2: Operating System Principles
CS490 Windows Internals Quiz 2 09/27/2013.
Chapter 3: Windows7 Part 1.
Windows Internals Brown-Bag Seminar Chapter 1 – Concepts and Tools
.NET Debugging for the Production Environment
Case Study 2: Windows History of windows 2000
B.Ramamurthy Chapter 2 : Appendix
Operating Systems: A Modern Perspective, Chapter 3
Outline Operating System Organization Operating System Examples
Operating Systems Structure
Introduction to Windbg – Part2 Symbols
Presentation transcript:

SQL Server Crash Dump Analysis A brief tour with WinDbg and other ugly tools Pablo Álvarez Doval Debugging & Optimization Team Lead

Who am I?

Session Objectives  What is this session about?  What isn’t this session about?

Who are you?

Agenda  Tools of the Trade  Brief Windows Architecture Refresher  SQL Server Post-mortem Debugging  Handling SQL Server dumps  Analyzing SQL Server dumps  Debugging.NET Applications with SOS

Debugging Tools for Windows  Free download:   Updated several times a year  Debuggers, extensions, tools and a great help file:  windbg.exe, kd.exe, cdb.exe  gflags.exe, tlist.exe, etc  debugger.chm  Can be installed via xcopy

Demo 0: … is it really so ugly?

Thesaurus  Just to keep with the forensics analogy:  Corpse  Dump file  Forensic Lab  WinDbg  Forensic Scientist  You!  Gray’s Anathomy  Windows Internals 5 th Ed.  We are not going to get into details, but we will do a little refresher of some key concepts

User mode vs. Kernel mode User Mode Kernel Mode Hardware Abstraction Layer (HAL) Device Drivers Microkernel Graphics Controller Object Manager Executive Services FS I/OIPC Memory Processes Security WMPNP UNIX LSA Shell Lsass.exe Client/Server csrss.exe Notepad notepad.exe Windows on Windows wowexec.exe Virtual DOS Machine ntvdm.exe Win32Interix

Application, Processes and Threads  An application is formed by one or more processes  A process is an in-memory executable, which is made up of one or more threads and its resources  A thread is the basic unit of execution and scheduling in the OS.

… is it really worth it?

Other good reasons…

Win32 Virtual Memory Addressing (I) KernelKernel Process 1 Thread 1 Thread 2 Thread n : Process 2 Thread 1 Thread 2 Thread n : sqlsrv.exe Thread 1 Thread 2 Thread n : Process n Thread 1 Thread 2 Thread n : … 4 Gb 2 Gb

Win32 Virtual Memory Addressing(II)

Thread Call Stacks  Shows part of the history of the function calls of the thread  Each thread has its own Call Stack  i.e: ntdll!KiFastSystemCallRet USER32!NtUserGetMessage+0xc notepad!WinMain+0xe5 notepad!WinMainCRTStartup+0x174 kernel32!BaseProcessStart+0x23

Call Stacks (I)  Each thread of the process has its own call stack:

Call Stacks (II)  Each frame has the following structure: Frame Parameters Return Address Frame Pointer Exception Handler Local Variables Registros

Symbols  Symbols make the call stack useful:  Without Symbols:  With Symbols: kernel32!+136aa kernel32!CreateFileW+0x35f

Symbol formats  Current format:.PDB  Old Format:.DBG  Retail vs. Debug (Free vs. Checked) builds  Private symbols vs. public symbols

Symbol Servers  Uses the File System as a Symbol’s database:  Organized by name and a unique identifier  Folder structure: \\SymSrv\file_name.pdb\unique_number\____  i.e: \\Symbols\ntdll.pdb\3B5EDCA52\ntdll.pdb \\Symbols\ntdll.pdb\380FCC4F2\ntdll.pdb

Demo 1: Scheduler Non-Yielding

Scenario  A customer’s SQL Server 2000 is hanging, showing errors in SQL Server’s ErrorLog  When these errores ocurr, SQL Server automatically triggers the creation of a dump … :17:14.10 server Error: 17883, Severity: 1, State: :17:14.10 server Process 59:0 (834) UMS Context 0x125ABD80 appears to be non-yielding on Scheduler 1. … :17:14.10 server Error: 17883, Severity: 1, State: :17:14.10 server Process 59:0 (834) UMS Context 0x125ABD80 appears to be non-yielding on Scheduler 1. …

Demo 2: DBCC CHECKDB

Demo 3: Cluster Resources

Managed Debugging with.NET  WinDbg is a native debugger  In order to debug.NET code we need to use debugger extensions:  SOS.dll (until framework.NET 3.5)  CLR.dll (framework 4.0)  Why all this? Is it worth it?

Demo 4: Managed Debugging with SOS

Some cool tips…  Did we really get to this slide in time?!  Well.. enjoy some free tips!  Using SOS from VS.NET  Memory dump analysis from inside VS2010

Resources  Concepts      Books:  Microsoft Windows Internals, 5th Ed. [Mark E. Russinovich and David A. Solomon] Microsoft Press.  Debugging Applications for Microsoft.NET and Microsoft Windows [John Robbins] Microsoft Press.

Any Questions? Thanks!