Skip to content

[Impeller] EGL_BAD_ACCESS after returning to the foreground, then no frames at all (Mali-G57, OpenGLES) #195424

Open

Description

@yx-wh

Steps to reproduce

Steps to reproduce

  1. Open the app, look something up (a WebView with dictionary content is on
    screen), then leave it — the task stays in recents, the activity is stopped
    but not destroyed.
  2. From another app, share text to this app. The share entry is an invisible
    ProcessTextActivity that starts the existing singleTop MainActivity
    with NEW_TASK | CLEAR_TOP | SINGLE_TOP, then finishes.
  3. The window comes back black, and stays black.

It happens on roughly every second such entry on this device, and never after a
plain home → recents → tap cycle. See the attached black.mp4 (the black
segment starts around 16.5 s) and ok.mp4 for the same steps on the same device
with EnableImpeller=false, where it works.

App: https://github.com/mumu-lhl/Ciyue (open source, Flutter 3.47.5, release build)

Expected results

Expected results

The UI redraws as before, as it does in ok.mp4.

Actual results

Actual results

The window stays black for the rest of the process lifetime. The app is alive:
the UI thread runs, Dart receives the intent (the lookup the share asked for
does happen), back navigation responds.

ActivityTaskManager: START u0 {act=android.intent.action.PROCESS_TEXT ...
                    flg=0x34000000 cmp=.../MainActivity}
BufferQueueDebug: [SurfaceView[...MainActivity](BLAST)#400066]   <- new surface
E flutter: [ERROR:flutter/impeller/toolkit/egl/egl.cc(56)]
           EGL Error: Bad Access (12290) in .../impeller/toolkit/egl/context.cc:55
E flutter: [ERROR:flutter/shell/gpu/gpu_surface_gl_impeller.cc(76)]
           Could not make the context current to acquire the frame.
ActivityTaskManager: Displayed .../MainActivity: +85ms           <- "displayed"
(no BufferQueueProducer queueBuffer for that SurfaceView afterwards)

The system considers the window displayed (Displayed ... +85ms) while the
engine never submits another buffer.

On every resume that recovers, the engine logs a new context
(android_context_gl_impeller.cc(104): Using the Impeller rendering backend (OpenGLES).); in the failing resume that line is absent.

Isolation

Same app, same commit, same device; only the named line changes. Each row is
reproducible by toggling one line and rebuilding.

Build What differs Result
as shipped useHybridComposition: true in the InAppWebView settings black + EGL_BAD_ACCESS
A that line set to false (surface composition) renders
B WebView replaced by a Text (no platform view at all) renders
C whole Dart UI replaced by ten lines (Android shell and all plugins kept) renders
D EnableImpeller=false (Skia) renders

So Impeller, texture-layer hybrid composition and a real WebView are all
required: remove any one of the four and the app is fine.

Minimal reproduction attempt (negative result)

Two attempts, both with a singleTop activity and an invisible
ProcessTextActivity forwarding ACTION_PROCESS_TEXT:

  1. PlatformViewsService.initExpensiveAndroidView with a plain native
    TextView — no reproduction (16 cycles, no EGL errors).
  2. The real flutter_inappwebview 6.2.0-beta.3 with useHybridComposition: true, transparentBackground: true and baseUrl: http://ciyue.internal/,
    the app's own settings — no reproduction either.

Project: https://github.com/yx-wh/impeller-platform-view-repro

Remaining differences: the app's word view is a PageView, so several platform
views exist at the same time; the WebView loads through webViewAssetLoader
plus custom schemes (entry, gdlookup, sound); and the app does a large
startup (dictionaries, isolates) before the first frame. I am happy to bisect
along whichever you think is most likely.

Code sample

Code sample

The sample does not reproduce the failure — it is the closest reduction I
could reach. Full project:
https://github.com/yx-wh/impeller-platform-view-repro

The essential parts:

// lib/main.dart
class _ExpensivePlatformView extends StatelessWidget {
  const _ExpensivePlatformView();

  @override
  Widget build(BuildContext context) {
    return PlatformViewLink(
      viewType: "repro/view",
      surfaceFactory: (context, controller) => PlatformViewSurface(
        controller: controller,
        gestureRecognizers: const <Factory<OneSequenceGestureRecognizer>>{},
        hitTestBehavior: PlatformViewHitTestBehavior.opaque,
      ),
      onCreatePlatformView: (params) {
        return PlatformViewsService.initExpensiveAndroidView(
          id: params.id,
          viewType: params.viewType,
          layoutDirection: Directionality.of(context),
          creationParamsCodec: const StandardMessageCodec(),
          onFocus: () => params.onFocusChanged(true),
        )
          ..addOnPlatformViewCreatedListener(params.onPlatformViewCreated)
          ..create();
      },
    );
  }
}
// MainActivity.kt — singleTop, receives the forwarded intent
override fun onNewIntent(intent: Intent) {
    super.onNewIntent(intent)
    setIntent(intent)
    val text = intent.getCharSequenceExtra(Intent.EXTRA_PROCESS_TEXT)?.toString()
    if (text != null) channel?.invokeMethod("text", text)
}

// ProcessTextActivity.kt — invisible entry point
val intent = Intent(this, MainActivity::class.java).apply {
    action = Intent.ACTION_PROCESS_TEXT
    putExtra(Intent.EXTRA_PROCESS_TEXT, text)
    addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
    addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP or Intent.FLAG_ACTIVITY_SINGLE_TOP)
}
startActivity(intent)
finish()

