react-native-skia: Crash in 0.1.120

Hi,

The fix applied in version 0.1.120 seems to work pretty well for the piling of views, at least in debug 😃

We have a crash of the app, only in release, here is the Sentry log:

OS Version: iOS 15.3.1 (19D52)
Report Version: 104

Exception Type: EXC_CRASH (SIGABRT)
Crashed Thread: 12

Application Specific Information:
allowsWeakReference > Cannot form weak reference to instance (0x2819e8a80) of class CAMetalLayer. It is possible that this object was over-released, or is in the process of deallocation. > objc[1151]: Cannot form weak reference to instance (0x2819e8a80) of class CAMetalLayer. It is possible that this object was over-released, or is in the process of deallocation.


Thread 12 Crashed:
0   libsystem_kernel.dylib          0x36f562cf8         __abort_with_payload
1   libsystem_kernel.dylib          0x36f5655b4         abort_with_payload_wrapper_internal
2   libsystem_kernel.dylib          0x36f56554c         abort_with_reason
3   libobjc.A.dylib                 0x331862348         _objc_fatalv
4   libobjc.A.dylib                 0x3318622dc         _objc_fatal
5   libobjc.A.dylib                 0x33183d4a0         weak_register_no_lock
6   libobjc.A.dylib                 0x331842508         objc_storeWeak
7   QuartzCore                      0x30825fb34         -[CAMetalDrawable initWithDrawablePrivate:layer:]
8   QuartzCore                      0x308175d08         -[CAMetalLayer nextDrawable]
9   app                             0x203164be4         RNSkDrawViewImpl::drawFrame
10  app                             0x2031652a8         std::__1::__invoke_void_return_wrapper<T>::__call<T>
11  app                             0x2031645ac         std::__1::__function::__func<T>::operator()
12  app                             0x203160a08         RNSkia::RNSkDispatchQueue::dispatch_thread_handler
13  app                             0x203160dc0         std::__1::__thread_proxy<T>
14  libsystem_pthread.dylib         0x3e2ec59a0         _pthread_start

Thread 0
0   libsystem_kernel.dylib          0x36f53a1a4         __ulock_wait
1   libsystem_platform.dylib        0x3e2eb49a0         _os_unfair_lock_lock_slow
2   QuartzCore                      0x308203794         layer_private_release
3   QuartzCore                      0x3082933bc         -[CAMetalLayer dealloc]
4   app                             0x20319fdf0         std::__1::__shared_ptr_emplace<T>::__on_zero_shared
5   app                             0x20319f6e0         -[SkiaDrawView willMoveToWindow:]
6   UIKitCore                       0x305163cf8         __UIViewWillBeRemovedFromSuperview
7   UIKitCore                       0x305193088         -[UIView(Hierarchy) removeFromSuperview]
8   app                             0x203004c18         -[UIView(React) removeReactSubview:]
9   app                             0x202fef330         -[RCTUIManager _removeChildren:fromContainer:]
10  app                             0x202ff067c         -[RCTUIManager _manageChildren:moveFromIndices:moveToIndices:addChildReactTags:addAtIndices:removeAtIndices:registry:]
11  app                             0x202f491e0         -[REAUIManager _manageChildren:moveFromIndices:moveToIndices:addChildReactTags:addAtIndices:removeAtIndices:registry:]
12  app                             0x202ff04b0         __108-[RCTUIManager manageChildren:moveFromIndices:moveToIndices:addChildReactTags:addAtIndices:removeAtIndices:]_block_invoke
13  app                             0x202ff21c8         __44-[RCTUIManager flushUIBlocksWithCompletion:]_block_invoke
14  app                             0x202ff22bc         __44-[RCTUIManager flushUIBlocksWithCompletion:]_block_invoke.426
15  libdispatch.dylib               0x3000a0920         _dispatch_call_block_and_release
16  libdispatch.dylib               0x3000a266c         _dispatch_client_callout
17  libdispatch.dylib               0x3000b0b6c         _dispatch_main_queue_callback_4CF
18  CoreFoundation                  0x3006e1d80         __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__
19  CoreFoundation                  0x30069bf58         __CFRunLoopRun
20  CoreFoundation                  0x3006af464         CFRunLoopRunSpecific
21  GraphicsServices                0x337e15388         GSEventRunModal
22  UIKitCore                       0x3054fb5cc         -[UIApplication _run]
23  UIKitCore                       0x305279f70         UIApplicationMain
24  app                             0x202ea941c         main
25  <unknown>                       0x1041b1aa4         <redacted>

