渲染期间遇到EGL错误12291 EGL_BAD_ALLOC

时间:2016-06-01 12:36:10

标签: android

我有一个动态壁纸应用程序处理图像。我在Play商店中收到了一些崩溃报告(但没有在fabric.io中),这个堆栈跟踪:

*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
Build fingerprint: 'samsung/hero2ltexx/hero2lte:6.0.1/MMB29K/G935FXXU1APDN:user/release-keys'
Revision: '9'
ABI: 'arm64'
pid: 15250, tid: 15331, name: RenderThread  >>> com.xxxx.xxxxx <<<
signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
Abort message: 'Encountered EGL error 12291 EGL_BAD_ALLOC during rendering'
    x0   0000000000000000  x1   0000000000003be3  x2   0000000000000006  x3   0000000000000000
    x4   0000000000000000  x5   0000000000000001  x6   0000000000000000  x7   0000000000000000
    x8   0000000000000083  x9   fefeff7e6032ce0b  x10  7f7f7f7f7f7fff7f  x11  0101010101010101
    x12  0000000000000010  x13  0000007f6f425bdc  x14  0000000000000001  x15  000000000000000f
    x16  0000007f9422f568  x17  0000007f941c23b8  x18  0000007f945cf720  x19  0000007f6f426500
    x20  0000007f6f426440  x21  0000000000000019  x22  0000000000000006  x23  0000007f6132f6c0
    x24  0000007f6132e800  x25  0000007f614fd7b0  x26  0000000000000002  x27  0000007f70602bb0
    x28  0000007f6eb58c10  x29  0000007f6f425b80  x30  0000007f941bfb54
    sp   0000007f6f425b80  pc   0000007f941c23c0  pstate 0000000020000000

backtrace:
    #00 pc 00000000000693c0  /system/lib64/libc.so (tgkill+8)
    #01 pc 0000000000066b50  /system/lib64/libc.so (pthread_kill+68)
    #02 pc 0000000000023990  /system/lib64/libc.so (raise+28)
    #03 pc 000000000001e2c0  /system/lib64/libc.so (abort+60)
    #04 pc 000000000000cf04  /system/lib64/libcutils.so (__android_log_assert+236)
    #05 pc 000000000002be6c  /system/lib64/libhwui.so
    #06 pc 00000000000284f4  /system/lib64/libhwui.so
    #07 pc 000000000002aa68  /system/lib64/libhwui.so
    #08 pc 000000000002ef50  /system/lib64/libhwui.so (_ZN7android10uirenderer12renderthread12RenderThread10threadLoopEv+124)
    #09 pc 000000000001699c  /system/lib64/libutils.so (_ZN7android6Thread11_threadLoopEPv+208)
    #10 pc 0000000000095110  /system/lib64/libandroid_runtime.so (_ZN7android14AndroidRuntime15javaThreadShellEPv+96)
    #11 pc 00000000000161ec  /system/lib64/libutils.so
    #12 pc 0000000000065fa0  /system/lib64/libc.so (_ZL15__pthread_startPv+52)
    #13 pc 000000000001ee6c  /system/lib64/libc.so (__start_thread+16)

我在互联网上找不到很多信息......它似乎只是一个三星问题。

1 个答案:

答案 0 :(得分:3)

我从服务中遇到同样的问题,当服务被破坏时崩溃,onDestroy删除WindowManager上的一些视图。

我找到的解决方案是使用 removeViewImmediate 而不是 removeView

删除视图
Function RangeBitOr(rng As Range) As LongLong
Dim i As LongLong
Dim cell As Range

i = 0
For Each cell In rng
    i = i Or CLngLng(cell.Value)
Next cell

RangeBitOr = i

End Function

替换为

@Override
public void onDestroy() {
  super.onDestroy();
  WindowManager windowManager = (WindowManager) getSystemService(WINDOW_SERVICE);
  windowManager.removeView(view);
}

https://developer.android.com/reference/android/view/WindowManager.html#removeViewImmediate(android.view.View)

不知道为什么这会解决它,文档很轻......

只发生在使用Android 6.0.1(主要是S6和S7)的三星设备上。