Skip to content

[Impeller] HandleUsingDestroyedMutex crash on Mali GPUs during disposal #187140

Open

Description

@sdegenaar

Steps to reproduce

We are seeing a 0.23% crash rate and 0.5% ANR rate in production specifically on Mali GPU devices (e.g., Relndoo TAB10_US, Android 15) when using Impeller (Vulkan backend) on Flutter 3.41.6.

The crash signature is HandleUsingDestroyedMutex originating from the Impeller texture destructor / Isolate::Shutdown path.

This appears to be the same issue as the closed/locked #185324, but I am opening a new issue with the raw native stack traces from the Google Play Console that were missing from the original report.

Steps to reproduce: Difficult to reproduce locally as it relies on specific GPU driver timing, but occurs reliably in production when our package (liquid_glass_widgets) disposes of FragmentProgram shaders and BackdropFilter layers during widget tree teardown.

crash_anrs.txt

Cheers

Expected results

The application should gracefully dispose of the FragmentProgram and BackdropFilter resources and release the associated Vulkan textures without triggering a native driver panic.

Actual results

The application crashes natively with a SIGABRT (HandleUsingDestroyedMutex) originating from the Mali GPU driver (libGLES_mali.so). The crash occurs during Impeller's Vulkan texture teardown or garbage collection sequence, causing the entire app process to terminate abruptly without a Dart-level exception.

Code sample

Code sample
// This is a native GPU driver crash occurring in production (Google Play Console) 
// on specific Mali hardware, so providing a minimal, reproducible code sample 
// is not possible as it depends on exact device timing and Vulkan context lifecycles.
// 
// However, the crash is reliably triggered in our production app when tearing down 
// the widget tree containing heavy GPU workloads, specifically FragmentProgram 
// shaders and BackdropFilter layers.
//
// Please refer to the attached production stack traces which contain the exact 
// native crash location in the Impeller backend.

Screenshots or Video

Screenshots / Video demonstration

[Upload media here]

Logs

crash_anrs.txt

Logs
[Paste your logs here]

crash_anrs.txt

Flutter Doctor output

Doctor output
Note: The production crashes were reported by a user running Flutter 3.41.6 on Android 15 (Impeller/Vulkan). The flutter doctor output below is from the package maintainer's environment (3.44.0). We have not yet confirmed whether the crashes reproduce on 3.44.0.

[Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.44.0, on macOS 26.5 25F71 darwin-arm64, locale en-AU)
[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 26.5)
[✓] Chrome - develop for the web
[✓] Connected device (4 available)
[✓] Network resources

Activity

  1. added
    in triagePresently being triaged by the triage team
    e: impellerImpeller rendering backend issues and features requests
    platform-androidAndroid applications specifically
    needs repro infoAutomated crash report whose cause isn't yet known
    engineflutter/engine related. See also e: labels.
    team-androidOwned by Android platform team
    fyi-androidFor the attention of Android platform team
    and removed
    team-androidOwned by Android platform team
    in triagePresently being triaged by the triage team
    needs repro infoAutomated crash report whose cause isn't yet known
    on May 27, 2026
  2. mbcorona commented on May 27, 2026

    @mbcorona
    Member

    HI @sdegenaar
    Thanks for the production stack traces, that's the artifact #185324 was closed for lacking.
    One question: do you have any 3.44.0 production data showing whether the crash persists or has resolved?
    Routing to team-engine (Impeller), fyi-android .

  3. gaaclarke commented on Jun 1, 2026

    @gaaclarke
    Member

    We have an outstanding issue we are looking into related to the cleanup of vulkan fences (which are often implemented as mutexes under the covers). So that may be related to this issue (cc @jason-simmons )

  4. added
    P1High-priority issues at the top of the work list
    on Jun 1, 2026
  5. 2 remaining items

  6. sdegenaar commented on Jun 3, 2026

    @sdegenaar
    Author

    After the user upgraded to 3.44 still had the issue. 2 day crash log attached.

    crashes2june2026.txt

    Cheers

  7. gaaclarke commented on Jun 3, 2026

    @gaaclarke
    Member

    Yea, 3.44.0 won't have the fix. @jason-simmons can you link your PR that was related to this so we can track when it should be available. Was it this one, #187216 ?

  8. jason-simmons commented on Jun 3, 2026

    @jason-simmons
    Contributor

    No - #187216 involves a different issue in the GLES backend that is probably unrelated.

    I've noticed some situations similar to this and have some ideas about what might be going on (likely some issue in the lifetime management of fences in CommandQueueVK / FenceWaiterVK). But there is currently no PR for this.

  9. jason-simmons commented on Jun 16, 2026

    @jason-simmons
    Contributor

    I landed #187761, which fixes a bug that can cause HandleUsingDestroyedMutex errors on Mali GPUs during engine shutdown.

    However, it's unclear whether that bug matches the stack traces in this issue. I tried reproducing the crash in the liquid_glass_widgets package example apps but was unable to make it happen.

  10. sdegenaar commented on Jun 25, 2026

    @sdegenaar
    Author

    Another updated log from the user experiencing this issue

    Still seeing this on Flutter 3.44.2. Crash rate went from 0.23% → 1.26% after upgrading from 3.41.

    Also getting ANRs — new logs attached. Main thread blocked indefinitely in fml::AutoResetWaitableEvent::Wait() via SurfaceChanged, triggered by a normal Android layout pass. The wait has no timeout so if the raster thread is busy, ANR fires after 5s.

    Previous reports were framed as Android 15 / Mali only — we're seeing this on Android 13 (SDK 33) as well.

    On our end we're proposing to mitigate by suspending GPU texture captures during AppLifecycleState.inactive/paused but that's a workaround. The unbounded wait in SurfaceChanged seems to be the root issue here.

    Cheers

    crash25jun2026.txt

  11. flutter-triage-bot commented on Oct 21, 2026

    @flutter-triage-bot

    This issue is marked P1 but has had no recent status updates.

    The P1 label indicates high-priority issues that are at the top of the work list. This is the highest priority level a bug can have if it isn't affecting a top-tier customer or breaking the build. Bugs marked P1 are generally actively being worked on unless the assignee is dealing with a P0 bug (or another P1 bug). Issues at this level should be resolved in a matter of months and should have monthly updates on GitHub.

    Please consider where this bug really falls in our current priorities, and label it or assign it accordingly. This allows people to have a clearer picture of what work is actually planned. Thanks!

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

    P1High-priority issues at the top of the work liste: impellerImpeller rendering backend issues and features requestsengineflutter/engine related. 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