react-native-reanimated: EXC_BAD_ACCESS Random Ios crashes

Description

Recently, I upgraded my React Native version to 0.76.3. I am also using Tailwind CSS.

Lately, we noticed random crashes occurring in the iOS app. Upon analyzing Sentry logs, we found that the issue was related to a memory mismatch error. After researching online, I couldn’t find a definitive solution. I have not been able to reproduce the error in development, and in production, the crashes only occur randomly in certain iOS sessions, not across all users.

Report Version: 104

Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: SEGV_NOOP at 0x0000000000000020
Crashed Thread: 24

Application Specific Information:
ReanimatedModule >
KERN_INVALID_ADDRESS at 0x20.

Thread 24 Crashed:
0   Anyo                            0x20520c374         facebook::react::UIManager::setAnimationDelegate (UIManager.cpp:653)
1   Anyo                            0x205020a04         reanimated::NativeReanimatedModule::initializeLayoutAnimationsProxy (NativeReanimatedModule.cpp:864)
2   Anyo                            0x205020914         reanimated::NativeReanimatedModule::initializeFabric (NativeReanimatedModule.cpp:855)
3   Anyo                            0x20502e840         -[REAModule injectDependencies:] (REAModule.mm:110)
4   Anyo                            0x20502f5ac         -[REAModule installTurboModule:] (REAModule.mm:298)
5   CoreFoundation                  0x322199c80         __invoking___
6   CoreFoundation                  0x32219970c         -[NSInvocation invoke]
7   CoreFoundation                  0x322199534         -[NSInvocation invokeWithTarget:]
8   Anyo                            0x205257084         facebook::react::ObjCTurboModule::performMethodInvocation (RCTTurboModule.mm:347)
9   Anyo                            0x205256d00         facebook::react::ObjCTurboModule::performMethodInvocation (RCTTurboModule.mm:366)
10  Anyo                            0x205258f0c         facebook::react::ObjCTurboModule::invokeObjCMethod (RCTTurboModule.mm:766)
11  Anyo                            0x2051a0d60         facebook::react::__hostFunction_NativeReanimatedModuleSpecJSI_installTurboModule (rnreanimated-generated.mm:30)
12  hermes                          0x107afcf78         std::__1::function<T>::operator()
13  hermes                          0x107afcc2c         facebook::hermes::HermesRuntimeImpl::HFContext::func
14  hermes                          0x107b0b6e0         hermes::vm::NativeFunction::_nativeCall
15  hermes                          0x107b1788c         hermes::vm::Interpreter::handleCallSlowPath
16  hermes                          0x107b19298         hermes::vm::Interpreter::interpretFunction<T>
17  hermes                          0x107b18884         hermes::vm::Runtime::interpretFunctionImpl
18  hermes                          0x107b484ac         hermes::vm::Runtime::runBytecode
19  hermes                          0x107af0af8         facebook::hermes::HermesRuntimeImpl::evaluatePreparedJavaScript
20  hermes                          0x107af0990         facebook::hermes::HermesRuntime::evaluateJavaScriptWithSourceMap
21  hermes                          0x107af17e8         facebook::hermes::HermesRuntimeImpl::evaluateJavaScript
22  Anyo                            0x205273954         [inlined] facebook::react::ReactInstance::loadScript::lambda::operator() (ReactInstance.cpp:225)
23  Anyo                            0x205273954         [inlined] std::__1::__invoke[abi:ne180100]<T> (invoke.h:344)
24  Anyo                            0x205273954         [inlined] std::__1::__invoke_void_return_wrapper<T>::__call[abi:ne180100]<T> (invoke.h:419)
25  Anyo                            0x205273954         [inlined] std::__1::__function::__alloc_func<T>::operator()[abi:ne180100] (function.h:169)
26  Anyo                            0x205273954         std::__1::__function::__func<T>::operator() (function.h:311)
27  Anyo                            0x205299f04         [inlined] std::__1::__function::__value_func<T>::operator()[abi:ne180100] (function.h:428)
28  Anyo                            0x205299f04         [inlined] std::__1::function<T>::operator() (function.h:981)
29  Anyo                            0x205299f04         facebook::react::Task::execute (Task.cpp:48)
30  Anyo                            0x205296700         facebook::react::RuntimeScheduler_Modern::executeTask (RuntimeScheduler_Modern.cpp:396)
31  Anyo                            0x20529615c         facebook::react::RuntimeScheduler_Modern::runEventLoopTick (RuntimeScheduler_Modern.cpp:338)
32  Anyo                            0x205296454         facebook::react::RuntimeScheduler_Modern::runEventLoop (RuntimeScheduler_Modern.cpp:286)
33  Anyo                            0x205271df8         [inlined] std::__1::__function::__value_func<T>::operator()[abi:ne180100] (function.h:428)
34  Anyo                            0x205271df8         [inlined] std::__1::function<T>::operator() (function.h:981)
35  Anyo                            0x205271df8         [inlined] const::lambda::operator() (ReactInstance.cpp:77)
36  Anyo                            0x205271df8         [inlined] std::__1::__invoke[abi:ne180100]<T> (invoke.h:344)
37  Anyo                            0x205271df8         [inlined] std::__1::__invoke_void_return_wrapper<T>::__call[abi:ne180100]<T> (invoke.h:419)
38  Anyo                            0x205271df8         [inlined] std::__1::__function::__alloc_func<T>::operator()[abi:ne180100] (function.h:169)
39  Anyo                            0x205271df8         std::__1::__function::__func<T>::operator() (function.h:311)
40  Anyo                            0x205118f7c         [inlined] std::__1::__function::__value_func<T>::operator()[abi:ne180100] (function.h:428)
41  Anyo                            0x205118f7c         [inlined] std::__1::function<T>::operator() (function.h:981)
42  Anyo                            0x205118f7c         facebook::react::tryAndReturnError (RCTCxxUtils.mm:73)
43  Anyo                            0x2051262f4         facebook::react::RCTMessageThread::tryFunc (RCTMessageThread.mm:68)
44  Anyo                            0x2051260f8         [inlined] std::__1::__function::__value_func<T>::operator()[abi:ne180100] (function.h:428)
45  Anyo                            0x2051260f8         [inlined] std::__1::function<T>::operator() (function.h:981)
46  Anyo                            0x2051260f8         facebook::react::RCTMessageThread::runAsync (RCTMessageThread.mm:44)
47  CoreFoundation                  0x32219f6b4         __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__
48  CoreFoundation                  0x32219dea8         __CFRunLoopDoBlocks
49  CoreFoundation                  0x32219c3d0         __CFRunLoopRun
50  CoreFoundation                  0x32219b964         CFRunLoopRunSpecific
51  Anyo                            0x20526ded0         +[RCTJSThreadManager runRunLoop] (RCTJSThreadManager.mm:102)
52  Foundation                      0x31ff32a98         __NSThread__start__
53  libsystem_pthread.dylib         0x3da12ca8c         _pthread_start

