0

I'm working on java web app which uses some external JAR lib with native C++ libraries. From time to time one of the methods from C++ libraries causes SIGSEGV which terminates my tomcat app. Is there any good way to extract this small piece of java code with native library to prevent my app from being terminated? I would like to make a call to this extracted part of code and if SIGSEGV occurs it should not impact on my whole web app and java VM. Any idea?

  • It's not an Android platform
  • SIGSEGV in JNI code will generally crash the JVM before control is returned to your Java code.
sticker
  • 83
  • 8
  • If you can, solve the root problem and fix the native code instead. – Federico klez Culloca Nov 14 '18 at 13:37
  • Anyway, possible duplicate of [How can I catch SIGSEGV (segmentation fault) and get a stack trace under JNI on Android?](https://stackoverflow.com/questions/1083154/how-can-i-catch-sigsegv-segmentation-fault-and-get-a-stack-trace-under-jni-on) – Federico klez Culloca Nov 14 '18 at 13:38
  • I'm not allowed to fix the native code. It's a black box for me. Moreover I have to use exactly this lib. In general, SIGSEGV will generally crash the JVM before control is returned to my Java code. – sticker Nov 14 '18 at 15:02

0 Answers0