Microsoft KB Archive/191866

BUG: VB Out of Memory Error Caused by COMTI Access Violation

PSS ID Number: Q191866 Article last modified on 08-26-1998

================================================================ ==

The information in this article applies to:


 * Microsoft COM Transaction Integrator for CICS and IMS version 1.0 SP1, included with SNA Server version 4.0 SP1 —————————————————————————

= SYMPTOMS =

An Out of Memory error occurs when one component installed in a Microsoft Transaction Server (MTS) package invokes a method of a COMTI component installed in the same MTS package. The error occurs in the COMTI component when the following conditions are met:


 * A COMTI component is called from another MTS component; for example, a VB or VC++ component.
 * Both components are in the same MTS package.
 * Both components share MTS Object Context; for example, Set oComTI = GetObjectContext.CreateInstance(“MyCOMTI.MyMethod”).
 * The COMTI method being called has a return value.

= CAUSE =

The return value of the COMTI component is not being initialized in the COMTI runtime, which causes an attempt to free memory before handling the reply data (return value) from the host. This causes the COMTI component to generate an access violation exception that MTS detects, causing it to destroy the hosting process (Mtx.exe). In turn, this causes a failed method call and eventually an Out Of Memory error to be returned to the Visual Basic caller.

= WORKAROUND =

To resolve this problem, apply the hotfix described in the STATUS section below, or use one of the three alternatives described as follows:


 * 1) Put the COMI component in a different package than the calling component, which causes a marshal to occur. The marshaling code initializes all parameters, including return values.
 * 2) Do not share MTS Object Context. If MTS Object Context is not shared, the COMTI component is created on a different thread; therefore a thread marshal occurs and yields results similar to those in workaround #1.
 * 3) Do not use a return value for the COMTI method, but instead make the desired return value an output parameter, which avoids the problem.

= STATUS =

Microsoft has confirmed this to be a problem in Microsoft COM Transaction Integrator for CICS and IMS version 1.0 SP1, included with SNA Server version 4.0 SP1. A supported fix is now available, but has not been fully regression- tested and should be applied only to systems experiencing this specific problem. Unless you are severely impacted by this specific problem, Microsoft recommends that you wait for the next Service Pack that contains this fix. Contact Microsoft Product Support Services for more information.

=
========================================================= Issue type : kbbug Solution Type : kbfix ============================================================================= Copyright Microsoft Corporation 1998.