I am working on an AR heavy android application and have the problem that it seems to crash at random. After some testing with logcat I’ve found the following stacktrace. All used packages are up to date:
Unity: 2020.3.18f1
ARFoundation: 4.2.0
Addressables: 1.18.15 (maybe not relevant, but using this to load and unload scenes)
Maybe it’s good to note that I am actively turning AR components on and off trough the application. However, there is only one instance of the AR components.
You might want to start by switching to a debug build for automatic symbol resolution. You should then be able to see the names of the functions in the backtrace. From there, you might be able to infer which null pointer is being dereferenced. (See line 12 in your log excerpt)
If the pointer in question is created by you, you should be able to fix your issue.
Fair point. I did a development buid test. This time the application ran for 40ish minutes before crashing randomly. Don’t have a lot of experience with Android debugging. I will build with symbols later and try to get some information out of the memory addresses.
The other tread is trapped message makes me think something is going wrong in another process (ARCore) though.
2021-09-20 17:35:23.446 2635-3406/com.process.name E/CRASH: other thread is trapped; signum = 11
--------- beginning of crash
2021-09-20 17:35:23.449 2635-3406/com.process.name E/AndroidRuntime: FATAL EXCEPTION: UnityMain
Process: com.process.name, PID: 2635
java.lang.Error: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
Version '2020.3.18f1 (a7d1c678663c)', Build type 'Development', Scripting Backend 'il2cpp', CPU 'arm64-v8a'
Build fingerprint: 'samsung/gta4xlwifieea/gta4xlwifi:11/RP1A.200720.012/P610XXS2CUG5:user/release-keys'
Revision: '7'
ABI: 'arm64'
Timestamp: 2021-09-20 17:35:22+0200
pid: 2635, tid: 26727, name: ImageReader-640 >>> com.process.name <<<
uid: 10241
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x138
Cause: null pointer dereference
x0 0000000000000138 x1 0000007a802333e8 x2 7f7c9c50b673486e x3 00000079b1180680
x4 0000000000000000 x5 0000000000000000 x6 0000000000000000 x7 00000079b1180680
x8 000000000000006e x9 0101010101010101 x10 0000000000000014 x11 000000000000000a
x12 00000000000040b4 x13 00000079b1193280 x14 000000000004b000 x15 0000007a4c5d9d80
x16 0000007caa5949b8 x17 0000007caa588f7c x18 0000000000000032 x19 0000007a80233400
x20 0000000000000000 x21 0000000000000138 x22 0000007a802333e8 x23 0000007a802333d0
x24 000000000000000a x25 0000000000000001 x26 0000000000000000 x27 0000000000000002
x28 0000007a8013b000 x29 0000007a802339e0
sp 0000007a802331f0 lr 0000007a3ceabae4 pc 0000007a3c1127b0
backtrace:
#00 pc 0000000000b087b0 /data/app/~~jPgyhxqCCkX3mhRac7Iq-g==/com.google.ar.core-FrcwsyibXySCdCnkAcl8-g==/base.apk (BuildId: f21450fbdd9ec446d4ad18d03c20480d)
#01 pc 00000000018a1ae0 /data/app/~~jPgyhxqCCkX3mhRac7Iq-g==/com.google.ar.core-FrcwsyibXySCdCnkAcl8-g==/base.apk (BuildId: f21450fbdd9ec446d4ad18d03c20480d)
#02 pc 0000000000a2d0cc /data/app/~~jPgyhxqCCkX3mhRac7Iq-g==/com.google.ar.core-FrcwsyibXySCdCnkAcl8-g==/base.apk (BuildId: f21450fbdd9ec446d4ad18d03c20480d)
#03 pc 0000000000a39f90 /data/app/~~jPgyhxqCCkX3mhRac7Iq-g==/com.google.ar.core-FrcwsyibXySCdCnkAcl8-g==/base.apk (BuildId: f21450fbdd9ec446d4ad18d03c20480d)
#04 pc 00000000019a28e8 /data/app/~~jPgyhxqCCkX3mhRac7Iq-g==/com.google.ar.core-FrcwsyibXySCdCnkAcl8-g==/base.apk (BuildId: f21450fbdd9ec446d4ad18d03c20480d)
#05 pc 0000000000c19eb8 /data/app/~~jPgyhxqCCkX3mhRac7Iq-g==/com.google.ar.core-FrcwsyibXySCdCnkAcl8-g==/base.apk (BuildId: f21450fbdd9ec446d4ad18d03c20480d)
#06 pc 0000000000b9ebc4 /data/app/~~jPgyhxqCCkX3mhRac7Iq-g==/com.google.ar.core-FrcwsyibXySCdCnkAcl8-g==/base.apk (BuildId: f21450fbdd9ec446d4ad18d03c20480d)
#07 pc 0000000000bd16cc /data/app/~~jPgyhxqCCkX3mhRac7Iq-g==/com.google.ar.core-FrcwsyibXySCdCnkAcl8-g==/base.apk (BuildId: f21450fbdd9ec446d4ad18d03c20480d)
#08 pc 0000000000bf557c /data/app/~~jPgyhxqCCkX3mhRac7Iq-g==/com.google.ar.core-FrcwsyibXySCdCnkAcl8-g==/base.apk (BuildId: f21450fbdd9ec446d4ad18d03c20480d)
#09 pc 0000000000bf9888 /data/app/~~jPgyhxqCCkX3mhRac7Iq-g==/com.google.ar.core-FrcwsyibXySCdCnkAcl8-g==/base.apk (BuildId: f21450fbdd9ec446d4ad18d03c20480d)
#10 pc 0000000000027df4 /system/lib64/libmediandk.so (BuildId: 796ed63909f4b11bb527cdc57b082be9)
#11 pc 0000000000018814 /system/lib64/libstagefright_foundation.so (android::AHandler::deliverMessage(android::sp<android::AMessage> const&)+84) (BuildId: 684ca5fa699d8995be76b3f9bfc86bd2)
#12 pc 000000000001e9cc /system/lib64/libstagefright_foundation.so (android::AMessage::deliver()+188) (BuildId: 684ca5fa699d8995be76b3f9bfc86bd2)
#13 pc 0000000000019b48 /system/lib64/libstagefright_foundation.so (android::ALooper::loop()+572) (BuildId: 684ca5fa699d8995be76b3f9bfc86bd2)
#14 pc 0000000000015594 /system/lib64/libutils.so (android::Thread::_threadLoop(void*)+460) (BuildId: 4e69b93bf70ed592f0029dbd1097529e)
#15 pc 00000000000a5574 /system/lib64/libandroid_runtime.so (android::AndroidRuntime::javaThreadShell(void*)+144) (BuildId: 1923439784d0fe87e907dbd50dbab548)
2021-09-20 17:35:23.450 2635-3406/com.process.name E/AndroidRuntime: #16 pc 0000000000014d90 /system/lib64/libutils.so (BuildId: 4e69b93bf70ed592f0029dbd1097529e)
#17 pc 00000000000eb7a8 /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+64) (BuildId: 698b6aef520f034a9d40736d477f7a96)
#18 pc 000000000008bc8c /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64) (BuildId: 698b6aef520f034a9d40736d477f7a96)
at base.0xb087b0(Native Method)
at base.0x18a1ae0(Native Method)
at base.0xa2d0cc(Native Method)
at base.0xa39f90(Native Method)
at base.0x19a28e8(Native Method)
at base.0xc19eb8(Native Method)
at base.0xb9ebc4(Native Method)
at base.0xbd16cc(Native Method)
at base.0xbf557c(Native Method)
at base.0xbf9888(Native Method)
at libmediandk.0x27df4(Native Method)
at libstagefright_foundation.android::AHandler::deliverMessage(android::sp<android::AMessage> const&)(deliverMessage:84)
at libstagefright_foundation.android::AMessage::deliver()(deliver:188)
at libstagefright_foundation.android::ALooper::loop()(loop:572)
at libutils.android::Thread::_threadLoop(void*)(_threadLoop:460)
at libandroid_runtime.android::AndroidRuntime::javaThreadShell(void*)(javaThreadShell:144)
at libutils.0x14d90(Native Method)
at libc.__pthread_start(void*)(__pthread_start:64)
at libc.__start_thread(__start_thread:64)
2021-09-20 17:35:23.571 2635-4251/com.process.name W/libc: Unable to set property "debug.sf.dequeuebuffer" to "1": connection failed; errno=13 (Permission denied)
2021-09-20 17:35:23.571 2635-4251/com.process.name E/BufferQueueProducer: [ImageReader-640x480f23u3m16-2635-146](id:a4b000000af,api:4,p:4711,c:2635) waitForFreeSlotThenRelock: timeout
2021-09-20 17:35:23.572 2635-4251/com.process.name D/ACameraDevice: Device error received, code 3, frame number 91, request ID 0, subseq ID 0
2021-09-20 17:35:23.572 2635-26729/com.process.name E/native: E0920 17:35:23.572759 26729 android_camera.cc:1719] Camera 0: Repeating CaptureRequest capture failed! frame: 91 reason: 1
2021-09-20 17:35:23.791 2635-2635/com.process.name I/Unity: onPause
2021-09-20 17:35:23.821 2635-3406/com.process.name I/Process: Sending signal. PID: 2635 SIG: 9