FIX: Logging Large Error Messages May Generate Access Violation

ID: Q197242


The information in this article applies to:

BUG #: 16775 (SQLBUG_65)

SYMPTOMS

When performing a database or transaction log dump, the SQL Server process attempts to log the action in the error log. If the length of the combined message exceeds the maximum error message size, the SQL Server will fail to log the message and may encounter a handled access violation (AV). Note that to exceed the message length, seven stripe dump devices with 255-byte names are required.


CAUSE

Large error messages exceed the internal message buffer, leading to unexpected behavior.


WORKAROUND

To work around this problem, reduce the size of the message to be logged. To do this, you can break the error message into smaller sections using the state to signify each relevant piece, as in the following example:


   raiserror("Part 1", 12, 1) with log
   raiserror("Part 2", 12, 2) with log
   raiserror("Part 3", 12, 3) with log
   go 
This places the following in the SQL Server error log:

   1998-10-19 08:15:57.74 spid7    Error: 50000, Severity: 12, State: 1
   1998-10-19 08:15:57.74 spid7    Part 1.
   1998-10-19 08:15:57.82 spid7    Error: 50000, Severity: 12, State: 2
   1998-10-19 08:15:57.82 spid7    Part 2.
   1998-10-19 08:15:57.82 spid7    Error: 50000, Severity: 12, State: 3
   1998-10-19 08:15:57.82 spid7    Part 3. 
NOTE: In versions of SQL Server earlier than SQL Server 6.5 Service Pack 5, the length restriction was 512 bytes. SQL Server 6.5 Service Pack 5 extends the allowable length to 1,024 bytes.


STATUS

Microsoft has confirmed this to be a problem in SQL Server version 6.5. This problem has been corrected in U.S. Service Pack 5a for Microsoft SQL Server version 6.5. For information about downloading and installing the latest SQL Server Service Pack, see http://support.microsoft.com/support/sql/.

For more information, contact your primary support provider.

Additional query words: prodsqlsp sp5errorlog


Keywords          : SSrvErr_Log kbbug6.50 kbfix6.50.SP5 
Version           : winnt:6.5
Platform          : winnt 
Issue type        : kbbug 

Last Reviewed: May 4, 1999