react-native-reanimated: C++ Exception: N8facebook3jsi7JSErrorE (iOS in production)

Description

Our iOS app is crashing seemingly randomly in production. Seems heavily related to #2327 which was supposed to be fixed by v3.

Click me for sentry stack trace
OS Version: iOS 17.2.1 (21C66)
Report Version: 104

Exception Type: EXC_CRASH (SIGABRT)
Crashed Thread: 0

Application Specific Information:
N8facebook3jsi7JSErrorE

Thread 1
0   libsystem_kernel.dylib          0x3b1ddd6d0         __workq_kernreturn
1   libsystem_pthread.dylib         0x3f6f519ac         _pthread_wqthread

Thread 2
0   libsystem_kernel.dylib          0x3b1ddd6d0         __workq_kernreturn
1   libsystem_pthread.dylib         0x3f6f519ac         _pthread_wqthread

Thread 3
0   libsystem_kernel.dylib          0x3b1ddd6d0         __workq_kernreturn
1   libsystem_pthread.dylib         0x3f6f519ac         _pthread_wqthread

Thread 4 name: com.apple.uikit.eventfetch-thread
0   libsystem_kernel.dylib          0x3b1dd5178         mach_msg2_trap
1   libsystem_kernel.dylib          0x3b1dd4f0c         mach_msg2_internal
2   libsystem_kernel.dylib          0x3b1dd4e24         mach_msg_overwrite
3   libsystem_kernel.dylib          0x3b1dd4c64         mach_msg
4   CoreFoundation                  0x322f4db18         __CFRunLoopServiceMachPort
5   CoreFoundation                  0x322f4ba10         __CFRunLoopRun
6   CoreFoundation                  0x322f4b474         CFRunLoopRunSpecific
7   Foundation                      0x320e78488         -[NSRunLoop(NSRunLoop) runMode:beforeDate:]
8   Foundation                      0x320ea5748         -[NSRunLoop(NSRunLoop) runUntilDate:]
9   UIKitCore                       0x3274fc4a4         -[UIEventFetcher threadMain]
10  Foundation                      0x320efbddc         __NSThread__start__
11  libsystem_pthread.dylib         0x3f6f524d0         _pthread_start

Thread 5
0   libsystem_kernel.dylib          0x3b1ddd6d0         __workq_kernreturn
1   libsystem_pthread.dylib         0x3f6f519ac         _pthread_wqthread

Thread 6
0   libsystem_kernel.dylib          0x3b1ddd6d0         __workq_kernreturn
1   libsystem_pthread.dylib         0x3f6f519ac         _pthread_wqthread

Thread 7
0   libsystem_kernel.dylib          0x3b1dd5978         __semwait_signal
1   libsystem_c.dylib               0x332f95f1c         nanosleep
2   libsystem_c.dylib               0x332f95e34         usleep
3   BeatGig                         0x2019807fc         __45-[RSCloudModeManager startCloudModeProcessor]_block_invoke
4   libdispatch.dylib               0x332f006a4         _dispatch_call_block_and_release
5   libdispatch.dylib               0x332f022fc         _dispatch_client_callout
6   libdispatch.dylib               0x332f09890         _dispatch_lane_serial_drain
7   libdispatch.dylib               0x332f0a3c0         _dispatch_lane_invoke
8   libdispatch.dylib               0x332f15000         _dispatch_root_queue_drain_deferred_wlh
9   libdispatch.dylib               0x332f14874         _dispatch_workloop_worker_thread
10  libsystem_pthread.dylib         0x3f6f51960         _pthread_wqthread

Thread 8
0   libswiftCore.dylib              0x315a41d80         swift_retain
1   LogRocket                       0x103b90770         thunk for closure
2   libdispatch.dylib               0x332f022fc         _dispatch_client_callout
3   libdispatch.dylib               0x332f057b4         _dispatch_continuation_pop
4   libdispatch.dylib               0x332f195bc         _dispatch_source_latch_and_call
5   libdispatch.dylib               0x332f1818c         _dispatch_source_invoke
6   libdispatch.dylib               0x332f09714         _dispatch_lane_serial_drain
7   libdispatch.dylib               0x332f0a3c0         _dispatch_lane_invoke
8   libdispatch.dylib               0x332f15000         _dispatch_root_queue_drain_deferred_wlh
9   libdispatch.dylib               0x332f14874         _dispatch_workloop_worker_thread
10  libsystem_pthread.dylib         0x3f6f51960         _pthread_wqthread