Screenshots or Video

Screenshots / Video demonstration
  • black.mp4 — Impeller build: the window is black from ~16.5 s to ~21.2 s
    (only the status and navigation bars are drawn), then back navigation returns
    to the reader, so the process is alive.
  • ok.mp4 — same device, same steps, EnableImpeller=false: the UI renders.
  • black-frame.png / skia-frame.png — single frames from each clip.
Image Image

black:

black-small.mp4

ok:

ok-small.mp4

Logs

Logs
10-27 21:02:33.565   993   993 I BufferQueueProducer: [SurfaceView[...MainActivity](BLAST)#400048] ...
10-27 21:02:35.239  1623  2118 I ActivityTaskManager: START u0 {act=android.intent.action.PROCESS_TEXT typ=text/plain ...}
10-27 21:02:35.269  1623  1950 I ActivityTaskManager: START u0 {act=android.intent.action.PROCESS_TEXT flg=0x34000000 cmp=.../MainActivity}
10-27 21:02:35.305   993  1811 I BufferQueueDebug: [SurfaceView[...MainActivity](BLAST)#400066]       <- new surface
10-27 21:02:35.307 16463 16524 E flutter : [ERROR:flutter/impeller/toolkit/egl/egl.cc(56)] EGL Error: Bad Access (12290) in ../../../flutter/impeller/toolkit/egl/context.cc:55
10-27 21:02:35.319 16463 16524 E flutter : [ERROR:flutter/shell/gpu/gpu_surface_gl_impeller.cc(76)] Could not make the context current to acquire the frame.
10-27 21:02:35.337  1623  1641 I ActivityTaskManager: Displayed .../MainActivity: +85ms              <- "displayed"
(no BufferQueueProducer queueBuffer for that SurfaceView afterwards)

Full sessions attached:

  • impeller-black-full-round.txt — the failing run (app + system lines only)
  • skia-same-steps-ok.txt — identical steps with Skia, no failure

impeller-black-full-round.txt
skia-same-steps-ok.txt

Flutter Doctor output

Doctor output
[!] Flutter (Channel stable, 3.47.5, on Debian GNU/Linux forky/sid 7.2.12+deb14-amd64, locale en_US.UTF-8) [216ms]
    • Flutter version 3.47.5 on channel stable at /home/yx/flutter
    ! The flutter binary is not on your path. Consider adding /home/yx/flutter/bin to your path.
    ! The dart binary is not on your path. Consider adding /home/yx/flutter/bin to your path.
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 6a19cca564 (6 weeks ago), 2026-09-17 14:13:22 -0400
    • Engine revision af7e796e16
    • Dart version 3.13.4
    • DevTools version 2.60.0
    • Feature flags: enable-web, enable-linux-desktop, enable-macos-desktop, enable-windows-desktop, enable-android, enable-ios, cli-animations, enable-native-assets, enable-record-use, enable-swift-package-manager, omit-legacy-version-file, enable-lldb-debugging, enable-uiscene-migration
    • If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perform update checks and upgrades.

[✓] Android toolchain - develop for Android devices (Android SDK version 37.0.0) [2.7s]
    • Android SDK at /home/yx/android-sdk
    • Emulator version unknown
    • Platform android-37.0, build-tools 37.0.0
    • Java binary at: /usr/bin/java
      This JDK was found in the system PATH.
      To manually set the JDK path, use: `flutter config --jdk-dir="path/to/jdk"`.
    • Java version OpenJDK Runtime Environment (build 21.0.13-ea+8-1-Debian)
    • All Android licenses accepted.

[✗] Chrome - develop for the web (Cannot find Chrome executable at google-chrome) [42ms]
    ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.

[✓] Linux toolchain - develop for Linux desktop [389ms]
    • Debian clang version 21.1.8 (13)
    • cmake version 4.3.4
    • ninja version 1.13.2
    • pkg-config version 2.5.1
    • OpenGL core renderer: llvmpipe (LLVM 21.1.8, 256 bits) (X11)
    • OpenGL core version: 4.6 (Core Profile) Mesa 26.1.6-1 (X11)
    • OpenGL core shading language version: 4.60 (X11)
    • OpenGL ES renderer: llvmpipe (LLVM 21.1.8, 256 bits) (X11)
    • OpenGL ES version: OpenGL ES 3.2 Mesa 26.1.6-1 (X11)
    • OpenGL ES shading language version: OpenGL ES GLSL ES 3.20 (X11)
    • GL_EXT_framebuffer_blit: yes (X11)
    • GL_EXT_texture_format_BGRA8888: yes (X11)

[✓] Connected device (1 available) [85ms]
    • Linux (desktop) • linux • linux-x64 • Debian GNU/Linux forky/sid 7.2.12+deb14-amd64

[!] Network resources [135.2s]
    ✗ A network error occurred while checking "https://maven.google.com/": Connection failed

! Doctor found issues in 3 categories.

Activity

  1. added
    platform-android
    engine
    has reproducible steps
    e: impeller
    in triage
    team-engine
    c: rendering
    workaround available
    and removed
    in triage
    on Oct 27, 2026
  2. mbcorona commented on Oct 27, 2026

    @mbcorona
    Member

    Hi @yx-wh, thanks for the detailed isolation and logs. Disabling Impeller or hybrid composition both work around it.

    Routing to team-engine.

  3. j-ixcayau commented on Oct 27, 2026

    @j-ixcayau

    Hi! I'm having the same issue

  4. yx-wh commented on Oct 28, 2026

    @yx-wh
    Author

    Alldocube iPlay50 mini Pro also known as 酷比魔方 掌玩mini (MediaTek MT6789 / Helio G99,
    ARM Mali-G57 MC2, OpenGL ES 3.2 v1.r32p1), Android 13. Same black screen
    and the same EGL_BAD_ACCESS / "Could not make the context current" pair after
    returning to the foreground through the share/ProcessText path, roughly every
    second entry. EnableImpeller=false resolves it on this device.

  5. j-ixcayau commented on Oct 28, 2026

    @j-ixcayau

    We're hitting the same issue in a production app (internal testing track on Play Store).

    Environment

    Flutter 3.47.6 (stable), release build
    Device Redmi Note 8 Pro (MediaTek Helio G90T, Mali-G76), Android 11 / API 30
    Renderer Using the Impeller rendering backend (OpenGLES). (device supports Vulkan 1.1, but MediaTek < API 31 falls back to GLES)
    Platform views flutter_inappwebview 6.1.5 (flutter_inappwebview_android 1.1.3), default useHybridComposition: true → initExpensiveAndroidView; plus one native ad view via initExpensiveAndroidView
    Activity FlutterFragmentActivity, launchMode="singleTask"

    Scenarios

    1. Deep link while the app is alive

    1. Cold start from a deep link (App Link) → works. The first screen shows an HTML banner in an InAppWebView.
    2. Switch to another app (e.g. Telegram) and tap a deep link again → the app comes back to the foreground (onNewIntent) → still works while the WebView screen is still showing.
    3. Continue to the next screen (the WebView is removed), switch apps, tap the deep link again → black screen, and it stays black for the rest of the process. Only a force-stop recovers it.

    2. Plain background → foreground
    Intermittent. It fails after a screen with WebViews has been on screen. Once broken, reopening from the launcher stays black too.

    Observations

    • Going to background and back while the WebView is still on screen is fine: no EGL errors over several cycles.
    • It breaks after the WebView leaves the screen. Logcat shows the HC ImageReader layer being released and the SurfaceView reconnecting, then pause/stop, then on resume the very first frame fails on the raster thread:
    I BufferQueueProducer: [ImageReader-1080x2340f1m3-20505-4] disconnect(): api=1
    I BufferQueueProducer: [SurfaceView - .../MainActivity#0] connect(): api=1
    ... onPause / onStop (ImageReader-...-3 and SurfaceView disconnect)
    ... onRestart / onStart / onResume
    I BufferQueueProducer: [SurfaceView - .../MainActivity#0] connect(): api=1
    E libEGL  : eglMakeCurrentImpl:1124 error 3002 (EGL_BAD_ACCESS)
    E flutter : [ERROR:flutter/impeller/toolkit/egl/egl.cc(56)] EGL Error: Bad Access (12290) in ../../../flutter/impeller/toolkit/egl/context.cc:55
    E libEGL  : call to OpenGL ES API with no current context (logged once per thread)
    E flutter : [ERROR:flutter/shell/gpu/gpu_surface_gl_impeller.cc(76)] Could not make the context current to acquire the frame.
    
    • After that, every frame logs the same two errors. The Dart side keeps running (network calls continue) but nothing is drawn.
    • Like the original report, the failing resume doesn't log a new Using the Impeller rendering backend (OpenGLES). line.
  6. yx-wh commented on Oct 30, 2026

    @yx-wh
    Author

    Mainline Ciyue 词悦 is using the workaroud now.
    mumu-lhl/Ciyue@7a1ef84

  7. AmrTawfek commented on Nov 2, 2026

    @AmrTawfek

    Is a fix for this being considered for a 3.47 hotfix? For apps that show WebViews with hybrid composition (flutter_inappwebview's default on Android), the two workarounds above are both app-wide trade-offs: EnableImpeller=false turns Impeller off for every user, and disabling hybrid composition changes how every WebView renders. A fix in 3.47.x would let those apps upgrade without either.

  8. added
    P1
    on Nov 2, 2026
  9. gaaclarke commented on Nov 2, 2026

    @gaaclarke
    Member

    @yx-wh what happens on other devices? Is this seem specific to Mali-g57?

  10. added
    waiting for response
    triaged-engine
    on Nov 2, 2026
  11. yx-wh commented on Nov 3, 2026

    @yx-wh
    Author

    Impeller OpenGLES: EGL_BAD_ACCESS and black window after a second ACTION_PROCESS_TEXT lookup on Mali (not reproducible on Adreno)

    Environment (app)

    • Ciyue on Flutter 3.47.5 (stable), Impeller enabled; backend OpenGLES.
    • Build: flutter build apk --profile --flavor full-dev with
      io.flutter.embedding.android.EnableImpeller = true
      and io.flutter.embedding.android.ImpellerBackend = opengles
      (--impeller-backend is honoured only in debug/profile; release ignores it.)

    Reproduces

    • Alldocube iPlay 50 Mini Pro (iPlay50_mini_Pro), Android 13 (SDK 33)
    • Build iPlay50_mini_Pro_V2.0_20260301
    • Fingerprint Alldocube/iPlay50_mini_Pro/iPlay50_mini_Pro:13/TP1A.220624.014/1699256002:user/release-keys
    • GPU: Mali-G57 MC2 (Helio G99), GLES OpenGL ES 3.2 v1.r32p1-01eac0..., ro.hardware.egl = meow

    Does NOT reproduce this particular flow (same APK, same OpenGLES backend)

    • Xiaomi 9, Adreno 640 (Snapdragon 855), same profile build with ImpellerBackend=opengles
      -> 0 EGL_BAD_ACCESS, 0 context-current failures for the task-background / second-intent sequence.

    Steps

    1. In Moon+ Reader, select a word no dictionary contains (e.g. Animecover) and share/process it to Ciyue
      (ACTION_PROCESS_TEXT -> ProcessTextActivity -> MainActivity).
    2. Ciyue shows the "not found" page with "Split into words: Anime + Cover". Tap Anime
      (a WebView platform view is created).
    3. Press Back to return to Moon+ Reader (the Ciyue task is moved to the background).
    4. In Moon+ Reader, invoke Ciyue again with any word (whether the second word is found or not seems not to matter; the firm precondition is the first lookup).
    5. Ciyue comes to the foreground with a black window.

    The firm precondition is steps 1-3: the first lookup must be a word that is not found and yields a "split into words" chip, and tapping it must create the WebView before going back. Simply backgrounding and returning (Home / recents) does not reproduce; a second invocation is also required, but its word does not appear to matter.

    The same flow reproduces with a Chinese dictionary and CJK word splitting — e.g. selecting a run such as
    中华人民共和 (which is not a single headword) and tapping 中华 in the "split into words" suggestions.
    So it is not specific to English compounds: any not-found query that yields a split suggestion chip triggers it.

    Logs at step 5 (iPlay, exact excerpt)

    10:30:01.997 I/ActivityTaskManager(1632): moveTaskToBack: Task{a27783d #305 type=standard A=10232:org.eu.mumulhl.ciyue.full.dev U=0 visible=true visibleRequested=true mode=fullscreen translucent=false sz=1}
    10:30:03.453 I/ActivityTaskManager(1632): START u0 {act=android.intent.action.PROCESS_TEXT typ=text/plain pkg=org.eu.mumulhl.ciyue.full.dev cmp=org.eu.mumulhl.ciyue.full.dev/org.eu.mumulhl.ciyue.ProcessTextActivity (has extras)
    10:30:03.481 I/ActivityTaskManager(1632): START u0 {act=android.intent.action.PROCESS_TEXT flg=0x34000000 cmp=org.eu.mumulhl.ciyue.full.dev/org.eu.mumulhl.ciyue.MainActivity (has extras)} from uid 10232
    10:30:03.522 E/libEGL  (8653): eglMakeCurrentImpl:1068 error 3002 (EGL_BAD_ACCESS)
    10:30:03.522 E/flutter (8653): [ERROR:flutter/impeller/toolkit/egl/egl.cc(56)] EGL Error: Bad Access (12290) in ../../../flutter/impeller/toolkit/egl/context.cc:55
    10:30:03.524 E/libEGL  (8653): eglMakeCurrentImpl:1068 error 3002 (EGL_BAD_ACCESS)
    10:30:03.536 E/flutter (8653): [ERROR:flutter/shell/gpu/gpu_surface_gl_impeller.cc(76)] Could not make the context current to acquire the frame.
    

    Every subsequent frame logs "Could not make the context current" until the process is killed.

    Conclusion
    This is not a single-GPU-vendor problem. The same failure — Impeller OpenGLES + a hybrid-composition
    platform view + the surface being destroyed/recreated -> EGL_BAD_ACCESS, permanently black window — has
    also been reported on an Adreno device: chengxicx/LuteForMobile@56e4145 (BOOX Leaf5C, Snapdragon 690 /
    Adreno 619L, Android 13) hits it after lock/unlock. On this iPlay (Mali-G57, GLES r32p1,
    ro.hardware.egl=meow) it is triggered by the task-background / second-intent cycle, while a Xiaomi 9
    (Adreno 640) running the same APK and the same OpenGLES backend does not reproduce that particular flow.
    The failure therefore depends on the driver and on which surface-loss path is taken, not on Mali alone.

    Filtered logcat from both devices (reproducer + non-reproducing Adreno control): https://gist.github.com/yx-wh/37359a798cb6174735ff1e21269b2db7

  12. removed
    waiting for response
    on Nov 3, 2026
  13. yx-wh commented on Nov 3, 2026

    @yx-wh
    Author

    Independent corroboration (translation of chengxicx/LuteForMobile@56e4145)

    The linked commit message is in Chinese, so here is a translation for reference:
    chengxicx/LuteForMobile@56e4145

    fix(android): disable Impeller to avoid a permanent black screen from EGL_BAD_ACCESS after unlocking

    On the BOOX Leaf5C, after locking and unlocking the screen the EGL context of Impeller OpenGLES is dead
    (eglMakeCurrent returns EGL_BAD_ACCESS), and the raster thread can no longer submit a single frame from
    then on: the process stays alive and the Dart side works normally, but the whole screen is black and only
    killing the process recovers it. Returning to the foreground / recreating the activity does not help — the
    EGL context is already broken at the driver level.

    Upstream: #195424 (open). The trigger is Impeller + GLES + hybrid-composition platform views +
    backgrounding, all of which this project has. In the 3.47 engine, Skia GL is still present and the
    EnableImpeller flag still works (deprecation warning, but usable), so they fall back to Skia; once the engine
    fix lands, this meta-data should be removed to restore Impeller.

    This is a second, independent dictionary app hitting the same failure — different app, different device
    (BOOX Leaf5C, Snapdragon 690 / Adreno 619L, Android 13), same EGL_BAD_ACCESS / permanently black screen,
    and the same workaround (disable Impeller). Note that this is an Adreno device, so the failure is not
    Mali-specific.

  14. yx-wh commented on Nov 3, 2026

    @yx-wh
    Author

    Reproducer build / configuration requirements

    A stock build of the repo is not enough. To reach the trigger, all of the following are required:

    • Source: a Ciyue build that includes the "split into words" suggestions on the not-found page
      (added in mumu-lhl/Ciyue@887f58df, merged via mumu-lhl/Ciyue#770). Builds before that show a plain
      not-found page with no chips, so there is no way to open an entry from it and the trigger cannot be reached.

    • Renderer: Impeller enabled with the OpenGLES backend. Release builds ignore the backend override
      (--impeller-backend is compiled out under FLUTTER_RELEASE), so this must be a profile (or debug) build
      with:

      • <meta-data android:name="io.flutter.embedding.android.EnableImpeller" android:value="true"/>
      • <meta-data android:name="io.flutter.embedding.android.ImpellerBackend" android:value="opengles"/>

      e.g. flutter build apk --profile --flavor full-dev.

    • UI mode: Ciyue's floating-window option must be off (this is a setting inside Ciyue, not an Android
      system setting) — the share/process-text invocation has to go to the main activity, not the floating window.

    • Layout: must be the phone / small-tablet (narrow) UI. On a true large-screen tablet layout the navigation
      takes a different path (split view / pushReplacement) and does not reproduce.

    With this build, the iPlay 50 Mini Pro reproduces on the second ACTION_PROCESS_TEXT invocation.

  15. gaaclarke commented on Nov 3, 2026

    @gaaclarke
    Member

    fyi @gmackall this is a bug at the intersection of platform views and impeller

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1c: renderinge: impellere: openglenginehas reproducible stepsplatform-androidteam-enginetriaged-engineworkaround available

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions