Skip to content

[Impeller] Crash on macOS when app is foregrounded? #185394

Description

@alexvoina

Steps to reproduce

We recently transitioned to Impeller for our macOS app and started getting some crashes in Sentry.

I hit the issue once on my device once after leaving the app open for a few hours and then just bringing it to foreground. In the last week more people have encountered the same problem, but I don't know under what circumstances it happened for them, I can only see the sentry issues. It happens on a wide range of devices & os versions.

device
Mac14,7
43%
Mac15,12
14%
MacBookPro17,1
14%
Other
29%

os
macOS 26.3.1
57%
macOS 15.6.1
14%
macOS 26.4.0
14%
Other
15%

This issue seems to be similar judging by the stack:

#164628

Expected results

The app shouldn't crash in flutter code

Actual results

The app crashes

Code sample

Code sample
[Paste your code here]

Screenshots or Video

Screenshots / Video demonstration

[Upload media here]

Logs

Logs
EXC_BAD_ACCESS: Exception 1, Code 1, Subcode 0 >
Attempted to dereference null pointer.
  FlutterMacOS        0x104b055e8  impeller::Canvas::SetupRenderPass (canvas.cc:1344)
  FlutterMacOS        0x104b05ba4  impeller::Canvas::Canvas (canvas.cc:326)
  FlutterMacOS        0x104b1a780  impeller::CanvasDlDispatcher::CanvasDlDispatcher (dl_dispatcher.cc:936)
  FlutterMacOS        0x104b1a780  impeller::CanvasDlDispatcher::CanvasDlDispatcher (dl_dispatcher.cc:942)
  FlutterMacOS        0x104b1a780  impeller::RenderToTarget (dl_dispatcher.cc:1310)
  FlutterMacOS        0x104d169d4  flutter::EmbedderExternalView::Render (embedder_external_view.cc:135)
  FlutterMacOS        0x104d187c4  flutter::(anonymous namespace)::Layer::RenderFlutterContents (embedder_external_view_embedder.cc:262)
  FlutterMacOS        0x104d187c4  flutter::(anonymous namespace)::LayerBuilder::Render (embedder_external_view_embedder.cc:335)
  FlutterMacOS        0x104d187c4  flutter::EmbedderExternalViewEmbedder::SubmitFlutterView (embedder_external_view_embedder.cc:482)
  FlutterMacOS        0x104bfe4f8  flutter::Rasterizer::DrawToSurfaceUnsafe (rasterizer.cc:807)
  FlutterMacOS        0x104bfddd0  flutter::Rasterizer::DrawToSurfacesUnsafe (rasterizer.cc:674)
  FlutterMacOS        0x104bfc150  flutter::Rasterizer::DrawToSurfaces (rasterizer.cc:603)
  FlutterMacOS        0x104bfd328  flutter::Rasterizer::DoDraw (rasterizer.cc:507)
  FlutterMacOS        0x104c0095c  flutter::Rasterizer::Draw::lambda::operator() (rasterizer.cc:260)
  FlutterMacOS        0x104c0095c  std::__fl::__invoke[abi:nn210000]<T> (invoke.h:179)
  FlutterMacOS        0x104c0095c  std::__fl::__invoke_void_return_wrapper<T>::__call[abi:nn210000]<T> (invoke.h:251)
  FlutterMacOS        0x104c0095c  std::__fl::__invoke_r[abi:nn210000]<T> (invoke.h:273)
  FlutterMacOS        0x104c0095c  std::__fl::__function::__alloc_func<T>::operator()[abi:nn210000] (function.h:167)
  FlutterMacOS        0x104c0095c  std::__fl::__function::__func<T>::operator() (function.h:319)
  FlutterMacOS        0x104bfc810  std::__fl::__function::__value_func<T>::operator()[abi:nn210000] (function.h:436)
  FlutterMacOS        0x104bfc810  std::__fl::function<T>::operator() (function.h:995)
  FlutterMacOS        0x104bfc810  flutter::Pipeline<T>::Consume (pipeline.h:203)
  FlutterMacOS        0x104bfc424  flutter::Rasterizer::Draw (rasterizer.cc:264)
  FlutterMacOS        0x104c20a04  flutter::Shell::OnAnimatorDraw::lambda::operator() (shell.cc:1412)
  FlutterMacOS        0x104c20a04  fml::internal::CopyableLambda<T>::operator()<T> (make_copyable.h:24)
  FlutterMacOS        0x104c20a04  std::__fl::__invoke[abi:nn210000]<T> (invoke.h:179)
  FlutterMacOS        0x104c20a04  std::__fl::__invoke_void_return_wrapper<T>::__call[abi:nn210000]<T> (invoke.h:251)
  FlutterMacOS        0x104c20a04  std::__fl::__invoke_r[abi:nn210000]<T> (invoke.h:273)
  FlutterMacOS        0x104c20a04  std::__fl::__function::__alloc_func<T>::operator()[abi:nn210000] (function.h:167)
  FlutterMacOS        0x104c20a04  std::__fl::__function::__func<T>::operator() (function.h:319)
  FlutterMacOS        0x10444bbb8  std::__fl::__function::__value_func<T>::operator()[abi:nn210000] (function.h:436)
  FlutterMacOS        0x10444bbb8  std::__fl::function<T>::operator() (function.h:995)
  FlutterMacOS        0x10444bbb8  fml::MessageLoopImpl::FlushTasks (message_loop_impl.cc:126)
  FlutterMacOS        0x10445540c  fml::MessageLoopDarwin::OnTimerFire (message_loop_darwin.mm:85)
  CoreFoundation      0x1a031fc50  __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__
  CoreFoundation      0x1a031f910  __CFRunLoopDoTimer
  CoreFoundation      0x1a031f44c  __CFRunLoopDoTimers
  CoreFoundation      0x1a0305858  __CFRunLoopRun
  CoreFoundation      0x1a0304a98  CFRunLoopRunSpecific
  FlutterMacOS        0x104455680  fml::MessageLoopDarwin::Run (message_loop_darwin.mm:51)
  FlutterMacOS        0x10444b9ec  fml::MessageLoopImpl::DoRun (message_loop_impl.cc:94)
  FlutterMacOS        0x104453cb4  fml::Thread::Thread::lambda::operator() (thread.cc:154)
  FlutterMacOS        0x104453cb4  std::__fl::__invoke[abi:nn210000]<T> (invoke.h:179)
  FlutterMacOS        0x104453cb4  std::__fl::__invoke_void_return_wrapper<T>::__call[abi:nn210000]<T> (invoke.h:251)
  FlutterMacOS        0x104453cb4  std::__fl::__invoke_r[abi:nn210000]<T> (invoke.h:273)
  FlutterMacOS        0x104453cb4  std::__fl::__function::__alloc_func<T>::operator()[abi:nn210000] (function.h:167)
  FlutterMacOS        0x104453cb4  std::__fl::__function::__func<T>::operator() (function.h:319)
  FlutterMacOS        0x104453704  std::__fl::__function::__value_func<T>::operator()[abi:nn210000] (function.h:436)
  FlutterMacOS        0x104453704  std::__fl::function<T>::operator() (function.h:995)
  FlutterMacOS        0x104453704  fml::ThreadHandle::ThreadHandle::lambda::operator() (thread.cc:76)
  FlutterMacOS        0x104453704  fml::ThreadHandle::ThreadHandle::lambda::__invoke (thread.cc:73)
  libsystem_pthread   0x1a021bc0c  _pthread_start

