Momo
Momo

Reputation: 21

Unity ARFoundation App Crash - null pointer dereference issue

I am working on the unity AR project with AR Foundation 4.0.8 and ARCore XR Plugin 4.0.8. Unity version is 2019.4.29f1. Test device is HTC Desired 20 with Android 10. App may crash when executing more than 30 minutes.

The crash information from logcat:

--------- beginning of crash
08-21 12:36:11.833 29189 29211 E AndroidRuntime: FATAL EXCEPTION: UnityMain
08-21 12:36:11.833 29189 29211 E AndroidRuntime: Process: com.XXXStudio.TestAR, PID: 29189
08-21 12:36:11.833 29189 29211 E AndroidRuntime: java.lang.Error: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
08-21 12:36:11.833 29189 29211 E AndroidRuntime: Version '2019.4.29f1 (0eeae20b1d82)', Build type 'Release', Scripting Backend 'il2cpp', CPU 'arm64-v8a'
08-21 12:36:11.833 29189 29211 E AndroidRuntime: Build fingerprint: 'HTC/htc_thudugl_00709/htc_thudugl:10/QKQ1.200927.002/1.02.709.2:user/release-keys'
08-21 12:36:11.833 29189 29211 E AndroidRuntime: Revision: '0'
08-21 12:36:11.833 29189 29211 E AndroidRuntime: ABI: 'arm64'
08-21 12:36:11.833 29189 29211 E AndroidRuntime: Timestamp: 2021-08-21 12:36:11+0800
08-21 12:36:11.833 29189 29211 E AndroidRuntime: pid: 29189, tid: 29760, name: ImageReader-192  
08-21 12:36:11.833 29189 29211 E AndroidRuntime: uid: 10213
08-21 12:36:11.833 29189 29211 E AndroidRuntime: signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x8
08-21 12:36:11.833 29189 29211 E AndroidRuntime: Cause: null pointer dereference
08-21 12:36:11.833 29189 29211 E AndroidRuntime:     x0  000000775214df80  x1  00000076f9e23870  x2  00000075d26ba6e2  x3  0000000000000018
08-21 12:36:11.833 29189 29211 E AndroidRuntime:     x4  0000000000000070  x5  00000075d25aea8a  x6  00000075d25aea8a  x7  00000000070a8a80
08-21 12:36:11.833 29189 29211 E AndroidRuntime:     x8  0000000000000000  x9  e1d73f7a8869a390  x10 0000000000000000  x11 00000000ffffffff
08-21 12:36:11.833 29189 29211 E AndroidRuntime:     x12 0000007578c8eaf0  x13 00000076144fad10  x14 00000076144fad00  x15 00000076144fad00
08-21 12:36:11.833 29189 29211 E AndroidRuntime:     x16 00000077e5afd8f0  x17 00000077e5aef080  x18 00000075693f8000  x19 00000076f9e23aa8
08-21 12:36:11.833 29189 29211 E AndroidRuntime:     x20 00000076142817e0  x21 00000075665327b0  x22 00000076f9e24020  x23 00000076f9e23bc0
08-21 12:36:11.833 29189 29211 E AndroidRuntime:     x24 00000076f9e24020  x25 00000076f9e23d50  x26 00000076f9e24020  x27 0000007587c60020
08-21 12:36:11.833 29189 29211 E AndroidRuntime:     x28 000000756c6c3700  x29 00000076f9e23b10
08-21 12:36:11.833 29189 29211 E AndroidRuntime:     sp  00000076f9e23990  lr  00000075d2ee0254  pc  00000075d2ee028c
08-21 12:36:11.833 29189 29211 E AndroidRuntime: 
08-21 12:36:11.833 29189 29211 E AndroidRuntime: backtrace:
08-21 12:36:11.833 29189 29211 E AndroidRuntime:       #00 pc 0000000000bd528c  /data/app/com.google.ar.core-HBY2br3q7H0pzejdcA8RBg==/base.apk (BuildId: eb946242684b89679284aac531faba1f)
08-21 12:36:11.833 29189 29211 E AndroidRuntime:       #01 pc 0000000000bd4ed4  /data/app/com.google.ar.core-HBY2br3q7H0pzejdcA8RBg==/base.apk (BuildId: eb946242684b89679284aac531faba1f)
08-21 12:36:11.833 29189 29211 E AndroidRuntime:       #02 pc 0000000000bdd87c  /data/app/com.google.ar.core-HBY2br3q7H0pzejdcA8RBg==/base.apk (BuildId: eb946242684b89679284aac531faba1f)
08-21 12:36:11.833 29189 29211 E AndroidRuntime:       #03 pc 0000000000028970  /system/lib64/libmediandk.so (BuildId: f14ffb179eb46c5d95c132b2c5050781)
08-21 12:36:11.833 29189 29211 E AndroidRuntime:       #04 pc 0000000000016930  /system/lib64/libstagefright_foundation.so (android::AHandler::deliverMessage(android::sp<android::AMessage> const&)+48) (BuildId: 843e7f193d393067ac620c6316979b94)
08-21 12:36:11.833 29189 29211 E AndroidRuntime:       #05 pc 000000000001a6e0  /system/lib64/libstagefright_foundation.so (android::AMessage::deliver()+100) (BuildId: 843e7f193d393067ac620c6316979b94)
08-21 12:36:11.833 29189 29211 E AndroidRuntime:       #06 pc 0000000000017378  /system/lib64/libstagefright_foundation.so (android::ALooper::loop()+560) (BuildId: 843e7f193d393067ac620c6316979b94)
08-21 12:36:11.833 29189 29211 E AndroidRuntime:       #07 pc 00000000000135ec  /system/lib64/libutils.so (android::Thread::_threadLoop(void*)+224) (BuildId: dab3f7a95f2023784757ab4f652ae37e)
08-21 12:36:11.833 29189 29211 E AndroidRuntime:       #08 pc 00000000000c2bd8  /system/lib64/libandroid_runtime.so (android::AndroidRuntime::javaThreadShell(void*)+140) (BuildId: 63ef97712049bbaf0149ba2d97c5e2b1)
08-21 12:36:11.833 29189 29211 E AndroidRuntime:       #09 pc 00000000000e68a0  /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+36) (BuildId: 1f1dcc5892d50cc3e093ea733dc69025)
08-21 12:36:11.833 29189 29211 E AndroidRuntime:       #10 pc 0000000000084b6c  /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64) (BuildId: 1f1dcc5892d50cc3e093ea733dc69025)
08-21 12:36:11.833 29189 29211 E AndroidRuntime: 
08-21 12:36:11.833 29189 29211 E AndroidRuntime:    at base.0xbd528c(Native Method)
08-21 12:36:11.833 29189 29211 E AndroidRuntime:    at base.0xbd4ed4(Native Method)
08-21 12:36:11.833 29189 29211 E AndroidRuntime:    at base.0xbdd87c(Native Method)
08-21 12:36:11.833 29189 29211 E AndroidRuntime:    at libmediandk.0x28970(Native Method)
08-21 12:36:11.833 29189 29211 E AndroidRuntime:    at libstagefright_foundation.android::AHandler::deliverMessage(android::sp<android::AMessage> const&)(deliverMessage:48)
08-21 12:36:11.833 29189 29211 E AndroidRuntime:    at libstagefright_foundation.android::AMessage::deliver()(deliver:100)
08-21 12:36:11.833 29189 29211 E AndroidRuntime:    at libstagefright_foundation.android::ALooper::loop()(loop:560)
08-21 12:36:11.833 29189 29211 E AndroidRuntime:    at libutils.android::Thread::_threadLoop(void*)(_threadLoop:224)
08-21 12:36:11.833 29189 29211 E AndroidRuntime:    at libandroid_runtime.android::AndroidRuntime::javaThreadShell(void*)(javaThreadShell:140)
08-21 12:36:11.833 29189 29211 E AndroidRuntime:    at libc.__pthread_start(void*)(__pthread_start:36)
08-21 12:36:11.833 29189 29211 E AndroidRuntime:    at libc.__start_thread(__start_thread:64)
08-21 12:36:11.833   793   793 E ANDR-PERF-MPCTL: Active req limit reached, No optimizations performed

Any help would be greatly appreciated.

Upvotes: 1

Views: 1669

Answers (2)

yuki8819
yuki8819

Reputation: 11

We had a similar issue with ARCore XR [email protected], it crashes when I unload the AR scene.

According to the ARCore XR Plugin changelog: https://docs.unity3d.com/Packages/[email protected]/changelog/CHANGELOG.html at 4.2.0-pre.9, there's:

Fixed a crash (which could also appear as a hang) when pausing or resuming a session in a development build.

Which appears to be the issue that I got, and upgrading to 4.2.0 solved my issue, but it requires Unity 2020 as well.

Upvotes: 1

kjyv
kjyv

Reputation: 616

We get exactly this when we disable image tracking while in AR. Currently investigating to try and find a workaround.

Upvotes: 0

Related Questions