Skip to content

Flutter Crashes OpenGL on MediaTek #166248

Open
@garthvs

Description

@garthvs

Steps to reproduce

We are seeing an influx of crash reports on Google Play specific to Mediatek MT6762 and MT6765 devices since upgrading to the latest flutter version:

Flutter version 3.29.2
Dart version 3.7.2

I am trying to find a device with these chipsets so that I can try reproduce the issue.

*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
pid: 0, tid: 11979 >>> com.xxx.app <<<

backtrace:
  #00  pc 0x0000000000088a8c  /vendor/lib/egl/libGLESv2_mtk.so
  #01  pc 0x00000000000d4b69  /vendor/lib/egl/libGLESv2_mtk.so
  #02  pc 0x0000000000026cb7  /vendor/lib/egl/libGLESv2_mtk.so
  #03  pc 0x0000000000011883  /vendor/lib/libIMGegl.so (IMGeglMakeCurrent+3026)
  #04  pc 0x000000000001c5af  /vendor/lib/egl/libGLES_meow.so
  #05  pc 0x000000000000f8c7  /system/lib/libEGL.so (android::egl_display_t::makeCurrent(android::egl_context_t*, android::egl_context_t*, void*, void*, void*, void*, void*, void*)+170)
  #06  pc 0x0000000000015ccb  /system/lib/libEGL.so (android::eglMakeCurrentImpl(void*, void*, void*, void*)+318)
  #07  pc 0x00000000002a01dd  /system/lib/libhwui.so (android::uirenderer::renderthread::EglManager::makeCurrent(void*, int*, bool)+64)
  #08  pc 0x0000000000317dcf  /system/lib/libhwui.so (android::uirenderer::renderthread::EglManager::destroySurface(void*)+22)
  #09  pc 0x0000000000317bff  /system/lib/libhwui.so (android::uirenderer::skiapipeline::SkiaOpenGLPipeline::setSurface(ANativeWindow*, android::uirenderer::renderthread::SwapBehavior, android::uirenderer::renderthread::ColorMode, unsigned int)+30)
  #10  pc 0x0000000000341005  /system/lib/libhwui.so (android::uirenderer::renderthread::CanvasContext::setSurface(android::sp<android::Surface>&&)+164)
  #11  pc 0x000000000019920d  /system/lib/libhwui.so (_ZNSt3__110__function6__funcIZN7android10uirenderer12renderthread11RenderProxy10setSurfaceERKNS2_2spINS2_7SurfaceEEEE3$_6NS_9allocatorISB_EEFvvEEclEv$a651803144434c688dcacf747223d8a2+14)
  #12  pc 0x00000000002b1aef  /system/lib/libhwui.so (android::uirenderer::WorkQueue::process()+158)
  #13  pc 0x00000000002b194d  /system/lib/libhwui.so (android::uirenderer::renderthread::RenderThread::threadLoop()+72)
  #14  pc 0x000000000000d8b3  /system/lib/libutils.so (android::Thread::_threadLoop(void*)+182)
  #15  pc 0x00000000000a6293  /apex/com.android.runtime/lib/bionic/libc.so (__pthread_start(void*)+20)
  #16  pc 0x0000000000060803  /apex/com.android.runtime/lib/bionic/libc.so (__start_thread+30)

Expected results

No crashes.

Actual results

Crash reports on Google Play specific to Mediatek MT6762 and MT6765 devices.

Code sample

Code sample
[Paste your code here]

Screenshots or Video

Screenshots / Video demonstration

[Upload media here]

Logs

Logs
[Paste your logs here]

Flutter Doctor output

Doctor output
[√] Flutter (Channel stable, 3.29.2, on Microsoft Windows [Version 10.0.26100.3624], locale en-ZA) [520ms]
    • Flutter version 3.29.2 on channel stable at C:\Flutter\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision c236373904 (3 weeks ago), 2025-03-13 16:17:06 -0400
    • Engine revision 18b71d647a
    • Dart version 3.7.2
    • DevTools version 2.42.3

[√] Windows Version (11 Home Single Language 64-bit, 24H2, 2009) [3.6s]

[√] Android toolchain - develop for Android devices (Android SDK version 35.0.1) [2.5s]
    • Android SDK at C:\Users\xxx\AppData\Local\Android\sdk
    • Platform android-35, build-tools 35.0.1
    • Java binary at: C:\\Program Files\\Microsoft\\jdk-17.0.14.7-hotspot\bin\java
      This JDK is specified in your Flutter configuration.
      To change the current JDK, run: `flutter config --jdk-dir="path/to/jdk"`.
    • Java version OpenJDK Runtime Environment Microsoft-10800295 (build 17.0.14+7-LTS)
    • All Android licenses accepted.

[√] Chrome - develop for the web [175ms]
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.13.3) [174ms]
    • Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
    • Visual Studio Community 2022 version 17.13.35828.75
    • Windows 10 SDK version 10.0.26100.0

[√] Android Studio (version 2024.2) [19ms]
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 21.0.5+-13047016-b750.29)

[√] VS Code (version 1.98.2) [17ms]
    • VS Code at C:\Users\xxx\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.106.0

[√] Connected device (3 available) [303ms]
    • Windows (desktop) • windows • windows-x64    • Microsoft Windows [Version 10.0.26100.3624]
    • Chrome (web)      • chrome  • web-javascript • Google Chrome 134.0.6998.178
    • Edge (web)        • edge    • web-javascript • Microsoft Edge 133.0.3065.69

[√] Network resources [681ms]
    • All expected network resources are available.

• No issues found!

Metadata

Metadata

Assignees

Labels

P1High-priority issues at the top of the work listc: crashStack traces logged to the consolee: OS-version specificAffects only some versions of the relevant operating systeme: device-specificOnly manifests on certain devicesengineflutter/engine repository. See also e: labels.platform-androidAndroid applications specificallyteam-engineOwned by Engine teamtriaged-engineTriaged by Engine team

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions