【问题标题】:Unity ARFoundation App Crash - null pointer dereference issueUnity ARFoundation App Crash - 空指针取消引用问题
【发布时间】:2021-08-24 07:24:39
【问题描述】:

我正在使用 AR Foundation 4.0.8 和 ARCore XR Plugin 4.0.8 开发统一 AR 项目。 Unity 版本为 2019.4.29f1。 测试设备是装有 Android 10 的 HTC Desired 20。 执行超过 30 分钟时,应用可能会崩溃。

来自 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

任何帮助将不胜感激。

【问题讨论】:

标签: android unity3d crash augmented-reality


【解决方案1】:

我们在使用 ARCore XR Plugin@4.1.7 时遇到了类似的问题,当我卸载 AR 场景时它崩溃了。

根据 ARCore XR 插件更新日志:https://docs.unity3d.com/Packages/com.unity.xr.arcore@4.2/changelog/CHANGELOG.html 在 4.2.0-pre.9 中,有:

修复了在开发构建中暂停或恢复会话时的崩溃(也可能显示为挂起)。

这似乎是我遇到的问题,升级到 4.2.0 解决了我的问题,但它也需要 Unity 2020。

【讨论】:

    【解决方案2】:

    当我们在 AR 中禁用图像跟踪时,我们得到的正是这一点。目前正在调查以尝试找到解决方法。

    【讨论】:

      猜你喜欢
      • 2021-08-04
      • 2013-07-04
      • 2013-02-20
      • 2022-01-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-08-06
      相关资源
      最近更新 更多