react-native-reanimated: [IOS] Random app crash on production build

Description

Getting app crash on random places with reanimated 2

Expected behavior

No crash

Actual behavior & steps to reproduce

Random behaviour

Snack or minimal code example

terminating with uncaught exception of type facebook::jsi::JSError: Exception in HostObject::get(propName:_value): mutex lock failed: Invalid argument
workletValueSetter
[native code]
(lldb)

Package versions

  • React Native: 0.64.2
  • React Native Reanimated: 2.2.0
  • NodeJS: 14
  • Xcode: 12.5.1
  • Java & Gradle: -

Affected platforms

  • Android
  • iOS
  • Web

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 27
  • Comments: 73 (4 by maintainers)

Most upvoted comments

What features your application uses?

  • shared values in context 👍
  • portals 👎
  • setting shared value in InteractionManager 😃
  • scrollOffset based animations 🎉
  • runOnJS 😕

Exact same crash happened on production using react-native-reanimated@2.2.4 and react-native-screens@3.9.0.

Not sure if this is relevant (or true), but I have reason to believe screens is related because sentry tells me it happens in a transaction called RNSScreen: Screenshot 2021-12-13 at 13 25 58

(crashlytics reports the exact same error message as in #2327 (comment))

We are also experiencing this:

image

And the reason seems obvious. An unchecked null ptr access. The reanimated code is riddled with unchecked access to pointers and could really need a thorough linting cure.

image It even says in the comment can be null, yet RNRA just chains calls on it, without any try..catch protection.

Exact same crash happened on production using react-native-reanimated@2.2.4 and react-native-screens@3.9.0.

Not sure if this is relevant (or true), but I have reason to believe screens is related because sentry tells me it happens in a transaction called RNSScreen: Screenshot 2021-12-13 at 13 25 58

(crashlytics reports the exact same error message as in https://github.com/software-mansion/react-native-reanimated/issues/2327#issue-981221150)

Any update on this issue?? It’s affecting our production app negatively.

I would be willing to spend time and help fix the issue too if someone can point me in a direction

Still happens on 2.4.1, when I swipe back in stack. Very rarely, only in production. It says “C++ Exception: N8facebook3jsi7JSErrorE”. Stack trace points to reanimated::Scheduler::triggerUI I’m using an old react-navigation:

    "react-navigation": "^2.18.3",
    "react-navigation-stack": "0.7.0",

In my case it happens when a screen that contains some worklets that are being used in animated styles gets unmounted. I’m hosting my shared values in react context, so that these values can later be accessed by various components on the screen. The context gets erased, along with all components having animated styles, but the worklet is still being called after that.

Fixed with https://github.com/software-mansion/react-native-reanimated/pull/4239, the fix is available since 3.+ versions 🚀

Any updates on this? We are seeing this issue with Hermes enabled, so unlikely it’s due to that. Also noticed that this mostly happens now after XCode 14

If it helps anyone, check the component where you use reanimated/gestures is not rendering more than necessary.

I was running into an issue with quite a lot of freezing, hanging and crashes from having reanimated shared values set with in a FlatList item components. Noticed that there were a lot of unnecessary renders with my FlatList item components and after fixing this, with the use of memorisation, my app has become more stable and have not seen any reported app freezing since.

This might be similar to some of the earlier comments in regards to noticing this issue happens more when mounting/unmounting more complex screens

We’ve RN 0.66 and reanimated 2.3 and the app crash with the issue.EXC_CRASH (SIGABRT): Exception in HostObject::get(propName:_value): mutex lock failed: Invalid argument workletValueSetter@/Users/XXXX/Documents/bancoChile/front/xxx-app/node_modules/react-native-reanimated/src/reanimated2/core.ts (143:0):1:1085

Only affect the IOS SO v. 15.4, 15.4.1, 15.3, 15.5.

We were able to get rid of these deadlocks / crashes by enabling Hermes on iOS. So if you haven’t already, try enabling Hermes and see if the problem still persists.

It’s quite amusing that we’ve had a day with no crashes AFTER disabling hermes. But it was only a single day with 1 QA guy, maybe it’s a wrong assumption. Not so sure if hermes/jsc is the issue, or that we are even having the same issues.

Spent a week sniffing around in various issues in all repos, the only thing that comes close and looks promising is 2568

Kinda puzzled I guess.

This issue is labeled IOS only, but it happens on android for us too - log is a bit different, but the behavior is the same -> navigate to the screen that has reanimated code -> it crashes sometimes.

It’s kinda possible to somewhat to reproduce the crash: If I navigate to screen that uses reanimated features (useAnimatedStyles/GestureHandler yada yada) right after launching the app (not 100%, but like 70% of the time) it crashes. If I spend some time in app, visit a few different screens, it kinda works until relaunch/background->foreground interaction.

Packages/versions:

"react-native": "0.68.2",
"react-native-reanimated": "2.8.0",
"react-native-screens": "3.13.1",
"@react-navigation/bottom-tabs": "6.3.1",
"@react-navigation/devtools": "^6.0.7",
"@react-navigation/elements": "^1.3.3",
"@react-navigation/native": "6.0.10",
"@react-navigation/stack": "6.2.1",
"react-native-gesture-handler": "2.4.2",

Devices are MI8 Android 10/iPhone 7 Here’s the sample Sentry logs:

iOS log here:
OS Version: iOS 15.5 (19F77)
Report Version: 104

Exception Type: EXC_CRASH (SIGABRT)
Crashed Thread: 0

Application Specific Information:
N8facebook3jsi7JSErrorE

Thread 0 Crashed:
0   APPLICATION_NAME                   0x2006d7d1c         folly::Try<T>::throwUnlessValue
1   hermes                          0x101b3af5c         facebook::hermes::debugger::Debugger::jsiValueFromHermesValue
2   hermes                          0x101b3a904         facebook::hermes::debugger::Debugger::jsiValueFromHermesValue
3   hermes                          0x101b49504         facebook::jsi::JSError::~JSError
4   hermes                          0x101b33948         facebook::hermes::HermesRuntime::rootsListLength
5   APPLICATION_NAME                   0x2006a8580         folly::Try<T>::throwUnlessValue
6   APPLICATION_NAME                   0x2006d09a4         folly::Try<T>::throwUnlessValue
7   libdispatch.dylib               0x300973094         <redacted>
8   libdispatch.dylib               0x300974094         <redacted>
9   libdispatch.dylib               0x300920d44         <redacted>
10  libdispatch.dylib               0x300920994         <redacted>
11  CoreFoundation                  0x300f800c4         <redacted>
12  CoreFoundation                  0x300f3d5e8         <redacted>
13  CoreFoundation                  0x300f50240         CFRunLoopRunSpecific
14  GraphicsServices                0x342559988         GSEventRunModal
15  UIKitCore                       0x305a8941c         <redacted>
16  UIKitCore                       0x305822b88         UIApplicationMain
17  APPLICATION_NAME                   0x2005312dc         <redacted>
18  <unknown>                       0x1010a03d0         <redacted>

Thread 0 Crashed:
0   APPLICATION_NAME                   0x2006d7d1c         folly::Try<T>::throwUnlessValue
1   hermes                          0x101b3af5c         facebook::hermes::debugger::Debugger::jsiValueFromHermesValue
2   hermes                          0x101b3a904         facebook::hermes::debugger::Debugger::jsiValueFromHermesValue
3   hermes                          0x101b49504         facebook::jsi::JSError::~JSError
4   hermes                          0x101b33948         facebook::hermes::HermesRuntime::rootsListLength
5   APPLICATION_NAME                   0x2006a8580         folly::Try<T>::throwUnlessValue
6   APPLICATION_NAME                   0x2006d09a4         folly::Try<T>::throwUnlessValue
7   libdispatch.dylib               0x300973094         <redacted>
8   libdispatch.dylib               0x300974094         <redacted>
9   libdispatch.dylib               0x300920d44         <redacted>
10  libdispatch.dylib               0x300920994         <redacted>
11  CoreFoundation                  0x300f800c4         <redacted>
12  CoreFoundation                  0x300f3d5e8         <redacted>
13  CoreFoundation                  0x300f50240         CFRunLoopRunSpecific
14  GraphicsServices                0x342559988         GSEventRunModal
15  UIKitCore                       0x305a8941c         <redacted>
16  UIKitCore                       0x305822b88         UIApplicationMain
17  APPLICATION_NAME                   0x2005312dc         <redacted>
18  <unknown>                       0x1010a03d0         <redacted>

Thread 1
0   libdispatch.dylib               0x300918b28         <redacted>
1   APPLICATION_NAME                   0x2007dddec         [inlined] facebook::react::JSIExecutor::defaultTimeoutInvoker
2   APPLICATION_NAME                   0x2007dddec         facebook::react::JSIExecutor::defaultTimeoutInvoker
3   APPLICATION_NAME                   0x2007dd054         facebook::react::JSIExecutor::defaultTimeoutInvoker
4   APPLICATION_NAME                   0x2007dbec4         facebook::react::JSIExecutor::defaultTimeoutInvoker
5   APPLICATION_NAME                   0x2007dd6c8         facebook::react::JSIExecutor::defaultTimeoutInvoker
6   libdispatch.dylib               0x300973094         <redacted>
7   libdispatch.dylib               0x300974094         <redacted>
8   libdispatch.dylib               0x30091a73c         <redacted>
9   libdispatch.dylib               0x30091b1f4         <redacted>
10  libdispatch.dylib               0x300924ec8         <redacted>
11  libsystem_pthread.dylib         0x3b75f5e10         _pthread_wqthread

Thread 2
0   libsystem_pthread.dylib         0x3b75f5934         <redacted>

Thread 3
0   libsystem_kernel.dylib          0x376125014         __workq_kernreturn
1   libsystem_pthread.dylib         0x3b75f5e5c         _pthread_wqthread

Thread 4 name: com.apple.uikit.eventfetch-thread
0   libsystem_kernel.dylib          0x376124aac         mach_msg_trap
1   libsystem_kernel.dylib          0x37612507c         mach_msg
2   CoreFoundation                  0x300f38d78         <redacted>
3   CoreFoundation                  0x300f3d080         <redacted>
4   CoreFoundation                  0x300f50240         CFRunLoopRunSpecific
5   Foundation                      0x303d71efc         <redacted>
6   Foundation                      0x303db1010         <redacted>
7   UIKitCore                       0x305a0886c         <redacted>
8   Foundation                      0x303dbec0c         <redacted>
9   libsystem_pthread.dylib         0x3b75f7348         _pthread_start

Thread 5
0   libsystem_kernel.dylib          0x376125014         __workq_kernreturn
1   libsystem_pthread.dylib         0x3b75f5e5c         _pthread_wqthread

Thread 6
0   libsystem_kernel.dylib          0x376125014         __workq_kernreturn
1   libsystem_pthread.dylib         0x3b75f5e5c         _pthread_wqthread

Thread 7
0   libsystem_pthread.dylib         0x3b75f5934         <redacted>

Thread 8 name: com.facebook.react.JavaScript
0   hermes                          0x101b6404c         facebook::jsi::JSError::~JSError
1   hermes                          0x101b62368         facebook::jsi::JSError::~JSError
2   hermes                          0x101b49718         facebook::jsi::JSError::~JSError
3   hermes                          0x101b4904c         facebook::jsi::JSError::~JSError
4   hermes                          0x101b612c4         facebook::jsi::JSError::~JSError
5   hermes                          0x101b62ba8         facebook::jsi::JSError::~JSError
6   hermes                          0x101b62368         facebook::jsi::JSError::~JSError
7   hermes                          0x101b49718         facebook::jsi::JSError::~JSError
8   hermes                          0x101b484fc         facebook::jsi::JSError::~JSError
9   hermes                          0x101be8e68         facebook::jsi::JSError::~JSError
10  hermes                          0x101b49504         facebook::jsi::JSError::~JSError
11  hermes                          0x101b612b8         facebook::jsi::JSError::~JSError
12  hermes                          0x101b62ba8         facebook::jsi::JSError::~JSError
13  hermes                          0x101b62368         facebook::jsi::JSError::~JSError
14  hermes                          0x101b49718         facebook::jsi::JSError::~JSError
15  hermes                          0x101b4904c         facebook::jsi::JSError::~JSError
16  hermes                          0x101b33948         facebook::hermes::HermesRuntime::rootsListLength
17  APPLICATION_NAME                   0x200826628         _ZN5folly6detail8function9execSmallIZNS_7futures6detail4CoreINS_4UnitEE11setCallbackIZNS4_10FutureBaseIS6_E18thenImplementationIZNRS_6FutureIS6_E3viaENS_8Executor9KeepAliveISE_EEEUlOSG_ONS_3TryIS6_EEE_NS4_25tryExecutorCallableResultIS6_SL_vEEEENSt3__19e...
18  APPLICATION_NAME                   0x20085cfac         folly::exception_wrapper::InPlace<T>::get_exception_ptr_
19  APPLICATION_NAME                   0x20085ce10         folly::exception_wrapper::InPlace<T>::get_exception_ptr_
20  APPLICATION_NAME                   0x2006d9694         facebook::react::JSIExecutor::defaultTimeoutInvoker
21  APPLICATION_NAME                   0x20085a300         folly::exception_wrapper::InPlace<T>::get_exception_ptr_
22  APPLICATION_NAME                   0x2007ff2a8         facebook::react::JSIExecutor::defaultTimeoutInvoker
23  APPLICATION_NAME                   0x200749554         facebook::react::JSIExecutor::defaultTimeoutInvoker
24  APPLICATION_NAME                   0x200755a04         facebook::react::JSIExecutor::defaultTimeoutInvoker
25  APPLICATION_NAME                   0x2007557b8         facebook::react::JSIExecutor::defaultTimeoutInvoker
26  CoreFoundation                  0x300f9f73c         <redacted>
27  CoreFoundation                  0x300fa0560         <redacted>
28  CoreFoundation                  0x300f3cf0c         <redacted>
29  CoreFoundation                  0x300f50240         CFRunLoopRunSpecific
30  APPLICATION_NAME                   0x20073e840         facebook::react::JSIExecutor::defaultTimeoutInvoker
31  Foundation                      0x303dbec0c         <redacted>
32  libsystem_pthread.dylib         0x3b75f7348         _pthread_start

Thread 9 name: hades
0   libsystem_kernel.dylib          0x376125484         __psynch_cvwait
1   libsystem_pthread.dylib         0x3b75fdbd4         <redacted>
2   libc++.1.dylib                  0x33015c8e0         std::__1::condition_variable::wait
3   hermes                          0x101c03ec8         facebook::jsi::JSError::~JSError
4   hermes                          0x101c03dfc         facebook::jsi::JSError::~JSError
5   libsystem_pthread.dylib         0x3b75f7348         _pthread_start

Thread 10 name: hermes-chrome-inspector-conn
0   libsystem_kernel.dylib          0x376125484         __psynch_cvwait
1   libsystem_pthread.dylib         0x3b75fdbd4         <redacted>
2   libc++.1.dylib                  0x33015c8e0         std::__1::condition_variable::wait
3   APPLICATION_NAME                   0x20084df1c         folly::exception_wrapper::InPlace<T>::get_exception_ptr_
4   APPLICATION_NAME                   0x20080f4c0         facebook::hermes::inspector::detail::Thread::run
5   libsystem_pthread.dylib         0x3b75f7348         _pthread_start

Thread 11 name: hermes-inspector
0   libsystem_kernel.dylib          0x376125484         __psynch_cvwait
1   libsystem_pthread.dylib         0x3b75fdbd4         <redacted>
2   libc++.1.dylib                  0x33015c8e0         std::__1::condition_variable::wait
3   APPLICATION_NAME                   0x20084df1c         folly::exception_wrapper::InPlace<T>::get_exception_ptr_
4   APPLICATION_NAME                   0x20080f4c0         facebook::hermes::inspector::detail::Thread::run
5   libsystem_pthread.dylib         0x3b75f7348         _pthread_start

Thread 12 name: hades
0   libsystem_kernel.dylib          0x376125484         __psynch_cvwait
1   libsystem_pthread.dylib         0x3b75fdbd4         <redacted>
2   libc++.1.dylib                  0x33015c8e0         std::__1::condition_variable::wait
3   hermes                          0x101c03ec8         facebook::jsi::JSError::~JSError
4   hermes                          0x101c03dfc         facebook::jsi::JSError::~JSError
5   libsystem_pthread.dylib         0x3b75f7348         _pthread_start

Thread 13
0   libsystem_kernel.dylib          0x376125014         __workq_kernreturn
1   libsystem_pthread.dylib         0x3b75f5e5c         _pthread_wqthread

Thread 14 name: com.apple.CoreMotion.MotionThread
0   libsystem_kernel.dylib          0x376124aac         mach_msg_trap
1   libsystem_kernel.dylib          0x37612507c         mach_msg
2   CoreFoundation                  0x300f38d78         <redacted>
3   CoreFoundation                  0x300f3d080         <redacted>
4   CoreFoundation                  0x300f50240         CFRunLoopRunSpecific
5   CoreFoundation                  0x300fcb3cc         CFRunLoopRun
6   CoreMotion                      0x31a0d1ec0         CLMotionActivity::isTypeInVehicle
7   libsystem_pthread.dylib         0x3b75f7348         _pthread_start

Thread 15 name: AVAudioSession Notify Thread
0   libsystem_kernel.dylib          0x376124aac         mach_msg_trap
1   libsystem_kernel.dylib          0x37612507c         mach_msg
2   CoreFoundation                  0x300f38d78         <redacted>
3   CoreFoundation                  0x300f3d080         <redacted>
4   CoreFoundation                  0x300f50240         CFRunLoopRunSpecific
5   AudioSession                    0x312aac478         <redacted>
6   AudioSession                    0x312ab57c8         <redacted>
7   libsystem_pthread.dylib         0x3b75f7348         _pthread_start

Thread 16
0   libsystem_kernel.dylib          0x376124fd0         __semwait_signal
1   libsystem_c.dylib               0x315ddea40         nanosleep
2   libsystem_c.dylib               0x315df2710         sleep
3   APPLICATION_NAME                   0x2008af9fc         folly::exception_wrapper::InPlace<T>::get_exception_ptr_
4   libsystem_pthread.dylib         0x3b75f7348         _pthread_start

Thread 17 name: SentryCrash Exception Handler (Secondary)
0   libsystem_kernel.dylib          0x376124aac         mach_msg_trap
1   libsystem_kernel.dylib          0x37612507c         mach_msg
2   libsystem_kernel.dylib          0x376130810         thread_suspend
3   APPLICATION_NAME                   0x2008bc284         __cxa_throw
4   libsystem_pthread.dylib         0x3b75f7348         _pthread_start

Thread 18 name: SentryCrash Exception Handler (Primary)
0   libsystem_kernel.dylib          0x376124aac         mach_msg_trap
1   libsystem_kernel.dylib          0x37612507c         mach_msg
2   APPLICATION_NAME                   0x2008bc2b0         __cxa_throw
3   libsystem_pthread.dylib         0x3b75f7348         _pthread_start

Thread 19
0   libsystem_kernel.dylib          0x376125014         __workq_kernreturn
1   libsystem_pthread.dylib         0x3b75f5e5c         _pthread_wqthread

Thread 21 name: com.apple.NSURLConnectionLoader
0   libsystem_kernel.dylib          0x376124aac         mach_msg_trap
1   libsystem_kernel.dylib          0x37612507c         mach_msg
2   CoreFoundation                  0x300f38d78         <redacted>
3   CoreFoundation                  0x300f3d080         <redacted>
4   CoreFoundation                  0x300f50240         CFRunLoopRunSpecific
5   CFNetwork                       0x302131b08         _CFURLStorageSessionDisableCache
6   Foundation                      0x303dbec0c         <redacted>
7   libsystem_pthread.dylib         0x3b75f7348         _pthread_start

Thread 22 name: com.squareup.SocketRocket.NetworkThread
0   libsystem_kernel.dylib          0x376124aac         mach_msg_trap
1   libsystem_kernel.dylib          0x37612507c         mach_msg
2   CoreFoundation                  0x300f38d78         <redacted>
3   CoreFoundation                  0x300f3d080         <redacted>
4   CoreFoundation                  0x300f50240         CFRunLoopRunSpecific
5   Foundation                      0x303d71efc         <redacted>
6   APPLICATION_NAME                   0x20077a73c         facebook::react::JSIExecutor::defaultTimeoutInvoker
7   Foundation                      0x303dbec0c         <redacted>
8   libsystem_pthread.dylib         0x3b75f7348         _pthread_start

Thread 23 name: com.apple.CFSocket.private
0   libsystem_kernel.dylib          0x3761256b0         select$DARWIN_EXTSN
1   CoreFoundation                  0x300fd596c         <redacted>
2   libsystem_pthread.dylib         0x3b75f7348         _pthread_start



EOF
Android 10 Log here
OS Version: Android 10 (QKQ1.190828.002 test-keys)
Report Version: 104

Exception Type: Unknown (SIGSEGV)

Application Specific Information:
Segfault

Thread 0 Crashed:
0   base.apk                        0x77ab57f6e8        <unknown> + 513975777000
1   base.apk                        0x77ab4fa438        <unknown> + 513975231544
2   base.apk                        0x7786cd6fdc        facebook::jsi::String::createFromAscii
3   base.apk                        0x7786cd6f98        facebook::jsi::String::createFromAscii
4   base.apk                        0x7786cd3134        facebook::jsi::Object::getProperty
5   base.apk                        0x7786cfd2fc        reanimated::ShareableValue::adapt
6   base.apk                        0x7786cfe3e8        reanimated::ShareableValue::adapt
7   base.apk                        0x7786cec8b4        reanimated::FrozenObject::FrozenObject
8   base.apk                        0x7786d143c8        std::__ndk1::__compressed_pair_elem<T>::__compressed_pair_elem<T>
9   base.apk                        0x7786d13f8c        std::__ndk1::__compressed_pair<T>::__compressed_pair<T>
10  base.apk                        0x7786d13b6c        std::__ndk1::__shared_ptr_emplace<T>::__shared_ptr_emplace<T>
11  base.apk                        0x7786d138a4        std::__ndk1::shared_ptr<T>::make_shared<T>
12  base.apk                        0x7786d0d128        <unknown> + 513362940200
13  base.apk                        0x7786cfdf9c        reanimated::ShareableValue::adapt
14  base.apk                        0x7786cfe3e8        reanimated::ShareableValue::adapt
15  base.apk                        0x7786cec8b4        reanimated::FrozenObject::FrozenObject
16  base.apk                        0x7786d143c8        std::__ndk1::__compressed_pair_elem<T>::__compressed_pair_elem<T>
17  base.apk                        0x7786d13f8c        std::__ndk1::__compressed_pair<T>::__compressed_pair<T>
18  base.apk                        0x7786d13b6c        std::__ndk1::__shared_ptr_emplace<T>::__shared_ptr_emplace<T>
19  base.apk                        0x7786d138a4        std::__ndk1::shared_ptr<T>::make_shared<T>
20  base.apk                        0x7786d0d128        <unknown> + 513362940200
21  base.apk                        0x7786cfdf9c        reanimated::ShareableValue::adapt
22  base.apk                        0x7786cfe3e8        reanimated::ShareableValue::adapt
23  base.apk                        0x7786cec8b4        reanimated::FrozenObject::FrozenObject
24  base.apk                        0x7786d143c8        std::__ndk1::__compressed_pair_elem<T>::__compressed_pair_elem<T>
25  base.apk                        0x7786d13f8c        std::__ndk1::__compressed_pair<T>::__compressed_pair<T>
26  base.apk                        0x7786d13b6c        std::__ndk1::__shared_ptr_emplace<T>::__shared_ptr_emplace<T>
27  base.apk                        0x7786d138a4        std::__ndk1::shared_ptr<T>::make_shared<T>
28  base.apk                        0x7786d0d128        <unknown> + 513362940200
29  base.apk                        0x7786cfdf9c        reanimated::ShareableValue::adapt
30  base.apk                        0x7786cfe3e8        reanimated::ShareableValue::adapt
31  base.apk                        0x7786cec8b4        reanimated::FrozenObject::FrozenObject
32  base.apk                        0x7786d143c8        std::__ndk1::__compressed_pair_elem<T>::__compressed_pair_elem<T>
33  base.apk                        0x7786d13f8c        std::__ndk1::__compressed_pair<T>::__compressed_pair<T>
34  base.apk                        0x7786d13b6c        std::__ndk1::__shared_ptr_emplace<T>::__shared_ptr_emplace<T>
35  base.apk                        0x7786d138a4        std::__ndk1::shared_ptr<T>::make_shared<T>
36  base.apk                        0x7786d0d128        <unknown> + 513362940200
37  base.apk                        0x7786cfdf9c        reanimated::ShareableValue::adapt
38  base.apk                        0x7786cfe3e8        reanimated::ShareableValue::adapt
39  base.apk                        0x7786cec8b4        reanimated::FrozenObject::FrozenObject
40  base.apk                        0x7786d143c8        std::__ndk1::__compressed_pair_elem<T>::__compressed_pair_elem<T>
41  base.apk                        0x7786d13f8c        std::__ndk1::__compressed_pair<T>::__compressed_pair<T>
42  base.apk                        0x7786d13b6c        std::__ndk1::__shared_ptr_emplace<T>::__shared_ptr_emplace<T>
43  base.apk                        0x7786d138a4        std::__ndk1::shared_ptr<T>::make_shared<T>
44  base.apk                        0x7786d0d128        <unknown> + 513362940200
45  base.apk                        0x7786cfdf9c        reanimated::ShareableValue::adapt
46  base.apk                        0x7786cfe3e8        reanimated::ShareableValue::adapt
47  base.apk                        0x7786cec8b4        reanimated::FrozenObject::FrozenObject
48  base.apk                        0x7786d143c8        std::__ndk1::__compressed_pair_elem<T>::__compressed_pair_elem<T>
49  base.apk                        0x7786d13f8c        std::__ndk1::__compressed_pair<T>::__compressed_pair<T>
50  base.apk                        0x7786d13b6c        std::__ndk1::__shared_ptr_emplace<T>::__shared_ptr_emplace<T>
51  base.apk                        0x7786d138a4        std::__ndk1::shared_ptr<T>::make_shared<T>
52  base.apk                        0x7786d0d128        <unknown> + 513362940200
53  base.apk                        0x7786cfdf9c        reanimated::ShareableValue::adapt
54  base.apk                        0x7786cfe3e8        reanimated::ShareableValue::adapt
55  base.apk                        0x7786cec8b4        reanimated::FrozenObject::FrozenObject
56  base.apk                        0x7786d143c8        std::__ndk1::__compressed_pair_elem<T>::__compressed_pair_elem<T>
57  base.apk                        0x7786d13f8c        std::__ndk1::__compressed_pair<T>::__compressed_pair<T>
58  base.apk                        0x7786d13b6c        std::__ndk1::__shared_ptr_emplace<T>::__shared_ptr_emplace<T>
59  base.apk                        0x7786d138a4        std::__ndk1::shared_ptr<T>::make_shared<T>
60  base.apk                        0x7786d0d128        <unknown> + 513362940200
61  base.apk                        0x7786cfdf9c        reanimated::ShareableValue::adapt
62  base.apk                        0x7786cfe3e8        reanimated::ShareableValue::adapt
63  base.apk                        0x7786cec8b4        reanimated::FrozenObject::FrozenObject
64  base.apk                        0x7786d143c8        std::__ndk1::__compressed_pair_elem<T>::__compressed_pair_elem<T>
65  base.apk                        0x7786d13f8c        std::__ndk1::__compressed_pair<T>::__compressed_pair<T>
66  base.apk                        0x7786d13b6c        std::__ndk1::__shared_ptr_emplace<T>::__shared_ptr_emplace<T>
67  base.apk                        0x7786d138a4        std::__ndk1::shared_ptr<T>::make_shared<T>
68  base.apk                        0x7786d0d128        <unknown> + 513362940200
69  base.apk                        0x7786cfdf9c        reanimated::ShareableValue::adapt
70  base.apk                        0x7786cfe3e8        reanimated::ShareableValue::adapt
71  base.apk                        0x7786cec8b4        reanimated::FrozenObject::FrozenObject
72  base.apk                        0x7786d143c8        std::__ndk1::__compressed_pair_elem<T>::__compressed_pair_elem<T>
73  base.apk                        0x7786d13f8c        std::__ndk1::__compressed_pair<T>::__compressed_pair<T>
74  base.apk                        0x7786d13b6c        std::__ndk1::__shared_ptr_emplace<T>::__shared_ptr_emplace<T>
75  base.apk                        0x7786d138a4        std::__ndk1::shared_ptr<T>::make_shared<T>
76  base.apk                        0x7786d0d128        <unknown> + 513362940200
77  base.apk                        0x7786cfdf9c        reanimated::ShareableValue::adapt
78  base.apk                        0x7786cfe3e8        reanimated::ShareableValue::adapt
79  base.apk                        0x7786cec8b4        reanimated::FrozenObject::FrozenObject
80  base.apk                        0x7786d143c8        std::__ndk1::__compressed_pair_elem<T>::__compressed_pair_elem<T>
81  base.apk                        0x7786d13f8c        std::__ndk1::__compressed_pair<T>::__compressed_pair<T>
82  base.apk                        0x7786d13b6c        std::__ndk1::__shared_ptr_emplace<T>::__shared_ptr_emplace<T>
83  base.apk                        0x7786d138a4        std::__ndk1::shared_ptr<T>::make_shared<T>
84  base.apk                        0x7786d0d128        <unknown> + 513362940200
85  base.apk                        0x7786cfdf9c        reanimated::ShareableValue::adapt
86  base.apk                        0x7786cfe3e8        reanimated::ShareableValue::adapt
87  base.apk                        0x7786cec8b4        reanimated::FrozenObject::FrozenObject
88  base.apk                        0x7786d143c8        std::__ndk1::__compressed_pair_elem<T>::__compressed_pair_elem<T>
89  base.apk                        0x7786d13f8c        std::__ndk1::__compressed_pair<T>::__compressed_pair<T>
90  base.apk                        0x7786d13b6c        std::__ndk1::__shared_ptr_emplace<T>::__shared_ptr_emplace<T>
91  base.apk                        0x7786d138a4        std::__ndk1::shared_ptr<T>::make_shared<T>
92  base.apk                        0x7786d0d128        <unknown> + 513362940200
93  base.apk                        0x7786cfdf9c        reanimated::ShareableValue::adapt
94  base.apk                        0x7786cfe3e8        reanimated::ShareableValue::adapt
95  base.apk                        0x7786cec8b4        reanimated::FrozenObject::FrozenObject
96  base.apk                        0x7786d143c8        std::__ndk1::__compressed_pair_elem<T>::__compressed_pair_elem<T>
97  base.apk                        0x7786d13f8c        std::__ndk1::__compressed_pair<T>::__compressed_pair<T>
98  base.apk                        0x7786d13b6c        std::__ndk1::__shared_ptr_emplace<T>::__shared_ptr_emplace<T>
99  base.apk                        0x7786d138a4        std::__ndk1::shared_ptr<T>::make_shared<T>
100 base.apk                        0x7786d0d128        <unknown> + 513362940200
101 base.apk                        0x7786cfdf9c        reanimated::ShareableValue::adapt
102 base.apk                        0x7786cfe3e8        reanimated::ShareableValue::adapt
103 base.apk                        0x7786cec8b4        reanimated::FrozenObject::FrozenObject
104 base.apk                        0x7786d143c8        std::__ndk1::__compressed_pair_elem<T>::__compressed_pair_elem<T>
105 base.apk                        0x7786d13f8c        std::__ndk1::__compressed_pair<T>::__compressed_pair<T>
106 base.apk                        0x7786d13b6c        std::__ndk1::__shared_ptr_emplace<T>::__shared_ptr_emplace<T>
107 base.apk                        0x7786d138a4        std::__ndk1::shared_ptr<T>::make_shared<T>
108 base.apk                        0x7786d0d128        <unknown> + 513362940200
109 base.apk                        0x7786cfdf9c        reanimated::ShareableValue::adapt
110 base.apk                        0x7786cfe3e8        reanimated::ShareableValue::adapt
111 base.apk                        0x7786cec8b4        reanimated::FrozenObject::FrozenObject
112 base.apk                        0x7786d143c8        std::__ndk1::__compressed_pair_elem<T>::__compressed_pair_elem<T>
113 base.apk                        0x7786d13f8c        std::__ndk1::__compressed_pair<T>::__compressed_pair<T>
114 base.apk                        0x7786d13b6c        std::__ndk1::__shared_ptr_emplace<T>::__shared_ptr_emplace<T>
115 base.apk                        0x7786d138a4        std::__ndk1::shared_ptr<T>::make_shared<T>
116 base.apk                        0x7786d0d128        <unknown> + 513362940200
117 base.apk                        0x7786cfdf9c        reanimated::ShareableValue::adapt
118 base.apk                        0x7786cfe3e8        reanimated::ShareableValue::adapt
119 base.apk                        0x7786cec8b4        reanimated::FrozenObject::FrozenObject
120 base.apk                        0x7786d143c8        std::__ndk1::__compressed_pair_elem<T>::__compressed_pair_elem<T>
121 base.apk                        0x7786d13f8c        std::__ndk1::__compressed_pair<T>::__compressed_pair<T>
122 base.apk                        0x7786d13b6c        std::__ndk1::__shared_ptr_emplace<T>::__shared_ptr_emplace<T>
123 base.apk                        0x7786d138a4        std::__ndk1::shared_ptr<T>::make_shared<T>
124 base.apk                        0x7786d0d128        <unknown> + 513362940200
125 base.apk                        0x7786cfdf9c        reanimated::ShareableValue::adapt
126 base.apk                        0x7786cfe3e8        reanimated::ShareableValue::adapt
127 base.apk                        0x7786cec8b4        reanimated::FrozenObject::FrozenObject



EOF

Still getting the same error.

"react-native": "0.68.2",
"react-native-reanimated": "2.8.0",

Error:

workletValueSetter@/.../node_modules/react-native-reanimated/src/reanimated2/core.ts (143:0):1:1085
@[native code]
dyld4 config: DYLD_LIBRARY_PATH=/usr/lib/system/introspection DYLD_INSERT_LIBRARIES=/Developer/usr/lib/libBacktraceRecording.dylib:/Developer/usr/lib/libMainThreadChecker.dylib:/Developer/Library/PrivateFrameworks/DTDDISupport.framework/libViewDebuggerSupport.dylib:/usr/lib/libMTLCapture.dylib
terminating with uncaught exception of type facebook::jsi::JSError: Exception in HostObject::get(propName:_value): mutex lock failed: Invalid argument

Any updates on the original crash

Fatal Exception: facebook::jsi::JSError Exception in HostObject::get(propName:_value): mutex lock failed

The culprit has been found! It was down to a weirdly constructed animated gradient I forgot we were using. Posting more info in #2244

We have limited capacity unfortunately 😕 So it is hard to maintain two branches of versions. I really recommend an update to Reanimated 3 because is much more stable than Rea 2.

Appreciate all the work you do. We are working towards v3 right now. Thank you.

We have limited capacity unfortunately 😕 So it is hard to maintain two branches of versions. I really recommend an update to Reanimated 3 because is much more stable than Rea 2.

@RomanTsegelskyi anything else you’ve updated or enabled? I’ve noticed this issue happening for quite some time on even on XCode 13.

@arinjay They have release a new version some hours ago. I’m installing and testing. Hope it is solved in this version.

Any updates here ?

we are experiencing the same issue for months now. The issue happens when clearing multiple screens for the navigation stack.

@hrupesh The application has been stable since. We were getting consistent deadlocks within the first minute of using the app, now nothing.

We were able to get rid of these deadlocks / crashes by enabling Hermes on iOS. So if you haven’t already, try enabling Hermes and see if the problem still persists.

@VishnuNCS Thanks a lot for letting me know ✊ Then I guess I will extend my patch until some of code owners come help us.

Changing line 261 on screenshot above to

dispatch_semaphore_wait(semaphore, dispatch_time(DISPATCH_TIME_NOW, 100000000));

fixes the “freeze” problem. I’m thinking to fire a PR for that, we are still testing this solution on our app.

Ran into the same error using:

"react-native-reanimated": "2.3.1",
"react-native-screens": "3.10.2",
"@react-navigation/native": "6.0.6",
"@react-navigation/native-stack": "6.2.5",

Exact same crash happened on production using react-native-reanimated@2.2.4 and react-native-screens@3.9.0.

Not sure if this is relevant (or true), but I have reason to believe screens is related because sentry tells me it happens in a transaction called RNSScreen: Screenshot 2021-12-13 at 13 25 58

(crashlytics reports the exact same error message as in #2327 (comment))

Same here.

"react-native-reanimated": "2.2.4",
"react-native-navigation": "7.24.3",

Hey, we are facing the same problem. When running on physical devices (ios) we get this crash randomly