Thread 1
0   libsystem_pthread.dylib         0x3e2ec4e8c         start_wqthread

Thread 2
0   libsystem_kernel.dylib          0x36f539b2c         __workq_kernreturn
1   libsystem_pthread.dylib         0x3e2ec513c         _pthread_wqthread

Thread 3
0   libsystem_malloc.dylib          0x32419bd90         small_madvise_free_range_no_lock
1   libsystem_malloc.dylib          0x32419ce70         free_small
2   IOGPU                           0x393e19cd4         IOGPUMetalCommandBufferStorageReleaseAllResources
3   IOGPU                           0x393e190bc         IOGPUMetalCommandBufferStorageDealloc
4   IOGPU                           0x393e17058         -[IOGPUMetalCommandBuffer didCompleteWithStartTime:endTime:error:]
5   Metal                           0x3351b484c         -[_MTLCommandQueue commandBufferDidComplete:startTime:completionTime:error:]
6   IOGPU                           0x393e16dd0         __IOGPUNotificationQueueSetDispatchQueue_block_invoke
7   libdispatch.dylib               0x3000a272c         _dispatch_client_callout4
8   libdispatch.dylib               0x3000be7a4         _dispatch_mach_msg_invoke
9   libdispatch.dylib               0x3000a9cc8         _dispatch_lane_serial_drain
10  libdispatch.dylib               0x3000bf4f4         _dispatch_mach_invoke
11  libdispatch.dylib               0x3000a9cc8         _dispatch_lane_serial_drain
12  libdispatch.dylib               0x3000aa998         _dispatch_lane_invoke
13  libdispatch.dylib               0x3000a9cc8         _dispatch_lane_serial_drain
14  libdispatch.dylib               0x3000aa964         _dispatch_lane_invoke
15  libdispatch.dylib               0x3000b51b4         _dispatch_workloop_worker_thread
16  libsystem_pthread.dylib         0x3e2ec50f0         _pthread_wqthread

Thread 4 name: com.apple.uikit.eventfetch-thread
0   libsystem_kernel.dylib          0x36f539504         mach_msg_trap
1   libsystem_kernel.dylib          0x36f539b98         mach_msg
2   CoreFoundation                  0x300697734         __CFRunLoopServiceMachPort
3   CoreFoundation                  0x30069ba28         __CFRunLoopRun
4   CoreFoundation                  0x3006af464         CFRunLoopRunSpecific
5   Foundation                      0x3036f2c80         -[NSRunLoop(NSRunLoop) runMode:beforeDate:]
6   Foundation                      0x303733db4         -[NSRunLoop(NSRunLoop) runUntilDate:]
7   UIKitCore                       0x305474748         -[UIEventFetcher threadMain]
8   Foundation                      0x3037423f8         __NSThread__start__
9   libsystem_pthread.dylib         0x3e2ec59a0         _pthread_start

Thread 5
0   libsystem_kernel.dylib          0x36f539b2c         __workq_kernreturn
1   libsystem_pthread.dylib         0x3e2ec513c         _pthread_wqthread

Thread 6
0   libsystem_kernel.dylib          0x36f539b2c         __workq_kernreturn
1   libsystem_pthread.dylib         0x3e2ec513c         _pthread_wqthread

