Icon View Incident Report

Serious Serious
Reported By: Sergey Kolotov
Reported On: 7/16/2011
For: Version 4.30 Build 6
# 3482 Thread Safety Issue when Opening Sessions From Multiple Threads When TDBISAMEngine Inactive

TDBISAMEngine is not thread-safe! Initializing a Engine (Engine.Active:=True) occur when session is initializing. See code below.

// DBISAM 4.29 Build 4
procedure TDataEngine.Initialize(...);
begin
  Randomize;
  FIsWindows95:=(OSGetVersion=4.00) and (OSGetPlatform=VER_PLATFORM_WIN32_WINDOWS);
  FLockFileName:=LockFile;


// DBISAM 4.30 Build 6
procedure TDataEngine.Initialize(...);
begin
  PopulateLocales;  // <--- AV occur here
  Randomize;
  FIsWindows95:=(OSGetVersion=4.00) and (OSGetPlatform=VER_PLATFORM_WIN32_WINDOWS);
  FLockFileName:=LockFile;



Comments Comments and Workarounds
The workaround is to ensure that the engine is activated via the main process thread prior to opening any sessions in separate threads.

The engine initialization code is now wrapped with a critical section.


Resolution Resolution
Fixed Problem on 7/18/2011 in version 4.30 build 7


Products Affected Products Affected
DBISAM CLX Client-Server
DBISAM CLX Client-Server with Source
DBISAM CLX Standard
DBISAM CLX Standard with Source
DBISAM VCL Client-Server
DBISAM VCL Client-Server with Source
DBISAM VCL Standard
DBISAM VCL Standard with Source
DBISAM VCL Trial

Image