You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have created a program that just loads fbembed.dll, make a call to isc_create_database with minimal parameters and unloads the dll. The program almost always crashes under Windows XP SP2, although it seems to work on Vista.
This program was made as an atempt to find why my application crashed when using isc_dsql_execute_immediate to create a database. I decided to check whether it would crash with isc_create_database and this is the case. The test program is written in Delphi, I give it below in case it is useful.
The program crashes after the call to FreeLibrary returns, as it just has time to show the dialog which says "done" before disappearing.
var isc_create_database: function(user_status: Pointer; file_length: Smallint;
file_name: PChar; handle: Pointer; dpb_length: Smallint; dpb: PChar;
db_type: Smallint): longint; stdcall;
procedure TForm2.Button1Click(Sender: TObject);
var FileName:string;
StatusVector:longint;
DBHandle:PPointer;
GDS32Lib:cardinal;
errcode:integer;
begin
FileName := 'c:\test1\test.fdb';
DeleteFile(FileName);
DBHandle := nil;
GDS32Lib := LoadLibrary('c:\test1\fbembed.dll');
try
isc_create_database := GetProcAddress(GDS32Lib, 'isc_create_database');
if not assigned(isc_create_database) then
raise exception.create('isc_create_database = nil');
errcode := isc_create_database(@StatusVector, Length(FileName), PChar(FileName), @DBHandle, 0, nil, 0);
if errcode <> 0 then raise exception.create('error ' + inttostr(errcode));
finally
sleep(1000); // when we sleep for 1 second the program does not crashes...
FreeLibrary(GDS32Lib);
end;
MessageDlg('done', mtInformation, [mbok], 0);
end;
The text was updated successfully, but these errors were encountered:
You see yourself - it's not isc_create_database() who crashes embedded server, but unload of dynamically loaded library. This is fixed in 2.5, but in 2.1 - please do not use LoadLibrary() to work with ebmedded library, instead link it with your application.
Submitted by: Vincent Schmid (biscotte)
I have created a program that just loads fbembed.dll, make a call to isc_create_database with minimal parameters and unloads the dll. The program almost always crashes under Windows XP SP2, although it seems to work on Vista.
This program was made as an atempt to find why my application crashed when using isc_dsql_execute_immediate to create a database. I decided to check whether it would crash with isc_create_database and this is the case. The test program is written in Delphi, I give it below in case it is useful.
The program crashes after the call to FreeLibrary returns, as it just has time to show the dialog which says "done" before disappearing.
var isc_create_database: function(user_status: Pointer; file_length: Smallint;
file_name: PChar; handle: Pointer; dpb_length: Smallint; dpb: PChar;
db_type: Smallint): longint; stdcall;
procedure TForm2.Button1Click(Sender: TObject);
var FileName:string;
StatusVector:longint;
DBHandle:PPointer;
GDS32Lib:cardinal;
errcode:integer;
begin
FileName := 'c:\test1\test.fdb';
DeleteFile(FileName);
DBHandle := nil;
GDS32Lib := LoadLibrary('c:\test1\fbembed.dll');
try
isc_create_database := GetProcAddress(GDS32Lib, 'isc_create_database');
if not assigned(isc_create_database) then
raise exception.create('isc_create_database = nil');
errcode := isc_create_database(@StatusVector, Length(FileName), PChar(FileName), @DBHandle, 0, nil, 0);
if errcode <> 0 then raise exception.create('error ' + inttostr(errcode));
finally
sleep(1000); // when we sleep for 1 second the program does not crashes...
FreeLibrary(GDS32Lib);
end;
MessageDlg('done', mtInformation, [mbok], 0);
end;
The text was updated successfully, but these errors were encountered: