1

An Android application, which uses Native Shared libraries (via JNI), runs correctly on Any Android device. It has a point in code, where a NullPointerExcetion might be thrown, For example: 1. Attempt to invoke interface method 'java.lang.String java.security.PrivateKey.getFormat()' on a null object reference 2. kjava.lang.NullPointerException: Attempt to get length of null array

in Most of the devices and different versions of Android devices, the thrown exception is trapped and handled - and the application continues running.

BUT: on certain Android devices (e.g. Sony Xperia Z3+), the application crashes due to Signal 11 - after the Native Code is initialized and executed (via JNI). If the JNI code was not executed - the NullPointerException is thrown and correctly handled. Once the JNI code is executed, the application would crash on Signal 11 instead of getting the Java Exception.

My questions: have some of you experienced that behavior - Process Signal instead of Java Exception? Is there a way to avoid that?

Again, please note that the issue was only detected on Android 5 devices!

Thanks!!

Ratilal Chopda
  • 4,162
  • 4
  • 18
  • 31
  • 2
    Possible duplicate of [What is a NullPointerException, and how do I fix it?](https://stackoverflow.com/questions/218384/what-is-a-nullpointerexception-and-how-do-i-fix-it) – Ratilal Chopda Nov 07 '17 at 07:19
  • @RatilalChopda no. This question doesn't ask how to fix a NullPointer, it asks how to fix a Signal 11 crash that only occurs on some devices. – Zoe Nov 07 '17 at 07:33
  • Hi, It appears that the source of the crash lies in a c++ code, which transforms C/C++ runtime signals into Java exceptions - and under 64 bits Android 5, it wrongly causes the application's signal instead of the Java Exception. – user3595598 Nov 13 '17 at 06:54

0 Answers0