Skip to content

Crash stemming from MTLRiveColorPixelFormat in New Runtime #453

Description

@khaptonstall

Submission checklist

  • I have confirmed the issue is present in the latest version of RiveRuntime
  • I have searched the documentation and forums and could not find an answer
  • I have searched existing issues and this is not a duplicate

Description

We've begun seeing a crash pop up as we're rolling out the New Rive Runtime in our app.

The crash appears on the app.rive.command-server thread with the following stacktrace:

Crashed: app.rive.command-server
0  QuartzCore                     0xb6f24 layer_private_release(_CAMetalLayerPrivate*) + 20
1  QuartzCore                     0xdfdf8 -[CAMetalDrawable dealloc] + 208
2  RiveRuntime                    0x9598c MTLRiveColorPixelFormat + 483780
3  libswiftCore.dylib             0x2f7184 _swift_release_dealloc + 28
4  libswiftCore.dylib             0x2f8060 bool swift::RefCounts<swift::RefCountBitsT<(swift::RefCountInlinedness)1> >::doDecrementSlow<(swift::PerformDeinit)1>(swift::RefCountBitsT<(swift::RefCountInlinedness)1>, unsigned int) + 184
5  libsystem_blocks.dylib         0x16cc _call_dispose_helpers_excp + 44
6  libsystem_blocks.dylib         0x135c _Block_release + 300
7  libsystem_blocks.dylib         0x1074 _Block_object_dispose + 220
8  RiveRuntime                    0x1f680 RiveViewModelInstanceDataTypeFromCpp(rive::DataType) + 47720
9  libsystem_blocks.dylib         0x16cc _call_dispose_helpers_excp + 44
10 libsystem_blocks.dylib         0x135c _Block_release + 300
11 RiveRuntime                    0xe73d4 rive::CommandServer::processCommands() + 18956
12 RiveRuntime                    0xe2968 rive::CommandServer::serveUntilDisconnect() + 48
13 RiveRuntime                    0x137dc RiveHitResultFromRuntime(rive::HitResult) + 18660
14 libdispatch.dylib              0x637a8 _dispatch_call_block_and_release + 24
15 libdispatch.dylib              0x64780 _dispatch_client_callout + 16
16 libdispatch.dylib              0x673c _dispatch_continuation_pop$VARIANT$mp + 444
17 libdispatch.dylib              0x5e60 _dispatch_async_redirect_invoke + 588
18 libdispatch.dylib              0x13ab0 _dispatch_root_queue_drain + 340
19 libdispatch.dylib              0x142ac _dispatch_worker_thread2 + 172
20 libsystem_pthread.dylib        0x1b94 _pthread_wqthread + 224
21 libsystem_pthread.dylib        0x1720 start_wqthread + 8

Additionally, here's the Main Thread stack trace at time of the crash:

com.apple.main-thread
0  libsystem_kernel.dylib         0xfc4 semaphore_timedwait_trap + 8
1  libdispatch.dylib              0x4580 _dispatch_sema4_timedwait$VARIANT$mp + 60
2  libdispatch.dylib              0x4b18 _dispatch_semaphore_wait_slow + 72
3  QuartzCore                     0x230c0 -[CAMetalLayer nextDrawable] + 880
4  MetalKit                       0x1ff8 -[MTKView currentDrawable] + 176
5  RiveRuntime                    0x92a4c MTLRiveColorPixelFormat + 471684
6  RiveRuntime                    0x928d0 MTLRiveColorPixelFormat + 471304
7  RiveRuntime                    0x9371c MTLRiveColorPixelFormat + 474964
8  MetalKit                       0x24fc -[MTKView draw] + 156
9  QuartzCore                     0x1c538 CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 408
10 QuartzCore                     0x2cef4 CA::Context::commit_transaction(CA::Transaction*, double, double*) + 456
11 QuartzCore                     0x5a29c CA::Transaction::commit() + 644
12 QuartzCore                     0x27e54 CA::Display::DisplayLink::dispatch_items(unsigned long long, unsigned long long, unsigned long long) + 1524
13 QuartzCore                     0x3733c display_timer_callback(__CFMachPort*, void*, long, void*) + 368
14 CoreFoundation                 0x74e64 __CFMachPortPerform + 172
15 CoreFoundation                 0x90020 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 56
16 CoreFoundation                 0x91c34 __CFRunLoopDoSource1 + 512
17 CoreFoundation                 0x757c4 __CFRunLoopRun + 2332
18 CoreFoundation                 0x79da0 CFRunLoopRunSpecific + 584
19 GraphicsServices               0x1998 GSEventRunModal + 160
20 UIKitCore                      0x37180c -[UIApplication _run] + 868
21 UIKitCore                      0x371484 UIApplicationMain + 312
22 <Our App>                  0x40f0 main + 14 (main.swift:14)
23 ???                            0x1adb2c344 (Missing)

We've recorded crashes on the following device/OS combinations:

  • iPad (7th generation) (iPadOS 16.6.1)

  • iPad (6th generation) (iPadOS 16.3.1, 17.0.1)

  • iPad (5th generation) (iPadOS 16.7.12, 16.7.16)

  • iPhone 8 Plus (iOS 16.7.16)

  • iPhone 8 (iOS 16.7.16)

  • iPhone 15 Plus (iOS 17.3.1)

Personally, I have been unable to reproduce on the following:

  • iPad Pro (10.5 in) (iPadOS 17.4.1)
  • iPad (7th generation) (iPadOS 18.7.9)
  • iPad Simulator (7th generation) (iPadOS 16.4)

Previous working version

No response

Rive Apple runtime version

6.20.5

Reproduction steps / code

No response

Upload your reproduction files / stack trace

No response

Source .riv / .rev file

No response

Screenshots / video

No response

Device

iPad/iPhone

Apple OS version

  • iPadOS 16.x.x, 17.x.x
  • iOS 16.x.x, 17.x.x

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions