This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: GCJ and signal handling


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]