Thread 9
0   libsystem_kernel.dylib          0x3b1ddd6d0         __workq_kernreturn
1   libsystem_pthread.dylib         0x3f6f519ac         _pthread_wqthread

Thread 10 name: com.facebook.react.JavaScript
0   hermes                          0x1035896d0         facebook::hermes::HermesRuntimeImpl::ManagedValue<T>::invalidate
1   hermes                          0x103592af0         facebook::jsi::Value::~Value
2   hermes                          0x10358d4cc         facebook::hermes::HermesRuntimeImpl::JsiProxy::get
3   hermes                          0x1035bcc18         hermes::vm::JSObject::getNamedWithReceiver_RJS
4   hermes                          0x1035ac150         hermes::vm::Interpreter::interpretFunction<T>
5   hermes                          0x1035a9dfc         hermes::vm::Runtime::interpretFunctionImpl
6   hermes                          0x10359c394         hermes::vm::JSFunction::_callImpl
7   hermes                          0x10359b060         hermes::vm::Callable::executeCall3
8   hermes                          0x1035f8aa8         hermes::vm::arrayPrototypeMap
9   hermes                          0x10359c29c         hermes::vm::NativeFunction::_nativeCall
10  hermes                          0x1035a8e04         hermes::vm::Interpreter::handleCallSlowPath
11  hermes                          0x1035aa60c         hermes::vm::Interpreter::interpretFunction<T>
12  hermes                          0x1035a9dfc         hermes::vm::Runtime::interpretFunctionImpl
13  hermes                          0x10359c394         hermes::vm::JSFunction::_callImpl
14  hermes                          0x10359b060         hermes::vm::Callable::executeCall3
15  hermes                          0x1035f8aa8         hermes::vm::arrayPrototypeMap
16  hermes                          0x10359c29c         hermes::vm::NativeFunction::_nativeCall
17  hermes                          0x1035a8e04         hermes::vm::Interpreter::handleCallSlowPath
18  hermes                          0x1035aa60c         hermes::vm::Interpreter::interpretFunction<T>
19  hermes                          0x1035a9dfc         hermes::vm::Runtime::interpretFunctionImpl
20  hermes                          0x10359c394         hermes::vm::JSFunction::_callImpl
21  hermes                          0x10359b060         hermes::vm::Callable::executeCall3
22  hermes                          0x1035f8aa8         hermes::vm::arrayPrototypeMap
23  hermes                          0x10359c29c         hermes::vm::NativeFunction::_nativeCall
24  hermes                          0x1035a8e04         hermes::vm::Interpreter::handleCallSlowPath
25  hermes                          0x1035aa60c         hermes::vm::Interpreter::interpretFunction<T>
26  hermes                          0x1035a9dfc         hermes::vm::Runtime::interpretFunctionImpl
27  hermes                          0x10359c394         hermes::vm::JSFunction::_callImpl
28  hermes                          0x10359b5a0         hermes::vm::Callable::executeCall
29  hermes                          0x10362e774         hermes::vm::functionPrototypeApply
30  hermes                          0x10359c29c         hermes::vm::NativeFunction::_nativeCall
31  hermes                          0x1035a8e04         hermes::vm::Interpreter::handleCallSlowPath
32  hermes                          0x1035aa60c         hermes::vm::Interpreter::interpretFunction<T>
33  hermes                          0x1035a9dfc         hermes::vm::Runtime::interpretFunctionImpl
34  hermes                          0x10359c394         hermes::vm::JSFunction::_callImpl
35  hermes                          0x10359bf84         hermes::vm::BoundFunction::_boundCall
36  hermes                          0x103586d6c         facebook::hermes::HermesRuntimeImpl::call
37  BeatGig                         0x201cf4810         [inlined] facebook::jsi::RuntimeDecorator<T>::call (decorator.h:340)
38  BeatGig                         0x201cf4810         facebook::jsi::WithRuntimeDecorator<T>::call (decorator.h:753)
39  BeatGig                         0x201af3a8c         [inlined] facebook::jsi::Function::call (jsi-inl.h:259)
40  BeatGig                         0x201af3a8c         [inlined] facebook::jsi::Function::call (jsi-inl.h:264)
41  BeatGig                         0x201af3a8c         [inlined] facebook::jsi::Function::call<T> (jsi-inl.h:272)
42  BeatGig                         0x201af3a8c         facebook::react::JSIExecutor::flush (JSIExecutor.cpp:428)
43  BeatGig                         0x201acc4a4         [inlined] std::__1::__function::__value_func<T>::operator()[abi:v160006] (function.h:510)
44  BeatGig                         0x201acc4a4         [inlined] std::__1::function<T>::operator() (function.h:1156)
45  BeatGig                         0x201acc4a4         [inlined] facebook::react::NativeToJsBridge::runOnExecutorQueue::lambda::operator() (NativeToJsBridge.cpp:308)
46  BeatGig                         0x201acc4a4         [inlined] std::__1::__invoke[abi:v160006]<T> (invoke.h:394)
47  BeatGig                         0x201acc4a4         [inlined] std::__1::__invoke_void_return_wrapper<T>::__call<T> (invoke.h:487)
48  BeatGig                         0x201acc4a4         [inlined] std::__1::__function::__alloc_func<T>::operator()[abi:v160006] (function.h:185)
49  BeatGig                         0x201acc4a4         std::__1::__function::__func<T>::operator() (function.h:356)
50  BeatGig                         0x2017d2d30         [inlined] std::__1::__function::__value_func<T>::operator()[abi:v160006] (function.h:510)
51  BeatGig                         0x2017d2d30         [inlined] std::__1::function<T>::operator() (function.h:1156)
52  BeatGig                         0x2017d2d30         facebook::react::tryAndReturnError (RCTCxxUtils.mm:73)
53  BeatGig                         0x2017ded58         facebook::react::RCTMessageThread::tryFunc (RCTMessageThread.mm:68)
54  BeatGig                         0x2017deb64         [inlined] std::__1::__function::__value_func<T>::operator()[abi:v160006] (function.h:510)
55  BeatGig                         0x2017deb64         [inlined] std::__1::function<T>::operator() (function.h:1156)
56  BeatGig                         0x2017deb64         facebook::react::RCTMessageThread::runAsync (RCTMessageThread.mm:44)
57  CoreFoundation                  0x322f4f1b4         __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__
58  CoreFoundation                  0x322f4d9a8         __CFRunLoopDoBlocks
59  CoreFoundation                  0x322f4bee0         __CFRunLoopRun
60  CoreFoundation                  0x322f4b474         CFRunLoopRunSpecific
61  BeatGig                         0x2017c84fc         +[RCTCxxBridge runRunLoop] (RCTCxxBridge.mm:332)
62  Foundation                      0x320efbddc         __NSThread__start__
63  libsystem_pthread.dylib         0x3f6f524d0         _pthread_start