Thread 0
0   libsystem_kernel.dylib          0x3b2c1daf8         mach_msg2_trap
1   libsystem_kernel.dylib          0x3b2c1d88c         mach_msg2_internal
2   libsystem_kernel.dylib          0x3b2c1d7a4         mach_msg_overwrite
3   libsystem_kernel.dylib          0x3b2c1d5e4         mach_msg
4   CoreFoundation                  0x32219e018         __CFRunLoopServiceMachPort
5   CoreFoundation                  0x32219bf00         __CFRunLoopRun
6   CoreFoundation                  0x32219b964         CFRunLoopRunSpecific
7   GraphicsServices                0x3aa7b74dc         GSEventRunModal
8   UIKitCore                       0x32688aed8         -[UIApplication _run]
9   UIKitCore                       0x32688a514         UIApplicationMain
10  Anyo                            0x204674544         main (main.m:7)
11  <unknown>                       0x1bd50ad84         <redacted>

Thread 1
0   libsystem_kernel.dylib          0x3b2c26084         __workq_kernreturn
1   libsystem_pthread.dylib         0x3da12bf68         _pthread_wqthread

Thread 2
0   libsystem_kernel.dylib          0x3b2c26084         __workq_kernreturn
1   libsystem_pthread.dylib         0x3da12bf68         _pthread_wqthread

Thread 3
0   libsystem_kernel.dylib          0x3b2c26084         __workq_kernreturn
1   libsystem_pthread.dylib         0x3da12bf68         _pthread_wqthread

