DOCUMENT:Q267993 12-JUN-2001 [sna] TITLE :Access Violation in Snatrc.dll When You Enable CPI-C API Traces PRODUCT :Microsoft SNA Server PROD/VER::3.0 (all SP),4.0,4.0 SP1,4.0 SP2,4.0 SP3 OPER/SYS: KEYWORDS:kbsna300sp1 kbsna300sp2 kbsna300sp3 kbsna300sp4 sna4 kbsna400sp1 kbsna400sp2 kbsna400sp ====================================================================== ------------------------------------------------------------------------------- The information in this article applies to: - Microsoft SNA Server, versions 3.0 SP1, 3.0 SP2, 3.0 SP3, 3.0 SP4, 4.0, 4.0 SP1, 4.0 SP2, 4.0 SP3 - Microsoft Host Integration Server 2000 ------------------------------------------------------------------------------- SYMPTOMS ======== An Access Violation error message may occur in the SNA Server Trace DLL (Snatrc.dll) when CPI-C API tracing is enabled through the SNA Server Trace program (Snatrace.exe). The symptoms that occur vary depending on the CPI-C application and the context that it is running under. If Drwtsn32.exe is the default debugger on the Windows NT or Windows 2000-based computer where tracing is enabled, a Drwtsn32.log entry similar to the following may be created: Application exception occurred: App: dll\snatrc.dbg () Exception number: c0000005 (access violation) The function that fails is com_trc_dumpl. If a Drwtsn32.log entry is not created, an application debugger such as NTSD, CDB, or Visual Studio can be used to catch the Access Violation error message. The following is the output obtained from an application debugger when the Access Violation error message occurs: Access violation - code c0000005 (first chance) eax=00000000 ebx=fdc9afff ecx=00000000 edx=00000000 esi=78003e6d edi=02365001 eip=61d01cea esp=1c2cf4fc ebp=00000001 iopl=0 nv up ei pl zr na po nc cs=001b ss=0023 ds=0023 es=0023 fs=0038 gs=0000 efl=00010246 SNATRC!com_trc_dumpl+aa: 61d01cea 8a47ff mov al,[edi-0x1] ds:0023:02365000=?? 0:038> kb ChildEBP RetAddr Args to Child 1c2cf54c 61d02358 00000021 61d124f0 02365000 SNATRC!com_trc_dumpl+0xaa 1c2cf57c 61d08523 00000021 61d124f0 02364ff0 SNATRC!com_trc_dump+0x88 1c2cf6b8 62e12058 00000001 00000017 1b8c03d0 SNATRC!seputrcp_d+0x3033 602012b0 55536021 57c08556 0102840f 15ff0000 WCPIC32!seputrcp+0x7f [e:\sna40\shared\win32\semfcom.c @ 513] 3d6ca151 00000000 00000000 00000000 00000000 0x55536021 If the CPI-C application is running as part of an MTX object under Microsoft Transaction Server (MTS), an event similar to the following may be logged in the Windows NT or Windows 2000 Application event log: Event ID: 4104 Source: Transaction Server Description: An object call caused an exception. (Package: BCCS DSO) (ProgId: MCCMGSP.ExecuteTransaction) (CLSID: {61D8D9B8-80AF-11D2-81A6-006008A0C451}) (Interface: ExecuteTransaction) (IID: {61D8D9B7-80AF-11D2-81A6-006008A0C451}) (Method: 13) (Microsoft Transaction Server Internals Information: File: d:\viper\src\runtime\cw\cwlib.cpp, Line: 861). After the Access Violation error message occurs, the associated MTX object(s) stops responding (hangs). CAUSE ===== The following issues can cause the Access Violation error message in Snatrc.dll when CPI-C API tracing is enabled: - The tracing routine for the CMSTPN (Set_TP_Name) call ignores the TP_Name_Length field and writes a 64-byte TP_Name regardless of the actual length of the TP_Name. This can result in an Access Violation error message if the calling program allocates less than 64-bytes of buffer to store the TP_name. - The tracing routine for the CMSSL (Set_Sync_Level) call causes an Access Violation error message if the calling program passes an invalid pointer for the sync_level parameter. RESOLUTION ========== To resolve this problem, obtain the latest service pack for SNA Server 4.0. For additional information, please see the following article in the Microsoft Knowledge Base: Q215838 How to Obtain the Latest SNA Server Version 4.0 Service Pack WORKAROUND ========== Disable CPI-C API tracing to prevent this problem from occurring. STATUS ====== Microsoft has confirmed this to be a problem in Microsoft SNA Server versions 3.0, 3.0 SP1, 3.0 SP2, 3.0 SP3, 3.0 SP4, 4.0, 4.0 SP1, 4.0 SP2, 4.0 SP3. This problem was first corrected in SNA Server 4.0 Service Pack 4. MORE INFORMATION ================ In addition to correcting the problems found in the tracing routines for the CPI-C CMSTPN and CMSSL calls, an exception handler has been added to the CPI-C API tracing routines to protect applications from being affected if/when an Access Violation error message occurs when CPI-C API traces are enabled. After you apply this update, any future Access Violation error messages that occur when you run CPI-C API traces will result in partially traced CPI-C verbs without affecting the underlying CPI-C application. Only CPI-C applications that call the CPI-C Set_TP_Name or Set_Sync_Level verbs have the potential of experiencing the Access Violation error message described in this article. NOTE: SNA Server tracing (including CPI-C tracing) should not be enabled under normal circumstances. SNA Server traces are used to troubleshoot specific problems related to SNA Server and SNA Server related applications. Additional query words: ====================================================================== Keywords : kbsna300sp1 kbsna300sp2 kbsna300sp3 kbsna300sp4 sna4 kbsna400sp1 kbsna400sp2 kbsna400sp3 kbSNA400sp4fix kbSNA400PreSP4fix Technology : kbAudDeveloper kbSNAServSearch kbHostIntegServ2000 kbSNAServ400 kbSNAServ300SP3 kbSNAServ300SP1 kbSNAServ400SP1 kbSNAServ400SP2 kbSNAServ400SP3 kbSNAServ300SP2 kbSNAServ300SP4 Version : :3.0 (all SP),4.0,4.0 SP1,4.0 SP2,4.0 SP3 Issue type : kbbug Solution Type : kbfix ============================================================================= 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. Copyright Microsoft Corporation 2001.