This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: GCJ and signal handling
- From: Bryce McKinlay <mckinlay at redhat dot com>
- To: Thomas Hallgren <thomas at tada dot se>
- Cc: java at gcc dot gnu dot org
- Date: Tue, 24 Jan 2006 12:23:38 -0500
- Subject: Re: GCJ and signal handling
- References: <dr2uf1$ahj$1@sea.gmane.org>
Thomas Hallgren wrote:
Hi,
I'm using GCJ for PL/Java (enables Java stored procedures in
PostgreSQL). Everything is based on JNI calls. When I start a non-gcj
VM using the JNI_createVM() call, I always pass the option '-Xrs'
since I don't want the VM install handlers for the SIGHUP, SIGINT,
SIGQUIT, and SIGTERM signals. The '-Xrs' option is not supported when
using GCJ. Question is, do I need to worry? I.e. will the
JNI_createVM() install handlers at all?
libgcj's garbage collector uses a signal internally in order to suspend
threads. It currently uses SIGPWR on Linux, and all threads will have a
handler for this installed. libgcj also uses SIGHUP internally in order
to implement the Thread.interrupt(), but this is there to interrupt
system calls - there is not a handler installed for it.
SIGSEGV and SIGFPE are handled and converted to the appropriate Java
exceptions, and a handler for SIGCHLD is installed by the
java.lang.Process implementation. We don't currently install handlers
explicitly for any of the other signals, but SIGQUIT will be handled
soon for thread dumping. I wasn't aware of the -Xrs option - is this
documented anywhere?
Bryce