Thread 4
0   libsystem_kernel.dylib          0x3b2c26084         __workq_kernreturn
1   libsystem_pthread.dylib         0x3da12bf68         _pthread_wqthread

Thread 5
0   libsystem_kernel.dylib          0x3b2c26084         __workq_kernreturn
1   libsystem_pthread.dylib         0x3da12bf68         _pthread_wqthread

Thread 6
0   libsystem_kernel.dylib          0x3b2c26084         __workq_kernreturn
1   libsystem_pthread.dylib         0x3da12bf68         _pthread_wqthread

Thread 7 name: com.apple.uikit.eventfetch-thread
0   libsystem_kernel.dylib          0x3b2c1daf8         mach_msg2_trap
1   libsystem_kernel.dylib          0x3b2c1d88c         mach_msg2_internal
2   libsystem_kernel.dylib          0x3b2c1d7a4         mach_msg_overwrite
3   libsystem_kernel.dylib          0x3b2c1d5e4         mach_msg
4   CoreFoundation                  0x32219e018         __CFRunLoopServiceMachPort
5   CoreFoundation                  0x32219bf00         __CFRunLoopRun
6   CoreFoundation                  0x32219b964         CFRunLoopRunSpecific
7   Foundation                      0x31fec14a4         -[NSRunLoop(NSRunLoop) runMode:beforeDate:]
8   Foundation                      0x31feeb4e4         -[NSRunLoop(NSRunLoop) runUntilDate:]
9   UIKitCore                       0x3267edac4         -[UIEventFetcher threadMain]
10  Foundation                      0x31ff32a98         __NSThread__start__
11  libsystem_pthread.dylib         0x3da12ca8c         _pthread_start

Thread 8
0   libsystem_kernel.dylib          0x3b2c26084         __workq_kernreturn
1   libsystem_pthread.dylib         0x3da12bf68         _pthread_wqthread

Thread 9
0   libsystem_kernel.dylib          0x3b2c26084         __workq_kernreturn
1   libsystem_pthread.dylib         0x3da12bf68         _pthread_wqthread

Thread 10
0   libsystem_kernel.dylib          0x3b2c26084         __workq_kernreturn
1   libsystem_pthread.dylib         0x3da12bf68         _pthread_wqthread

Thread 11 name: com.google.firebase.crashlytics.MachExceptionServer
0   libsystem_kernel.dylib          0x3b2c1daf8         mach_msg2_trap
1   libsystem_kernel.dylib          0x3b2c1d88c         mach_msg2_internal
2   libsystem_kernel.dylib          0x3b2c1d7a4         mach_msg_overwrite
3   libsystem_kernel.dylib          0x3b2c1d5e4         mach_msg
4   Anyo                            0x204a6e0c4         [inlined] FIRCLSMachExceptionReadMessage (FIRCLSMachException.c:196)
5   Anyo                            0x204a6e0c4         FIRCLSMachExceptionServer (FIRCLSMachException.c:172)
6   libsystem_pthread.dylib         0x3da12ca8c         _pthread_start

Thread 12
0   libsystem_kernel.dylib          0x3b2c26084         __workq_kernreturn
1   libsystem_pthread.dylib         0x3da12bf68         _pthread_wqthread

Thread 13 name: com.apple.NSURLConnectionLoader
0   libsystem_kernel.dylib          0x3b2c1daf8         mach_msg2_trap
1   libsystem_kernel.dylib          0x3b2c1d88c         mach_msg2_internal
2   libsystem_kernel.dylib          0x3b2c1d7a4         mach_msg_overwrite
3   libsystem_kernel.dylib          0x3b2c1d5e4         mach_msg
4   CoreFoundation                  0x32219e018         __CFRunLoopServiceMachPort
5   CoreFoundation                  0x32219bf00         __CFRunLoopRun
6   CoreFoundation                  0x32219b964         CFRunLoopRunSpecific
7   CFNetwork                       0x324632c44         estimatedPropertyListSize
8   Foundation                      0x31ff32a98         __NSThread__start__
9   libsystem_pthread.dylib         0x3da12ca8c         _pthread_start

Thread 14
0   libsystem_kernel.dylib          0x3b2c1e2f8         __semwait_signal
1   libsystem_c.dylib               0x331ff1e9c         nanosleep
2   libsystem_c.dylib               0x332000154         sleep
3   Anyo                            0x2052e3eb8         monitorCachedData (SentryCrashCachedData.c:146)
4   libsystem_pthread.dylib         0x3da12ca8c         _pthread_start