Thread: io.flutter.raster
  FlutterMacOS        0x104b055e8  impeller::Canvas::SetupRenderPass (canvas.cc:1344)
  FlutterMacOS        0x104b05ba4  impeller::Canvas::Canvas (canvas.cc:326)
  FlutterMacOS        0x104b1a780  impeller::CanvasDlDispatcher::CanvasDlDispatcher (dl_dispatcher.cc:936)
  FlutterMacOS        0x104b1a780  impeller::CanvasDlDispatcher::CanvasDlDispatcher (dl_dispatcher.cc:942)
  FlutterMacOS        0x104b1a780  impeller::RenderToTarget (dl_dispatcher.cc:1310)
  FlutterMacOS        0x104d169d4  flutter::EmbedderExternalView::Render (embedder_external_view.cc:135)
  FlutterMacOS        0x104d187c4  flutter::(anonymous namespace)::Layer::RenderFlutterContents (embedder_external_view_embedder.cc:262)
  FlutterMacOS        0x104d187c4  flutter::(anonymous namespace)::LayerBuilder::Render (embedder_external_view_embedder.cc:335)
  FlutterMacOS        0x104d187c4  flutter::EmbedderExternalViewEmbedder::SubmitFlutterView (embedder_external_view_embedder.cc:482)
  FlutterMacOS        0x104bfe4f8  flutter::Rasterizer::DrawToSurfaceUnsafe (rasterizer.cc:807)
  FlutterMacOS        0x104bfddd0  flutter::Rasterizer::DrawToSurfacesUnsafe (rasterizer.cc:674)
  FlutterMacOS        0x104bfc150  flutter::Rasterizer::DrawToSurfaces (rasterizer.cc:603)
  FlutterMacOS        0x104bfd328  flutter::Rasterizer::DoDraw (rasterizer.cc:507)
  FlutterMacOS        0x104c0095c  flutter::Rasterizer::Draw::lambda::operator() (rasterizer.cc:260)
  FlutterMacOS        0x104c0095c  std::__fl::__invoke[abi:nn210000]<T> (invoke.h:179)
  FlutterMacOS        0x104c0095c  std::__fl::__invoke_void_return_wrapper<T>::__call[abi:nn210000]<T> (invoke.h:251)
  FlutterMacOS        0x104c0095c  std::__fl::__invoke_r[abi:nn210000]<T> (invoke.h:273)
  FlutterMacOS        0x104c0095c  std::__fl::__function::__alloc_func<T>::operator()[abi:nn210000] (function.h:167)
  FlutterMacOS        0x104c0095c  std::__fl::__function::__func<T>::operator() (function.h:319)
  FlutterMacOS        0x104bfc810  std::__fl::__function::__value_func<T>::operator()[abi:nn210000] (function.h:436)
  FlutterMacOS        0x104bfc810  std::__fl::function<T>::operator() (function.h:995)
  FlutterMacOS        0x104bfc810  flutter::Pipeline<T>::Consume (pipeline.h:203)
  FlutterMacOS        0x104bfc424  flutter::Rasterizer::Draw (rasterizer.cc:264)
  FlutterMacOS        0x104c20a04  flutter::Shell::OnAnimatorDraw::lambda::operator() (shell.cc:1412)
  FlutterMacOS        0x104c20a04  fml::internal::CopyableLambda<T>::operator()<T> (make_copyable.h:24)
  FlutterMacOS        0x104c20a04  std::__fl::__invoke[abi:nn210000]<T> (invoke.h:179)
  FlutterMacOS        0x104c20a04  std::__fl::__invoke_void_return_wrapper<T>::__call[abi:nn210000]<T> (invoke.h:251)
  FlutterMacOS        0x104c20a04  std::__fl::__invoke_r[abi:nn210000]<T> (invoke.h:273)
  FlutterMacOS        0x104c20a04  std::__fl::__function::__alloc_func<T>::operator()[abi:nn210000] (function.h:167)
  FlutterMacOS        0x104c20a04  std::__fl::__function::__func<T>::operator() (function.h:319)
  FlutterMacOS        0x10444bbb8  std::__fl::__function::__value_func<T>::operator()[abi:nn210000] (function.h:436)
  FlutterMacOS        0x10444bbb8  std::__fl::function<T>::operator() (function.h:995)
  FlutterMacOS        0x10444bbb8  fml::MessageLoopImpl::FlushTasks (message_loop_impl.cc:126)
  FlutterMacOS        0x10445540c  fml::MessageLoopDarwin::OnTimerFire (message_loop_darwin.mm:85)
  CoreFoundation      0x1a031fc50  __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__
  CoreFoundation      0x1a031f910  __CFRunLoopDoTimer
  CoreFoundation      0x1a031f44c  __CFRunLoopDoTimers
  CoreFoundation      0x1a0305858  __CFRunLoopRun
  CoreFoundation      0x1a0304a98  CFRunLoopRunSpecific
  FlutterMacOS        0x104455680  fml::MessageLoopDarwin::Run (message_loop_darwin.mm:51)
  FlutterMacOS        0x10444b9ec  fml::MessageLoopImpl::DoRun (message_loop_impl.cc:94)
  FlutterMacOS        0x104453cb4  fml::Thread::Thread::lambda::operator() (thread.cc:154)
  FlutterMacOS        0x104453cb4  std::__fl::__invoke[abi:nn210000]<T> (invoke.h:179)
  FlutterMacOS        0x104453cb4  std::__fl::__invoke_void_return_wrapper<T>::__call[abi:nn210000]<T> (invoke.h:251)
  FlutterMacOS        0x104453cb4  std::__fl::__invoke_r[abi:nn210000]<T> (invoke.h:273)
  FlutterMacOS        0x104453cb4  std::__fl::__function::__alloc_func<T>::operator()[abi:nn210000] (function.h:167)
  FlutterMacOS        0x104453cb4  std::__fl::__function::__func<T>::operator() (function.h:319)
  FlutterMacOS        0x104453704  std::__fl::__function::__value_func<T>::operator()[abi:nn210000] (function.h:436)
  FlutterMacOS        0x104453704  std::__fl::function<T>::operator() (function.h:995)
  FlutterMacOS        0x104453704  fml::ThreadHandle::ThreadHandle::lambda::operator() (thread.cc:76)
  FlutterMacOS        0x104453704  fml::ThreadHandle::ThreadHandle::lambda::__invoke (thread.cc:73)
  libsystem_pthread   0x1a021bc0c  _pthread_start

