SlideShare a Scribd company logo
SQL Server CrashDumpAnalysisA brief tour withWinDbg and otheruglytoolsPablo Álvarez DovalDebugging & OptimizationTeam Leadpablod@plainconcepts.com
Who am I?
Sql Bits   Sql Server Crash Dump Analysis
Sql Bits   Sql Server Crash Dump Analysis
SessionObjectivesWhatisthissessionabout?Whatisn’tthissessionabout?
Sql Bits   Sql Server Crash Dump Analysis
Who are you?
AgendaTools of theTradeBrief Windows ArchitectureRefresherSQL Server Post-mortem DebuggingHandling SQL Server dumpsAnalyzing SQL Server dumpsDebugging .NET Applicationswith SOS
Debugging Tools for WindowsFree download:http://www.microsoft.com/whdc/devtools/debuggingUpdated several times a yearDebuggers, extensions, tools and a great help file:windbg.exe, kd.exe, cdb.exegflags.exe, tlist.exe, etcdebugger.chmCan be installed via xcopy
Demo 0: … isitreally so ugly?
ThesaurusJust to keep with the forensics analogy:Corpse  Dump fileForensic Lab  WinDbgForensic Scientist  You!Gray’s Anathomy  Windows Internals 5th Ed. We are not going to get into details, but we will do a little refresher of some key concepts
Usermode vs. KernelmodeWindows on Windowswowexec.exeUNIXLSA ShellLsass.exeClient/Servercsrss.exeNotepadnotepad.exeVirtual DOS Machinentvdm.exeWin32InterixUser ModeKernel ModeExecutiveServicesI/OIPCMemoryProcessesSecurityWMPNPGraphicsControllerObject ManagerFSDevice DriversMicrokernelHardware AbstractionLayer (HAL)
Application, Processes and ThreadsAn application is formed by one or more processesA process is an in-memory executable, which is made up of one or more threads and its resourcesA thread is the basic unit of execution and schedulingin the OS.
… isitreallyworthit?
Sql Bits   Sql Server Crash Dump Analysis
Othergoodreasons…
Win32 Virtual MemoryAddressing (I)sqlsrv.exeProcess nProcess 1Process 2Thread 1Thread 1Thread 1Thread 1Thread2Thread2Thread2Thread2…::::2 GbThread nThread nThread nThread n4GbKernel2 Gb
Win32 Virtual MemoryAddressing(II)
Thread Call StacksShows part of the history of the function calls of the threadEach thread has its own Call Stacki.e:ntdll!KiFastSystemCallRetUSER32!NtUserGetMessage+0xcnotepad!WinMain+0xe5notepad!WinMainCRTStartup+0x174kernel32!BaseProcessStart+0x23
CallStacks (I)Eachthread of theprocess has itsowncallstack:
CallStacks (II)Eachframe has thefollowingstructure:FrameParametersReturnAddressFrame PointerExceptionHandlerLocal VariablesRegistros
SymbolsSymbols make the call stack useful:Without Symbols:With Symbols:kernel32!+136aakernel32!CreateFileW+0x35f
Symbol formatsCurrent format: .PDBOld Format: .DBGRetail vs. Debug (Free vs. Checked) buildsPrivate symbols vs. public symbols
Symbol ServersUses the File System as a Symbol’s database:Organized by name and a unique identifierFolder 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
ScenarioA customer’s SQL Server 2000 ishanging, showing 17883 errors in SQL Server’sErrorLogWhenthese errores ocurr, SQL Server automaticallytriggersthecreation of a dump…2007-02-12 11:17:14.10 server    Error: 17883, Severity: 1, State: 02007-02-12 11: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: ClusterResources
ManagedDebuggingwith .NETWinDbgis a nativedebuggerIn ordertodebug .NET codeweneedto use debuggerextensions:SOS.dll (untilframework .NET 3.5)CLR.dll (framework 4.0)Whyallthis? Isitworthit?
Demo 4: ManagedDebuggingwith SOS
Somecooltips…Didwereallygettothisslide in time?! Well.. enjoysome free tips! Using SOS from VS.NETMemorydumpanalysisfrominside VS2010
Resourcespablod@plainconcepts.com@Plain Conceptshttp://www.geeks.ms/blogs/palvarezhttp://www.geeks.ms/blogs/rcorralhttp://www.geeks.ms/blogs/luisguerrero@MSDN:http://blogs.msdn.com/tess/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.
AnyQuestions?Thanks! 

More Related Content

What's hot (20)

PDF
Mem forensic
Chong-Kuan Chen
 
PDF
Unpack your troubles*: .NET packer tricks and countermeasures
ESET
 
ODP
Os Cook
oscon2007
 
PPTX
Who’s afraid of WinDbg
Dror Helper
 
PPTX
Designing Tracing Tools
Sysdig
 
PDF
Auditing the Opensource Kernels
Silvio Cesare
 
PPTX
Windows Debugging with WinDbg
Arno Huetter
 
PPTX
Injection on Steroids: Codeless code injection and 0-day techniques
enSilo
 
PDF
Part 03 File System Implementation in Linux
Tushar B Kute
 
PPT
bh-us-02-murphey-freebsd
webuploader
 
PPT
Swug July 2010 - windows debugging by sainath
Dennis Chung
 
ODP
An Overview of Next-Gen Filesystems
Great Wide Open
 
PDF
Metasploit - The Exploit Learning Tree
E Hacking
 
PDF
Configuring Syslog by Octavio
Rowell Dionicio
 
PDF
Syslog Protocols
Martin Schütte
 
PPTX
C++ Production Debugging
Sasha Goldshtein
 
PDF
An Introduction to User Space Filesystem Development
Matt Turner
 
PDF
Advanced Evasion Techniques by Win32/Gapz
Alex Matrosov
 
PPTX
Metasploit & Windows Kernel Exploitation
zeroSteiner
 
PPTX
Vulnerability, exploit to metasploit
Tiago Henriques
 
Mem forensic
Chong-Kuan Chen
 
Unpack your troubles*: .NET packer tricks and countermeasures
ESET
 
Os Cook
oscon2007
 
Who’s afraid of WinDbg
Dror Helper
 
Designing Tracing Tools
Sysdig
 
Auditing the Opensource Kernels
Silvio Cesare
 
Windows Debugging with WinDbg
Arno Huetter
 
Injection on Steroids: Codeless code injection and 0-day techniques
enSilo
 
Part 03 File System Implementation in Linux
Tushar B Kute
 
bh-us-02-murphey-freebsd
webuploader
 
Swug July 2010 - windows debugging by sainath
Dennis Chung
 
An Overview of Next-Gen Filesystems
Great Wide Open
 
Metasploit - The Exploit Learning Tree
E Hacking
 
Configuring Syslog by Octavio
Rowell Dionicio
 
Syslog Protocols
Martin Schütte
 
C++ Production Debugging
Sasha Goldshtein
 
An Introduction to User Space Filesystem Development
Matt Turner
 
Advanced Evasion Techniques by Win32/Gapz
Alex Matrosov
 
Metasploit & Windows Kernel Exploitation
zeroSteiner
 
Vulnerability, exploit to metasploit
Tiago Henriques
 

Similar to Sql Bits Sql Server Crash Dump Analysis (20)

PPT
.NET Debugging Tips and Techniques
Bala Subra
 
PPT
.Net Debugging Techniques
Bala Subra
 
PDF
Formbook - In-depth malware analysis (Botconf 2018)
Rémi Jullian
 
PDF
Typhoon Managed Execution Toolkit
Dimitry Snezhkov
 
PPTX
Creating user-mode debuggers for Windows
Mithun Shanbhag
 
PPTX
Patching Windows Executables with the Backdoor Factory | DerbyCon 2013
midnite_runr
 
PPT
Advanced driver debugging (13005399) copy
Burlacu Sergiu
 
PPT
Introduction to Programming Lesson 01
A-Tech and Software Development
 
PPT
DotNet Introduction
Wei Sun
 
PPTX
Production Debugging at Code Camp Philly
Brian Lyttle
 
PDF
Practical Malware Analysis: Ch 10: Kernel Debugging with WinDbg
Sam Bowne
 
PPT
Virtual platform
sean chen
 
PPTX
How We Analyzed 1000 Dumps in One Day - Dina Goldshtein, Brightsource - DevOp...
DevOpsDays Tel Aviv
 
PPT
01 Introduction to programming
maznabili
 
PPTX
01. introduction to-programming
Stoian Kirov
 
PDF
Security Challenges of Antivirus Engines, Products and Systems
Antiy Labs
 
PDF
Debugging ZFS: From Illumos to Linux
Serapheim-Nikolaos Dimitropoulos
 
PPT
Windows Embedded in the Real World
ukdpe
 
PPTX
Introductiontoasp netwindbgdebugging-100506045407-phpapp01
Camilo Alvarez Rivera
 
PPT
Dotnetintroduce 100324201546-phpapp02
Wei Sun
 
.NET Debugging Tips and Techniques
Bala Subra
 
.Net Debugging Techniques
Bala Subra
 
Formbook - In-depth malware analysis (Botconf 2018)
Rémi Jullian
 
Typhoon Managed Execution Toolkit
Dimitry Snezhkov
 
Creating user-mode debuggers for Windows
Mithun Shanbhag
 
Patching Windows Executables with the Backdoor Factory | DerbyCon 2013
midnite_runr
 
Advanced driver debugging (13005399) copy
Burlacu Sergiu
 
Introduction to Programming Lesson 01
A-Tech and Software Development
 
DotNet Introduction
Wei Sun
 
Production Debugging at Code Camp Philly
Brian Lyttle
 
Practical Malware Analysis: Ch 10: Kernel Debugging with WinDbg
Sam Bowne
 
Virtual platform
sean chen
 
How We Analyzed 1000 Dumps in One Day - Dina Goldshtein, Brightsource - DevOp...
DevOpsDays Tel Aviv
 
01 Introduction to programming
maznabili
 
01. introduction to-programming
Stoian Kirov
 
Security Challenges of Antivirus Engines, Products and Systems
Antiy Labs
 
Debugging ZFS: From Illumos to Linux
Serapheim-Nikolaos Dimitropoulos
 
Windows Embedded in the Real World
ukdpe
 
Introductiontoasp netwindbgdebugging-100506045407-phpapp01
Camilo Alvarez Rivera
 
Dotnetintroduce 100324201546-phpapp02
Wei Sun
 
Ad

Sql Bits Sql Server Crash Dump Analysis