【问题标题】:Unity Android signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0unity Android 信号 11(SIGSEGV),代码 1(SEGV_MAPERR),故障地址 0x0
【发布时间】:2018-05-16 19:53:15
【问题描述】:

我正在使用 Unity 2018.1.0f2 构建一个 Android 应用程序,并在运行它时遇到某种分段错误。确切的错误如下:

05-16 20:54:11.834: E/SamsungIME(9413): <AbstractKeyboardView> - onDraw() called
05-16 20:54:12.142: E/ViewRootImpl(17850): sendUserActionEvent() mView == null
05-16 20:54:12.146: E/SKBD KeyboardInfoUtils(9413): getInstance start
05-16 20:54:12.146: E/SKBD KeyboardInfoUtils(9413): sendSIPInformation state:6  isAbstractKeyboardView : true
05-16 20:54:12.151: E/SKBD KeyboardInfoUtils(9413): sending null keyboardInfo as SIP is closed
05-16 20:54:15.401: A/libc(17850): Fatal signal 11 (SIGSEGV), code 1, fault addr 0x0 in tid 17865 (UnityMain)
05-16 20:54:15.401: A/libc(17850): [ 05-16 20:54:15.407  3096: 3096 W/         ]
05-16 20:54:15.401: A/libc(17850): debuggerd: handling request: pid=17850 uid=10350 gid=10350 tid=17865
05-16 20:54:15.633: A/DEBUG(17987): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
05-16 20:54:15.634: A/DEBUG(17987): Build fingerprint: 'samsung/heroltexx/herolte:7.0/NRD90M/G930FXXS2DRDI:user/release-keys'
05-16 20:54:15.635: A/DEBUG(17987): Revision: '8'
05-16 20:54:15.635: A/DEBUG(17987): ABI: 'arm'
05-16 20:54:15.635: A/DEBUG(17987): pid: 17850, tid: 17865, name: UnityMain  >>> de.zoomapp.zoom <<<
05-16 20:54:15.635: A/DEBUG(17987): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0
05-16 20:54:15.636: A/DEBUG(17987):     r0 00000000  r1 c7ad20b0  r2 cf9ffc24  r3 efc62308
05-16 20:54:15.637: A/DEBUG(17987):     r4 c7ad20b0  r5 c7ad20cc  r6 ffffffff  r7 00000000
05-16 20:54:15.637: A/DEBUG(17987):     r8 00000000  r9 ee67ecb4  sl ee67ebc8  fp ee67e5e8
05-16 20:54:15.637: A/DEBUG(17987):     ip c7ad20b0  sp ee67e5c8  lr cf9ffc3c  pc f2386338  cpsr a00e0030
05-16 20:54:15.651: A/DEBUG(17987): backtrace:
05-16 20:54:15.652: A/DEBUG(17987):     #00 pc 00018338  /system/lib/libc.so (strcmp+47)
05-16 20:54:15.652: A/DEBUG(17987):     #01 pc 0014bc38  /data/app/de.zoomapp.zoom-1/lib/arm/libunity.so
05-16 20:54:15.652: A/DEBUG(17987):     #02 pc 00008484  <anonymous:c7275000>
05-16 20:54:17.518: E/audit(4645): type=1701 audit(1526496857.505:4791): auid=4294967295 uid=10350 gid=10350 ses=4294967295 subj=u:r:untrusted_app:s0:c512,c768 pid=17865 comm="UnityMain" exe="/system/bin/app_process32" sig=11
05-16 20:54:17.562: E/lowmemorykiller(3180): Error writing /proc/17850/oom_score_adj; errno=22

我尝试以横向和纵向模式提供每个屏幕。当用户在登录屏幕并单击登录按钮时,会向服务器发送 UnityWebRequest。如果服务器以肯定的结果响应,UI 转换打开一个加载屏幕,在后台发送多个 UnityWebRequest 以检索有关要显示的图标和图像的更多信息。加载完成后,会显示主菜单,并且在后台游戏已经加载,但已暂停。这个游戏只显示了一堆图像并且非常静态,这就是我在这里不详细描述它的原因。 如果用户在单击登录后立即将手机从纵向旋转到横向并且显示加载屏幕,则会发生上述崩溃。我可以在我的三星 Galaxy S7 上一直重现这个错误,但无法在一个干净的项目中做一个最小的例子。 产生网络请求可能是个问题?我将日志消息放在我的代码中,在崩溃之前我经常看到一些 web 请求的 yield 语句。我有更多的协程异步加载一些图像。如果我注释掉所有协程它运行良好,但我不知道这是由于加载运行非常快还是协程导致问题。 然后我在互联网上搜索,发现使用 addr2line 工具。它为地址 0014bc38 生成:

operator delete[](void*, std::nothrow_t const&)

我找不到确切的问题。我希望也许有人能提示我如何搜索这个。 谢谢各位。

问候, 迈克尔

【问题讨论】:

    标签: android unity3d segmentation-fault


    【解决方案1】:

    地址为 0x0 的 SEG_MAPERR 是null pointer dereference

    删除空指针是有效的(并且应该用于 delete[] 运算符)。我怀疑你有某种竞争条件。当你删除或释放任何东西时放一些日志(尽管一切都是 GC...)

    此外,如果您找不到类似的内容,请检查 official bug trackersubmit a new bug。我怀疑它在将新窗口参数发送到应用程序时尝试访问空指针。

    【讨论】:

      猜你喜欢
      • 2018-05-29
      • 1970-01-01
      • 2020-07-19
      • 2021-11-01
      • 1970-01-01
      • 1970-01-01
      • 2022-12-20
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多