Microsoft KB Archive/305576

= FIX: Regression: AV When xp_findnextmsg Is Invoked Against an Empty Inbox =

Article ID: 305576

Article Last Modified on 9/4/2002

-

APPLIES TO


 * Microsoft SQL Server 2000 Service Pack 1

-



This article was previously published under Q305576



BUG #: 354951 (SHILOH_BUGS)



SYMPTOMS
You may see a handled access violation (AV) in SQL Server 2000 under the following conditions:
 * SQL Server 2000 uses SQL Mail of Service Pack 1 (version 8.00.384 of Sqlmap70.dll).
 * The xp_findnextmsg extended stored procedure is invoked without the output parameter @msg_id.
 * The Inbox of the MAPI profile used by SQL Mail is empty.

A client will receive an error message that resembles the following:

ODBC: Msg 0, Level 19, State 1

SqlDumpExceptionHandler: Process 51 generated fatal exception c0000005 EXCEPTION_ACCESS_VIOLATION. SQL Server is terminating this process.

Additional details about this access violation are logged into the errorlog of the SQL Server instance in the \LOG subdirectory.

NOTE: This is a regression in Service Pack 1 for SQL Server 2000 (build 384). This works correctly in the RTM version of SQL Server 2000 (build 194).



CAUSE
Due to other changes in Service Pack 1, xp_findnextmsg does not handle an invocation without parameters correctly.



RESOLUTION
To 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 INF: How to Obtain the Latest SQL Server 2000 Service Pack

Hotfix
NOTE: The following hotfix was created prior to Microsoft SQL Server 2000 Service Pack 2.

The English version of this fix should have the following file attributes or later:   Date         Time    Version   Size      File name      Platform 04-Aug-2001 12:19   8.00.427  172,600   Sqlmap70.dll   Intel NOTE: Due to file dependencies, the most recent hotfix or feature that contains the above files may also contain additional files.



WORKAROUND
One possible workaround is to invoke the extended stored procedure with the output parameter @msg_id and then test @msg_id against NULL. The following code demonstrates this workaround: DECLARE @msg varchar(255) EXEC xp_findnextmsg @msg_id = @msg OUTPUT if @msg is null print 'No message!' else print @msg



STATUS
Microsoft has confirmed this to be a problem in SQL Server 2000 Service Pack 1. This problem was first corrected in Microsoft SQL Server 2000 Service Pack 2.



MORE INFORMATION
For additional information on other SQL Mail bugs fixed in the same hotfix, click the article number below to view the article in the Microsoft Knowledge Base:

300414 FIX: SQL Mail Operations May Lead to Failures and Memory Leaks

Keywords: kbbug kbfix kbsqlserv2000presp2fix KB305576

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.