Flutter Doctor output

Doctor output

Happens on 2 versions 3.41.0 & 3.41.6

[✓] Flutter (Channel stable, 3.41.0, on macOS 15.7.4 24G517 darwin-arm64, locale en-US) [11.3s]
    • Flutter version 3.41.0 on channel stable at /Users/runner/hostedtoolcache/flutter/stable-3.41.0-arm64/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 44a626f4f0 (7 weeks ago), 2026-02-10 10:16:12 -0800
    • Engine revision 3452d735bd
    • Dart version 3.11.0
    • DevTools version 2.54.1
    • Feature flags: enable-web, enable-linux-desktop, enable-macos-desktop, enable-windows-desktop, enable-android, enable-ios, cli-animations, enable-native-assets, omit-legacy-version-file, enable-lldb-debugging, enable-uiscene-migration

[!] Android toolchain - develop for Android devices (Android SDK version 36.1.0) [16.3s]
    • Android SDK at /Users/runner/Library/Android/sdk
    • Emulator version 36.4.10.0 (build_id 15004761) (CL:N/A)
    • Platform android-36-ext19, build-tools 36.1.0
    • ANDROID_HOME = /Users/runner/Library/Android/sdk
    • ANDROID_SDK_ROOT = /Users/runner/Library/Android/sdk
    • Java binary at: /Users/runner/hostedtoolcache/Java_Temurin-Hotspot_jdk/21.0.10-7.0/arm64/Contents/Home/bin/java
      This JDK is specified by the JAVA_HOME environment variable.
      To manually set the JDK path, use: `flutter config --jdk-dir="path/to/jdk"`.
    • Java version OpenJDK Runtime Environment Temurin-21.0.10+7 (build 21.0.10+7-LTS)
    ! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses

[✓] Xcode - develop for iOS and macOS (Xcode 16.4) [16.9s]
    • Xcode at /Applications/Xcode_16.4.app/Contents/Developer
    • Build 16F6
    • CocoaPods version 1.16.2

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

[✓] Connected device (2 available) [12.2s]
    • macOS (desktop) • macos  • darwin-arm64   • macOS 15.7.4 24G517 darwin-arm64
    • Chrome (web)    • chrome • web-javascript • Google Chrome 146.0.7680.165

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

! Doctor found issues in 1 category.


[✓] Flutter (Channel stable, 3.41.6, on macOS 15.7.4 24G517 darwin-arm64, locale en-US) [8.2s]
    • Flutter version 3.41.6 on channel stable at /Users/runner/hostedtoolcache/flutter/stable-3.41.6-arm64/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision db50e20168 (2 weeks ago), 2026-03-25 16:21:00 -0700
    • Engine revision 425cfb54d0
    • Dart version 3.11.4
    • DevTools version 2.54.2
    • Feature flags: enable-web, enable-linux-desktop, enable-macos-desktop, enable-windows-desktop, enable-android, enable-ios, cli-animations, enable-native-assets, omit-legacy-version-file, enable-lldb-debugging, enable-uiscene-migration

[!] Android toolchain - develop for Android devices (Android SDK version 37.0.0) [12.2s]
    • Android SDK at /Users/runner/Library/Android/sdk
    • Emulator version 36.4.10.0 (build_id 15004761) (CL:N/A)
    • Platform android-37.0, build-tools 37.0.0
    • ANDROID_HOME = /Users/runner/Library/Android/sdk
    • ANDROID_SDK_ROOT = /Users/runner/Library/Android/sdk
    • Java binary at: /Users/runner/hostedtoolcache/Java_Temurin-Hotspot_jdk/21.0.10-7.0/arm64/Contents/Home/bin/java
      This JDK is specified by the JAVA_HOME environment variable.
      To manually set the JDK path, use: `flutter config --jdk-dir="path/to/jdk"`.
    • Java version OpenJDK Runtime Environment Temurin-21.0.10+7 (build 21.0.10+7-LTS)
    ! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses

[✓] Xcode - develop for iOS and macOS (Xcode 16.4) [12.2s]
    • Xcode at /Applications/Xcode_16.4.app/Contents/Developer
    • Build 16F6
    • CocoaPods version 1.16.2

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

[✓] Connected device (2 available) [10.1s]
    • macOS (desktop) • macos  • darwin-arm64   • macOS 15.7.4 24G517 darwin-arm64
    • Chrome (web)    • chrome • web-javascript • Google Chrome 146.0.7680.165

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

! Doctor found issues in 1 category.

Activity

  1. added
    in triagePresently being triaged by the triage team
    engineflutter/engine related. See also e: labels.
    platform-macosBuilding on or for macOS specifically
    e: impellerImpeller rendering backend issues and features requests
    c: crashStack traces logged to the console
    on Apr 22, 2026
  2. mbcorona commented on Apr 22, 2026

    @mbcorona
    Member

    HI @alexvoina , thanks for reporting, Im routing this to the engine team for review.

  3. removed
    in triagePresently being triaged by the triage team
    on Apr 22, 2026
  4. gaaclarke commented on Apr 28, 2026

    @gaaclarke
    Member

    @alexvoina can you reproduce this issue with just the standard Flutter counter app?

  5. added
    P1High-priority issues at the top of the work list
    on Apr 28, 2026
  6. alexvoina commented on May 1, 2026

    @alexvoina
    Author

    I've built the counter app with Impeller enabled. I'll keep it open and post an update if it crashes or not.

  7. alexvoina commented on May 3, 2026

    @alexvoina
    Author

    @alexvoina can you reproduce this issue with just the standard Flutter counter app?

    a few days already and the app didn't crash, i'm not really sure how to reproduce it

  8. gaaclarke commented on May 4, 2026

    @gaaclarke
    Member

    What packages are you using in your app that demonstrates the issue? Unfortunately a naughty plugin can take down the whole process. I'd consider any plugin that has a native component a suspect. Has there been any modifications to the embedder? (files in the macos/ directory). Is there some animation that is running in the app that demonstrates the problem?

    Those are the sort of questions I'd ask and explore when trying to come up with a reproduction.

  9. alexvoina commented on May 6, 2026

    @alexvoina
    Author

    @gaaclarke

    Our app registers quite a few native macOS plugins/components, including an audio engine plugin, window_manager, media/video plugins, super_native_extensions, Sentry, Firebase, and connectivity_plus.

    Some of these integrations can trigger Dart-side state changes even while the app is backgrounded. For example, connectivity changes or audio-device changes such as AirPods disconnecting can fire listeners and schedule a rebuild/frame. I tried repeatedly triggering those callbacks locally, but I haven't been able to reproduce the crash on demand.

    What makes me suspect this path is that the Sentry reports consistently include breadcrumbs for events that could trigger background activity shortly before the crash, such as connectivity changes and RevenueCat customer-info updates. That also lines up with what affected users are describing.

    The stack lands in Impeller render-target setup, which makes me wonder whether Flutter/Impeller is attempting to render while the macOS render target does not have a valid color texture.

    Have you already explored that hypothesis, and if so, did it rule anything in or out?

  10. 23 remaining items

  11. removed
    platform-macosBuilding on or for macOS specifically
    P1High-priority issues at the top of the work list
    e: impellerImpeller rendering backend issues and features requests
    on Sep 24, 2026
  12. moved this from In progress to No status in Flutter Engine Focuson Sep 24, 2026
  13. added
    engineflutter/engine related. See also e: labels.
    on Sep 24, 2026
  14. added
    P2Important issues not at the top of the work list
    triaged-macosTriaged by the macOS platform team
    on Sep 24, 2026
  15. socksprox commented on Nov 6, 2026

    @socksprox

    Disclosure: this comment was written by an AI coding assistant analyzing a crash report on behalf of an app developer.

    We hit what looks like this exact crash signature in a release build of a Flutter macOS app: EXC_BAD_ACCESS (SIGSEGV, read at 0x0) on io.flutter.raster while the user was resizing the window. Built with Flutter 3.47.1 (engine 5d531788691ec3404cac0cee66ead4007b177363), macOS 27.0.1, arm64.

    Symbolicated against the matching FlutterMacOS.framework dSYM and disassembled the faulting instruction:

    impeller::Canvas::SetupRenderPass()                        canvas.cc:1615
    impeller::Canvas::Canvas(...)                              canvas.cc:0
    impeller::RenderToTarget(...)                              dl_dispatcher.cc:1318
    flutter::EmbedderExternalViewEmbedder::SubmitFlutterView   embedder_external_view_embedder.cc:598
    flutter::Rasterizer::DrawToSurfaceUnsafe                   rasterizer.cc:831
    flutter::Rasterizer::DrawToSurfacesUnsafe                  rasterizer.cc:698
    flutter::Rasterizer::DoDraw                                rasterizer.cc:531
    flutter::Pipeline::Consume / Rasterizer::Draw              rasterizer.cc:265
    Shell::OnAnimatorDraw lambda
    fml::MessageLoopImpl::FlushTasks                           message_loop_impl.cc:128
    fml::MessageLoopDarwin::OnTimerFire
    

    The faulting instruction is ldr x8, [x0] at the color0.texture->GetSize() call site in Canvas::SetupRenderPass (impeller/display_list/canvas.cc), with x0 = 0 — so color0.texture is a null shared_ptr<Texture>, i.e. the RenderTarget reaching the canvas has no color attachment at index 0 (GetColorAttachment returns a default-constructed attachment when index 0 was never set).

    Tracing how a target with no color0 reaches the canvas:

    1. RenderToTarget receives *impeller_target, the impeller::RenderTarget owned by EmbedderRenderTargetImpeller, built in MakeRenderTargetFromBackingStoreImpeller (shell/platform/embedder/embedder.cc).
    2. There, the embedder-provided id<MTLTexture> (FlutterMetalBackingStore) is wrapped as color0.resolve_texture via WrapTextureMTL. TextureMTL's constructor marks it invalid if desc.size != GetSize() — where GetSize() reads the real texture.width/texture.height — which is exactly the texture_mtl.mm:36 "The texture and its descriptor disagree about its size." validation error reported in App crashes on MacOS 27 with Impeller #192829.
    3. Attachment::IsValid() (impeller/core/formats.cc) then fails because store_action = kMultisampleResolve requires a valid resolve texture — matching the second reported log, formats.cc:48 "Store action needs resolve but no valid resolve texture specified."
    4. RenderTarget::SetColorAttachment silently early-returns on an invalid attachment (if (!attachment.IsValid()) return *this;), so the RenderTarget ends up with no color attachment 0. RenderTarget::IsValid() is never checked on this path.
    5. Canvas::SetupRenderPass reads color0 = render_target_.GetColorAttachment(0) → default attachment with texture == nullptr. The embedder target carries no depth/stencil attachment, so it enters SetupDepthStencilAttachments(...) and unconditionally dereferences color0.texture->GetSize() → null read → crash.

    Two compounding gaps:

    • The macOS embedder (FlutterCompositor::CreateBackingStore → FlutterSurfaceManager surfaceForSize: → FlutterSurface) can supply an MTLTexture whose pixel size doesn't match FlutterBackingStoreConfig.size — the actual race, apparently triggered by window geometry changes (resize here; foregrounding/fullscreen transitions in the other reports).
    • The Impeller side has no guard: an invalid attachment is dropped silently and SetupRenderPass dereferences the default (empty) attachment instead of bailing on RenderTarget::IsValid().

    Still unguarded on main: SetColorAttachment still drops invalid attachments silently, and SetupRenderPass still dereferences color0.texture unconditionally. Even without fixing the underlying resize race, a null-check / IsValid() check before SetupDepthStencilAttachments would turn this from a crash into a dropped frame.

  16. vladvoina commented on Nov 12, 2026

    @vladvoina

    @gaaclarke this issue is now the top crashing in our product

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

    P2Important issues not at the top of the work listengineflutter/engine related. See also e: labels.team-macosOwned by the macOS platform teamtriaged-macosTriaged by the macOS platform team

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions