SQL Server WinDbg debug: mssqlwiki.com

Source: Internet
Author: User
Tags mssql server error log

https://mssqlwiki.com/2012/10/16/sql-server-exception_access_violation-and-sql-server-assertion/

SQL Server Exception, exception_access_violation and SQL Server assertion

Posted by Karthick P.K on October 16, 2012

I have got few request's from SQL Server DBA's in past-to-blog about analyzing SQL server exceptions and assertions. After seeing lot of DBAs ' s getting stuck when they get exception_access_violation (or) assertion in SQL Serversi decided to Write this blog.

This blog was published with intention to make DBA ' s analyze and resolve exception_access_violation and SQL Server Assertio  N Before contacting Microsoft support. Exception and assertion are and different things.  SQL handles both assertions and exceptions by writing the current thread's stack to the Error log and generating a dump. In a exception are an event that occurs during the execution of a program, and requires the execution of code outs The IDE the normal flow of control and assertion is the check, the programmer inserted into the code to make sure that som E condition is true, If it returns false a assert is raised. SQL handles both assertions and exceptions by writing the current thread's stack to the Error log and generating a dump, s o Trouble shooting Steps is similar.

You'll find messages similar to one below in SQL Serve error logs if you get Exception or exception_access_violation.

{

Error

External dump process returned no errors.
Using ' Dbghelp.dll ' version ' 4.0.5′
Sqldumpexceptionhandler:process 510 generated fatal exception c0000005 EXCEPTION_ACCESS_VIOLATION. SQL Server is terminating the this process.
* *******************************************************************************
* BEGIN STACK DUMP:
* Exception Address = 000000007752485C Module (ntdll+000000000002285c)

* Exception Code = c0000005 exception_access_violation

* Access violation occurred reading address 0000041EA9AE2EF0

* Input Buffer 510 bytes–

Ex_terminator–last Chance Exception Handling

}

You'll find messages similar to one below in SQL Server error logs If you get a assertion.

{

Error

spid323 error:17065, Severity:16, State:1.

spid323 SQL Server Assertion:file: <. cpp>, line = 2576 Failed assertion = ' Ffalse ' This error could be timing-r Elated. If the error persists after rerunning the statement, use DBCC CHECKDB to check the database for structural integrity, or R Estart the server to ensure in-memory data structures is not corrupted

SQL Server assertion:file: < Cpp>, line=2040 Failed assertion =

}

To analyze the dump download and Install Windows Debugger from this Link

Step 1 (Load the memory dump file to debugger):

Open Windbg. Choose file menu–> Select Open crash dump–>select the dump file (SQLDUMP000#.MDMP)

Note:you'll find Sqldump000#.mdmp in your SQL Server error log if you get the Exception or assertion.

Step 2 (Set the symbol path to Microsoft symbols server):

on Command Window type

. Sympath Srv*c:\websymbols*http://msdl.microsoft.com/download/symbols;

Step 3 (Load the symbols from Microsoft symbols server):

Type. reload/f and hit Enter. This would force debugger-immediately load all the symbols.

Step 4 (check if symbols is loaded):

Verify if symbols is loaded for SQL Server by using the debugger command LMVM

0:002> LMVM sqlservr

Start End Module Name

00000000 ' 01000000 00000000 ' 03679000 sqlservr T (pdb symbols) c:\websymbols\sqlservr.pdb\21E4AC6E96294A529C9D998 26b5a7c032\sqlservr.pdb

Loaded symbol Image File:sqlservr.exe

Image path:c:\program Files\Microsoft SQL Server\mssql.1\mssql\binn\sqlservr.exe

Image Name:sqlservr.exe

timestamp:wed Oct 21:15:52 (4acd6778)

checksum:025feb5e

imagesize:02679000

File version:2005.90.4266.0

Product version:9.0.4266.0

File flags:0 (Mask 3F)

File os:40000 NT Base

File type:1.0 App

File date:00000000.00000000

Translations:0000.04b0 0000.04e4 0409.04b0 0409.04e4

Step 5 (Switch to exception context):

Type. ECXR

Step 6 (Get the stack of thread which caused exception or assertion):

Type KC//you'll get the stack of thread which raised exception or assertion.

I have pasted one of the sample stacks below, from the exception dump which I worked recently. First thing to identify from Stack are who are raising the exception. The below stack look at the portion which are highlighted in red (on each frame before the! symbol), which is the module which raised the exception (Exe or DLL name).

If exe/dll name is Non Microsoft module (Exe or DLL name) then the exception was being caused by a third party compon ENT, you'll need to work with the company that provided that component to get a solution. Lmvmexe/dll name would give you the company name. For EXAMPLE:LMVM WinInet

If Exe/dll name is sqlservr (or) any of the other SQL server modules then the exception are raised by SQL server, in this case T ype KC Paste the stack in comments session of this blog (or) If you start thread in MSDN forums (or) I N this face book group. If you don't get any of the prompt reply from the community, your may need to open a support ticket with Microsoft.

Note:when you get assertion make sure your post message line which contains SQL Server Assertion:file: <filename . cpp>, line = 2576 Failed assertion = "

0:000> KC 1000

Call Site

WinInet! Internetfreethreadinfo+0x26

WinInet! internetdestroythreadinfo+0x40

WinInet! Dllmain_wininet+0xb5

WinInet!__dllmaincrtstartup+0xdb

ntdll! ldrshutdownthread+0x155

ntdll! rtlexituserthread+0x38

Msvcr80!_endthreadex+0x27

msvcr80!_callthreadstartex+0x1e

msvcr80!_threadstartex+0x84

kernel32! Basethreadinitthunk+0xd

ntdll! rtluserthreadstart+0x1d

If you liked the This post, does like us on Facebook at Https://www.facebook.com/mssqlwiki and joins our Facebook group https://w ww.facebook.com/mssqlwiki#!/groups/454762937884205/

Related Posts:

    • How to Analyze "deadlocked schedulers" dumps?
    • How to analyze Non-yielding Scheduler or non-yielding IOCP Listener dumps ...
    • Non-yielding IOCP Listener, non-yielding Scheduler and non-yielding Resource Monitor known issues and fixes
    • SQL Server generated Access violation dumps while accessing Oracle linked servers.
    • SQL Server Latch & debugging Latch Time Out

Thank you,

Karthick P.K | My Facebook Page | My site| Blog space| Twitter

Disclaimer

The views expressed on this website/blog is mine alone and do not reflect the views of M

SQL Server WinDbg debug: mssqlwiki.com

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.