Microsoft KB Archive/314128

= FIX: Access violation occurs when an RPC call is made that includes a bit parameter value that is not valid =

Article ID: 314128

Article Last Modified on 2/22/2007

-

APPLIES TO


 * Microsoft SQL Server 2000 Service Pack 2

-



This article was previously published under Q314128



BUG #: 356323 (SHILOH_BUGS)



SYMPTOMS
In SQL Server 2000 Service Pack 2 (SP2), when you run a SQL Profiler trace that includes RPC events (RPC:Starting or RPC:Completed), a statement that includes a bit parameter that has a value that is greater than 9 causes an access violation in CNetInputBuffer::Init.

In SQL Server 2000 Service Pack 1 (SP1), the trace is truncated, and you receive an error message in SQL Profiler, but no access violation occurs in SQL Server. The data type of the table column is irrelevant; only the data type of the parameter is relevant to this problem.

NOTE: The table column may be another type other than bit.

SQL Server 2000 SP2 (8.00.534) generates the following stack dump:   Short Stack Dump

00410B23 Module(sqlservr+00010B23) (CNetInputBuffer::Init+0000005C) 004B7422 Module(sqlservr+000B7422) (CNetInputStream::FAddEventFragment+0000005E) 00639EB1 Module(sqlservr+00239EB1) (PcnisGetRpcTraceInput+000004BB) 0063A2C1 Module(sqlservr+0023A2C1) (PostRPC+000000AB) 00605A07 Module(sqlservr+00205A07) (execrpc+0000095E) 00437E05 Module(sqlservr+00037E05) (execute_rpc+00000019) 00410E73 Module(sqlservr+00010E73) (process_commands+00000210) 41073379 Module(UMS+00003379) (ProcessWorkRequests+0000024A) 41073071 Module(UMS+00003071) (ThreadStartRoutine+000000BD) 7800A27B Module(MSVCRT+0000A27B) (beginthread+000000CE) 77E8758A Module(KERNEL32+0000758A) (SetFilePointer+0000018A)



Service pack information
To resolve this problem, obtain the latest service pack for Microsoft SQL Server 2000. For more information, click the following article number to view the article in the Microsoft Knowledge Base:

290211 How to obtain the latest SQL Server 2000 service pack

Hotfix information
NOTE: The following hotfix was created before the release of Microsoft SQL Server 2000 Service Pack 3.

The English version of this fix 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.   Date         Version    Size     File name

12-DEC-2001 8.00.552   7,442,513  Sqlservr.exe NOTE: Because of file dependencies, the most recent hotfix or feature that contains these files may also contain additional files.



STATUS
Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the &quot;Applies to&quot; section. This problem was first corrected in Microsoft SQL Server 2000 Service Pack 4.



MORE INFORMATION
To reproduce the access violation, run a SQL Profiler trace that includes at least one of the RPC events (RPC:Starting or RPC:Completed), and then run the following C code: long int myBitStatus=0xff; //Invalid value

SQLRETURN  retcode; SQLHENV    henv = NULL; SQLHDBC    hdbc = NULL; SQLHSTMT   hstmt = NULL;

PTSTR      szDataSource = _T(&quot;localserver&quot;); PTSTR      szUID = _T(&quot;sa&quot;); PTSTR      szPWD = _T(&quot;sa_password&quot;);

if (SQLAllocHandle(SQL_HANDLE_ENV, NULL, &henv) == SQL_ERROR) return 1; SQLSetEnvAttr(henv, SQL_ATTR_ODBC_VERSION, (void*) SQL_OV_ODBC3,   SQL_IS_INTEGER);

if (SQLAllocHandle(SQL_HANDLE_DBC, henv, &hdbc) == SQL_ERROR) return 1;

if (SQLConnect(hdbc, (SQLTCHAR*) szDataSource, SQL_NTS, (SQLTCHAR*) szUID, SQL_NTS, (SQLTCHAR*) szPWD, SQL_NTS) == SQL_ERROR) return 1;

if (SQLAllocHandle(SQL_HANDLE_STMT, hdbc, &hstmt) == SQL_ERROR) return 1;

retcode = SQLAllocHandle(hstmt, hdbc, &hstmt); retcode=SQLBindParameter(hstmt,                 1,                  SQL_PARAM_INPUT,                  SQL_C_BIT,                 SQL_BIT,                  1,                  0,                  &myBitStatus,                  0,                  &myBitStatus);

if (retcode == SQL_SUCCESS || retcode == SQL_SUCCESS_WITH_INFO) {       retcode = SQLExecDirect (hstmt, &quot;SELECT au_id FROM pubs.dbo.authors WHERE contract = ?&quot;, SQL_NTS); } This access violation occurs when the server is running SQL Server 2000 SP2; the SQL Profiler tool version does not affect this problem.

Additional query words: profiler access violation

Keywords: kbhotfixserver kbqfe kbqfe kbbug kbfix kbsqlserv2000presp3fix KB314128

-

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

© Microsoft Corporation. All rights reserved.