Lazarus+ZeosDB+Firebird with message raise exception class 'External: SIGSEGV'. lazarus / 16-Databases ---------------------------------------------------------------------- jaky2551 · 2015-10-21 08:21 I need help because I have a connection with the Firebird Server, which can be done as usual. But when I want to disconnect. My program will display the message "raise exception class 'External: SIGSEGV'." Every time I'm supposed to solve this dilemma. I use Lazarus 1.2.6, ZeosDB 7.1.3a stable, Firebird-2.5.4.26856_0_Win32 work on Win7-64Bit. Program Code in below : unit UMain; {$mode objfpc}{$H+} interface uses   Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,   DBGrids, ZConnection, ZDataset, db; type   { TFMain }   TFMain = class(TForm)     btConnect: TButton;     btExecute: TButton;     Button1: TButton;     cbProtocol: TComboBox;     Data: TDataSource;     DBGrid1: TDBGrid;     edHost: TEdit;     edQuery: TEdit;     edPort: TEdit;     edUser: TEdit;     edPass: TEdit;     Label1: TLabel;     Label2: TLabel;     Label3: TLabel;     Label4: TLabel;     Label5: TLabel;     ZConnect: TZConnection;     Label6: TLabel;     ZQuery: TZQuery;     procedure btConnectClick(Sender: TObject);     procedure btExecuteClick(Sender: TObject);     procedure Button1Click(Sender: TObject);     procedure FormCreate(Sender: TObject);     procedure ZConnectAfterConnect(Sender: TObject);     procedure ZConnectAfterDisconnect(Sender: TObject);   private     { private declarations }   public     { public declarations }   end; var   FMain: TFMain;   PDir: string; implementation {$R *.lfm} { TFMain } procedure TFMain.btConnectClick(Sender: TObject); begin   if btConnect.Caption = 'Connect' then   begin     ZConnect.LibraryLocation := PDir + 'fbembed.dll';     ZConnect.User := edUser.Text;     ZConnect.Password := edPass.Text;     ZConnect.Protocol := cbProtocol.Text;     ZConnect.Port := StrToInt(edPort.Text);     ZConnect.HostName := edHost.Text;     ZConnect.Database := 'MSGLIVE';                   // database name in server     ZConnect.Connect;   end   else   begin //    ZConnect.Commit;     ZQuery.Close; //    ZConnect.FreeInstance; //    ZConnect.Connected := False;     ZConnect.Disconnect;                                      // this error message of this statement   end; end; procedure TFMain.btExecuteClick(Sender: TObject); begin   ZQuery.Close;   ZQuery.SQL.Text := edQuery.Text;   ZQuery.Open; end; procedure TFMain.Button1Click(Sender: TObject); begin   ZConnect.LibraryLocation := PDir + 'fbembed.dll';   ZConnect.User := edUser.Text;   ZConnect.Password := edPass.Text;   ZConnect.Protocol := cbProtocol.Text;   ZConnect.Port := StrToInt(edPort.Text);   ZConnect.HostName := edHost.Text;   ZConnect.Connect;   ZConnect.ExecuteDirect('CREATE TABLE TB_TEST (' +         'ID INTEGER NOT NULL PRIMARYKEY, ' +         'NAME VARCHAR(40), AGE INTEGER, SALARY DECIMAL(8,2));');   ZConnect.ExecuteDirect('CREATE GENERATOR GEN_TEST_ID;');   ZConnect.ExecuteDirect('SET GENERATOR GEN_TEST_ID TO 0;');   ZConnect.ExecuteDirect('CREATE TRIGGER TR_TEST FOR TB_TEST' +                          ' ACTIVE BEFORE INSERT POSITION 0' +                          ' AS BEGIN if (NEW.ID is NULL) then NEW.ID = GEN_ID(GEN_' +                          'TEST_ID, 1); END;');   MessageDlg('Create TB_TEST success!', mtInformation, [mbOk], 0); end; procedure TFMain.FormCreate(Sender: TObject); begin   PDir := ExtractFilePath(Application.ExeName);   if Copy(PDir, Length(PDir), 1) <> '\' then     PDir := PDir + '\'; end; procedure TFMain.ZConnectAfterConnect(Sender: TObject); begin   btConnect.Caption := 'Disconnect'; end; procedure TFMain.ZConnectAfterDisconnect(Sender: TObject); begin   btConnect.Caption := 'Connect'; end; end. ---------------------------------------------------------------------- balazsszekely · 2015-10-21 08:53 It's not exactly clear what are you trying to achieve. On btConnectClick your application connects to MSGLIVE database, then on Button1click you connect the same zconnection again, without disconnecting. Why? PS. I tested Zeos with firebird 2.5.4, everything is working fine. ---------------------------------------------------------------------- jaky2551 · 2015-10-21 09:10 This problem stems from the btconnect when I connect to the server. And disconnect, The program will display this message every time. For the button1click I used for creating tables in the server to test without any problems. Note the embed no problem. But connection to the firebird database server can be a problem when disconnected or close program. ---------------------------------------------------------------------- balazsszekely · 2015-10-21 09:47 Ok. Let's hope somebody can reproduce this issue because I can't. I recreated the same environment(including the embedded database part). After 25+ connect/disconnect still no SIGSEGV. ---------------------------------------------------------------------- jaky2551 · 2015-10-21 10:11 Thanks. I hope there will be others who experience this problem and can give advice. I'm still waiting for those good advice. ---------------------------------------------------------------------- patyi · 2015-10-21 15:05 Zeos 7.1.3a has problem with Firebird 2.5.4 API calls (changed protocol), upgrade Zeos to 7.2, there is fixed ! ---------------------------------------------------------------------- jaky2551 · 2015-10-22 02:41 I tried new experiments throughout the night. (Thailand time). I installed the new Firebird Server. The first did not choose to install fbclient.dll into the . But this time I choose fbclient.dll. And try to connect to the new server. When disconnected or close. No error messages as before. Another I think that problem. Likely from the fbembed.dll that is used to connect to the server because I put fbclient.dll from system folder used to connect this issue has been resolved and do not recur. So it may be concluded that If the connection to the server should use. fbclient.dll. But if working independently can not connect to the server fbembed.dll. I know that this idea of ​​mine is correct. But I have a solution. Thank You.