tgkill - native error on Android 8.0 Samsung S8

后端 未结 2 1142
遥遥无期
遥遥无期 2020-12-30 02:43

Recently I started getting Android native crashes (reported in Google Play vitals). They happen only on Samsung Galaxy S8 or S8+ phones with Android 8.

According to

2条回答
  •  长发绾君心
    2020-12-30 03:21

    Logcat analysis

    This is where your code is crashing EglManager.cpp:

    void EglManager::damageFrame(const Frame& frame, const SkRect& dirty) {
    #ifdef EGL_KHR_partial_update
        if (EglExtensions.setDamage && mSwapBehavior == SwapBehavior::BufferAge) {
            EGLint rects[4];
            frame.map(dirty, rects);
            if (!eglSetDamageRegionKHR(mEglDisplay, frame.mSurface, rects, 1)) {
                LOG_ALWAYS_FATAL("Failed to set damage region on surface %p, error=%s",
                        (void*)frame.mSurface, egl_error_str());
            }
        }
    #endif
    }
    

    Called from SkiaOpenGLPipeline.cpp:

    SkiaOpenGLPipeline::draw //method
    
    mEglManager.damageFrame(frame, dirty);
    

    Why ?

    It seems you may have a 'Failed to set damage region on surface', probably after onResume() from screen rotation or onPause() in your Activity. See fixing-common-android-lifecycle-issues

    Fixes

    I started getting this crash after updating to Oreo, every-time I started my app, with the message "Failed to set damage region on surface" followed by all those lines about libhwui.so and EglManager And it turned out that, for some obscure reason, it was somehow caused by a totally unrelated problem in my app (too many open files [forgot to close them]). After fixing this my own bug, no more crashes on the EglManager. [also note that crashes only happen if hardware acceleration is turned on] Ref: issuetracker.google.com { issue 70259031}

    See also: eglCreateWindowSurface {SO problem}, Logging, native-crashes-on-abort-in-developer-console-with-oreo-8-1 {SO problem}, hardware-acceleration, opengl, GLSurfaceView

提交回复
热议问题