Reputation: 51
I implement a custom POSIX signal handler Ref : http://blog.httrack.com/blog/2013/08/23/catching-posix-signals-on-android/
Their appears to be a platform limitation with ART.
Is there a work around or any other way to achieve, calling java method from JNI through the signal handler method.
If not then is there an alternative scheme to catch the native crash and propagate to the app ?
Upvotes: 2
Views: 539
Reputation: 8209
First of all - you should be very carefully with what you doing in signal handler. Also there is a list of functions that you can safely invoke from there, look for "Async-signal-safe functions". And surely you shouldn't invoke anything outside of that list or anythyng via JNIEnv
because you don't know what JVM does under the hood.
As result there is no way to propagate error to the app. You can just write anything you want to some file with write() and then test this file at next launch.
Upvotes: 1