This scenario can happen when LayoutAnimations API is used when the app is first rendered. The main thread is trying to lock the ComponentDescriptorRegistry mutex, while the JS thread is holding the lock, and trying to execute a synchronous callback on the main thread. We have a similar case in reanimated, with our implementation of layout animations.
System:
OS: macOS 15.3.2
CPU: (14) arm64 Apple M4 Pro
Memory: 134.70 MB / 24.00 GB
Shell:
version: "5.9"
path: /bin/zsh
Binaries:
Node:
version: 22.14.0
path: ~/.nvm/versions/node/v22.14.0/bin/node
Yarn:
version: 1.22.19
path: /opt/homebrew/bin/yarn
npm:
version: 10.9.2
path: ~/.nvm/versions/node/v22.14.0/bin/npm
Watchman:
version: 2025.03.10.00
path: /opt/homebrew/bin/watchman
Managers:
CocoaPods:
version: 1.16.2
path: /Users/bartlomiejbloniarz/.rbenv/shims/pod
SDKs:
iOS SDK:
Platforms:
- DriverKit 24.5
- iOS 18.5
- macOS 15.5
- tvOS 18.5
- visionOS 2.5
- watchOS 11.5
Android SDK:
API Levels:
- "30"
- "31"
- "33"
- "34"
- "35"
- "36"
Build Tools:
- 30.0.2
- 30.0.3
- 33.0.0
- 33.0.1
- 34.0.0
- 35.0.0
- 36.0.0
System Images:
- android-33 | Google APIs ARM 64 v8a
- android-34 | Google APIs ARM 64 v8a
- android-35 | ARM 64 v8a
- android-35 | Google APIs ARM 64 v8a
- android-35 | Google Play ARM 64 v8a
- android-36 | Google Play ARM 64 v8a
Android NDK: Not Found
IDEs:
Android Studio: 2025.1 AI-251.25410.109.2511.13752376
Xcode:
version: 16.4/16F6
path: /usr/bin/xcodebuild
Languages:
Java:
version: 17.0.14
path: /opt/homebrew/opt/openjdk@17/bin/javac
Ruby:
version: 3.4.2
path: /Users/bartlomiejbloniarz/.rbenv/shims/ruby
npmPackages:
"@react-native-community/cli": Not Found
react: Not Found
react-native: Not Found
react-native-macos: Not Found
npmGlobalPackages:
"*react-native*": Not Found
Android:
hermesEnabled: false
newArchEnabled: false
iOS:
hermesEnabled: true
newArchEnabled: true
main thread:
#0 0x00000001048f082c in __psynch_cvwait ()
#1 0x000000010495bc98 in _pthread_cond_wait ()
#2 0x000000018030529c in std::__1::condition_variable::wait ()
#3 0x00000001803069a0 in std::__1::__shared_mutex_base::lock_shared ()
#4 0x0000000108837f24 in std::__1::shared_mutex::lock_shared[abi:de190102] at /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.5.sdk/usr/include/c++/v1/shared_mutex:206
#5 0x0000000108837efc in std::__1::shared_lock<std::__1::shared_mutex>::shared_lock[abi:de190102] at /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.5.sdk/usr/include/c++/v1/shared_mutex:322
#6 0x0000000108834848 in std::__1::shared_lock<std::__1::shared_mutex>::shared_lock[abi:de190102] at /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.5.sdk/usr/include/c++/v1/shared_mutex:321
#7 0x000000010883b678 in facebook::react::ComponentDescriptorRegistry::hasComponentDescriptorAt at /Users/bartlomiejbloniarz/react-native/packages/react-native/ReactCommon/react/renderer/componentregistry/ComponentDescriptorRegistry.cpp:138
#8 0x00000001088928a0 in facebook::react::LayoutAnimationKeyFrameManager::hasComponentDescriptorForShadowView at /Users/bartlomiejbloniarz/react-native/packages/react-native/ReactCommon/react/renderer/animations/LayoutAnimationKeyFrameManager.cpp:1067
#9 0x0000000108895224 in facebook::react::LayoutAnimationKeyFrameManager::createInterpolatedShadowView at /Users/bartlomiejbloniarz/react-native/packages/react-native/ReactCommon/react/renderer/animations/LayoutAnimationKeyFrameManager.cpp:1083
#10 0x0000000108886630 in facebook::react::LayoutAnimationDriver::animationMutationsForFrame at /Users/bartlomiejbloniarz/react-native/packages/react-native/ReactCommon/react/renderer/animations/LayoutAnimationDriver.cpp:54
#11 0x0000000108891cf4 in facebook::react::LayoutAnimationKeyFrameManager::pullTransaction at /Users/bartlomiejbloniarz/react-native/packages/react-native/ReactCommon/react/renderer/animations/LayoutAnimationKeyFrameManager.cpp:982
#12 0x00000001088c0c34 in facebook::react::MountingCoordinator::pullTransaction at /Users/bartlomiejbloniarz/react-native/packages/react-native/ReactCommon/react/renderer/mounting/MountingCoordinator.cpp:135
#13 0x000000010894ecac in facebook::react::TelemetryController::pullTransaction at /Users/bartlomiejbloniarz/react-native/packages/react-native/ReactCommon/react/renderer/mounting/TelemetryController.cpp:22
#14 0x0000000108bb9038 in -[RCTMountingManager performTransaction:] at /Users/bartlomiejbloniarz/react-native/packages/react-native/React/Fabric/Mounting/RCTMountingManager.mm:258
#15 0x0000000108bb8d68 in -[RCTMountingManager initiateTransaction:] at /Users/bartlomiejbloniarz/react-native/packages/react-native/React/Fabric/Mounting/RCTMountingManager.mm:246
#16 0x0000000108bb8498 in -[RCTMountingManager scheduleTransaction:] at /Users/bartlomiejbloniarz/react-native/packages/react-native/React/Fabric/Mounting/RCTMountingManager.mm:193
#17 0x0000000108c14740 in -[RCTSurfacePresenter schedulerShouldRenderTransactions:] at /Users/bartlomiejbloniarz/react-native/packages/react-native/React/Fabric/RCTSurfacePresenter.mm:307
#18 0x0000000108bf2960 in SchedulerDelegateProxy::schedulerShouldRenderTransactions at /Users/bartlomiejbloniarz/react-native/packages/react-native/React/Fabric/RCTScheduler.mm:36
#19 0x00000001088f3ee4 in facebook::react::Scheduler::uiManagerDidFinishTransaction at /Users/bartlomiejbloniarz/react-native/packages/react-native/ReactCommon/react/renderer/scheduler/Scheduler.cpp:260
#20 0x0000000108968944 in facebook::react::UIManager::shadowTreeDidFinishTransaction at /Users/bartlomiejbloniarz/react-native/packages/react-native/ReactCommon/react/renderer/uimanager/UIManager.cpp:635
#21 0x0000000108927610 in facebook::react::ShadowTree::notifyDelegatesOfUpdates at /Users/bartlomiejbloniarz/react-native/packages/react-native/ReactCommon/react/renderer/mounting/ShadowTree.cpp:417
#22 0x000000010898daac in facebook::react::UIManager::animationTick() const::$_0::operator()(facebook::react::ShadowTree const&, bool&) const at /Users/bartlomiejbloniarz/react-native/packages/react-native/ReactCommon/react/renderer/uimanager/UIManager.cpp:685
#23 0x000000010898da80 in std::__1::__invoke[abi:de190102]<facebook::react::UIManager::animationTick() const::$_0&, facebook::react::ShadowTree const&, bool&> at /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.5.sdk/usr/include/c++/v1/__type_traits/invoke.h:149
#24 0x000000010898da28 in std::__1::__invoke_void_return_wrapper<void, true>::__call[abi:de190102]<facebook::react::UIManager::animationTick() const::$_0&, facebook::react::ShadowTree const&, bool&> at /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.5.sdk/usr/include/c++/v1/__type_traits/invoke.h:224
#25 0x000000010898d9f4 in std::__1::__function::__alloc_func<facebook::react::UIManager::animationTick() const::$_0, std::__1::allocator<facebook::react::UIManager::animationTick() const::$_0>, void (facebook::react::ShadowTree const&, bool&)>::operator()[abi:de190102] at /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.5.sdk/usr/include/c++/v1/__functional/function.h:171
#26 0x000000010898c89c in std::__1::__function::__func<facebook::react::UIManager::animationTick() const::$_0, std::__1::allocator<facebook::react::UIManager::animationTick() const::$_0>, void (facebook::react::ShadowTree const&, bool&)>::operator() at /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.5.sdk/usr/include/c++/v1/__functional/function.h:313
#27 0x00000001089349f4 in std::__1::__function::__value_func<void (facebook::react::ShadowTree const&, bool&)>::operator()[abi:de190102] at /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.5.sdk/usr/include/c++/v1/__functional/function.h:430
#28 0x0000000108931f94 in std::__1::function<void (facebook::react::ShadowTree const&, bool&)>::operator() at /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.5.sdk/usr/include/c++/v1/__functional/function.h:989
#29 0x0000000108931ea0 in facebook::react::ShadowTreeRegistry::enumerate at /Users/bartlomiejbloniarz/react-native/packages/react-native/ReactCommon/react/renderer/mounting/ShadowTreeRegistry.cpp:60
#30 0x0000000108968d90 in facebook::react::UIManager::animationTick at /Users/bartlomiejbloniarz/react-native/packages/react-native/ReactCommon/react/renderer/uimanager/UIManager.cpp:684
#31 0x00000001088f3d78 in facebook::react::Scheduler::animationTick at /Users/bartlomiejbloniarz/react-native/packages/react-native/ReactCommon/react/renderer/scheduler/Scheduler.cpp:235
#32 0x0000000108bf1d28 in -[RCTScheduler animationTick] at /Users/bartlomiejbloniarz/react-native/packages/react-native/React/Fabric/RCTScheduler.mm:149
#33 0x0000000108bf3b18 in LayoutAnimationDelegateProxy::activityDidChange at /Users/bartlomiejbloniarz/react-native/packages/react-native/React/Fabric/RCTScheduler.mm:109
#34 0x0000000108f818e8 in facebook::react::RunLoopObserver::activityDidChange at /Users/bartlomiejbloniarz/react-native/packages/react-native/ReactCommon/react/utils/RunLoopObserver.cpp:52
#35 0x0000000108b5f928 in invocation function for block in facebook::react::PlatformRunLoopObserver::PlatformRunLoopObserver(facebook::react::RunLoopObserver::Activity, std::__1::weak_ptr<void const>, __CFRunLoop*) at /Users/bartlomiejbloniarz/react-native/packages/react-native/React/Fabric/Utils/PlatformRunLoopObserver.mm:65
#36 0x000000018041c22c in __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ ()
#37 0x0000000180416a90 in __CFRunLoopDoObservers ()
#38 0x0000000180416f00 in __CFRunLoopRun ()
#39 0x0000000180416704 in CFRunLoopRunSpecific ()
#40 0x0000000190604b10 in GSEventRunModal ()
#41 0x0000000185b39180 in -[UIApplication _run] ()
#42 0x0000000185b3d378 in UIApplicationMain ()
#43 0x00000001084f5a8c in main at /Users/bartlomiejbloniarz/react-native/packages/rn-tester/RNTester/main.m:15
#44 0x0000000104825410 in start_sim ()
#45 0x00000001049d2274 in start ()
JS thread:
#5 0x00000001087004b4 in RCTUnsafeExecuteOnMainQueueSync at /Users/bartlomiejbloniarz/react-native/packages/react-native/React/Base/RCTUtils.mm:318
#6 0x0000000108a971bc in -[RCTTurboModuleManager _provideObjCModule:moduleHolder:shouldPerfLog:moduleProvider:] at /Users/bartlomiejbloniarz/react-native/packages/react-native/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModuleManager.mm:604
#7 0x0000000108a96dd4 in -[RCTTurboModuleManager _provideObjCModule:moduleProvider:] at /Users/bartlomiejbloniarz/react-native/packages/react-native/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModuleManager.mm:547
#8 0x0000000108a994d8 in -[RCTTurboModuleManager moduleForName:warnOnLookupFailure:] at /Users/bartlomiejbloniarz/react-native/packages/react-native/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModuleManager.mm:990
#9 0x0000000108a99480 in -[RCTTurboModuleManager moduleForName:] at /Users/bartlomiejbloniarz/react-native/packages/react-native/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModuleManager.mm:979
#10 0x000000010869f140 in -[RCTModuleRegistry moduleForName:lazilyLoadIfNecessary:] at /Users/bartlomiejbloniarz/react-native/packages/react-native/React/Base/RCTModuleRegistry.m:50
#11 0x000000010860c2a8 in -[RCTBridgeProxy moduleForName:lazilyLoadIfNecessary:] at /Users/bartlomiejbloniarz/react-native/packages/react-native/React/Base/RCTBridgeProxy.mm:121
#12 0x00000001088ba0a4 in facebook::react::getViewManagerClass at /Users/bartlomiejbloniarz/react-native/packages/react-native/ReactCommon/react/renderer/components/legacyviewmanagerinterop/LegacyViewManagerInteropComponentDescriptor.mm:101
#13 0x00000001088b888c in facebook::react::constructCoordinator at /Users/bartlomiejbloniarz/react-native/packages/react-native/ReactCommon/react/renderer/components/legacyviewmanagerinterop/LegacyViewManagerInteropComponentDescriptor.mm:125
#14 0x00000001088b860c in facebook::react::LegacyViewManagerInteropComponentDescriptor::LegacyViewManagerInteropComponentDescriptor at /Users/bartlomiejbloniarz/react-native/packages/react-native/ReactCommon/react/renderer/components/legacyviewmanagerinterop/LegacyViewManagerInteropComponentDescriptor.mm:153
#15 0x00000001088b8c7c in facebook::react::LegacyViewManagerInteropComponentDescriptor::LegacyViewManagerInteropComponentDescriptor at /Users/bartlomiejbloniarz/react-native/packages/react-native/ReactCommon/react/renderer/components/legacyviewmanagerinterop/LegacyViewManagerInteropComponentDescriptor.mm:154
#16 0x0000000108ba6de0 in std::__1::make_unique[abi:de190102]<facebook::react::LegacyViewManagerInteropComponentDescriptor const, facebook::react::ComponentDescriptorParameters const&> at /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.5.sdk/usr/include/c++/v1/__memory/unique_ptr.h:635
#17 0x0000000108ba6d94 in facebook::react::concreteComponentDescriptorConstructor<facebook::react::LegacyViewManagerInteropComponentDescriptor> at /Users/bartlomiejbloniarz/react-native/packages/rn-tester/Pods/Headers/Public/React-Fabric/react/renderer/componentregistry/ComponentDescriptorProvider.h:52
#18 0x000000010883a644 in facebook::react::ComponentDescriptorRegistry::add at /Users/bartlomiejbloniarz/react-native/packages/react-native/ReactCommon/react/renderer/componentregistry/ComponentDescriptorRegistry.cpp:35
#19 0x0000000108834390 in facebook::react::ComponentDescriptorProviderRegistry::add at /Users/bartlomiejbloniarz/react-native/packages/react-native/ReactCommon/react/renderer/componentregistry/ComponentDescriptorProviderRegistry.cpp:40
#20 0x0000000108b677b0 in -[RCTComponentViewFactory _registerComponentIfPossible:] at /Users/bartlomiejbloniarz/react-native/packages/react-native/React/Fabric/Mounting/RCTComponentViewFactory.mm:170
#21 0x0000000108b72018 in +[RCTComponentViewFactory currentComponentViewFactory]::'block-literal'::$_1::operator()(char const*) const at /Users/bartlomiejbloniarz/react-native/packages/react-native/React/Fabric/Mounting/RCTComponentViewFactory.mm:91
#22 0x0000000108b71fcc in std::__1::__invoke[abi:de190102]<+[RCTComponentViewFactory currentComponentViewFactory]::'block-literal'::$_1&, char const*> at /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.5.sdk/usr/include/c++/v1/__type_traits/invoke.h:149
#23 0x0000000108b71f78 in std::__1::__invoke_void_return_wrapper<void, true>::__call[abi:de190102]<+[RCTComponentViewFactory currentComponentViewFactory]::'block-literal'::$_1&, char const*> at /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.5.sdk/usr/include/c++/v1/__type_traits/invoke.h:224
#24 0x0000000108b71f4c in std::__1::__function::__alloc_func<+[RCTComponentViewFactory currentComponentViewFactory]::'block-literal'::$_1, std::__1::allocator<+[RCTComponentViewFactory currentComponentViewFactory]::'block-literal'::$_1>, void (char const*)>::operator()[abi:de190102] at /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.5.sdk/usr/include/c++/v1/__functional/function.h:171
#25 0x0000000108b70ddc in std::__1::__function::__func<+[RCTComponentViewFactory currentComponentViewFactory]::'block-literal'::$_1, std::__1::allocator<+[RCTComponentViewFactory currentComponentViewFactory]::'block-literal'::$_1>, void (char const*)>::operator() at /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.5.sdk/usr/include/c++/v1/__functional/function.h:313
#26 0x0000000108838704 in std::__1::__function::__value_func<void (char const*)>::operator()[abi:de190102] at /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.5.sdk/usr/include/c++/v1/__functional/function.h:430
#27 0x0000000108834aa8 in std::__1::function<void (char const*)>::operator() at /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.5.sdk/usr/include/c++/v1/__functional/function.h:989
#28 0x000000010883493c in facebook::react::ComponentDescriptorProviderRegistry::request at /Users/bartlomiejbloniarz/react-native/packages/react-native/ReactCommon/react/renderer/componentregistry/ComponentDescriptorProviderRegistry.cpp:62
#29 0x000000010883ade4 in facebook::react::ComponentDescriptorRegistry::at at /Users/bartlomiejbloniarz/react-native/packages/react-native/ReactCommon/react/renderer/componentregistry/ComponentDescriptorRegistry.cpp:71
#30 0x0000000108965300 in facebook::react::UIManager::createNode at /Users/bartlomiejbloniarz/react-native/packages/react-native/ReactCommon/react/renderer/uimanager/UIManager.cpp:69
#31 0x0000000108997e80 in facebook::react::UIManagerBinding::get(facebook::jsi::Runtime&, facebook::jsi::PropNameID const&)::$_0::operator()(facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned long) const at /Users/bartlomiejbloniarz/react-native/packages/react-native/ReactCommon/react/renderer/uimanager/UIManagerBinding.cpp:225
#32 0x0000000108997c6c in std::__1::__invoke[abi:de190102]<facebook::react::UIManagerBinding::get(facebook::jsi::Runtime&, facebook::jsi::PropNameID const&)::$_0&, facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned long> at /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.5.sdk/usr/include/c++/v1/__type_traits/invoke.h:149
#33 0x0000000108997bf4 in std::__1::__invoke_void_return_wrapper<facebook::jsi::Value, false>::__call[abi:de190102]<facebook::react::UIManagerBinding::get(facebook::jsi::Runtime&, facebook::jsi::PropNameID const&)::$_0&, facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned long> at /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.5.sdk/usr/include/c++/v1/__type_traits/invoke.h:216
#34 0x0000000108997ba8 in std::__1::__function::__alloc_func<facebook::react::UIManagerBinding::get(facebook::jsi::Runtime&, facebook::jsi::PropNameID const&)::$_0, std::__1::allocator<facebook::react::UIManagerBinding::get(facebook::jsi::Runtime&, facebook::jsi::PropNameID const&)::$_0>, facebook::jsi::Value (facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned long)>::operator()[abi:de190102] at /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.5.sdk/usr/include/c++/v1/__functional/function.h:171
#35 0x0000000108996930 in std::__1::__function::__func<facebook::react::UIManagerBinding::get(facebook::jsi::Runtime&, facebook::jsi::PropNameID const&)::$_0, std::__1::allocator<facebook::react::UIManagerBinding::get(facebook::jsi::Runtime&, facebook::jsi::PropNameID const&)::$_0>, facebook::jsi::Value (facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned long)>::operator() at /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.5.sdk/usr/include/c++/v1/__functional/function.h:313
#36 0x0000000105ac0da0 in facebook::hermes::(anonymous namespace)::HermesRuntimeImpl::HFContext::func [inlined] std::__1::__function::__value_func<facebook::jsi::Value (facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned long)>::operator()[abi:ne190102](facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*&&, unsigned long&&) const [inlined] at /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.5.sdk/usr/include/c++/v1/__functional/function.h:430
#37 0x0000000105ac0d78 in facebook::hermes::(anonymous namespace)::HermesRuntimeImpl::HFContext::func [inlined] std::__1::function<facebook::jsi::Value (facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned long)>::operator()(facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned long) const [inlined] at /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.5.sdk/usr/include/c++/v1/__functional/function.h:989
#38 0x0000000105ac0d78 in facebook::hermes::(anonymous namespace)::HermesRuntimeImpl::HFContext::func at /Users/bartlomiejbloniarz/react-native/packages/rn-tester/Pods/hermes-engine/API/hermes/hermes.cpp:901
#39 0x0000000105b79984 in hermes::vm::NativeFunction::_nativeCall at /Users/bartlomiejbloniarz/react-native/packages/rn-tester/Pods/hermes-engine/include/hermes/VM/Callable.h:507
#40 0x0000000105b93864 in hermes::vm::Interpreter::interpretFunction<false, false> [inlined] hermes::vm::Interpreter::handleCallSlowPath(hermes::vm::Runtime&, hermes::vm::PinnedHermesValue*) [inlined] at /Users/bartlomiejbloniarz/react-native/packages/rn-tester/Pods/hermes-engine/lib/VM/Interpreter.cpp:274
#41 0x0000000105b93838 in hermes::vm::Interpreter::interpretFunction<false, false> at /Users/bartlomiejbloniarz/react-native/packages/rn-tester/Pods/hermes-engine/lib/VM/Interpreter.cpp:1614
#42 0x0000000105b9128c in hermes::vm::Runtime::interpretFunctionImpl at /Users/bartlomiejbloniarz/react-native/packages/rn-tester/Pods/hermes-engine/lib/VM/Interpreter.cpp:811
#43 0x0000000105b79c58 in hermes::vm::JSFunction::_callImpl at /Users/bartlomiejbloniarz/react-native/packages/rn-tester/Pods/hermes-engine/lib/VM/Callable.cpp:1110
#44 0x0000000105b79518 in hermes::vm::BoundFunction::_boundCall [inlined] hermes::vm::Callable::call(hermes::vm::Handle<hermes::vm::Callable>, hermes::vm::Runtime&) [inlined] at /Users/bartlomiejbloniarz/react-native/packages/rn-tester/Pods/hermes-engine/include/hermes/VM/Callable.h:253
#45 0x0000000105b794f4 in hermes::vm::BoundFunction::_boundCall at /Users/bartlomiejbloniarz/react-native/packages/rn-tester/Pods/hermes-engine/lib/VM/Callable.cpp:763
#46 0x0000000105ab752c in facebook::hermes::(anonymous namespace)::HermesRuntimeImpl::call [inlined] hermes::vm::Callable::call(hermes::vm::Handle<hermes::vm::Callable>, hermes::vm::Runtime&) [inlined] at /Users/bartlomiejbloniarz/react-native/packages/rn-tester/Pods/hermes-engine/include/hermes/VM/Callable.h:253
#47 0x0000000105ab7528 in facebook::hermes::(anonymous namespace)::HermesRuntimeImpl::call at /Users/bartlomiejbloniarz/react-native/packages/rn-tester/Pods/hermes-engine/API/hermes/hermes.cpp:2517
#48 0x0000000108575b60 in facebook::jsi::Function::call at /Users/bartlomiejbloniarz/react-native/packages/rn-tester/Pods/Headers/Public/React-jsi/jsi/jsi-inl.h:282
#49 0x0000000108575af0 in facebook::jsi::Function::call at /Users/bartlomiejbloniarz/react-native/packages/rn-tester/Pods/Headers/Public/React-jsi/jsi/jsi-inl.h:287
#50 0x0000000108f7eaac in facebook::react::Task::execute at /Users/bartlomiejbloniarz/react-native/packages/react-native/ReactCommon/react/renderer/runtimescheduler/Task.cpp:57
#51 0x0000000108f63740 in facebook::react::RuntimeScheduler_Modern::executeTask at /Users/bartlomiejbloniarz/react-native/packages/react-native/ReactCommon/react/renderer/runtimescheduler/RuntimeScheduler_Modern.cpp:375
#52 0x0000000108f642b4 in facebook::react::RuntimeScheduler_Modern::runEventLoopTick at /Users/bartlomiejbloniarz/react-native/packages/react-native/ReactCommon/react/renderer/runtimescheduler/RuntimeScheduler_Modern.cpp:312
#53 0x0000000108f63fa4 in facebook::react::RuntimeScheduler_Modern::runEventLoop at /Users/bartlomiejbloniarz/react-native/packages/react-native/ReactCommon/react/renderer/runtimescheduler/RuntimeScheduler_Modern.cpp:266
#54 0x0000000108f6c7f0 in facebook::react::RuntimeScheduler_Modern::scheduleEventLoop()::$_0::operator()(facebook::jsi::Runtime&) const at /Users/bartlomiejbloniarz/react-native/packages/react-native/ReactCommon/react/renderer/runtimescheduler/RuntimeScheduler_Modern.cpp:251
#55 0x0000000108f6c7c0 in std::__1::__invoke[abi:de190102]<facebook::react::RuntimeScheduler_Modern::scheduleEventLoop()::$_0&, facebook::jsi::Runtime&> at /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.5.sdk/usr/include/c++/v1/__type_traits/invoke.h:149
#56 0x0000000108f6c770 in std::__1::__invoke_void_return_wrapper<void, true>::__call[abi:de190102]<facebook::react::RuntimeScheduler_Modern::scheduleEventLoop()::$_0&, facebook::jsi::Runtime&> at /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.5.sdk/usr/include/c++/v1/__type_traits/invoke.h:224
#57 0x0000000108f6c744 in std::__1::__function::__alloc_func<facebook::react::RuntimeScheduler_Modern::scheduleEventLoop()::$_0, std::__1::allocator<facebook::react::RuntimeScheduler_Modern::scheduleEventLoop()::$_0>, void (facebook::jsi::Runtime&)>::operator()[abi:de190102] at /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.5.sdk/usr/include/c++/v1/__functional/function.h:171
#58 0x0000000108f6b5dc in std::__1::__function::__func<facebook::react::RuntimeScheduler_Modern::scheduleEventLoop()::$_0, std::__1::allocator<facebook::react::RuntimeScheduler_Modern::scheduleEventLoop()::$_0>, void (facebook::jsi::Runtime&)>::operator() at /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.5.sdk/usr/include/c++/v1/__functional/function.h:313
#59 0x000000010867e470 in std::__1::__function::__value_func<void (facebook::jsi::Runtime&)>::operator()[abi:de190102] at /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.5.sdk/usr/include/c++/v1/__functional/function.h:430
#60 0x000000010867c8e4 in std::__1::function<void (facebook::jsi::Runtime&)>::operator() at /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.5.sdk/usr/include/c++/v1/__functional/function.h:989
#61 0x0000000108d376f0 in _ZZZN8facebook5react13ReactInstanceC1ENSt3__110unique_ptrINS0_9JSRuntimeENS2_14default_deleteIS4_EEEENS2_10shared_ptrINS0_18MessageQueueThreadEEENS8_INS0_12TimerManagerEEENS2_8functionIFvRNS_3jsi7RuntimeERKNS0_14JsErrorHandler14ProcessedErrorEEEEPNS0_18jsinspector_modern10HostTargetEENK3$_0clINSD_IFvSG_EEEEEDaT_ENKUlvE_clEv at /Users/bartlomiejbloniarz/react-native/packages/react-native/ReactCommon/react/runtime/ReactInstance.cpp:86
#62 0x0000000108d37640 in _ZNSt3__18__invokeB8de190102IRZZN8facebook5react13ReactInstanceC1ENS_10unique_ptrINS2_9JSRuntimeENS_14default_deleteIS5_EEEENS_10shared_ptrINS2_18MessageQueueThreadEEENS9_INS2_12TimerManagerEEENS_8functionIFvRNS1_3jsi7RuntimeERKNS2_14JsErrorHandler14ProcessedErrorEEEEPNS2_18jsinspector_modern10HostTargetEENK3$_0clINSE_IFvSH_EEEEEDaT_EUlvE_JEEEDTclclsr3stdE7declvalISW_EEspclsr3stdE7declvalIT0_EEEEOSW_DpOSZ_ at /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.5.sdk/usr/include/c++/v1/__type_traits/invoke.h:149
#63 0x0000000108d375f8 in _ZNSt3__128__invoke_void_return_wrapperIvLb1EE6__callB8de190102IJRZZN8facebook5react13ReactInstanceC1ENS_10unique_ptrINS4_9JSRuntimeENS_14default_deleteIS7_EEEENS_10shared_ptrINS4_18MessageQueueThreadEEENSB_INS4_12TimerManagerEEENS_8functionIFvRNS3_3jsi7RuntimeERKNS4_14JsErrorHandler14ProcessedErrorEEEEPNS4_18jsinspector_modern10HostTargetEENK3$_0clINSG_IFvSJ_EEEEEDaT_EUlvE_EEEvDpOT_ at /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.5.sdk/usr/include/c++/v1/__type_traits/invoke.h:224
#64 0x0000000108d375d4 in _ZNSt3__110__function12__alloc_funcIZZN8facebook5react13ReactInstanceC1ENS_10unique_ptrINS3_9JSRuntimeENS_14default_deleteIS6_EEEENS_10shared_ptrINS3_18MessageQueueThreadEEENSA_INS3_12TimerManagerEEENS_8functionIFvRNS2_3jsi7RuntimeERKNS3_14JsErrorHandler14ProcessedErrorEEEEPNS3_18jsinspector_modern10HostTargetEENK3$_0clINSF_IFvSI_EEEEEDaT_EUlvE_NS_9allocatorISY_EEFvvEEclB8de190102Ev at /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.5.sdk/usr/include/c++/v1/__functional/function.h:171
#65 0x0000000108d36314 in _ZNSt3__110__function6__funcIZZN8facebook5react13ReactInstanceC1ENS_10unique_ptrINS3_9JSRuntimeENS_14default_deleteIS6_EEEENS_10shared_ptrINS3_18MessageQueueThreadEEENSA_INS3_12TimerManagerEEENS_8functionIFvRNS2_3jsi7RuntimeERKNS3_14JsErrorHandler14ProcessedErrorEEEEPNS3_18jsinspector_modern10HostTargetEENK3$_0clINSF_IFvSI_EEEEEDaT_EUlvE_NS_9allocatorISY_EEFvvEEclEv at /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.5.sdk/usr/include/c++/v1/__functional/function.h:313
#66 0x0000000108546630 in std::__1::__function::__value_func<void ()>::operator()[abi:de190102] at /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.5.sdk/usr/include/c++/v1/__functional/function.h:430
#67 0x00000001085465e8 in std::__1::function<void ()>::operator() at /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.5.sdk/usr/include/c++/v1/__functional/function.h:989
#68 0x000000010865c4c4 in facebook::react::tryAndReturnError at /Users/bartlomiejbloniarz/react-native/packages/react-native/React/CxxModule/RCTCxxUtils.mm:76
#69 0x0000000108687610 in facebook::react::RCTMessageThread::tryFunc at /Users/bartlomiejbloniarz/react-native/packages/react-native/React/CxxBridge/RCTMessageThread.mm:68
#70 0x000000010868b71c in facebook::react::RCTMessageThread::runOnQueue(std::__1::function<void ()>&&)::$_0::operator()() const at /Users/bartlomiejbloniarz/react-native/packages/react-native/React/CxxBridge/RCTMessageThread.mm:81
#71 0x000000010868b6c0 in std::__1::__invoke[abi:de190102]<facebook::react::RCTMessageThread::runOnQueue(std::__1::function<void ()>&&)::$_0&> at /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.5.sdk/usr/include/c++/v1/__type_traits/invoke.h:149
#72 0x000000010868b678 in std::__1::__invoke_void_return_wrapper<void, true>::__call[abi:de190102]<facebook::react::RCTMessageThread::runOnQueue(std::__1::function<void ()>&&)::$_0&> at /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.5.sdk/usr/include/c++/v1/__type_traits/invoke.h:224
#73 0x000000010868b654 in std::__1::__function::__alloc_func<facebook::react::RCTMessageThread::runOnQueue(std::__1::function<void ()>&&)::$_0, std::__1::allocator<facebook::react::RCTMessageThread::runOnQueue(std::__1::function<void ()>&&)::$_0>, void ()>::operator()[abi:de190102] at /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.5.sdk/usr/include/c++/v1/__functional/function.h:171
#74 0x000000010868a384 in std::__1::__function::__func<facebook::react::RCTMessageThread::runOnQueue(std::__1::function<void ()>&&)::$_0, std::__1::allocator<facebook::react::RCTMessageThread::runOnQueue(std::__1::function<void ()>&&)::$_0>, void ()>::operator() at /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.5.sdk/usr/include/c++/v1/__functional/function.h:313
#75 0x0000000108546630 in std::__1::__function::__value_func<void ()>::operator()[abi:de190102] at /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.5.sdk/usr/include/c++/v1/__functional/function.h:430
#76 0x00000001085465e8 in std::__1::function<void ()>::operator() at /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.5.sdk/usr/include/c++/v1/__functional/function.h:989
#77 0x00000001086873f0 in invocation function for block in facebook::react::RCTMessageThread::runAsync(std::__1::function<void ()>) at /Users/bartlomiejbloniarz/react-native/packages/react-native/React/CxxBridge/RCTMessageThread.mm:44
#78 0x000000018041d06c in __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ ()
#79 0x000000018041c7a4 in __CFRunLoopDoBlocks ()
#80 0x00000001804174bc in __CFRunLoopRun ()
#81 0x0000000180416704 in CFRunLoopRunSpecific ()
#82 0x0000000108d226d4 in +[RCTJSThreadManager runRunLoop] at /Users/bartlomiejbloniarz/react-native/packages/react-native/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTJSThreadManager.mm:102
#83 0x0000000180f462d8 in __NSThread__start__ ()
#84 0x000000010495b6f8 in _pthread_start ()
Description
During app initalization, if we have a Legacy custom component, a
LegacyViewManagerInteropComponentDescriptorwill be created inComponentDescriptorRegistry::add. There is a code path in theLegacyViewManagerInteropComponentDescriptorconstructor that invokesRCTUnsafeExecuteOnMainQueueSync(In the repro I sort of had to fake it going through that path, but I've seen a component for which it would happen, but it was hard to recreate it in this app). Since the constructor was called byComponentDescriptorRegistry::add, it means that the JS thread holds theComponentDescriptorRegistrymutex. If at the same time someone tries to lock the mutex on the main thread, we get into a deadlock.This scenario can happen when LayoutAnimations API is used when the app is first rendered. The main thread is trying to lock the
ComponentDescriptorRegistrymutex, while the JS thread is holding the lock, and trying to execute a synchronous callback on the main thread. We have a similar case in reanimated, with our implementation of layout animations.Steps to reproduce
React Native Version
main
Affected Platforms
Runtime - iOS
Areas
Bridgeless - The New Initialization Flow
Output of
npx @react-native-community/cli infoStacktrace or Logs
MANDATORY Reproducer
https://github.com/bartlomiejbloniarz/react-native/tree/%40bartlomiejbloniarz/interop-repro
Screenshots and Videos
No response