Microsoft KB Archive/290907

= FIX: Race Condition on Heap Variable Causes Access Violation in Oracle ODBC Driver =

Article ID: 290907

Article Last Modified on 9/26/2005

-

APPLIES TO


 * Microsoft Open Database Connectivity 2.5
 * Microsoft Open Database Connectivity 2.5
 * Microsoft Open Database Connectivity 2.5
 * Microsoft Open Database Connectivity 2.0
 * Microsoft Open Database Connectivity 2.5
 * Microsoft Open Database Connectivity 2.5
 * Microsoft Open Database Connectivity 2.5
 * Microsoft Open Database Connectivity 2.5

-



This article was previously published under Q290907



SYMPTOMS
When the Microsoft ODBC driver for Oracle is being loaded for the first time and is still in the initialization routines, two threads attempting to use the driver at the same time can encounter a race condition that causes an access violation (AV) in the ODBC driver.

This problem can occur in the Microsoft Data Access Components (MDAC) 2.6 version of the Oracle ODBC driver (2.573.6526.0) and earlier.



CAUSE
During initialization, the Microsoft Oracle ODBC driver creates a heap for its own internal use. This heap is created during the driver's DLLMain initialization routines, and a handle to the heap is saved in a global variable.

Just prior to the creation of the heap, the driver loads the Oracle network libraries, which are necessary for communicating with the Oracle server. These DLLs can occasionally take a considerable amount of time to load, which delays the initialization of the heap variable.

If an additional thread is also starting up at the same time, it may attempt to use the heap handle before the other thread has given it a valid address, and an AV will occur.



RESOLUTION
This bug has been fixed in the Oracle ODBC Driver included with MDAC version 2.6 SP1.



STATUS
Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article. This problem was first corrected in Microsoft Data Access Components 2.6 Service Pack 1.



MORE INFORMATION
This fix can be applied to MDAC 2.5 and MDAC 2.6.

Additional query words: oracle odbc driver heap av crash dllmain initialization threads race

Keywords: kbbug kbfix kboracle kbqfe kbmdac260sp1fix kbhotfixserver KB290907

-

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

© Microsoft Corporation. All rights reserved.