Thread 15 name: SentryCrash Exception Handler (Secondary)
0   libsystem_kernel.dylib          0x3b2c1daf8         mach_msg2_trap
1   libsystem_kernel.dylib          0x3b2c1d88c         mach_msg2_internal
2   libsystem_kernel.dylib          0x3b2c1d7a4         mach_msg_overwrite
3   libsystem_kernel.dylib          0x3b2c1d5e4         mach_msg
4   Anyo                            0x2052ee81c         handleExceptions (SentryCrashMonitor_MachException.c:313)
5   libsystem_pthread.dylib         0x3da12ca8c         _pthread_start

Thread 17 name: io.sentry.app-hang-tracker
0   libsystem_kernel.dylib          0x3b2c1e2f8         __semwait_signal
1   libsystem_c.dylib               0x331ff1e9c         nanosleep
2   Foundation                      0x3205e66bc         +[NSThread sleepForTimeInterval:]
3   Anyo                            0x2052ce954         -[SentryANRTrackerV1 detectANRs] (SentryANRTrackerV1.m:105)
4   Foundation                      0x31ff32a98         __NSThread__start__
5   libsystem_pthread.dylib         0x3da12ca8c         _pthread_start

Thread 18
0   libsystem_kernel.dylib          0x3b2c26084         __workq_kernreturn
1   libsystem_pthread.dylib         0x3da12bf68         _pthread_wqthread

Thread 19
0   libsystem_kernel.dylib          0x3b2c26084         __workq_kernreturn
1   libsystem_pthread.dylib         0x3da12bf68         _pthread_wqthread

Thread 20
0   libsystem_kernel.dylib          0x3b2c26084         __workq_kernreturn
1   libsystem_pthread.dylib         0x3da12bf68         _pthread_wqthread

Thread 22 name: com.apple.coremedia.sharedRootQueue.47
0   libsystem_kernel.dylib          0x3b2c1da8c         semaphore_timedwait_trap
1   libdispatch.dylib               0x331f5e3e8         _dispatch_sema4_timedwait
2   libdispatch.dylib               0x331f5e9e4         _dispatch_semaphore_wait_slow
3   libdispatch.dylib               0x331f6f664         _dispatch_worker_thread
4   libsystem_pthread.dylib         0x3da12ca8c         _pthread_start

Thread 23 name: com.apple.coremedia.sharedRootQueue.47
0   libsystem_kernel.dylib          0x3b2c1da8c         semaphore_timedwait_trap
1   libdispatch.dylib               0x331f5e3e8         _dispatch_sema4_timedwait
2   libdispatch.dylib               0x331f5e9e4         _dispatch_semaphore_wait_slow
3   libdispatch.dylib               0x331f6f664         _dispatch_worker_thread
4   libsystem_pthread.dylib         0x3da12ca8c         _pthread_start

