Subject Access violations in ibserver.exe and gds32.dll
Author Christoph Schneider
We have a serious problem with the interbase open source version.
I observe during long time stress tests of our application (an NT-Service)
on different machines in several times access violations in the gds32.dll at
different addresses by reading of an address.

This happens randomly during running of a database insertion process which
does for every item the same identical procedure.

We also got the following other errors without any explainable reason:
- 335544485 (invalid statement handle)
- 335544332 (invalid transaction handle)
- unable to get generator value

The database will accessed always by the same thread by components of
IBObject. We use for all database connection the TCP/IP protocol. The server
are on the same machine located as the client runs. As isolation level for
transactions we used tiCommited. We handled IB_Events but a test with
disconnected events shows also the described errors.

We use the following configuration:
- Interbase Borland Open Source Version 6.0.1 (We already tried Version
6.0.2 and Firebird Release 0.9.4)
- IBObject 4.2 Gr (We tried already Version Ib)
- Delphi 6 SP2
- Win2k SP3, Win2k SP2, NT 4.0 SP6 on different machines with different
network cards.

For debugging in a first step I changed my application from an NT-Service
into a normal Executable but the problems are still the same.
In a second step I visualized in the debug output all interbase API calls of
IBObject but I don't found a reason for our problems. Nothing in the
parameters or results of the API calls indicates a coming access violation.
In the next step I build the interbase open source version 6.0.1 by my self
and connected the visual studio debugger to the ibserver.exe during runtime.
In the most cases only the client was influenced by an access violation of
my application. But in two cases I also saw an access violation in the
ibserver.

Here are two different error cases in which the client was crashed:

1---------------------------------------------------------------------------
-----------------------
ERROR CAUSE:
AV in gds32.dll in 40539C8F: read of address 53474E4D

STACK:
TIB_Transaction.API_Start
TIB_Transaction.SysStart
TIB_Transaction.SetStarted(???)
TMyTransactions.StartTransaction
TMyDataStore.StartTransaction
TServiceMain.SendResult(???,???,False)
TServiceMain.IB_Event(???)
TMyDBEventList.DoEventAlert(???,'VIEW_RESULTDATASET',1)
TIB_Events.DoEventAlert('VIEW_RESULTDATASET',1)
TMyEvent.DoEventAlert('VIEW_RESULTDATASET',1)
TIB_Events.CheckEvents
TIB_Events.ReceiveTimer(???)
TMyService.ServiceExecute(???)

ERROR IN IBOBjects\IBA_Transaction.imp in line 1534:

procedure TIB_Transaction.API_Start;
...
while ( errcode = isc_conn_lost ) and ( ticks > GetTickCount ) do
begin
---> errcode := isc_start_multiple( @status,
PtrHandle,
ConnectionCount,
pteb );
end;
if errcode <> 0 then HandleException( Self );

2---------------------------------------------------------------------------
-----------------------
ERROR CAUSE:
AV in GDS32.dll

STACK:
TIB_Transaction.API_Commit
TIB_Transaction.SysCommitBegin(???)
TIB_Transaction.SysCommit(False)
TIB_Transaction.Commit
TMyTransactions.Commit
TMyDataStore.Commit
TMyDataStore.EndResultUpload(???)
TServiceMain.SendResult(???,???,False)
TServiceMain.IB_Event(???)
TMyDBEventList.DoEventAlert(???,'VIEW_RESULTDATASET',68)
TIB_Events.DoEventAlert('VIEW_RESULTDATASET',68)
TMyEvent.DoEventAlert('VIEW_RESULTDATASET',68)
TIB_Events.CheckEvents
TIB_Events.ReceiveTimer(???)
TMyService.ServiceExecute(???)

ERROR IN IBOBjects\IBA_Transaction.imp in line 1590:

procedure TIB_Transaction.API_Commit;
begin
...
with IB_Session do
begin
asm fstcw [SaveCW] end;
--> errcode := isc_commit_transaction( @status, PtrHandle );
asm fldcw [SaveCW] end;


Have anybody similarly experience? Thanks for every hint for solving this
difficult case.

Christoph Schneider
Schneider Infosystems AG, Switzerland




[Non-text portions of this message have been removed]