Subject | Re: Client C program with Embedded SQL Crashing on Firebird 2.5/CentOS 5.5 |
---|---|
Author | jbovitzii |
Post date | 2011-01-04T17:54:35Z |
--- In firebird-support@yahoogroups.com, "alexpeshkoff" <peshkoff@...> wrote:
I Downloaded and installed the latest snapshot build from: http://www.firebirdsql.org/download/snapshot_builds/linux/fb2.5/FirebirdCS-2.5.1.26161-0.amd64.rpm.
The test came out the same way - the program still crashes.
In performing some more experiments, dkmrsa (my co-worker sho sent other posts to this thread) and I noticed that if we connect to the database first, and then register the SIGTERM handler, the program does not crash and behaves properly.
From a brief look at the Firebird source code, it appears that on each database attach, Firebird is registering its own chain of signal handlers for SIGTERM and adding ours to the end of that. I am not exactly sure what Firebird needs to do with SIGTERM from an external application that connects to the database and would appreciate an explanation of why it is set up that way. Hopefully, understanding what it is supposed to do will help us to debug this issue and possibly provide a fix.
If we do use the approach of registering our handler after connecting, that would replace the signal handler chain implemented by Firebird and the handlers in that chain would never get called. Would there be any negative side effects in Firebird (e.g. memory leaks, processes or threads not getting cleaned up, etc...) if we were to do that to work around the issue?
Our only use of SIGTERM is to tell our program that it needs to finish up any work it is doing (including any database transactions in process) and then to disconnect from the database and exit.
Thanks again in advance for all your help.
>Hi Alex,
> This bug is sooner of all already fixed in SVN repository.
> Can you try with latest snapshot build?
>
I Downloaded and installed the latest snapshot build from: http://www.firebirdsql.org/download/snapshot_builds/linux/fb2.5/FirebirdCS-2.5.1.26161-0.amd64.rpm.
The test came out the same way - the program still crashes.
In performing some more experiments, dkmrsa (my co-worker sho sent other posts to this thread) and I noticed that if we connect to the database first, and then register the SIGTERM handler, the program does not crash and behaves properly.
From a brief look at the Firebird source code, it appears that on each database attach, Firebird is registering its own chain of signal handlers for SIGTERM and adding ours to the end of that. I am not exactly sure what Firebird needs to do with SIGTERM from an external application that connects to the database and would appreciate an explanation of why it is set up that way. Hopefully, understanding what it is supposed to do will help us to debug this issue and possibly provide a fix.
If we do use the approach of registering our handler after connecting, that would replace the signal handler chain implemented by Firebird and the handlers in that chain would never get called. Would there be any negative side effects in Firebird (e.g. memory leaks, processes or threads not getting cleaned up, etc...) if we were to do that to work around the issue?
Our only use of SIGTERM is to tell our program that it needs to finish up any work it is doing (including any database transactions in process) and then to disconnect from the database and exit.
Thanks again in advance for all your help.