Thread 11 name: hades
0   libsystem_kernel.dylib          0x3b1dd5b1c         __psynch_cvwait
1   libsystem_pthread.dylib         0x3f6f50fd0         _pthread_cond_wait
2   libc++.1.dylib                  0x34336eec8         std::__1::condition_variable::wait
3   hermes                          0x103648104         hermes::vm::HadesGC::Executor::worker
4   hermes                          0x103647fa4         std::__1::__thread_proxy[abi:v15006]<T>
5   libsystem_pthread.dylib         0x3f6f524d0         _pthread_start

Thread 12 name: hades
0   libsystem_kernel.dylib          0x3b1dd5b1c         __psynch_cvwait
1   libsystem_pthread.dylib         0x3f6f50fd0         _pthread_cond_wait
2   libc++.1.dylib                  0x34336eec8         std::__1::condition_variable::wait
3   hermes                          0x103648104         hermes::vm::HadesGC::Executor::worker
4   hermes                          0x103647fa4         std::__1::__thread_proxy[abi:v15006]<T>
5   libsystem_pthread.dylib         0x3f6f524d0         _pthread_start

Thread 13
0   libsystem_kernel.dylib          0x3b1dd5978         __semwait_signal
1   libsystem_c.dylib               0x332f95f1c         nanosleep
2   libsystem_c.dylib               0x332fa41d8         sleep
3   BeatGig                         0x2019f7558         monitorCachedData (SentryCrashCachedData.c:145)
4   libsystem_pthread.dylib         0x3f6f524d0         _pthread_start

Thread 14 name: SentryCrash Exception Handler (Secondary)
0   libsystem_kernel.dylib          0x3b1dd5178         mach_msg2_trap
1   libsystem_kernel.dylib          0x3b1dd4f0c         mach_msg2_internal
2   libsystem_kernel.dylib          0x3b1dd9714         thread_suspend
3   BeatGig                         0x201a03274         handleExceptions (SentryCrashMonitor_MachException.c:306)
4   libsystem_pthread.dylib         0x3f6f524d0         _pthread_start

Thread 15 name: SentryCrash Exception Handler (Primary)
0   libsystem_kernel.dylib          0x3b1dd5178         mach_msg2_trap
1   libsystem_kernel.dylib          0x3b1dd4f0c         mach_msg2_internal
2   libsystem_kernel.dylib          0x3b1dd4e24         mach_msg_overwrite
3   libsystem_kernel.dylib          0x3b1dd4c64         mach_msg
4   BeatGig                         0x201a032a0         handleExceptions (SentryCrashMonitor_MachException.c:314)
5   libsystem_pthread.dylib         0x3f6f524d0         _pthread_start

Thread 16 name: io.sentry.app-hang-tracker
0   libsystem_kernel.dylib          0x3b1dd5978         __semwait_signal
1   libsystem_c.dylib               0x332f95f1c         nanosleep
2   Foundation                      0x321592768         +[NSThread sleepForTimeInterval:]
3   BeatGig                         0x2019e6004         -[SentryANRTracker detectANRs] (SentryANRTracker.m:105)
4   Foundation                      0x320efbddc         __NSThread__start__
5   libsystem_pthread.dylib         0x3f6f524d0         _pthread_start

Thread 17 name: KSCrash Exception Handler (Secondary)
0   libsystem_kernel.dylib          0x3b1dd5178         mach_msg2_trap
1   libsystem_kernel.dylib          0x3b1dd4f0c         mach_msg2_internal
2   libsystem_kernel.dylib          0x3b1dd9714         thread_suspend
3   BeatGig                         0x201785f30         rsc_ksmachexc_i_handleExceptions (RSC_KSCrashSentry_MachException.c:222)
4   libsystem_pthread.dylib         0x3f6f524d0         _pthread_start

Thread 18 name: KSCrash Exception Handler (Primary)
0   libsystem_kernel.dylib          0x3b1dd5178         mach_msg2_trap
1   libsystem_kernel.dylib          0x3b1dd4f0c         mach_msg2_internal
2   libsystem_kernel.dylib          0x3b1dd4e24         mach_msg_overwrite
3   libsystem_kernel.dylib          0x3b1dd4c64         mach_msg
4   BeatGig                         0x201785f64         rsc_ksmachexc_i_handleExceptions (RSC_KSCrashSentry_MachException.c:229)
5   libsystem_pthread.dylib         0x3f6f524d0         _pthread_start

Thread 19 name: com.bugsnag.app-hang-detector
0   libsystem_kernel.dylib          0x3b1dd510c         semaphore_timedwait_trap
1   libdispatch.dylib               0x332f02914         _dispatch_sema4_timedwait
2   libdispatch.dylib               0x332f02f10         _dispatch_semaphore_wait_slow
3   BeatGig                         0x20178b508         -[RSCAppHangDetector detectAppHangs] (RSCAppHangDetector.m:133)
4   BeatGig                         0x20178b474         DetectAppHangs (RSCAppHangDetector.m:216)
5   libsystem_pthread.dylib         0x3f6f524d0         _pthread_start

