Repository navigation
Flutter Crashes OpenGL on MediaTek #166248
Copy link
Copy link
Closed
Labels
P1High-priority issues at the top of the work listHigh-priority issues at the top of the work listc: crashStack traces logged to the consoleStack traces logged to the consolee: OS-version specificAffects only some versions of the relevant operating systemAffects only some versions of the relevant operating systeme: device-specificOnly manifests on certain devicesOnly manifests on certain devicesengineflutter/engine related. See also e: labels.flutter/engine related. See also e: labels.platform-androidAndroid applications specificallyAndroid applications specificallyslimpellerEngine binary size reduction. go/slimpellerEngine binary size reduction. go/slimpellerteam-engineOwned by Engine teamOwned by Engine teamtriaged-engineTriaged by Engine teamTriaged by Engine team
Description
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!Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P1High-priority issues at the top of the work listHigh-priority issues at the top of the work listc: crashStack traces logged to the consoleStack traces logged to the consolee: OS-version specificAffects only some versions of the relevant operating systemAffects only some versions of the relevant operating systeme: device-specificOnly manifests on certain devicesOnly manifests on certain devicesengineflutter/engine related. See also e: labels.flutter/engine related. See also e: labels.platform-androidAndroid applications specificallyAndroid applications specificallyslimpellerEngine binary size reduction. go/slimpellerEngine binary size reduction. go/slimpellerteam-engineOwned by Engine teamOwned by Engine teamtriaged-engineTriaged by Engine teamTriaged by Engine team
Type
Projects
- StatusShow more project fieldsDone
Activity
danagbemava-nc commentedon Mar 31, 2025
Hi @garthvs, what device(s) are you seeing this issue on? What version(s) of android are they running?
Crash logs looks similar to #162147
garthvs commentedon Mar 31, 2025
Here are all the devices and the chipsets so far:
Redmi dandelion Mediatek MT6762
TECNO TECNO-KD7 Mediatek MT6762d
Redmi cattail Mediatek MT6765
Redmi angelica Mediatek MT6765
Nokia ROON_sprout Mediatek MT6762
TECNO TECNO-LC8 Mediatek MT6762
They are all running Android 10 (SDK 29).
danagbemava-nc commentedon Apr 1, 2025
Hi @garthvs, do you use any platform views in your app and are you using the impeller or skia rendering engine?
Inakitajes commentedon Apr 1, 2025
Same here... with latest stable 3.29.2.
Mainly Android 10 MediaTek devices. Lots of problems lately with the Flutter stable channel. Every update fixes some issues while others arise... hoping for a solid stable version soon, we are about to pass the abnormal behavior threshold on Android.
garthvs commentedon Apr 1, 2025
We are using the default Flutter engine, so I think impeller. I don't know about platform views unfortunately.
szabot0412 commentedon Apr 1, 2025
Hi,
I'm facing the same issue.
Is downgrading to 3.27.4 solve the problem?
(I don't have a real device with this issue, only see the error logs in Play Console)
danagbemava-nc commentedon Apr 2, 2025
Thanks for the update. Labeling this for further investigation. Might be a duplicate of #162147
138 remaining items
zanderso commentedon Apr 1, 2026
zanderso commentedon Apr 1, 2026
@jason-simmons @gmackall Could you please take a look at the message from @misterGFTT above and provide thoughts?
kailane1231ho-code commentedon Apr 1, 2026
jason-simmons commentedon Apr 1, 2026
The MediaTek-specific issue discussed in this thread is different from what is described in #166248 (comment)
I can reproduce the MediaTek issue on a Xiaomi Redmi 9A by running the Wonderous app with a release build of the Flutter engine. The crash happens when scrolling through the part of the app that shows a map using a platform view.
When it happens, the engine is using the Impeller OpenGL ES back end. The crash is a SIGSEGV/null pointer dereference in a MediaTek/PowerVR graphics driver library.
In this environment I have not seen any cases where
PlatformViewAndroidJNIImpl::ImageGetHardwareBuffergets an exception from the call into Java and aborts. The crash sometimes occurs before any calls toPlatformViewAndroidJNIImpl::ImageGetHardwareBufferare made.misterGFTT commentedon Apr 2, 2026
StarProxima commentedon Apr 18, 2026
Seeing the same crash on Flutter 3.41.2 (so it's still present well past 3.29.2). Reporting to add fresh signal since the original repro is hard without hardware.
Scope (28 days): 23 affected users, 52 events, still occurring within the last few hours.
Common attributes across all samples:
libGLESv2_mtk.so/libGLES_meow.soDevices seen:
angelica/angelican)dandelion)Two variants of the same crash observed:
Variant A - via
EglManager::destroySurface→SkiaOpenGLPipeline::setSurface→CanvasContext::destroy()(happens on context teardown):Variant B - via a generic
WorkQueuetask (no destroySurface in the frame), same vendor stack below:64-bit sample (TCL TAB 10s, same signature in the 64-bit vendor libs):
Note that all frames above the Flutter engine are in the Android platform / MediaTek vendor drivers - none of the frames are in
libflutter.so. This looks like something changed in how the engine drives the platformRenderThread(likely around Surface lifecycle / PlatformView embedding), which consistently trips a latent bug in the MediaTek PowerVR EGL driver on Android 10 only. Happy to provide more samples or test a candidate fix.gaaclarke commentedon Jun 1, 2026
I tried 3 things that didn't work:
jtmcdole commentedon Jun 5, 2026
This just landed as master: #187404
gaaclarke commentedon Jun 5, 2026
#187404 should have marked this fixed.
kisrar commentedon Jun 15, 2026
Hi @gaaclarke , first of all, thanks a lot for fixing the bug as it was open for more than a year.
Any timeline when this fix will be available in stable branch ?
Because I tried to use master branch, but that was breaking some functionality of Google login, hence I switched back to stable branch and waiting for this fix release in stable branch.
gaaclarke commentedon Jun 15, 2026
This will follow the standard release process and not be cherry-picked. If you think you've found an problem, please file a new issue.
github-actions commentedon Jul 14, 2026
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.