Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-90578

Native OpenGL crashes on Android



    • Bug
    • Resolution: Incomplete
    • P1: Critical
    • None
    • 5.12.10, 5.15.2
    • Quick: SceneGraph
    • None
    • Android
    • 2022wk24FOQtforAndroid, 2022wk32FOQtforAndroid, 2022wk42FOQtforAndroid


      I am seeing a lot of native OpenGL crashes in my Google Play Console for all my Qt Quick apps using Qt5.15.x and Qt5.12.x . In some of these cases I suspect OpenGL compatibility issues. At the AndroidManifest.xml level compatibility checks could be set up. For e.g. <supports-gl-texture/> or
      <uses-feature android:glEsVersion="0x........" android:required="true" /> . But maybe there is a better solution that doesn't require filtering out devices...

      Here are the 2 main OpenGL crashes happening on Android. They account for more than 1/2 of the crashes I'm seeing in my Google Play Console.

      1) __egl_platform_color_conversion_needed

        #00  pc 0000000000012564  /vendor/lib/egl/libGLES_mali.so (__egl_platform_color_conversion_needed+4)
        #00  pc 0000000000012178  /vendor/lib/egl/libGLES_mali.so (__egl_platform_surface_post_processing_needed_android+12)
        #00  pc 00000000000712ec  /vendor/lib/egl/libGLES_mali.so (__egl_mali_start_soft_job+112)
        #00  pc 000000000006b314  /vendor/lib/egl/libGLES_mali.so (__egl_mali_post_color_buffer+1112)
        #00  pc 000000000006ad50  /vendor/lib/egl/libGLES_mali.so (__egl_mali_post_to_window_surface+104)
        #00  pc 000000000006a054  /vendor/lib/egl/libGLES_mali.so (_egl_swap_buffers+392)
        #00  pc 0000000000068108  /vendor/lib/egl/libGLES_mali.so (eglSwapBuffers+72)
        #00  pc 000000000000ca45  /system/lib/libEGL.so (eglSwapBuffersWithDamageKHR+236)
        #00  pc 0000000000089cc7  /lib/arm/libplugins_platforms_qtforandroid_armeabi-v7a.so (QEGLPlatformContext::swapBuffers(QPlatformSurface*))

      Only happens on devices with OpenGL ES version 2.0, Mediatek chips, <=1,024 MB RAM, Android 8.1 to Android 10. I suspect that this specific crash is limited to Mediatek - Android Go devices. I wasn't able to reproduce this crash as I do not have an Android Go device.

      Maybe specifying android:glEsVersion="0x00030000" in the Android Manifest would fix the issue. But I have a Huawei P8 Lite running OpenGL ES 2.0 on a Kirin chip - had no issues with it. So doing this might filter out some good devices. Is there a better approach?

      2) android::RefBase::incStrong

        #00  pc 000000000000f608  /system/lib64/libutils.so (android::RefBase::incStrong(void const*) const+8)
        #00  pc 0000000000009bc4  /vendor/lib64/egl/eglSubDriverAndroid.so
        #00  pc 00000000000098fc  /vendor/lib64/egl/eglSubDriverAndroid.so
        #00  pc 0000000000008aec  /vendor/lib64/egl/eglSubDriverAndroid.so
        #00  pc 000000000022d300  /vendor/lib64/egl/libGLESv2_adreno.so
        #00  pc 000000000022ac4c  /vendor/lib64/egl/libGLESv2_adreno.so
        #00  pc 0000000000129a48  /vendor/lib64/egl/libGLESv2_adreno.so
        #00  pc 000000000012a998  /vendor/lib64/egl/libGLESv2_adreno.so
        #00  pc 0000000000164d7c  /vendor/lib64/egl/libGLESv2_adreno.so
        #00  pc 000000000018a1e8  /lib/arm64/libQt5Quick.so (QSGBatchRenderer::Renderer::renderBatches()+392)


        #00  pc 000000000000f5f8  /system/lib64/libutils.so (android::RefBase::incStrong(void const*) const+8)
        #00  pc 0000000000a38928  /vendor/lib64/egl/libGLES_mali.so
        #00  pc 0000000000a4995c  /vendor/lib64/egl/libGLES_mali.so
        #00  pc 0000000000a497a0  /vendor/lib64/egl/libGLES_mali.so
        #00  pc 0000000000a71b24  /vendor/lib64/egl/libGLES_mali.so
        #00  pc 0000000000ad3bac  /vendor/lib64/egl/libGLES_mali.so
        #00  pc 0000000000a70a28  /vendor/lib64/egl/libGLES_mali.so
        #00  pc 0000000000a6f358  /vendor/lib64/egl/libGLES_mali.so
        #00  pc 0000000000a66a2c  /vendor/lib64/egl/libGLES_mali.so (glClear+124)
        #00  pc 000000000018a1e8  /lib/arm64/libQt5Quick.so (QSGBatchRenderer::Renderer::renderBatches()+392)

      This bug doesn't seem limited to a specific OpenGL version, Android API level, Android NDK, Java version or system on chip. Nor it is limited to Qt. Check: https://hg.libsdl.org/SDL/rev/e021e083c42c - it comes with a complete stack trace. It also hints the cause, a way to reproduce the bug and a fix. However I haven't been successful in reproducing the bug on my own ... yet. Maybe it's a random rare crash.


        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.



              qtandroidteam Qt Android Team
              adrian.gabureanu Adrian Gabureanu
              3 Vote for this issue
              8 Start watching this issue



                Gerrit Reviews

                  There are no open Gerrit changes