Skip to content

Android Impeller/Vulkan crash on Mali GPU when rotating during startup #187237

Closed

Description

@FelixMittermeier

Steps to reproduce

Launch the app from this reproduction repro: https://github.com/FelixMittermeier/flutter_impeller_mali_rotation_repro

Expected results

No crash no matter how often the device gets rotated.

Actual results

It crashes nearly every time the device is rotated.

Logs

Logs
See https://github.com/FelixMittermeier/flutter_impeller_mali_rotation_repro/blob/main/docs/android-crash-excerpt.txt
Captured from `scripts/reproduce_android_rotation_crash.sh` on 2026-05-28.

05-28 16:21:00.941   883   910 I flutter : [IMPORTANT:flutter/shell/platform/android/android_context_vk_impeller.cc(62)] Using the Impeller rendering backend (Vulkan).
05-28 16:21:01.065   883   883 I SurfaceView: 165387141 surfaceChanged -- format=4 w=1440 h=2304
05-28 16:21:01.942   883   883 I SurfaceView: 165387141 surfaceChanged -- format=4 w=2304 h=1440
05-28 16:21:01.952   883   926 F libc    : FORTIFY: pthread_mutex_lock called on a destroyed mutex (0xb400007d12b76118)
05-28 16:21:01.953   883   926 F libc    : Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 926 (mali-cmar-backe), pid 883 (_rotation_repro)
05-28 16:21:02.237   969   969 F DEBUG   : Abort message: 'FORTIFY: pthread_mutex_lock called on a destroyed mutex (0xb400007d12b76118)'
05-28 16:21:02.237   969   969 F DEBUG   :       #04 pc 00000000016b75f4  /vendor/lib64/egl/libGLES_mali.so (hal::halp::fence_internal::signal_internal()+52) (BuildId: 6509c2fdcf2e42bd5be5bb90fbea06b0)
05-28 16:21:02.237   969   969 F DEBUG   :       #05 pc 00000000016b9718  /vendor/lib64/egl/libGLES_mali.so (hal::halp::fence_release_callback(cmar_event*, int, void*)+24) (BuildId: 6509c2fdcf2e42bd5be5bb90fbea06b0)
05-28 16:21:02.237   969   969 F DEBUG   :       #06 pc 00000000016d0d44  /vendor/lib64/egl/libGLES_mali.so (cmarp_event_call_all_deferred_callbacks+244) (BuildId: 6509c2fdcf2e42bd5be5bb90fbea06b0)
05-28 16:21:02.237   969   969 F DEBUG   :       #07 pc 00000000016d3da8  /vendor/lib64/egl/libGLES_mali.so (cmarp_backend_thread+936) (BuildId: 6509c2fdcf2e42bd5be5bb90fbea06b0)
05-28 16:21:02.264  1448   977 W ActivityManager: crash : com.example.impeller_mali_rotation_repro,10337
05-28 16:21:02.323  1448  3154 I ActivityManager: Process com.example.impeller_mali_rotation_repro (pid 883) has died: fg  TOP (460,1914)

Flutter Doctor output

Doctor output
[✓] Flutter (Channel master, 3.45.0-1.0.pre-239, on macOS 26.5 25F71 darwin-arm64, locale de-DE) [3,6s]
    • Flutter version 3.45.0-1.0.pre-239 on channel master at /Users/felixmittermeier/Documents/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision c8f2f16632 (vor 25 Stunden), 2026-05-27 13:33:42 +0000
    • Engine revision c8f2f16632
    • Dart version 3.13.0 (build 3.13.0-138.0.dev)
    • DevTools version 2.58.0
    • Feature flags: enable-web, enable-linux-desktop, enable-macos-desktop, enable-windows-desktop, enable-android, enable-ios,
      cli-animations, enable-native-assets, enable-swift-package-manager, omit-legacy-version-file, enable-lldb-debugging,
      enable-uiscene-migration, enable-riscv64

[✓] Android toolchain - develop for Android devices (Android SDK version 36.0.0) [2,6s]
    • Android SDK at /Users/felixmittermeier/Library/Android/sdk
    • Emulator version 36.2.12.0 (build_id 14214601) (CL:N/A)
    • Platform android-36, build-tools 36.0.0
    • Java binary at: /Users/felixmittermeier/Library/Java/JavaVirtualMachines/jbr-17.0.14/Contents/Home/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 JBR-17.0.14+1-1367.22-nomod (build 17.0.14+1-b1367.22)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 26.0) [2,5s]
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 17A324
    • CocoaPods version 1.16.2

[✓] Chrome - develop for the web [5ms]
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Connected device (5 available) [9,5s]
    • SM X510 (mobile)                      • R52Y101TBDV               • android-arm64  • Android 16 (API 36)
    • iPhone 14 Pro Max (wireless) (mobile) • 00008120-00086C192E60C01E • ios            • iOS 26.4.2 23E261
    • iPhone (wireless) (mobile)            • 00008150-00167C513CF1401C • ios            • iOS 26.5 23F77
    • macOS (desktop)                       • macos                     • darwin-arm64   • macOS 26.5 25F71 darwin-arm64
    • Chrome (web)                          • chrome                    • web-javascript • Google Chrome 148.0.7778.168

[✓] Network resources [788ms]
    • All expected network resources are available.

• No issues found!

Activity

  1. added
    platform-androidAndroid applications specifically
    engineflutter/engine related. See also e: labels.
    e: impellerImpeller rendering backend issues and features requests
    has reproducible stepsThe issue has been confirmed reproducible and is ready to work on
    c: crashStack traces logged to the console
    on May 29, 2026
  2. jason-simmons commented on May 30, 2026

    @jason-simmons
    Contributor

    The attached app is using HCPP with Impeller/Vulkan and is therefore using the AHBSwapchainImplVK swapchain implementation.

    The crash happens because the AHBSwapchainImplVK destructor is not waiting for the Vulkan device to be idle before destroying its objects (as is done by the KHRSwapchainImplVK implementation).

    AHBSwapchainImplVK may own objects (specifically fences) that are given to Vulkan operations. The crash above will occur if those fences are destroyed before the operations have completed.

  3. added
    P1High-priority issues at the top of the work list
    on Jun 1, 2026
  4. AmanRajSinghMourya commented on Jul 7, 2026

    @AmanRajSinghMourya

    Also hitting this on Pixel 9 Pro (caiman), Android 16, GrapheneOS with MTE enabled (sync). Crash on app startup (~1s), Impeller/Vulkan.

    Flutter: 3.38
    App: Flutter app, crashes during first-frame shader compilation
    Signal: SIGSEGV, code 9 (SEGV_MTESERR) — MTE tag mismatch inside the Mali driver's shader compiler

    signal 11 (SIGSEGV), code 9 (SEGV_MTESERR)
    libGLES_mali.so PilotShaderBuilder::copyNode / MaliPilotShader::run (Mali shader compiler)
    ...
    vkCreateGraphicsPipelines
    libflutter.so

  5. github-actions commented on Jul 21, 2026

    @github-actions

    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 -v and a minimal reproduction of the issue.

  6. locked as resolved and limited conversation to collaborators on Jul 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P1High-priority issues at the top of the work listc: crashStack traces logged to the consolee: impellerImpeller rendering backend issues and features requestsengineflutter/engine related. See also e: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onplatform-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