Seeing iOS app crash in production with Compose Mu...
# compose-ios
d
Seeing iOS app crash in production with Compose Multiplatform (1.8.1, Kotlin 2.2.0). The crash happens inside
Surface.makeFromBackendRenderTarget
, but I can't figure out the root cause from the stack trace. Stack trace in 🧵
Copy code
Thread 0 Crashed:
0   libsystem_malloc.dylib          _xzm_xzone_malloc_tiny_outlined
1   libc++abi.dylib                 [inlined] std::runtime_error::~runtime_error
2   libc++abi.dylib                 std::runtime_error::~runtime_error
3   MyApp                           skgpu::ganesh::Device::Make
4   MyApp                           skgpu::ganesh::Device::Make
5   MyApp                           GrRecordingContextPriv::createDevice
6   MyApp                           SkSurfaces::WrapBackendRenderTarget
7   MyApp                           org_jetbrains_skia_Surface__1nMakeFromBackendRenderTarget
8   MyApp                           [inlined] inlined-lambda (Surface.kt:281)
9   MyApp                           [inlined] kfun:org.jetbrains.skia.impl#interopScope{0§<T>}0:0 (Native.native.kt:60)
10  MyApp                          kfun:org.jetbrains.skia.Surface.Companion#makeFromBackendRenderTarget{}org.jetbrains.skia.Surface? (Surface.kt:280)
11  MyApp                           [inlined] inlined-lambda (MetalRedrawer.uikit.kt:360)
12  MyApp                           [inlined] kfun:kotlinx.cinterop#autoreleasepool{0§<T>}0:0 (ObjectiveCUtils.kt:13)
13  MyApp                           [inlined] inlined-lambda (MetalRedrawer.uikit.kt:313)
14  MyApp                           [inlined] kfun:androidx.compose.ui.util#trace{0§<T>}0:0 (Trace.uikit.kt:35)
15  MyApp                           kfun:androidx.compose.ui.window.MetalRedrawer.draw#internal (MetalRedrawer.uikit.kt:308)
16  MyApp                           [inlined] inlined-lambda (MetalRedrawer.uikit.kt:224)
17  MyApp                           [inlined] inlined-out:onDisplayLinkTick (MetalRedrawer.uikit.kt:83)
18  MyApp                           [inlined] kfun:androidx.compose.ui.window.MetalRedrawer.MetalRedrawer$2.invoke#internal (MetalRedrawer.uikit.kt:223)
19  MyApp                           kfun:androidx.compose.ui.window.MetalRedrawer.MetalRedrawer$2.$<T>invoke{}#internal (MetalRedrawer.uikit.kt:220)
20  MyApp                           [inlined] kfun:kotlin.Function0#invoke{}1:0-trampoline ([K][Suspend]Functions:1)
21  MyApp                           [inlined] kfun:androidx.compose.ui.window.DisplayLinkProxy.handleDisplayLinkTick#internal (MetalRedrawer.uikit.kt:515)
22  MyApp                           kfun:androidx.compose.ui.window.DisplayLinkProxy.$imp:handleDisplayLinkTick#internal (MetalRedrawer.uikit.kt:512)
23  QuartzCore               CA::Display::DisplayLinkItem::dispatch_
24  QuartzCore               CA::Display::DisplayLink::dispatch_items
25  QuartzCore               CA::Display::DisplayLink::dispatch_deferred_display_links
26  UIKitCore                  _UIUpdateSequenceRun
27  UIKitCore                  schedulerStepScheduledMainSection
28  UIKitCore                  runloopSourceCallback
29  CoreFoundation        __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__
30  CoreFoundation        __CFRunLoopDoSource0
31  CoreFoundation        __CFRunLoopDoSources0
32  CoreFoundation        __CFRunLoopRun
33  CoreFoundation        CFRunLoopRunSpecific
34  GraphicsServices     GSEventRunModal
35  UIKitCore                 -[UIApplication _run]
36  UIKitCore                 UIApplicationMain
37  SwiftUI                     closure in KitRendererCommon
38  SwiftUI                     runApp<T>
39  SwiftUI                     App.main
40  MyApp                         [inlined] iOSApp.$main
41  MyApp                         main
42  dyld                         start
a
Do you have a stable reproducer? Also, I'd like to see the full crashlog.