GCJ and signal handling

Bryce McKinlay mckinlay@redhat.com
Tue Jan 24 23:00:00 GMT 2006


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


More information about the Java mailing list

AltStyle によって変換されたページ (->オリジナル) /