Crash on Android
recently, crash occured as soon as run Hello_xr on Android.
device was LG V50 with Android 11
12-06 10:04:57.412 19756 19782 F libc : Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0 in tid 19782 (Thread-2), pid 19756 (hello_xr.vulkan)
12-06 10:04:57.464 19787 19787 F DEBUG : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
12-06 10:04:57.464 19787 19787 F DEBUG : Build fingerprint: 'lge/flashlmdd_lao_com/flashlmdd:11/RKQ1.210420.001/212432001ef56:userdebug/test-keys'
12-06 10:04:57.464 19787 19787 F DEBUG : Revision: '12'
12-06 10:04:57.464 19787 19787 F DEBUG : ABI: 'arm64'
12-06 10:04:57.464 19787 19787 F DEBUG : Timestamp: 2021-12-06 10:04:57+0900
12-06 10:04:57.464 19787 19787 F DEBUG : pid: 19756, tid: 19782, name: Thread-2 >>> com.khronos.openxr.hello_xr.vulkan <<<
12-06 10:04:57.464 19787 19787 F DEBUG : uid: 10410
12-06 10:04:57.464 19787 19787 F DEBUG : signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0
12-06 10:04:57.464 19787 19787 F DEBUG : Cause: null pointer dereference
12-06 10:04:57.464 19787 19787 F DEBUG : x0 0000000000000000 x1 00000000000029d6 x2 0000000000000000 x3 0000007890a60f1e
12-06 10:04:57.464 19787 19787 F DEBUG : x4 0000007882153cb8 x5 0000000000000004 x6 0000000000000000 x7 6174736e49657461
12-06 10:04:57.464 19787 19787 F DEBUG : x8 0000000000000000 x9 06b6144f522ac6c3 x10 0000000000000001 x11 0000000000000001
12-06 10:04:57.464 19787 19787 F DEBUG : x12 06b6144f522ac6c3 x13 00000000000fb720 x14 0000000000001d10 x15 0000a7a4aaa99800
12-06 10:04:57.464 19787 19787 F DEBUG : x16 000000787cdbed28 x17 0000007b855b6810 x18 0000007822988000 x19 0000007882154cc0
12-06 10:04:57.464 19787 19787 F DEBUG : x20 0000007b855b5fd8 x21 0000007882154cc0 x22 0000000000004d2c x23 0000000000004d2c
12-06 10:04:57.464 19787 19787 F DEBUG : x24 0000007882154cc0 x25 0000007882154cc0 x26 0000007882154ff8 x27 0000007b86f0a000
12-06 10:04:57.464 19787 19787 F DEBUG : x28 000000788205c000 x29 0000007882153e30
12-06 10:04:57.464 19787 19787 F DEBUG : lr 000000787cd6649c sp 0000007882153e20 pc 000000787cd66388 pst 0000000060000000
I found that this commit caused above crash:
And with below patch, crash not happend.
diff --git a/src/external/jnipp/jnipp.cpp b/src/external/jnipp/jnipp.cpp
index 852ce39b..cd836eee 100644
--- a/src/external/jnipp/jnipp.cpp
+++ b/src/external/jnipp/jnipp.cpp
@@ -73,6 +73,8 @@ namespace jni
throw InitializationException("Could not attach JNI to thread");
_attached = true;
+ } else {
+ vm->GetEnv((void **) &_env, JNI_VERSION_1_2);
}
_vm = vm;