Thread 7 name: com.facebook.react.JavaScript
0   hermes                          0x10438039c         facebook::jsi::JSError::~JSError
1   hermes                          0x10437acb4         facebook::jsi::JSError::~JSError
2   hermes                          0x104361f28         facebook::jsi::JSError::~JSError
3   hermes                          0x104361884         facebook::jsi::JSError::~JSError
4   hermes                          0x104379c10         facebook::jsi::JSError::~JSError
5   hermes                          0x10437b5c0         facebook::jsi::JSError::~JSError
6   hermes                          0x10437acb4         facebook::jsi::JSError::~JSError
7   hermes                          0x104361f28         facebook::jsi::JSError::~JSError
8   hermes                          0x104360d3c         facebook::jsi::JSError::~JSError
9   hermes                          0x104400780         facebook::jsi::JSError::~JSError
10  hermes                          0x104361d14         facebook::jsi::JSError::~JSError
11  hermes                          0x104379c04         facebook::jsi::JSError::~JSError
12  hermes                          0x10437b5c0         facebook::jsi::JSError::~JSError
13  hermes                          0x10437acb4         facebook::jsi::JSError::~JSError
14  hermes                          0x104361f28         facebook::jsi::JSError::~JSError
15  hermes                          0x104361884         facebook::jsi::JSError::~JSError
16  hermes                          0x10434c34c         facebook::hermes::HermesRuntime::rootsListLength
17  app                             0x203090ee8         facebook::jsi::WithRuntimeDecorator<T>::call
18  app                             0x2030c2c68         facebook::jsi::Function::call<T>
19  app                             0x2030c2acc         std::__1::__function::__func<T>::operator()
20  app                             0x202f59248         std::__1::__invoke_void_return_wrapper<T>::__call<T>
21  app                             0x2030c003c         facebook::react::JSIExecutor::callFunction
22  app                             0x203069b1c         std::__1::__function::__func<T>::operator()
23  app                             0x202fb4530         facebook::react::tryAndReturnError
24  app                             0x202fc08a8         facebook::react::RCTMessageThread::tryFunc
25  app                             0x202fc065c         facebook::react::RCTMessageThread::runAsync
26  CoreFoundation                  0x3007029d0         __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__
27  CoreFoundation                  0x3007038cc         __CFRunLoopDoBlocks
28  CoreFoundation                  0x30069b8b4         __CFRunLoopRun
29  CoreFoundation                  0x3006af464         CFRunLoopRunSpecific
30  app                             0x202fa94e4         +[RCTCxxBridge runRunLoop]
31  Foundation                      0x3037423f8         __NSThread__start__
32  libsystem_pthread.dylib         0x3e2ec59a0         _pthread_start

Thread 8 name: hades
0   libsystem_kernel.dylib          0x36f539f90         __psynch_cvwait
1   libsystem_pthread.dylib         0x3e2ecc250         _pthread_cond_wait
2   libc++.1.dylib                  0x33198ddd8         std::__1::condition_variable::wait
3   hermes                          0x10441b1a4         facebook::jsi::JSError::~JSError
4   hermes                          0x10441b0d8         facebook::jsi::JSError::~JSError
5   libsystem_pthread.dylib         0x3e2ec59a0         _pthread_start

Thread 9 name: hermes-chrome-inspector-conn
0   libsystem_kernel.dylib          0x36f539f90         __psynch_cvwait
1   libsystem_pthread.dylib         0x3e2ecc250         _pthread_cond_wait
2   libc++.1.dylib                  0x33198ddd8         std::__1::condition_variable::wait
3   app                             0x2030b88c0         facebook::hermes::inspector::detail::SerialExecutor::runLoop
4   app                             0x203079d34         std::__1::__thread_proxy<T>
5   libsystem_pthread.dylib         0x3e2ec59a0         _pthread_start

Thread 10 name: hermes-inspector
0   libsystem_kernel.dylib          0x36f539f90         __psynch_cvwait
1   libsystem_pthread.dylib         0x3e2ecc250         _pthread_cond_wait
2   libc++.1.dylib                  0x33198ddd8         std::__1::condition_variable::wait
3   app                             0x2030b88c0         facebook::hermes::inspector::detail::SerialExecutor::runLoop
4   app                             0x203079d34         std::__1::__thread_proxy<T>
5   libsystem_pthread.dylib         0x3e2ec59a0         _pthread_start

Thread 11 name: hades
0   libsystem_kernel.dylib          0x36f539f90         __psynch_cvwait
1   libsystem_pthread.dylib         0x3e2ecc250         _pthread_cond_wait
2   libc++.1.dylib                  0x33198ddd8         std::__1::condition_variable::wait
3   hermes                          0x10441b1a4         facebook::jsi::JSError::~JSError
4   hermes                          0x10441b0d8         facebook::jsi::JSError::~JSError
5   libsystem_pthread.dylib         0x3e2ec59a0         _pthread_start

Thread 12 Crashed:
0   libsystem_kernel.dylib          0x36f562cf8         __abort_with_payload
1   libsystem_kernel.dylib          0x36f5655b4         abort_with_payload_wrapper_internal
2   libsystem_kernel.dylib          0x36f56554c         abort_with_reason
3   libobjc.A.dylib                 0x331862348         _objc_fatalv
4   libobjc.A.dylib                 0x3318622dc         _objc_fatal
5   libobjc.A.dylib                 0x33183d4a0         weak_register_no_lock
6   libobjc.A.dylib                 0x331842508         objc_storeWeak
7   QuartzCore                      0x30825fb34         -[CAMetalDrawable initWithDrawablePrivate:layer:]
8   QuartzCore                      0x308175d08         -[CAMetalLayer nextDrawable]
9   app                             0x203164be4         RNSkDrawViewImpl::drawFrame
10  app                             0x2031652a8         std::__1::__invoke_void_return_wrapper<T>::__call<T>
11  app                             0x2031645ac         std::__1::__function::__func<T>::operator()
12  app                             0x203160a08         RNSkia::RNSkDispatchQueue::dispatch_thread_handler
13  app                             0x203160dc0         std::__1::__thread_proxy<T>
14  libsystem_pthread.dylib         0x3e2ec59a0         _pthread_start

Thread 13
0   libsystem_kernel.dylib          0x36f539ae4         __semwait_signal
1   libsystem_c.dylib               0x31651eefc         nanosleep
2   libsystem_c.dylib               0x316532f38         sleep
3   app                             0x2030f07bc         monitorCachedData
4   libsystem_pthread.dylib         0x3e2ec59a0         _pthread_start

Thread 14 name: SentryCrash Exception Handler (Secondary)
0   libsystem_kernel.dylib          0x36f539504         mach_msg_trap
1   libsystem_kernel.dylib          0x36f539b98         mach_msg
2   libsystem_kernel.dylib          0x36f54522c         thread_suspend
3   app                             0x2030fd58c         handleExceptions
4   libsystem_pthread.dylib         0x3e2ec59a0         _pthread_start

Thread 15 name: SentryCrash Exception Handler (Primary)
0   libsystem_kernel.dylib          0x36f539504         mach_msg_trap
1   libsystem_kernel.dylib          0x36f539b98         mach_msg
2   app                             0x2030fd5b8         handleExceptions
3   libsystem_pthread.dylib         0x3e2ec59a0         _pthread_start

Thread 16 name: com.apple.NSURLConnectionLoader
0   libsystem_kernel.dylib          0x36f539504         mach_msg_trap
1   libsystem_kernel.dylib          0x36f539b98         mach_msg
2   CoreFoundation                  0x300697734         __CFRunLoopServiceMachPort
3   CoreFoundation                  0x30069ba28         __CFRunLoopRun
4   CoreFoundation                  0x3006af464         CFRunLoopRunSpecific
5   CFNetwork                       0x30194050c         _CFURLStorageSessionCopyIdentifier
6   Foundation                      0x3037423f8         __NSThread__start__
7   libsystem_pthread.dylib         0x3e2ec59a0         _pthread_start



EOF

I tried to rollback to 0.1.119, no more crash.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 3
  • Comments: 52 (1 by maintainers)

Most upvoted comments

Both issues are fixed! I can’t get it to crash anymore, even when pushing it to the limits. Thanks a lot for fixing this!

I will test Android as well, and let you know in a bit.

Great! I will test it immediately.

Still working on solving this issue. It is a tough one…

Thanks for helping out, I’m working on this one now.

I’ll try to do this, the thing is you’ll have to generate an AdHoc/Appstore profile to test the app in release mode