FIX: Stack Overflow If a SELECT Statement Is Killed

Last reviewed: April 9, 1997
Article ID: Q159339
The information in this article applies to:
  • Microsoft SQL Server, versions 6.5
BUG #: 15658 (sqlbug_65)

SYMPTOMS

If a process is killed while running a SELECT statement in which an aggregate function is used with a DISTINCT keyword, the following error message is displayed in the errorlog:

   spid10   ex_testhandle: stack overflow, top=0x10a0ac8, end=0x10a0ac8

In addition, if the table from which the SELECT is run is a temporary table, the following messages are displayed when the process is killed:

   kernel   udread: Operating system error 6(The handle is invalid.) on
   device 'D:\MSSQL\DATA\MASTER.DAT' (virtpage 0x00000394).

   kernel   udwritem: Operating system error 6(The handle is invalid.) on
   device 'D:\MSSQL\DATA\MASTER.DAT' (virtpage 0x00000b80).

If the SELECT is placed in a temporary stored procedure and it is selecting from a temp table, then the following error is added to the errors above:

   spid10   bufwait: timeout, BUF_IO, bp 0xca1420, pg 0x110, stat
   0x1004/0x6, obj 0, bpss 0x109f598

This error message will continue to be entered in the errorlog until either Windows NT or SQL Server is shut down. You will not be able to shut down SQL Server using SQL Service Manager or by performing a "net stop mssqlserver". At this point, the behavior of the server is somewhat unpredictable. You may or may not be able to make new connections to the server, but the existing connections appear to be stable.

However, if tempdb only has its original size of 2 MB on the master device, when the process is killed, you will receive the following error instead:

   Error: 1117, Severity: 21, State: 10
   Extent chain for object -321 is not correctly linked.


WORKAROUND

Avoid using the Kill command to terminate processes.

STATUS

Microsoft has confirmed this to be a problem in Microsoft SQL Server version 6.5. This problem has been corrected in U.S. Service Pack 2 for Microsoft SQL Server version 6.5. For more information, contact your primary support provider.

MORE INFORMATION

The following SELECT statement is an example of a statement that will cause this problem to occur:

   select avg (distinct Number) from Table


Additional query words: freeze frozen hung lock err msg errmsg
Keywords : kbbug6.50 kbfix6.50.sp2 kbinterop kbnetwork kbusage SSrvErr_Log
Version : 6.5
Platform : WINDOWS
Issue type : kberrmsg


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: April 9, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.