Forum > Databases

[SOLVED] [IBX] Error, Project raised exception class 'External : SIGSEGV'

(1/2) > >>

incendio:
Hi guys,

I tried IBX on Lazarus 2.0.6 on Linux Mint 20, got an error when running an app.

This error caused by Firebird server restarted when app still running.

When Firebird server restarted, tried to close TIBDatabase and open again, this is when the error throw.

This is not happen on Windows OS.

Here are the codes

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---unit main; {$mode objfpc}{$H+} interface uses  Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls, IBDatabase; type   { TForm1 }   TForm1 = class(TForm)    Button1: TButton;    Dba: TIBDatabase;    Trs: TIBTransaction;    procedure Button1Click(Sender: TObject);    procedure FormCreate(Sender: TObject);    procedure OpenDt();  private   public   end; var  Form1: TForm1; implementation {$R *.lfm} { TForm1 }procedure TForm1.OpenDt();begin  Dba.Close; // this line caused an error after Firebird Server restarted  Dba.Open;  Trs.Active:= true;  ShowMessage('Dba Opened.');end; procedure TForm1.FormCreate(Sender: TObject);begin  OpenDt(); end; procedure TForm1.Button1Click(Sender: TObject);begin  OpenDt(); // Clicked after Firebird Server restartedend; end. 
Anyone know how to fix this?

tonyw:
You need to call Dba.ForceClose rather than Close. Close will just keep returning an exception.

incendio:
I have tried ForceClose & Reconnect, nothing worked.

Same codes that runs OK in windows,  throws error in Linux.

Something strange though, on a connection that only has TIBSQL tied to it, a call to Close did not raise an error.

Only connection that have TIBDataset tied to it, raised an error.

tonyw:
When you try to close a database, IBX will attempt to commit/rollback any open transactions. That will be where you are mostly likely to be getting an error. I have tried to duplicate your problem, but all I see is a Firebird exception when I stop the server - Close always gives the same exception (as expected) - and ForceClose works.

Somewhere there may be an unprotected call to a low level handle. If you could post the stack tree when you get a sigserv then this might help.

incendio:

--- Quote from: tonyw on December 01, 2021, 02:44:51 pm ---When you try to close a database, IBX will attempt to commit/rollback any open transactions. That will be where you are mostly likely to be getting an error. I have tried to duplicate your problem, but all I see is a Firebird exception when I stop the server - Close always gives the same exception (as expected) - and ForceClose works.

Somewhere there may be an unprotected call to a low level handle. If you could post the stack tree when you get a sigserv then this might help.

--- End quote ---
Sorry, new to Lazarus here. What is stack tree and how to get it?

I use the exact codes from this post :
https://forum.lazarus.freepascal.org/index.php/topic,57344.0.html

Navigation

[0] Message Index

[#] Next page

Go to full version