Microsoft KB Archive/304417

= BUG: AV May Occur When _ATL_DEBUG_INTERFACES Is Defined in ATL Provider =

Article ID: 304417

Article Last Modified on 8/15/2005

-

APPLIES TO


 * Microsoft Visual Studio 6.0 Enterprise Edition

-



This article was previously published under Q304417



SYMPTOMS
An access violation (AV) may occur in the OLE DB Services layer whenever the _ATL_DEBUG_INTERFACES macro is defined within an Active Template Library (ATL) provider. When this occurs, the following error message is usually reported from the OLE DB client application:

&quot;catastrophic failure&quot;



CAUSE
Defining _ATL_DEBUG_QI and _ATL_DEBUG_INTERFACES when writing an ATL provider causes a QIThunk object to be created for each interface requested by way of a QueryInterface call. The code in the OLE DB services causes the QIThunk to be freed prematurely, and any attempt to use that freed object results in an access violation.



RESOLUTION
Remove the _ATL_DEBUG_XXX definitions from any custom ATL provider that uses the OLE DB services.



STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.

