Skip to Main Content

Java HotSpot Virtual Machine

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to catch SIGSEGV in JNI methods ?

843829Dec 20 2004 — edited Dec 21 2004
Hello,

is there a way to catch segmentation faults in JNI methods ?

On Windows, I can catch(...) exceptions in C++ code and then throw a Java RuntimeException - which can be handled gracefully (kind of).

On Unix, a SIGSEGV or SIGBUS signal is raised which immediately kills the JVM :-(

I already managed to install my own signal handler, but it is called after the JVM dies.
I would like to use my own handler in place of the JVM's handler.

What's the deal about libjsig.so ? Do I have to write my own JVM launcher to use it ?


-- Peter
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 18 2005
Added on Dec 20 2004
2 comments
3,149 views