Subject Ib_Events problems continued :)
Author Robert martin
Hi All

My problems with IB_Events continue. A quick recap. When closing our
application with some Ib_Events code, used and then freed we sometimes
get a serious error.

The error is 'Access violation at address 10024848 in module 'GDS32.dll'. Write of address 016A8046'

Sometimes this also crashes Firebird (100% usage) , which has to be restarted.

I thought I could wait to FB 2 release and update both our database and components as the crashes seemed to be from running in the IDE however the crashes are not and we cant ship to our users like this.

I found the following in the IBObjects web site...

"Then, there are intermittent problems when closing down your application. It occurs when calling FreeLibrary() for the GDS32.DLL. Using events causes something to get out of whack and it freezes up. It can be avoided by doing a clean reconnect of the database after everything else has been closed, to clear out whatever garbage is left that trips up the FreeLibrary() routine."

This is old, it refers to IBEventAlerter. I am using the latest 1.5 version and this still seems to be an issue. I have traced the error to the following code in IB_Events...


asm fstcw [SaveCW] end;
errCode := isc_detach_database( @Status, PdbHandle );
asm fldcw [SaveCW] end;
if ( errCode = 0 ) and FRequestReconnect then
begin
API_Connect;
asm fstcw [SaveCW] end;
errCode := isc_detach_database( @Status, PdbHandle );
asm fldcw [SaveCW] end;
end;


This code does exactly what the doc describes, if an error occurs while closing, it reconnects and tries closing again. My testing shows this kind of works. However my allows connection to multiple FB databases. If there is only one DB in use this code works fine. If there are more than one, closing the first is fine (although can cause the IDE to bring up the CPU window), closing the second causes the whole app to go bang with the GDS32.dll message.


Sorry about the long email, I just wanted to be clear.

My questions are...

1. Will updating to the latest version of IB_Objects potentially fix this? (we are on 4.3A - yes i know its old but we wanted to ship what we have then update to avoid re testing).

2. Does anybody have any other suggestions?




--
Rob Martin
Software Engineer

phone +64 03 377 0495
fax +64 03 377 0496
web www.chreos.com

Wild Software Ltd