1

I am running some native code in my Android app, and it produces a segmentation fault. Which takes down the entire app. Lets assume for the sake of this question that this part of the code can't be changed or avoided.

I want to avoid crashing the whole app and ignore the native error.

Naturally try / catch and signal handlers do not help with these specific signals as they are killing the entire process when they happen.

Is there any way (c or java side) to recover from these signals and avoid crashing the app?

Oren
  • 4,152
  • 3
  • 30
  • 37
  • The most reliable approach would be to run the crashing code in a separate process. You can catch the signals (see `sigaction()`), but doing something useful after they hit is tricky. – fadden Apr 07 '15 at 15:51
  • possible duplicate of [How can I catch SIGSEGV (segmentation fault) and get a stack trace under JNI on Android?](http://stackoverflow.com/questions/1083154/how-can-i-catch-sigsegv-segmentation-fault-and-get-a-stack-trace-under-jni-on) – super-qua Apr 28 '15 at 07:22

0 Answers0