Thread 20 name: com.apple.NSURLConnectionLoader
0   libsystem_kernel.dylib          0x3b1dd5178         mach_msg2_trap
1   libsystem_kernel.dylib          0x3b1dd4f0c         mach_msg2_internal
2   libsystem_kernel.dylib          0x3b1dd4e24         mach_msg_overwrite
3   libsystem_kernel.dylib          0x3b1dd4c64         mach_msg
4   CoreFoundation                  0x322f4db18         __CFRunLoopServiceMachPort
5   CoreFoundation                  0x322f4ba10         __CFRunLoopRun
6   CoreFoundation                  0x322f4b474         CFRunLoopRunSpecific
7   CFNetwork                       0x32532005c         estimatedPropertyListSize
8   Foundation                      0x320efbddc         __NSThread__start__
9   libsystem_pthread.dylib         0x3f6f524d0         _pthread_start

Thread 21
0   libsystem_kernel.dylib          0x3b1dd50f4         semaphore_wait_trap
1   caulk                           0x3fc82b690         caulk::semaphore::timed_wait
2   caulk                           0x3fc82b4c0         caulk::concurrent::details::worker_thread::run
3   caulk                           0x3fc844738         caulk::thread_proxy<T>
4   libsystem_pthread.dylib         0x3f6f524d0         _pthread_start

Thread 22
0   libsystem_kernel.dylib          0x3b1dd50f4         semaphore_wait_trap
1   caulk                           0x3fc82b690         caulk::semaphore::timed_wait
2   caulk                           0x3fc82b4c0         caulk::concurrent::details::worker_thread::run
3   caulk                           0x3fc844738         caulk::thread_proxy<T>
4   libsystem_pthread.dylib         0x3f6f524d0         _pthread_start





EOF

Steps to reproduce

Unfortunately I can’t narrow it down quite yet.

Snack or a link to a repository

https://no-repro.com

Reanimated version

3.7.0

React Native version

0.73.4

Platforms

iOS

JavaScript runtime

Hermes

Workflow

Expo Dev Client

Architecture

Paper (Old Architecture)

Build type

Release app & production bundle

Device

Real device

Device model

iPhone 16, iOS 17.2.1

Acknowledgements

Yes

About this issue

  • Original URL
  • State: open
  • Created 3 years ago
  • Reactions: 23
  • Comments: 49 (9 by maintainers)

Most upvoted comments

please reopen 😦

Image

@bartlomiejbloniarz maybe time to consider reopening this issue since it still happens on newer releases.

@bartlomiejbloniarz
We are also seeing this issue.

"expo": "52.0.25"
"react-native": "0.76.6"
"react-native-reanimated": "3.16.1",
"react-native-screens": "4.4.0",
  • Happens on various iOS versions and various devices.
  • new architecture (bridgeless)

@callaars @adriangonzy @joshpensky

have you guys solved the issue?

This patch fixed the issue for me if it helps anyone else, I just commented out the error that was thrown and caught a couple of potential exceptions. No noticeable change to the UX and no crash so works for me.

The underlying error that was thrown was: [Reanimated] Data type not recognized by value unpacker.

react-native-reanimated+3.7.1.patch

Same here

Is there anything in the sentry report that suggests that this is related to reanimated?

Thats a very relevant question. From my side I just googled the error and found it here.

Same problem here with sdk 52, maybe time for reopen issue?

Hi! It’s seems to be related to this issue. It was caused by RN missing some methods in their WithRuntimeDecorator implementation. We use it to ensure no concurrent access to the runtime. This was fixed in RN 0.75 via this PR and this PR.

This particular crash is no longer happening now, instead we are just seeing App Hanging constantly (including on 3.8.1)

I’ll open a new issue for that