Repository navigation
Open
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listengineflutter/engine related. See also e: labels.flutter/engine related. See also e: labels.team-macosOwned by the macOS platform teamOwned by the macOS platform teamtriaged-macosTriaged by the macOS platform teamTriaged by the macOS platform team
Description
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:
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_startFlutter 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.Reacted by Vlad Voina, Sebastian Godja, Kravchenko Igor, Luca Osti, Richard Harrington and Hans Kokx
Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listengineflutter/engine related. See also e: labels.flutter/engine related. See also e: labels.team-macosOwned by the macOS platform teamOwned by the macOS platform teamtriaged-macosTriaged by the macOS platform teamTriaged by the macOS platform team
Activity
mbcorona commentedon Apr 22, 2026
HI @alexvoina , thanks for reporting, Im routing this to the engine team for review.
gaaclarke commentedon Apr 28, 2026
@alexvoina can you reproduce this issue with just the standard Flutter counter app?
alexvoina commentedon May 1, 2026
I've built the counter app with Impeller enabled. I'll keep it open and post an update if it crashes or not.
alexvoina commentedon May 3, 2026
a few days already and the app didn't crash, i'm not really sure how to reproduce it
gaaclarke commentedon May 4, 2026
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.
alexvoina commentedon May 6, 2026
@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, andconnectivity_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?
23 remaining items
fix: stop the macOS app crashing in the background (#4)
fix(macos): disable Impeller to stop raster crash on wake/display change
socksprox commentedon Nov 6, 2026
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 at0x0) onio.flutter.rasterwhile the user was resizing the window. Built with Flutter 3.47.1 (engine5d531788691ec3404cac0cee66ead4007b177363), macOS 27.0.1, arm64.Symbolicated against the matching
FlutterMacOS.frameworkdSYM and disassembled the faulting instruction:The faulting instruction is
ldr x8, [x0]at thecolor0.texture->GetSize()call site inCanvas::SetupRenderPass(impeller/display_list/canvas.cc), withx0 = 0— socolor0.textureis a nullshared_ptr<Texture>, i.e. theRenderTargetreaching the canvas has no color attachment at index 0 (GetColorAttachmentreturns a default-constructed attachment when index 0 was never set).Tracing how a target with no color0 reaches the canvas:
RenderToTargetreceives*impeller_target, theimpeller::RenderTargetowned byEmbedderRenderTargetImpeller, built inMakeRenderTargetFromBackingStoreImpeller(shell/platform/embedder/embedder.cc).id<MTLTexture>(FlutterMetalBackingStore) is wrapped ascolor0.resolve_textureviaWrapTextureMTL.TextureMTL's constructor marks it invalid ifdesc.size != GetSize()— whereGetSize()reads the realtexture.width/texture.height— which is exactly thetexture_mtl.mm:36"The texture and its descriptor disagree about its size." validation error reported in App crashes on MacOS 27 with Impeller #192829.Attachment::IsValid()(impeller/core/formats.cc) then fails becausestore_action = kMultisampleResolverequires a valid resolve texture — matching the second reported log,formats.cc:48"Store action needs resolve but no valid resolve texture specified."RenderTarget::SetColorAttachmentsilently early-returns on an invalid attachment (if (!attachment.IsValid()) return *this;), so theRenderTargetends up with no color attachment 0.RenderTarget::IsValid()is never checked on this path.Canvas::SetupRenderPassreadscolor0 = render_target_.GetColorAttachment(0)→ default attachment withtexture == nullptr. The embedder target carries no depth/stencil attachment, so it entersSetupDepthStencilAttachments(...)and unconditionally dereferencescolor0.texture->GetSize()→ null read → crash.Two compounding gaps:
FlutterCompositor::CreateBackingStore→FlutterSurfaceManager surfaceForSize:→FlutterSurface) can supply anMTLTexturewhose pixel size doesn't matchFlutterBackingStoreConfig.size— the actual race, apparently triggered by window geometry changes (resize here; foregrounding/fullscreen transitions in the other reports).SetupRenderPassdereferences the default (empty) attachment instead of bailing onRenderTarget::IsValid().Still unguarded on
main:SetColorAttachmentstill drops invalid attachments silently, andSetupRenderPassstill dereferencescolor0.textureunconditionally. Even without fixing the underlying resize race, a null-check /IsValid()check beforeSetupDepthStencilAttachmentswould turn this from a crash into a dropped frame.fix(macos): disable Impeller pending upstream crash fix (#107)
vladvoina commentedon Nov 12, 2026
@gaaclarke this issue is now the top crashing in our product