react-native-reanimated: [iOS] Crash in MutableValue::set

Description

My app is crashing in production. It usually happens at app start. About every 5th app start will end in crash.

The stacktrace I get from crashlytics:

Crashed: com.apple.main-thread
0  pierre                         0x27fd74 std::__1::__function::__func<reanimated::MutableValue::set(facebook::jsi::Runtime&, facebook::jsi::PropNameID const&, facebook::jsi::Value const&)::$_2, std::__1::allocator<reanimated::MutableValue::set(facebook::jsi::Runtime&, facebook::jsi::PropNameID const&, facebook::jsi::Value const&)::$_2>, void ()>::operator()() + 580 (shared_ptr.h:580)
1  pierre                         0x2aa1e4 reanimated::Scheduler::triggerUI() + 463 (function.h:463)
2  libdispatch.dylib              0x63094 _dispatch_call_block_and_release + 24
3  libdispatch.dylib              0x64094 _dispatch_client_callout + 16
4  libdispatch.dylib              0x10d44 _dispatch_main_queue_drain + 928
5  libdispatch.dylib              0x10994 _dispatch_main_queue_callback_4CF$VARIANT$mp + 36
6  CoreFoundation                 0x4e0d4 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 12
7  CoreFoundation                 0xb5f8 __CFRunLoopRun + 2544
8  CoreFoundation                 0x1e250 CFRunLoopRunSpecific + 572
9  GraphicsServices               0x1988 GSEventRunModal + 160
10 UIKitCore                      0x4e5a88 -[UIApplication _run] + 1080
11 UIKitCore                      0x27efc8 UIApplicationMain + 336
12 pierre                         0x9020 main + 14 (main.m:14)
13 ???                            0x105d344d0 (Missing)

Steps to reproduce

I can only catch it in debug when opening and closing app rapidly.

Snack or a link to a repository

Reanimated version

2.10

React Native version

0.68.2

Platforms

iOS

JavaScript runtime

Hermes

Workflow

React Native (without Expo)

Architecture

Paper (Old Architecture)

Build type

Release mode

Device

Real device

Device model

iPhone 13

Acknowledgements

Yes

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Reactions: 7
  • Comments: 26 (7 by maintainers)

Most upvoted comments

Can anyone else confirm the migration to v3 is viable solution? If so, what react-native version are you running? We are currently on 0.67.5 (latest version without new architecture) and reanimated 2.4.0.

We experience problems only on iOS, only in production and we struggle to reproduce it regularly as well. We are currently having two options. Get rid of reanimated completely or migrate it, but migrate whole project to latest RN version (and all libraries) is not an option.

After successfully migrating to reanimated v3 and react-native 0.71.3 all reanimated-related errors on Sentry are gone for me, an awesome step up

I think I may have just gotten this error in prod with RNScreens 3.22 and Reanimated 3.5.4 (RN 0.72.5):

image

Does this error seem like it came from Reanimated?

@maXXCZ1 Reanimated 3.3.0 is the most stable version ever so I’d recommend upgrading. Let me know if you encounter any problems, we’re happy to help.

Hi, i’m on v3 of reanimated and get that issue a lot still, switch to expo-router last week and since then got 1XX crahes and that lead me to here. Only iOS 16 like everyone so not sure v3 would fix this unfortunately 😕

Screenshot 2023-05-29 at 10 50 09

Screenshot 2023-05-30 at 11 01 57

I also attached the issue originaly opened on react-native-screens, got many crash from a while when putting the app in background

Same here, we’re seeing this issue after the app is put in the background. Don’t really know how it’s possible but sentry shows a lot of “going to background” logs in a row, without any “going active”.

I think we gotta wait : https://github.com/software-mansion/react-native-reanimated/issues/3917

I got the same crash on iPhone XR iOS 15.6.1, which does not reproduce consistently, and I did not use react-native-multithreading and react-native-vision-camera either.

image