Thread 24 Crashed:
0   Anyo                            0x20520c374         facebook::react::UIManager::setAnimationDelegate (UIManager.cpp:653)
1   Anyo                            0x205020a04         reanimated::NativeReanimatedModule::initializeLayoutAnimationsProxy (NativeReanimatedModule.cpp:864)
2   Anyo                            0x205020914         reanimated::NativeReanimatedModule::initializeFabric (NativeReanimatedModule.cpp:855)
3   Anyo                            0x20502e840         -[REAModule injectDependencies:] (REAModule.mm:110)
4   Anyo                            0x20502f5ac         -[REAModule installTurboModule:] (REAModule.mm:298)
5   CoreFoundation                  0x322199c80         __invoking___
6   CoreFoundation                  0x32219970c         -[NSInvocation invoke]
7   CoreFoundation                  0x322199534         -[NSInvocation invokeWithTarget:]
8   Anyo                            0x205257084         facebook::react::ObjCTurboModule::performMethodInvocation (RCTTurboModule.mm:347)
9   Anyo                            0x205256d00         facebook::react::ObjCTurboModule::performMethodInvocation (RCTTurboModule.mm:366)
10  Anyo                            0x205258f0c         facebook::react::ObjCTurboModule::invokeObjCMethod (RCTTurboModule.mm:766)
11  Anyo                            0x2051a0d60         facebook::react::__hostFunction_NativeReanimatedModuleSpecJSI_installTurboModule (rnreanimated-generated.mm:30)
12  hermes                          0x107afcf78         std::__1::function<T>::operator()
13  hermes                          0x107afcc2c         facebook::hermes::HermesRuntimeImpl::HFContext::func
14  hermes                          0x107b0b6e0         hermes::vm::NativeFunction::_nativeCall
15  hermes                          0x107b1788c         hermes::vm::Interpreter::handleCallSlowPath
16  hermes                          0x107b19298         hermes::vm::Interpreter::interpretFunction<T>
17  hermes                          0x107b18884         hermes::vm::Runtime::interpretFunctionImpl
18  hermes                          0x107b484ac         hermes::vm::Runtime::runBytecode
19  hermes                          0x107af0af8         facebook::hermes::HermesRuntimeImpl::evaluatePreparedJavaScript
20  hermes                          0x107af0990         facebook::hermes::HermesRuntime::evaluateJavaScriptWithSourceMap
21  hermes                          0x107af17e8         facebook::hermes::HermesRuntimeImpl::evaluateJavaScript
22  Anyo                            0x205273954         [inlined] facebook::react::ReactInstance::loadScript::lambda::operator() (ReactInstance.cpp:225)
23  Anyo                            0x205273954         [inlined] std::__1::__invoke[abi:ne180100]<T> (invoke.h:344)
24  Anyo                            0x205273954         [inlined] std::__1::__invoke_void_return_wrapper<T>::__call[abi:ne180100]<T> (invoke.h:419)
25  Anyo                            0x205273954         [inlined] std::__1::__function::__alloc_func<T>::operator()[abi:ne180100] (function.h:169)
26  Anyo                            0x205273954         std::__1::__function::__func<T>::operator() (function.h:311)
27  Anyo                            0x205299f04         [inlined] std::__1::__function::__value_func<T>::operator()[abi:ne180100] (function.h:428)
28  Anyo                            0x205299f04         [inlined] std::__1::function<T>::operator() (function.h:981)
29  Anyo                            0x205299f04         facebook::react::Task::execute (Task.cpp:48)
30  Anyo                            0x205296700         facebook::react::RuntimeScheduler_Modern::executeTask (RuntimeScheduler_Modern.cpp:396)
31  Anyo                            0x20529615c         facebook::react::RuntimeScheduler_Modern::runEventLoopTick (RuntimeScheduler_Modern.cpp:338)
32  Anyo                            0x205296454         facebook::react::RuntimeScheduler_Modern::runEventLoop (RuntimeScheduler_Modern.cpp:286)
33  Anyo                            0x205271df8         [inlined] std::__1::__function::__value_func<T>::operator()[abi:ne180100] (function.h:428)
34  Anyo                            0x205271df8         [inlined] std::__1::function<T>::operator() (function.h:981)
35  Anyo                            0x205271df8         [inlined] const::lambda::operator() (ReactInstance.cpp:77)
36  Anyo                            0x205271df8         [inlined] std::__1::__invoke[abi:ne180100]<T> (invoke.h:344)
37  Anyo                            0x205271df8         [inlined] std::__1::__invoke_void_return_wrapper<T>::__call[abi:ne180100]<T> (invoke.h:419)
38  Anyo                            0x205271df8         [inlined] std::__1::__function::__alloc_func<T>::operator()[abi:ne180100] (function.h:169)
39  Anyo                            0x205271df8         std::__1::__function::__func<T>::operator() (function.h:311)
40  Anyo                            0x205118f7c         [inlined] std::__1::__function::__value_func<T>::operator()[abi:ne180100] (function.h:428)
41  Anyo                            0x205118f7c         [inlined] std::__1::function<T>::operator() (function.h:981)
42  Anyo                            0x205118f7c         facebook::react::tryAndReturnError (RCTCxxUtils.mm:73)
43  Anyo                            0x2051262f4         facebook::react::RCTMessageThread::tryFunc (RCTMessageThread.mm:68)
44  Anyo                            0x2051260f8         [inlined] std::__1::__function::__value_func<T>::operator()[abi:ne180100] (function.h:428)
45  Anyo                            0x2051260f8         [inlined] std::__1::function<T>::operator() (function.h:981)
46  Anyo                            0x2051260f8         facebook::react::RCTMessageThread::runAsync (RCTMessageThread.mm:44)
47  CoreFoundation                  0x32219f6b4         __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__
48  CoreFoundation                  0x32219dea8         __CFRunLoopDoBlocks
49  CoreFoundation                  0x32219c3d0         __CFRunLoopRun
50  CoreFoundation                  0x32219b964         CFRunLoopRunSpecific
51  Anyo                            0x20526ded0         +[RCTJSThreadManager runRunLoop] (RCTJSThreadManager.mm:102)
52  Foundation                      0x31ff32a98         __NSThread__start__
53  libsystem_pthread.dylib         0x3da12ca8c         _pthread_start

Thread 25
0   libsystem_kernel.dylib          0x3b2c1e49c         __psynch_cvwait
1   libsystem_pthread.dylib         0x3da12b58c         _pthread_cond_wait
2   libc++.1.dylib                  0x34290b500         std::__1::condition_variable::wait
3   hermes                          0x107bb4df4         hermes::vm::HadesGC::Executor::worker
4   hermes                          0x107bb4d5c         std::__1::__thread_proxy[abi:v160006]<T>
5   libsystem_pthread.dylib         0x3da12ca8c         _pthread_start

Thread 26
0   hermes                          0x107b0d408         hermes::vm::DictPropertyMap::lookupEntryFor
1   hermes                          0x107b0d5c0         hermes::vm::DictPropertyMap::findOrAdd
2   hermes                          0x107b13b9c         hermes::vm::HiddenClass::addToPropertyMap
3   hermes                          0x107b13728         hermes::vm::HiddenClass::addProperty
4   hermes                          0x107b2dfcc         hermes::vm::JSObject::addOwnPropertyImpl
5   hermes                          0x107b2c7a4         hermes::vm::JSObject::addOwnProperty
6   hermes                          0x107b2da1c         hermes::vm::JSObject::defineOwnPropertyInternal
7   hermes                          0x107b42e48         hermes::vm::objectFromPropertyDescriptor
8   hermes                          0x107b90c40         hermes::vm::getOwnPropertyDescriptor
9   hermes                          0x107b8f228         hermes::vm::objectGetOwnPropertyDescriptor
10  hermes                          0x107b0b6e0         hermes::vm::NativeFunction::_nativeCall
11  hermes                          0x107b1788c         hermes::vm::Interpreter::handleCallSlowPath
12  hermes                          0x107b19298         hermes::vm::Interpreter::interpretFunction<T>
13  hermes                          0x107b18884         hermes::vm::Runtime::interpretFunctionImpl
14  hermes                          0x107b484ac         hermes::vm::Runtime::runBytecode
15  hermes                          0x107af0af8         facebook::hermes::HermesRuntimeImpl::evaluatePreparedJavaScript
16  hermes                          0x107af0990         facebook::hermes::HermesRuntime::evaluateJavaScriptWithSourceMap
17  hermes                          0x107af17e8         facebook::hermes::HermesRuntimeImpl::evaluateJavaScript
18  Anyo                            0x205273954         [inlined] facebook::react::ReactInstance::loadScript::lambda::operator() (ReactInstance.cpp:225)
19  Anyo                            0x205273954         [inlined] std::__1::__invoke[abi:ne180100]<T> (invoke.h:344)
20  Anyo                            0x205273954         [inlined] std::__1::__invoke_void_return_wrapper<T>::__call[abi:ne180100]<T> (invoke.h:419)
21  Anyo                            0x205273954         [inlined] std::__1::__function::__alloc_func<T>::operator()[abi:ne180100] (function.h:169)
22  Anyo                            0x205273954         std::__1::__function::__func<T>::operator() (function.h:311)
23  Anyo                            0x205299f04         [inlined] std::__1::__function::__value_func<T>::operator()[abi:ne180100] (function.h:428)
24  Anyo                            0x205299f04         [inlined] std::__1::function<T>::operator() (function.h:981)
25  Anyo                            0x205299f04         facebook::react::Task::execute (Task.cpp:48)
26  Anyo                            0x205296700         facebook::react::RuntimeScheduler_Modern::executeTask (RuntimeScheduler_Modern.cpp:396)
27  Anyo                            0x20529615c         facebook::react::RuntimeScheduler_Modern::runEventLoopTick (RuntimeScheduler_Modern.cpp:338)
28  Anyo                            0x205296454         facebook::react::RuntimeScheduler_Modern::runEventLoop (RuntimeScheduler_Modern.cpp:286)
29  Anyo                            0x205271df8         [inlined] std::__1::__function::__value_func<T>::operator()[abi:ne180100] (function.h:428)
30  Anyo                            0x205271df8         [inlined] std::__1::function<T>::operator() (function.h:981)
31  Anyo                            0x205271df8         [inlined] const::lambda::operator() (ReactInstance.cpp:77)
32  Anyo                            0x205271df8         [inlined] std::__1::__invoke[abi:ne180100]<T> (invoke.h:344)
33  Anyo                            0x205271df8         [inlined] std::__1::__invoke_void_return_wrapper<T>::__call[abi:ne180100]<T> (invoke.h:419)
34  Anyo                            0x205271df8         [inlined] std::__1::__function::__alloc_func<T>::operator()[abi:ne180100] (function.h:169)
35  Anyo                            0x205271df8         std::__1::__function::__func<T>::operator() (function.h:311)
36  Anyo                            0x205118f7c         [inlined] std::__1::__function::__value_func<T>::operator()[abi:ne180100] (function.h:428)
37  Anyo                            0x205118f7c         [inlined] std::__1::function<T>::operator() (function.h:981)
38  Anyo                            0x205118f7c         facebook::react::tryAndReturnError (RCTCxxUtils.mm:73)
39  Anyo                            0x2051262f4         facebook::react::RCTMessageThread::tryFunc (RCTMessageThread.mm:68)
40  Anyo                            0x2051260f8         [inlined] std::__1::__function::__value_func<T>::operator()[abi:ne180100] (function.h:428)
41  Anyo                            0x2051260f8         [inlined] std::__1::function<T>::operator() (function.h:981)
42  Anyo                            0x2051260f8         facebook::react::RCTMessageThread::runAsync (RCTMessageThread.mm:44)
43  CoreFoundation                  0x32219f6b4         __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__
44  CoreFoundation                  0x32219dea8         __CFRunLoopDoBlocks
45  CoreFoundation                  0x32219c3d0         __CFRunLoopRun
46  CoreFoundation                  0x32219b964         CFRunLoopRunSpecific
47  Anyo                            0x20526ded0         +[RCTJSThreadManager runRunLoop] (RCTJSThreadManager.mm:102)
48  Foundation                      0x31ff32a98         __NSThread__start__
49  libsystem_pthread.dylib         0x3da12ca8c         _pthread_start

Thread 27
0   libsystem_kernel.dylib          0x3b2c1e49c         __psynch_cvwait
1   libsystem_pthread.dylib         0x3da12b58c         _pthread_cond_wait
2   libc++.1.dylib                  0x34290b500         std::__1::condition_variable::wait
3   hermes                          0x107bb4df4         hermes::vm::HadesGC::Executor::worker
4   hermes                          0x107bb4d5c         std::__1::__thread_proxy[abi:v160006]<T>
5   libsystem_pthread.dylib         0x3da12ca8c         _pthread_start

Thread 28
0   libsystem_kernel.dylib          0x3b2c1e49c         __psynch_cvwait
1   libsystem_pthread.dylib         0x3da12b58c         _pthread_cond_wait
2   libc++.1.dylib                  0x34290b500         std::__1::condition_variable::wait
3   hermes                          0x107bb4df4         hermes::vm::HadesGC::Executor::worker
4   hermes                          0x107bb4d5c         std::__1::__thread_proxy[abi:v160006]<T>
5   libsystem_pthread.dylib         0x3da12ca8c         _pthread_start

Thread 24 crashed with ARM Thread State (64-bit):
    x0: 0x0000000000000000   x1: 0x0000000000000000   x2: 0x00000001060e8dc8   x3: 0x0000000145313f90
    x4: 0x0000000700000007   x5: 0x0000000000000007   x6: 0x000000016c5c8b78   x7: 0x000000016c5c80d8
    x8: 0x0000000000000000   x9: 0x0000000000000000  x10: 0x0000000000000004  x11: 0x0000000145072a68
   x12: 0x0000000000000000  x13: 0x0000000000000000  x14: 0x02000001060e8dcd  x15: 0x00000001060e8dc8
   x16: 0x00000001aa393274  x17: 0x0000000000000002  x18: 0x0000000000000000  x19: 0x0000000145072a78
   x20: 0x0000000145072cc0  x21: 0x000000030090c780  x22: 0x000000030231eb80  x23: 0x000000030231eb80
   x24: 0x0000000301a4fe90  x25: 0x0000000302d1e600  x26: 0x000000016c5c8e28  x27: 0x0000000000000001
   x28: 0x0000000301603830   fp: 0x000000016c5c8d30   lr: 0x0000000105020a08   sp: 0x000000016c5c8cc0
    pc: 0x000000010520c374 cpsr: 0x0000000060001000



EOF

Steps to reproduce

Unable to reproduce

Snack or a link to a repository

https://snack.expo.io/)

Reanimated version

3.16.1

React Native version

0.76.3

Platforms

Android, iOS

JavaScript runtime

Hermes

Workflow

React Native

Architecture

Fabric (New Architecture)

Build type

Release app & production bundle

Device

Real device

Device model

iphone 14 plus

Acknowledgements

Yes

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Reactions: 7
  • Comments: 18

Most upvoted comments

@rpopovici Accidentally the nightlies were using the old branch after the release of 3.18.0, I made a fix here https://github.com/software-mansion/react-native-reanimated/pull/7609

This is what helped me

diff --git a/node_modules/react-native-reanimated/Common/cpp/.DS_Store b/node_modules/react-native-reanimated/Common/cpp/.DS_Store
new file mode 100644
index 0000000..707bd02
Binary files /dev/null and b/node_modules/react-native-reanimated/Common/cpp/.DS_Store differ
diff --git a/node_modules/react-native-reanimated/Common/cpp/worklets/.DS_Store b/node_modules/react-native-reanimated/Common/cpp/worklets/.DS_Store
new file mode 100644
index 0000000..cbb18f7
Binary files /dev/null and b/node_modules/react-native-reanimated/Common/cpp/worklets/.DS_Store differ
diff --git a/node_modules/react-native-reanimated/Common/cpp/worklets/WorkletRuntime/ReanimatedHermesRuntime.cpp b/node_modules/react-native-reanimated/Common/cpp/worklets/WorkletRuntime/ReanimatedHermesRuntime.cpp
index 29f068c..de9d64b 100644
--- a/node_modules/react-native-reanimated/Common/cpp/worklets/WorkletRuntime/ReanimatedHermesRuntime.cpp
+++ b/node_modules/react-native-reanimated/Common/cpp/worklets/WorkletRuntime/ReanimatedHermesRuntime.cpp
@@ -70,34 +70,7 @@ ReanimatedHermesRuntime::ReanimatedHermesRuntime(
   jsQueue->quitSynchronous();
 #endif // HERMES_ENABLE_DEBUGGER
 
-#ifndef NDEBUG
-  facebook::hermes::HermesRuntime *wrappedRuntime = runtime_.get();
-  jsi::Value evalWithSourceMap = jsi::Function::createFromHostFunction(
-      *runtime_,
-      jsi::PropNameID::forAscii(*runtime_, "evalWithSourceMap"),
-      3,
-      [wrappedRuntime](
-          jsi::Runtime &rt,
-          const jsi::Value &thisValue,
-          const jsi::Value *args,
-          size_t count) -> jsi::Value {
-        auto code = std::make_shared<const jsi::StringBuffer>(
-            args[0].asString(rt).utf8(rt));
-        std::string sourceURL;
-        if (count > 1 && args[1].isString()) {
-          sourceURL = args[1].asString(rt).utf8(rt);
-        }
-        std::shared_ptr<const jsi::Buffer> sourceMap;
-        if (count > 2 && args[2].isString()) {
-          sourceMap = std::make_shared<const jsi::StringBuffer>(
-              args[2].asString(rt).utf8(rt));
-        }
-        return wrappedRuntime->evaluateJavaScriptWithSourceMap(
-            code, sourceMap, sourceURL);
-      });
-  runtime_->global().setProperty(
-      *runtime_, "evalWithSourceMap", evalWithSourceMap);
-#endif // NDEBUG
+
 }
 
 ReanimatedHermesRuntime::~ReanimatedHermesRuntime() {