SQL Server Q&A

As a software engineer, I focus on .NET, especially asp.net, C#, WCF and so on, and I am also very interested in Search Engine Optimization.

Entries Tagged ‘sqlservr’

FIX: Improved SQL Manager Robustness for Odd Length Buffer

Symptoms
An access violation (AV) exception may occur when SQL Server tries to free the relevant memory block. The following is a sample short stack dump that you may see in the error log:

* Short Stack Dump* 0040A829 Module(sqlservr+0000A829) (CVariableInfo::CVarBlock::PvbJoin+00000035)* 0040A782 Module(sqlservr+0000A782) (CVariableInfo::PviRelease+00000056)* 0040A72C Module(sqlservr+0000A72C) (CVarPageMgr::Release+00000014)* 00401B52 Module(sqlservr+00001B52) (CMemObj::Free+0000001E)* 00401AFD Module(sqlservr+00001AFD) (CMemThread::Free+00000044)* 00401B26 Module(sqlservr+00001B26) (commondelete+0000001B)* 00560988 Module(sqlservr+00160988) (CSql::~CSql+00000021)* 0053E4B9 Module(sqlservr+0013E4B9) (CSqlMgr::DerefSql+00000065)* 0053EAC8 Module(sqlservr+0013EAC8) (CCompPlan::~CCompPlan+00000051)* 0053EA4B Module(sqlservr+0013EA4B) (CCompPlan::`vector deleting destructor’+0000000B)* 00440B4F Module(sqlservr+00040B4F) (CCacheObject::Release+000000D8)* 005D2F4F Module(sqlservr+001D2F4F) (CCache::FRemoveOne+00000316)* 0081AB31 Module(sqlservr+0041AB31) (BPool::ReplenishFreeList+00000144)* 0040AFAB Module(sqlservr+0000AFAB) (BPool::HelpLazyWriter+00000037)* 004306F5 Module(sqlservr+000306F5) (BPool::ReadAhead+00000074)* 00431A6D Module(sqlservr+00031A6D) (SDES::ReadAhead+0000006D)* 00521D63 Module(sqlservr+00121D63) (UnorderedPageSupplier::AddToQueue+00000546)* 00521938 Module(sqlservr+00121938) (UnorderedPageSupplier::GetNextPage+0000006C)* 00405810 Module(sqlservr+00005810) (SDES::GetBiDi+0000019C)* 0043362A Module(sqlservr+0003362A) (RowsetSS::FetchNextRow+000000B0)* 00433506 Module(sqlservr+00033506) (CQScanRowset::GetRowWithPrefetch+00000040)* 00521769 Module(sqlservr+00121769) (CQScanTableScan::GetRow+0000005F)* 0042C876 Module(sqlservr+0002C876) (CRowPrefetchDelayMgr::PopulateBuffer+0000001F)* 0042C334 Module(sqlservr+0002C334) (CRowPrefetchDelayMgr::GetRowUnordered+0000001E)* 0042C247 Module(sqlservr+0002C247) (CRowPrefetchDelayMgr::GetRow+0000001B)* 0042C22B Module(sqlservr+0002C22B) (CQScanRangePrefetchDelay::GetRow+00000014)* 0042D02F Module(sqlservr+0002D02F) (CQScanNLJoin::GetRow+0000010B)* 006D58CB Module(sqlservr+002D58CB) (CQScanConcat::GetRow+0000001C)* 005285B0 Module(sqlservr+001285B0) (CQScanSort::BuildSortTable+00000047)* 00528560 Module(sqlservr+00128560) (CQScanSort::Open+00000032)* 0041D92F Module(sqlservr+0001D92F) (CQueryScan::Startup+0000010D)* 0041925F Module(sqlservr+0001925F) (CStmtQuery::ErsqExecuteQuery+0000026B)* 00432F55 Module(sqlservr+00032F55) (CStmtSelect::XretExecute+00000229)* 0040F403 Module(sqlservr+0000F403) (CMsqlExecContext::ExecuteStmts+000002D9)* 0040EA95 Module(sqlservr+0000EA95) (CMsqlExecContext::Execute+000001B6)* 00410159 Module(sqlservr+00010159) (CSQLSource::Execute+00000331)* 005F74B6 Module(sqlservr+001F74B6) (CStmtExecStr::XretExecute+0000032E)* 0040F403 Module(sqlservr+0000F403) (CMsqlExecContext::ExecuteStmts+000002D9)* 0040EA95 Module(sqlservr+0000EA95) (CMsqlExecContext::Execute+000001B6)* 00410159 Module(sqlservr+00010159) (CSQLSource::Execute+00000331)* 00429DD3 Module(sqlservr+00029DD3) (execrpc+000004CB)* 0042904D Module(sqlservr+0002904D) (execute_rpc+00000019)* 00410FCE Module(sqlservr+00010FCE) (process_commands+00000210)* 41073379 Module(UMS+00003379) (ProcessWorkRequests+0000024A)* 41073071 Module(UMS+00003071) (ThreadStartRoutine+000000BD)* 7800A27B Module(MSVCRT+0000A27B) (beginthread+000000CE)* 77E5758A Module(KERNEL32+0000758A) (SetFilePointer+0000018A)
Resolution
SQL Server works with double-byte Unicode data internally; therefore, SQL Manager assumes an even length buffer.However, under some unexpected situations the buffer length can become an odd number. For example, this behavior might occur with an invalid Tabular Data Stream (TDS) language event. When the buffer length becomes an odd number, SQL Manager cannot allocate a sufficient memory block. This leads to a potential memory scratch and can cause the access violation that is described in the “Symptoms” section when the relevant memory block is freed later.

FIX: Exception Access Violation Encountered in PrintWarnings Function

Symptoms
A computer that is running SQL Server with Address Windowing Extensions (AWE) enabled may experience an Access Violation when attempting to generate a latch warning if the buffer is not currently mapped. For more information about AWE mapping, refer to the Win32 documentation about theMapUserPhysicalPages function.
The following stack trace is logged in the SQL Server error log:

0082CA07 Module(sqlservr+0042CA07) (LatchBase::PrintWarning+0000003E)0082C984 Module(sqlservr+0042C984) (LatchBase::Suspend+00000466)004018CB Module(sqlservr+000018CB) (LatchBase::Acquire+00000098)004290A0 Module(sqlservr+000290A0) (BUF::AcquireIOLatch+00000018)..
Resolution
The PrintWarning error message refers to a member of the un-mapped buffer, which then causes the exception to occur.

FIX: Exception Access Violation Encountered in CONSTANT::CONSTANT

Symptoms
Use of a query that involves the AN identity may result in the SQL Server client being forcefully disconnected and the following stack trace is reported in the SQL Server error log:

0×0043cc05 Module(sqlservr+3cc05) (CONSTANT::CONSTANT+6e)0×00782df9 Module(sqlservr+382df9) (trConstant::trConstant+31)0×005faad4 Module(sqlservr+1faad4) (PtrBldGetIdentity+125)0×00531660 Module(sqlservr+131660) (CCompPlan::Result+5dc)0×0044a4ab Module(sqlservr+4a4ab) (CCompPlan::FPreprocess+19c)0×004383d0 Module(sqlservr+383d0) (CCompPlan::FCompileStep+7e6)0×0043d00f Module(sqlservr+3d00f) (CProchdr::FCompile+5d9)…
Resolution
The CONSTANT::CONSTANT code line attempts to copy an extra character from the table name, which then causes the exception error.

FIX: An access violation may occur when you try to run a Transact-SQL query in SQL Server 2000

Symptoms
This article describes the following about this hotfix release:The issues that are fixed by the hotfix packageThe prerequisites for installing the hotfix packageWhether you must restart the computer after you install the hotfix packageWhether the hotfix package is replaced by any other hotfix packageWhether you must make any registry changesThe files that are contained in the hotfix package
Resolution
When you try to run a Transact-SQL query from an application in Microsoft SQL Server 2000, an access violation may occur. This problem occurs when the following conditions are true: The Transact-SQL query contains a UNION operator. The Transact-SQL query uses a parallel execution plan. When this problem occurs, the following error message is logged in the SQL Server error log:

<Date> <Time> server Microsoft SQL Server 2000 – 8.00.2039 (Intel X86) May 3 2005 23:18:38 Copyright (c) 1988-2003 Microsoft Corporation Enterprise Edition on Windows NT 5.2 (Build 3790: Service Pack 1) … 2005-08-31 12:21:15.46 spid54 DBCC TRACEON 2861, server process ID (SPID) 54.
<Date> <Time> spid57 Open of fault log C:\Program Files\Microsoft SQL Server\MSSQL\log\exception.log failed.
<Date> <Time> spid57 Open of fault log C:\Program Files\Microsoft SQL Server\MSSQL\log\exception.log failed.
<Date> <Time> spid57 Open of fault log C:\Program Files\Microsoft SQL Server\MSSQL\log\exception.log failed.
<Date> <Time> spid57 Using ‘dbghelp.dll’ version ‘4.0.5′
*Stack Dump being sent to C:\Program Files\Microsoft SQL Server\MSSQL\log\SQLDump0920.txt
<Date> <Time> spid57 SqlDumpExceptionHandler: Process 5984 generated fatal exception c0000005 EXCEPTION_ACCESS_VIOLATION. SQL Server is terminating this process.
* ******************************************************************************* * * BEGIN STACK DUMP:
<Date> <Time> spid 57
* Exception Address = 0040560F
* Exception Code = c0000005 EXCEPTION_ACCESS_VIOLATION
* Access Violation occurred reading address 000000B8
* d b o . P I H D 14 00 64 00 62 00 6f 00 2e 00 50 00 49 00 48 00 44 00
* e l e t e _ L e v 65 00 6c 00 65 00 74 00 65 00 5f 00 4c 00 65 00 76 00
* e l 2 §2 2 65 00 6c 00 32 00 00 00 00 00 a7 32 00 09 04 00 01 32
* F49 § 2 a 03 00 46 34 39 00 00 a7 08 00 09 04 00 01 32 07 00 61
* cdgood 63 64 67 6f 6f 64
* ——————————————————————————-
* Short Stack Dump * 0040560F Module(sqlservr+0000560F) * 00603FF5 Module(sqlservr+00203FF5) (SQLExit+0009C4FE)
* 0053577C Module(sqlservr+0013577C)
* 00420A14 Module(sqlservr+00020A14)
* 00874277 Module(sqlservr+00474277) (GetIMallocForMsxml+0007F6F7)
* 00875200 Module(sqlservr+00475200) (GetIMallocForMsxml+00080680)
* 00875611 Module(sqlservr+00475611) (GetIMallocForMsxml+00080A91)
* 005BB2F6 Module(sqlservr+001BB2F6) (SQLExit+000537FF)
* 005BAAB9 Module(sqlservr+001BAAB9) (SQLExit+00052FC2)
* 00866D25 Module(sqlservr+00466D25) (GetIMallocForMsxml+000721A5)
* 00868002 Module(sqlservr+00468002) (GetIMallocForMsxml+00073482)
* 00868B1E Module(sqlservr+00468B1E) (GetIMallocForMsxml+00073F9E)
* 0087E1CD Module(sqlservr+0047E1CD) (GetIMallocForMsxml+0008964D)
* 0087E422 Module(sqlservr+0047E422) (GetIMallocForMsxml+000898A2)
* 0055C692 Module(sqlservr+0015C692)
* 41075309 Module(ums+00005309) (ProcessWorkRequests+000002D9 Line 456+00000000)
* 41074978 Module(ums+00004978) (ThreadStartRoutine+00000098 Line 263+00000007)
* 7C34940F Module(MSVCR71+0000940F) (endthread+000000AA)
* 77E66063 Module(kernel32+00026063) (GetModuleFileNameA+000000EB)
*Dump thread – spid = 57, PSS = 0×530731f8, EC = 0×53073528 Additionally, the following events are logged in the Application log:
Event 1
Error 17055 <Date> <Time> MSSQLSERVER DUALP Server <ComputerName>\<Login> 17310 : SqlDumpExceptionHandler: Process 1780 generated fatal exception c0000005 EXCEPTION_ACCESS_VIOLATION. SQL Server is terminating this process.Event 2
Information 17052 <Date> <Time> MSSQLSERVER DUALP Server N/A Error: 17883, Severity: 1, State: 0 Process 56:51 (c84) UMS Context 0×0029DF20 appears to be non-yielding on Scheduler 1

FIX: An access violation may occur when you remove all elements from the procedure cache for a linked server over an interrupted remote access connection

Symptoms
You may receive an access violation exception if all the following conditions are true:You connect to a linked SQL server by using remote access.You run the DBCC FREEPROCCACHE Transact-SQL statement on the linked server to remove all elements from the procedure cache.The remote access connection is interrupted when you remove all elements from the procedure cache.You may notice the following short stack dump file that corresponds to the access violation:

* Short Stack Dump* 004AE996 Module(sqlservr+000AE996) (CLob::DestroyDeep+00000026 Line 907+0000000F)* 008CB71E Module(sqlservr+004CB71E) (CXVariant::ClearDeep+00000116 Line 4519+00000000)* 004A4D82 Module(sqlservr+000A4D82) (CXVariant::Clear+00000022 Line 325+00000000)* 004C6F66 Module(sqlservr+000C6F66) (CAutoClearXVariant::~CAutoClearXVariant+00000016 Line 2020+00000016)* 006936A8 Module(sqlservr+002936A8) (CParamExchange::RestoreFromDbParams+00000588 Line 1168+0000000F)* 00692787 Module(sqlservr+00292787) (CRpcInterfaces::Relay+00000AC1 Line 814+00000000)* 00691C80 Module(sqlservr+00291C80) (CStmtExec::XretRemoteExec+00000422 Line 579+00000000)* 00674325 Module(sqlservr+00274325) (CStmtExec::XretExecute+00000465 Line 561+00000041)* 00608FD2 Module(sqlservr+00208FD2) (CMsqlExecContext::ExecuteStmts+00000560 Line 1578+00000010)* 00608657 Module(sqlservr+00208657) (CMsqlExecContext::Execute+00000368 Line 1227+0000000C)* 0063FAA0 Module(sqlservr+0023FAA0) (CSQLSource::Execute+000006D6 Line 1265+00000013)* 007DEAFE Module(sqlservr+003DEAFE) (language_exec+00000A2B Line 735+00000000)* 007E075E Module(sqlservr+003E075E) (process_commands+000001A1 Line 1765+00000009)* 04CF74BD Module(ums+000074BD) (ProcessWorkRequests+00000292 Line 449+0000000D)* 04CF6852 Module(ums+00006852) (ThreadStartRoutine+000000BD Line 263+00000007)* 77C07E53 Module(MSVCRT+00027E53) (endthread+000000AA)* 77E5D33B Module(kernel32+0001D33B) (RegisterWaitForInputIdle+00000043)
Resolution
Service pack informationTo resolve this problem, obtain the latest service pack for Microsoft SQL Server 2000. For additional information, click the following article number to view the article in the Microsoft Knowledge Base:
290211?(http://support.microsoft.com/kb/290211/) How to obtain the latest SQL Server 2000 service pack
Hotfix informationThe English version of this hotfix has the file attributes (or later) that are listed in the following table. The dates and times for these files are listed in coordinated universal time (UTC). When you view the file information, it is converted to local time. To find the difference between UTC and local time, use the Time Zone tab in the Date and Time tool in Control Panel.

DateTimeVersionSizeFile name——————————————————————-31-May-200318:452000.80.818.078,400Console.exe25-Jun-200301:012000.80.818.033,340Dbmslpcn.dll25-Apr-200302:12786,432Distmdl.ldf25-Apr-200302:122,359,296Distmdl.mdf30-Jan-200301:55180Drop_repl_hotfix.sql23-Jun-200322:402000.80.837.01,557,052Dtsui.dll23-Jun-200322:402000.80.837.0639,552Dtswiz.dll24-Apr-200302:51747,927Instdist.sql03-May-200301:561,581Inst_repl_hotfix.sql08-Feb-200306:402000.80.765.090,692Msgprox.dll01-Apr-200302:071,873Odsole.sql05-Apr-200301:462000.80.800.062,024Odsole70.dll07-May-200320:412000.80.819.025,144Opends60.dll07-May-200318:47132,096Opends60.pdb02-Apr-200321:482000.80.796.057,904Osql.exe02-Apr-200323:152000.80.797.0279,104Pfutil80.dll22-May-200322:5719,195Qfe469571.sql11-Jul-200317:041,084,147Replmerg.sql04-Apr-200321:532000.80.798.0221,768Replprov.dll08-Feb-200306:402000.80.765.0307,784Replrec.dll11-Jul-200316:561,085,925Replsys.sql01-Jun-200301:012000.80.818.0492,096Semobj.dll31-May-200318:272000.80.818.0172,032Semobj.rll29-May-200300:29115,944Sp3_serv_uni.sql01-Jun-200301:012000.80.818.04,215,360Sqldmo.dll07-Apr-200317:4425,172Sqldumper.exe19-Mar-200318:202000.80.789.028,672Sqlevn70.rll02-Jul-200300:182000.80.834.0180,736Sqlmap70.dll08-Feb-200306:402000.80.765.057,920Sqlrepss.dll25-Jul-200321:452000.80.845.07,553,105Sqlservr.exe25-Jul-200321:4512,755,968Sqlservr.pdb25-Jul-200321:442000.80.845.0590,396Sqlsort.dll08-Feb-200306:402000.80.765.045,644Sqlvdi.dll25-Jun-200301:012000.80.818.033,340Ssmslpcn.dll01-Jun-200301:012000.80.818.082,492Ssnetlib.dll01-Jun-200301:012000.80.818.025,148Ssnmpn70.dll01-Jun-200301:012000.80.818.0158,240Svrnetcn.dll31-May-200318:592000.80.818.076,416Svrnetcn.exe30-Apr-200323:522000.80.816.045,132Ums.dll30-Apr-200323:52132,096Ums.pdb02-Jul-200300:192000.80.834.098,816Xpweb70.dllNote Because of file dependencies, the most recent hotfix or feature that contains these files may also contain additional files.

FIX: An access violation is logged in the SQL Server Errorlog file when you run a query that uses a plan guide in SQL Server 2005

Symptoms
This article describes the following about this hotfix release:The issues that are fixed by this hotfix packageThe prerequisites for installing the hotfix packageInformation about whether you must restart the computer after you install the hotfix packageInformation about whether the hotfix package is replaced by any other hotfix packageInformation about whether you must make any registry changesThe files that are contained in the hotfix package
Resolution
When you run a query that uses a plan guide in SQL Server 2005, the query may intermittently fail. Additionally, an access violation that resembles the following is logged in the SQL Server Errorlog file:

2006-08-23 13:34:10.48 spid438***Stack Dump being sent to H:\MSSQL\LOG\SQLDump0016.txt
2006-08-23 13:34:10.48 spid438SqlDumpExceptionHandler: Process 438 generated fatal exception c0000005 EXCEPTION_ACCESS_VIOLATION. SQL Server is terminating this process.
2006-08-23 13:34:10.48 spid438* *******************************************************************************
2006-08-23 13:34:10.48 spid438*
2006-08-23 13:34:10.48 spid438* BEGIN STACK DUMP:
2006-08-23 13:34:10.48 spid438*08/23/06 13:34:10 spid 438
2006-08-23 13:34:10.48 spid438*
2006-08-23 13:34:10.48 spid438*
2006-08-23 13:34:10.48 spid438*Exception Address = 00000000034CE1D0 Module(sqlservr+00000000024CE1D0)
2006-08-23 13:34:10.48 spid438*Exception Code= c0000005 EXCEPTION_ACCESS_VIOLATION
2006-08-23 13:34:10.48 spid438*Access Violation occurred reading address 0000000000000010 This problem occurs if the following conditions are true:The query uses a plan guide.The query accepts some parameters.The plan guide applies the OPTIMIZE FOR hint for the query. The query is recompiled before you run the query .