Skip to content

Skia crash due to an unexpected Metal pixel format while wrapping an onscreen surface. #125430

@chinmaygarde

Description

@chinmaygarde

Reported in b/279068136 and b/279064036

Backtrace is:

Thread 15 name:  io.flutter.1.raster
Thread 15 Crashed:
0   Flutter                       	       0x106883bdc GrMtlCaps::GetFormatIndex(MTLPixelFormat) + 
1   Flutter                       	       0x106883bdc GrMtlCaps::GetFormatIndex(MTLPixelFormat) + 
2   Flutter                       	       0x1068849b0 GrMtlCaps::onAreColorTypeAndFormatCompatible(GrColorType, GrBackendFormat const&) const + 
3   Flutter                       	       0x106878bfc validate_backend_texture(GrCaps const*, GrBackendTexture const&, int, GrColorType, bool) + 
4   Flutter                       	       0x106878e68 SkSurface::MakeFromBackendTexture(GrRecordingContext*, GrBackendTexture const&, GrSurfaceOrigin, int, SkColorType, sk_sp<SkColorSpace>, SkSurfaceProps const*, void (*)(void*), void*) + 
5   Flutter                       	       0x106c00d60 flutter::(anonymous namespace)::CreateSurfaceFromMetalTexture(GrDirectContext*, id<MTLTexture>, GrSurfaceOrigin, MsaaSampleCount, SkColorType, sk_sp<SkColorSpace>, SkSurfaceProps const*, void (*)(void*), SkSurfaceProps const*) + 
6   Flutter                       	       0x106c00448 flutter::GPUSurfaceMetalSkia::AcquireFrame(SkISize const&) + 
7   Flutter                       	       0x1069faec8 flutter::Rasterizer::DrawToSurfaceUnsafe(flutter::FrameTimingsRecorder&, flutter::LayerTree&) + 
8   Flutter                       	       0x1069fb4e8 std::_LIBCPP_ABI_NAMESPACE::__function::__func<flutter::Rasterizer::DrawToSurface(flutter::FrameTimingsRecorder&, flutter::LayerTree&)::$_1, std::_LIBCPP_ABI_NAMESPACE::allocator<flutter::Rasterizer::DrawToSurface(flutter::FrameTimingsRecorder&, flutter::LayerTree&)::$_1>, void ()>::operator()() + 
9   Flutter                       	       0x106901e24 fml::SyncSwitch::Execute(fml::SyncSwitch::Handlers const&) const + 
10  Flutter                       	       0x1069fac04 flutter::Rasterizer::DrawToSurface(flutter::FrameTimingsRecorder&, flutter::LayerTree&) + 
11  Flutter                       	       0x1069fc430 std::_LIBCPP_ABI_NAMESPACE::__function::__func<flutter::Rasterizer::Draw(std::_LIBCPP_ABI_NAMESPACE::shared_ptr<flutter::Pipeline<flutter::LayerTreeItem>> const&, std::_LIBCPP_ABI_NAMESPACE::function<bool (flutter::LayerTree&)>)::$_1, std::_LIBCPP_ABI_NAMESPACE::allocator<flutter::Rasterizer::Draw(std::_LIBCPP_ABI_NAMESPACE::shared_ptr<flutter::Pipeline<flutter::LayerTreeItem>> const&, std::_LIBCPP_ABI_NAMESPACE::function<bool (flutter::LayerTree&)>)::$_1>, void (std::_LIBCPP_ABI_NAMESPACE::unique_ptr<flutter::LayerTreeItem, std::_LIBCPP_ABI_NAMESPACE::default_delete<flutter::LayerTreeItem>>)>::operator()(std::_LIBCPP_ABI_NAMESPACE::unique_ptr<flutter::LayerTreeItem, std::_LIBCPP_ABI_NAMESPACE::default_delete<flutter::LayerTreeItem>>&&) + 
12  Flutter                       	       0x1069fb728 flutter::Rasterizer::Draw(std::_LIBCPP_ABI_NAMESPACE::shared_ptr<flutter::Pipeline<flutter::LayerTreeItem>> const&, std::_LIBCPP_ABI_NAMESPACE::function<bool (flutter::LayerTree&)>) + 
13  Flutter                       	       0x106a12a74 std::_LIBCPP_ABI_NAMESPACE::__function::__func<fml::internal::CopyableLambda<flutter::Shell::OnAnimatorDraw(std::_LIBCPP_ABI_NAMESPACE::shared_ptr<flutter::Pipeline<flutter::LayerTreeItem>>)::$_0>, std::_LIBCPP_ABI_NAMESPACE::allocator<fml::internal::CopyableLambda<flutter::Shell::OnAnimatorDraw(std::_LIBCPP_ABI_NAMESPACE::shared_ptr<flutter::Pipeline<flutter::LayerTreeItem>>)::$_0>>, void ()>::operator()() + 
14  Flutter                       	       0x10690045c fml::MessageLoopImpl::FlushTasks(fml::FlushType) + 
15  Flutter                       	       0x106903788 fml::MessageLoopDarwin::OnTimerFire(__CFRunLoopTimer*, fml::MessageLoopDarwin*) + 
16  CoreFoundation                	       0x1c0ec635c __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 
17  CoreFoundation                	       0x1c0e829d8 __CFRunLoopDoTimer + 
18  CoreFoundation                	       0x1c0e26598 __CFRunLoopDoTimers + 
19  CoreFoundation                	       0x1c0e73fcc __CFRunLoopRun + 
20  CoreFoundation                	       0x1c0e78ed4 CFRunLoopRunSpecific + 
21  Flutter                       	       0x106903874 fml::MessageLoopDarwin::Run() + 
22  Flutter                       	       0x106903364 void* std::_LIBCPP_ABI_NAMESPACE::__thread_proxy[abi:v15000]<std::_LIBCPP_ABI_NAMESPACE::tuple<std::_LIBCPP_ABI_NAMESPACE::unique_ptr<std::_LIBCPP_ABI_NAMESPACE::__thread_struct, std::_LIBCPP_ABI_NAMESPACE::default_delete<std::_LIBCPP_ABI_NAMESPACE::__thread_struct>>, fml::Thread::Thread(std::_LIBCPP_ABI_NAMESPACE::function<void (fml::Thread::ThreadConfig const&)> const&, fml::Thread::ThreadConfig const&)::$_0>>(void*) + 
23  libsystem_pthread.dylib       	       0x20de586cc _pthread_start + 
24  libsystem_pthread.dylib       	       0x20de57ba4 thread_start + 

Assertion message is:

../../third_party/skia/src/gpu/ganesh/mtl/GrMtlCaps.mm:630: fatal error: "Invalid MTLPixelFormat"

Nothing in the surface selection has changed recently. If we had a reproducible test case, we could log the format on failure here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P0Critical issues such as a build break or regressionengineflutter/engine related. See also e: labels.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions