software-mansion / react-native-reanimated

React Native's Animated library reimplemented
https://docs.swmansion.com/react-native-reanimated/
MIT License
8.95k stars 1.3k forks source link

App crash on launch : `reanimated::ReanimatedReentrancyCheck::before()` #5331

Closed akashraj9828 closed 10 months ago

akashraj9828 commented 11 months ago

Description

The app is randomly crashing(1 out of 15-20 times) when launching the app.

Stack trace from Firebase Crashlytics

Variant 1:

Crashed: com.apple.main-thread
0  randomAppName           0x1d060c reanimated::ReanimatedReentrancyCheck::before() + 85 (ReanimatedHermesRuntime.h:85)
1  randomAppName           0x1ce300 facebook::jsi::WithRuntimeDecorator<reanimated::ReanimatedReentrancyCheck, facebook::jsi::Runtime, facebook::jsi::Runtime>::createObject() + 226 (decorator.h:226)
2  randomAppName           0x1bd684 convertObjCObjectToJSIValue(facebook::jsi::Runtime&, objc_object*) + 406 (jsi.h:406)
3  randomAppName           0x1bd3e4 invocation function for block in reanimated::createReanimatedModule(RCTBridge*, std::__1::shared_ptr<facebook::react::CallInvoker> const&) + 300 (NativeProxy.mm:300)
4  randomAppName           0x1d2e9c __33-[REANodesManager dispatchEvent:]_block_invoke + 398 (REANodesManager.mm:398)
5  randomAppName           0x286b80 RCTExecuteOnMainQueue + 262 (RCTUtils.m:262)
6  randomAppName           0x1d2dc8 -[REANodesManager dispatchEvent:] + 401 (REANodesManager.mm:401)
7  randomAppName           0x1c8aac -[RCTEventDispatcher(Reanimated) reanimated_sendEvent:] + 23 (RCTEventDispatcher+Reanimated.m:23)
8  randomAppName           0x23c460 __createEventSetter_block_invoke_2 + 137 (RCTComponentData.m:137)
9  randomAppName           0x46e4f0 -[RNCSafeAreaProvider invalidateSafeAreaInsets] + 42 (RNCSafeAreaProvider.m:42)
10 UIKitCore                      0x1b1e8 -[UIView _safeAreaInsetsDidChangeFromOldInsets:] + 28
11 UIKitCore                      0x183d0 -[UIView _updateCombinedInsetsIfNecessary] + 100
12 UIKitCore                      0x62a78 -[UIView(Geometry) setBounds:] + 948
13 randomAppName           0x28bf9c -[RCTView reactSetFrame:] + 786 (RCTView.m:786)
14 randomAppName           0x27fa30 __51-[RCTUIManager uiBlockWithLayoutUpdateForRootView:]_block_invoke.97 + 688 (RCTUIManager.m:688)
15 randomAppName           0x282990 __44-[RCTUIManager flushUIBlocksWithCompletion:]_block_invoke + 1200 (RCTUIManager.m:1200)
16 randomAppName           0x282a80 __44-[RCTUIManager flushUIBlocksWithCompletion:]_block_invoke.146 + 1223 (RCTUIManager.m:1223)
17 libdispatch.dylib              0x26a8 _dispatch_call_block_and_release + 32
18 libdispatch.dylib              0x4300 _dispatch_client_callout + 20
19 libdispatch.dylib              0x12998 _dispatch_main_queue_drain + 984
20 libdispatch.dylib              0x125b0 _dispatch_main_queue_callback_4CF + 44
21 CoreFoundation                 0x379bc __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 16
22 CoreFoundation                 0x346c8 __CFRunLoopRun + 1996
23 CoreFoundation                 0x33e18 CFRunLoopRunSpecific + 608
24 GraphicsServices               0x35ec GSEventRunModal + 164
25 UIKitCore                      0x22f2fc -[UIApplication _run] + 888
26 UIKitCore                      0x22e938 UIApplicationMain + 340
27 randomAppName           0x822c main + 8 (main.m:8)
28 ???                            0x1c82ebd44 (Missing)

Variant 2:

Crashed: com.apple.main-thread
0  randomAppName           0x1d060c reanimated::ReanimatedReentrancyCheck::before() + 85 (ReanimatedHermesRuntime.h:85)
1  randomAppName           0x1ce300 facebook::jsi::WithRuntimeDecorator<reanimated::ReanimatedReentrancyCheck, facebook::jsi::Runtime, facebook::jsi::Runtime>::createObject() + 226 (decorator.h:226)
2  randomAppName           0x1bd684 convertObjCObjectToJSIValue(facebook::jsi::Runtime&, objc_object*) + 406 (jsi.h:406)
3  randomAppName           0x1bd3e4 invocation function for block in reanimated::createReanimatedModule(RCTBridge*, std::__1::shared_ptr<facebook::react::CallInvoker> const&) + 300 (NativeProxy.mm:300)
4  randomAppName           0x1d2e9c __33-[REANodesManager dispatchEvent:]_block_invoke + 398 (REANodesManager.mm:398)
5  libdispatch.dylib              0x26a8 _dispatch_call_block_and_release + 32
6  libdispatch.dylib              0x4300 _dispatch_client_callout + 20
7  libdispatch.dylib              0x12998 _dispatch_main_queue_drain + 984
8  libdispatch.dylib              0x125b0 _dispatch_main_queue_callback_4CF + 44
9  CoreFoundation                 0x379bc __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 16
10 CoreFoundation                 0x346c8 __CFRunLoopRun + 1996
11 CoreFoundation                 0x33e18 CFRunLoopRunSpecific + 608
12 GraphicsServices               0x35ec GSEventRunModal + 164
13 UIKitCore                      0x22f2fc -[UIApplication _run] + 888
14 UIKitCore                      0x22e938 UIApplicationMain + 340
15 randomAppName           0x822c main + 8 (main.m:8)
16 ???                            0x1c82ebd44 (Missing)

Variant 3:

Crashed: com.apple.main-thread
0  randomAppName           0x1d060c reanimated::ReanimatedReentrancyCheck::before() + 85 (ReanimatedHermesRuntime.h:85)
1  randomAppName           0x1ce300 facebook::jsi::WithRuntimeDecorator<reanimated::ReanimatedReentrancyCheck, facebook::jsi::Runtime, facebook::jsi::Runtime>::createObject() + 226 (decorator.h:226)
2  randomAppName           0x1bd684 convertObjCObjectToJSIValue(facebook::jsi::Runtime&, objc_object*) + 406 (jsi.h:406)
3  randomAppName           0x1bd3e4 invocation function for block in reanimated::createReanimatedModule(RCTBridge*, std::__1::shared_ptr<facebook::react::CallInvoker> const&) + 300 (NativeProxy.mm:300)
4  randomAppName           0x1d2e9c __33-[REANodesManager dispatchEvent:]_block_invoke + 398 (REANodesManager.mm:398)
5  randomAppName           0x286b80 RCTExecuteOnMainQueue + 262 (RCTUtils.m:262)
6  randomAppName           0x1d2dc8 -[REANodesManager dispatchEvent:] + 401 (REANodesManager.mm:401)
7  randomAppName           0x1c8aac -[RCTEventDispatcher(Reanimated) reanimated_sendEvent:] + 23 (RCTEventDispatcher+Reanimated.m:23)
8  randomAppName           0x23c460 __createEventSetter_block_invoke_2 + 137 (RCTComponentData.m:137)
9  randomAppName           0x2d2bc8 __68-[RCTImageView imageLoaderLoadedImage:error:forImageSource:partial:]_block_invoke.25 + 414 (RCTImageView.mm:414)
10 randomAppName           0x286b80 RCTExecuteOnMainQueue + 262 (RCTUtils.m:262)
11 randomAppName           0x2d27bc -[RCTImageView imageLoaderLoadedImage:error:forImageSource:partial:] + 436 (RCTImageView.mm:436)
12 randomAppName           0x2d23dc __27-[RCTImageView reloadImage]_block_invoke.11 + 339 (RCTImageView.mm:339)
13 randomAppName           0x2cb60c __140-[RCTImageLoader loadImageWithURLRequest:size:scale:clipped:resizeMode:priority:attribution:progressBlock:partialLoadBlock:completionBlock:]_block_invoke_2 + 827 (RCTImageLoader.mm:827)
14 randomAppName           0x2c9ac4 __139-[RCTImageLoader _loadImageOrDataWithURLRequest:size:scale:resizeMode:priority:attribution:progressBlock:partialLoadBlock:completionBlock:]_block_invoke + 555 (RCTImageLoader.mm:555)
15 randomAppName           0x2d4644 -[RCTLocalAssetImageLoader loadImageForURL:size:scale:resizeMode:progressHandler:partialLoadHandler:completionHandler:] + 57 (RCTLocalAssetImageLoader.mm:57)
16 randomAppName           0x2c9438 -[RCTImageLoader _loadImageOrDataWithURLRequest:size:scale:resizeMode:priority:attribution:progressBlock:partialLoadBlock:completionBlock:] + 577 (RCTImageLoader.mm:577)
17 randomAppName           0x2cb1b0 -[RCTImageLoader loadImageWithURLRequest:size:scale:clipped:resizeMode:priority:attribution:progressBlock:partialLoadBlock:completionBlock:] + 857 (RCTImageLoader.mm:857)
18 randomAppName           0x2d2078 -[RCTImageView reloadImage] + 347 (RCTImageView.mm:347)
19 randomAppName           0x2d2e38 -[RCTImageView reactSetFrame:] + 449 (RCTImageView.mm:449)
20 randomAppName           0x27fa30 __51-[RCTUIManager uiBlockWithLayoutUpdateForRootView:]_block_invoke.97 + 688 (RCTUIManager.m:688)
21 randomAppName           0x282990 __44-[RCTUIManager flushUIBlocksWithCompletion:]_block_invoke + 1200 (RCTUIManager.m:1200)
22 randomAppName           0x282a80 __44-[RCTUIManager flushUIBlocksWithCompletion:]_block_invoke.146 + 1223 (RCTUIManager.m:1223)
23 libdispatch.dylib              0x26a8 _dispatch_call_block_and_release + 32
24 libdispatch.dylib              0x4300 _dispatch_client_callout + 20
25 libdispatch.dylib              0x12998 _dispatch_main_queue_drain + 984
26 libdispatch.dylib              0x125b0 _dispatch_main_queue_callback_4CF + 44
27 CoreFoundation                 0x379bc __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 16
28 CoreFoundation                 0x346c8 __CFRunLoopRun + 1996
29 CoreFoundation                 0x33e18 CFRunLoopRunSpecific + 608
30 GraphicsServices               0x35ec GSEventRunModal + 164
31 UIKitCore                      0x22f2fc -[UIApplication _run] + 888
32 UIKitCore                      0x22e938 UIApplicationMain + 340
33 randomAppName           0x822c main + 8 (main.m:8)
34 ???                            0x1d957fd44 (Missing)

There's one more crash that started happening in parallel to the above one.

Packages used

"@react-native-firebase/analytics": "14.12.0",
"@react-native-firebase/app": "14.12.0",
"@react-native-firebase/crashlytics": "14.12.0",
"@react-native-firebase/messaging": "14.12.0",
"@react-native-masked-view/masked-view": "^0.2.9",
"@react-navigation/bottom-tabs": "^6.4.0",
"@react-navigation/native": "^6.0.13",
"@react-navigation/native-stack": "^6.9.7",
"@reduxjs/toolkit": "^1.9.2",
"axios": "0.27.2",
"buffer": "^6.0.3",
"crypto-js": "^4.1.1",
"deprecated-react-native-prop-types": "^2.3.0",
"geolib": "^3.3.3",
"native-base": "^3.4.22",
"react": "18.2.0",
"react-native": "0.72.4",
"react-native-actionsheet": "^2.4.2",
"react-native-android-location-enabler": "^1.2.2",
"react-native-background-actions": "^2.6.7",
"react-native-background-upload": "^6.6.0",
"react-native-fast-image": "8.6.3",
"react-native-fs": "^2.20.0",
"react-native-gesture-handler": "^2.9.0",
"react-native-get-random-values": "^1.8.0",
"react-native-keyboard-aware-scroll-view": "^0.9.5",
"react-native-linear-gradient": "^2.6.2",
"react-native-logs": "^5.0.1",
"react-native-maps": "^1.3.2",
"react-native-pager-view": "^6.1.2",
"react-native-permissions": "^3.6.1",
"react-native-reanimated": "^3.5.4",
"react-native-safe-area-context": "3.3.2",
"react-native-screens": "^3.18.2",
"react-native-tab-view": "^3.3.2",
"react-native-zoom-reanimated": "^1.1.2",
"realm": "11.10.2",
"semver": "^7.3.8",
"sha1": "^1.1.1",

AppDelegate.mm file

#import "AppDelegate.h"
#import <Firebase.h>
#import <GoogleMaps/GoogleMaps.h>

#import <React/RCTBundleURLProvider.h>
#import <React/RCTLinkingManager.h>

#ifdef FB_SONARKIT_ENABLED
#import <FlipperKit/FlipperClient.h>`
#import <FlipperPerformancePlugin.h>
#endif

@implementation AppDelegate
- (BOOL)application:(UIApplication *)application
            openURL:(NSURL *)url
            options:
                (NSDictionary<UIApplicationOpenURLOptionsKey, id> *)options {
  return [RCTLinkingManager application:application
                                openURL:url
                                options:options];
}

- (BOOL)application:(UIApplication *)application
    continueUserActivity:(nonnull NSUserActivity *)userActivity
      restorationHandler:
          (nonnull void (^)(NSArray<id<UIUserActivityRestoring>> *_Nullable))
              restorationHandler {
  return [RCTLinkingManager application:application
                   continueUserActivity:userActivity
                     restorationHandler:restorationHandler];
}
- (BOOL)application:(UIApplication *)application
    didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
  [FIRApp configure];

#ifdef FB_SONARKIT_ENABLED
  FlipperClient *client = [FlipperClient sharedClient];
  [client addPlugin:[FlipperPerformancePlugin new]];
#endif
  self.moduleName = @"randomAppname";
  // You can add your custom initial props in the dictionary below.
  // They will be passed down to the ViewController used by React Native.
  self.initialProps = @{};
  return [super application:application
      didFinishLaunchingWithOptions:launchOptions];
}

- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge {
#if DEBUG
  return
      [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index"];
#else
  return [[NSBundle mainBundle] URLForResource:@"main"
                                 withExtension:@"jsbundle"];
#endif
}

@end

Pod File


# Resolve react_native_pods.rb with node to allow for hoisting
require Pod::Executable.execute_command('node', ['-p',
  'require.resolve(
    "react-native/scripts/react_native_pods.rb",
    {paths: [process.argv[1]]},
  )', __dir__]).strip
$RNFirebaseAsStaticFramework = true

platform :ios, '13.0'
prepare_react_native_project!

flipperkit_version = '0.172.0'

# If you are using a `react-native-flipper` your iOS build will fail when `NO_FLIPPER=1` is set.
# because `react-native-flipper` depends on (FlipperKit,...) that will be excluded
#
# To fix this you can also exclude `react-native-flipper` using a `react-native.config.js`
# ```js
# module.exports = {
#   dependencies: {
#     ...(process.env.NO_FLIPPER ? { 'react-native-flipper': { platforms: { ios: null } } } : {}),
# ```
flipper_config = ENV['NO_FLIPPER'] == "1" ? FlipperConfiguration.disabled : FlipperConfiguration.enabled(["Debug","Dev.Debug","Dev.Release","Staging.Debug","Staging.Release","Release"], { 'Flipper' => flipperkit_version, 'Flipper-Folly' => '2.6.10', 'Flipper-DoubleConversion' => '3.2.0', 'Flipper-Glog' => '0.5.0.3', 'Flipper-PeerTalk' => '0.0.4', 'OpenSSL-Universal' => '1.1.1100' })
linkage = ENV['USE_FRAMEWORKS']
if linkage != nil
  Pod::UI.puts "Configuring Pod with #{linkage}ally linked Frameworks".green
  use_frameworks! :linkage => linkage.to_sym
end

target 'randomAppname' do
  permissions_path = '../node_modules/react-native-permissions/ios'
  config = use_native_modules!
  pod 'RNFS', :path => '../node_modules/react-native-fs'
  pod 'RNSensors', :path => '../node_modules/react-native-sensors'
  pod 'react-native-google-maps', :path =>  '../node_modules/react-native-maps'
  pod 'Permission-Camera', :path => "#{permissions_path}/Camera"
  pod 'Permission-LocationWhenInUse', :path => "#{permissions_path}/LocationWhenInUse"
  pod 'Permission-LocationAccuracy', :path => "#{permissions_path}/LocationAccuracy"
  pod 'Permission-Notifications', :path => "#{permissions_path}/Notifications"

  project 'randomAppname',
        'Dev.Debug' => :debug,
        'Dev.Release' => :release,
        'Staging.Debug' => :debug,
        'Staging.Release' => :release,
        'Debug' => :debug,
        'Release' => :release

  # Flags change depending on the env values.
  flags = get_default_flags()

  use_react_native!(
    :path => config[:reactNativePath],
    # Hermes is now enabled by default. Disable by setting this flag to false.
    :hermes_enabled => flags[:hermes_enabled],
    :fabric_enabled => flags[:fabric_enabled],
    # Enables Flipper.
    #
    # Note that if you have use_frameworks! enabled, Flipper will not work and
    # you should disable the next line.
    :flipper_configuration => flipper_config,

    # An absolute path to your application root.
    :app_path => "#{Pod::Config.instance.installation_root}/.."
  )

  target 'randomAppnameTests' do
    inherit! :complete
    # Pods for testing
  end

  post_install do |installer|
    # https://github.com/facebook/react-native/blob/main/packages/react-native/scripts/react_native_pods.rb#L197-L202
    react_native_post_install(
      installer,
      config[:reactNativePath],
      :mac_catalyst_enabled => false
    )
    __apply_Xcode_12_5_M1_post_install_workaround(installer)
    installer.pods_project.build_configurations.each do |config|
      config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
    end
  end
end

Steps to reproduce

  1. Make a release build
  2. Try launching the app multiple times(~15-20 recommended) (Do a fresh launch every time i.e kill the app before the new launch)
  3. In some tries you'll randomly get crashes. The app would look like it tried to open and before you can see the splash screen it would crash.

Snack or a link to a repository

-

Reanimated version

^3.5.4

React Native version

0.72.4

Platforms

iOS

JavaScript runtime

Hermes

Workflow

React Native

Architecture

Paper (Old Architecture)

Build type

Release mode

Device

Real device

Device model

iPhone 14 Pro (iOS 17.0.3)

Acknowledgements

Yes

github-actions[bot] commented 11 months ago

Hey! 👋

The issue doesn't seem to contain a minimal reproduction.

Could you provide a snack or a link to a GitHub repository under your username that reproduces the problem?

github-actions[bot] commented 11 months ago

Hey! 👋

It looks like you've omitted a few important sections from the issue template.

Please complete Snack or a link to a repository section.

alex-gale commented 11 months ago

We're getting this as well

akashraj9828 commented 11 months ago

We're getting this as well

@alex-gale are you seeing all 3 variants of the 1st crash and the 2nd crash as well?

alex-gale commented 11 months ago

Firebase is giving about 6 different variants for the first crash, including some of yours, but not seeing that second one anywhere yet

dravecky commented 11 months ago

i have same issue

deepindive commented 11 months ago

I got same issue too.

arditderstila commented 11 months ago

i am getting also same issue but crashes are random only on ios and mostly when a new build is made on first time.

AnasAlamin commented 11 months ago

I’m getting this too, have you found any good solutions?

LouisKraemer commented 11 months ago

Same issue here, happy to provide logs if needed

arditderstila commented 11 months ago

I’m getting this too, have you found any good solutions?

Same issue here, happy to provide logs if needed

guy have u found any solutions?

akashraj9828 commented 11 months ago

We were using a mix of Animated from react-native and Animated form react-native-reanimated

Once we migrated from react-native to react-native-reanimated completely this bug was resolved once in for all for us.

As for the 2nd bug that I had posted... that was resolved after removing the flipper.

sagar-tomar-groww commented 10 months ago

@akashraj9828 what was the root cause ? as in some difference in signature OR execution of Animated from react-native and react-native-reanimated ?

saadi-ninjasCode commented 10 months ago

I am using Animated from react-native-reanimated in a whole project. I am also facing this issue with React-native: 0.72.7 Reanimated: 3.5.4

Screenshot 2023-12-04 at 4 44 19 PM

tomekzaw commented 10 months ago

@akashraj9828 Thanks for reporting this issue and providing all details, we really appreciate it!

Could you please provide full stack traces for all threads?

akashraj9828 commented 10 months ago

Could you please provide full stack traces for all threads?

stack_trace.txt

nbonatsakis commented 10 months ago

Also seeing this issue, following.

iy-913 commented 10 months ago

Does stable version contain this fix?

tomekzaw commented 10 months ago

@iy-913 nope, 3.6.x does not contain the fix, try 3.7.0-nightly or 3.7.0 once we publish it (Jan 2024)

zabojad commented 9 months ago

I just reproduced it on simulator with 3.6.1. Oddly, it started to happen after having installed react-native-vector-icons...

zabojad commented 9 months ago

The nightly version 3.7.0-nightly-20240109-9e2c33716 solved the problem. Just don't forget to restart metro...

LouisKraemer commented 8 months ago

Any update on the release of that fix? It's still impacted some users on our app

tomekzaw commented 8 months ago

We plan to release 3.7.0 this week

LouisKraemer commented 8 months ago

After updating to 3.7.0 we seem to have a huge increase in crashes at startup on iOS only

Here are the logs

Main thread

Crashed: com.apple.main-thread
0  libsystem_kernel.dylib         0x9fbc __pthread_kill + 8
1  libsystem_pthread.dylib        0x5680 pthread_kill + 268
2  libsystem_c.dylib              0x75b90 abort + 180
3  libc++abi.dylib                0x14ff8 __cxxabiv1::__aligned_malloc_with_fallback(unsigned long) + 130
4  libc++abi.dylib                0x143c8 std::__terminate(void (*)()) + 28
5  libc++abi.dylib                0x14360 std::terminate() + 108
6  libobjc.A.dylib                0x3ccd4 objc_terminate + 16
7  libdispatch.dylib              0x4314 _dispatch_client_callout + 40
8  libdispatch.dylib              0x12998 _dispatch_main_queue_drain + 984
9  libdispatch.dylib              0x125b0 _dispatch_main_queue_callback_4CF + 44
10 CoreFoundation                 0x3701c __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 16
11 CoreFoundation                 0x33d28 __CFRunLoopRun + 1996
12 CoreFoundation                 0x33478 CFRunLoopRunSpecific + 608
13 GraphicsServices               0x34f8 GSEventRunModal + 164
14 UIKitCore                      0x22c62c -[UIApplication _run] + 888
15 UIKitCore                      0x22bc68 UIApplicationMain + 340
16 PerfectDraftMobileApp          0xac9c main + 7 (main.m:7)
17 ???                            0x1c2662dcc (Missing)

com.facebook.react.JavaScript thread

com.facebook.react.JavaScript
0  CoreFoundation                 0x6d04 CF_IS_OBJC + 252
1  CoreFoundation                 0x6dc4 CFStringGetLength + 148
2  CoreFoundation                 0x18d8c CFStringFindWithOptionsAndLocale + 88
3  Foundation                     0x10404 -[NSString rangeOfString:options:range:locale:] + 268
4  Foundation                     0x4dfc0 -[NSString hasPrefix:] + 52
5  PerfectDraftMobileApp          0x7b7054 RCTDropReactPrefixes + 1032 (RCTUtils.m:1032)
6  PerfectDraftMobileApp          0x763d58 RCTBridgeModuleNameForClass + 80 (RCTBridge.m:80)
7  PerfectDraftMobileApp          0x793620 facebook::react::RCTNativeModule::invoke(unsigned int, folly::dynamic&&, int) + 86 (RCTNativeModule.mm:86)
8  PerfectDraftMobileApp          0xa084a4 facebook::react::JsToNativeBridge::callNativeModules(facebook::react::JSExecutor&, folly::dynamic&&, bool) + 159 (wrap_iter.h:159)
9  PerfectDraftMobileApp          0xc2f388 facebook::react::JSIExecutor::callNativeModules(facebook::jsi::Value const&, bool) + 365 (dynamic-inl.h:365)
10 PerfectDraftMobileApp          0xc317a0 std::__1::__function::__func<facebook::react::JSIExecutor::initializeRuntime()::$_0, std::__1::allocator<facebook::react::JSIExecutor::initializeRuntime()::$_0>, facebook::jsi::Value (facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned long)>::operator()(facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*&&, unsigned long&&) + 1348 (jsi.h:1348)
11 PerfectDraftMobileApp          0xd91cd0 std::__1::function<facebook::jsi::Value (facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned long)>::operator()(facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned long) const + 1156 (function.h:1156)
12 hermes                         0x15480 facebook::hermes::debugger::Debugger::jsiValueFromHermesValue(hermes::vm::HermesValue) + 27576
13 hermes                         0x28d70 facebook::jsi::JSError::~JSError() + 34552
14 hermes                         0x47da8 facebook::jsi::JSError::~JSError() + 161584
15 hermes                         0x472b4 facebook::jsi::JSError::~JSError() + 158780
16 hermes                         0x29018 facebook::jsi::JSError::~JSError() + 35232
17 hermes                         0xddd4 facebook::hermes::HermesRuntime::rootsListLengthForTests() const + 17420
18 PerfectDraftMobileApp          0xd90968 facebook::jsi::WithRuntimeDecorator<facebook::react::(anonymous namespace)::ReentrancyCheck, facebook::jsi::Runtime, facebook::jsi::Runtime>::call(facebook::jsi::Function const&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned long) + 754 (decorator.h:754)
19 PerfectDraftMobileApp          0x7e5488 facebook::react::Task::execute(facebook::jsi::Runtime&, bool) + 259 (jsi-inl.h:259)
20 PerfectDraftMobileApp          0x7e2b74 facebook::react::RuntimeScheduler::startWorkLoop(facebook::jsi::Runtime&) const + 1211 (jsi.h:1211)
21 PerfectDraftMobileApp          0x79b150 std::__1::__function::__func<RCTRuntimeExecutorFromBridge(RCTBridge*)::$_0::operator()(std::__1::function<void (facebook::jsi::Runtime&)>&&) const::'lambda'(), std::__1::allocator<RCTRuntimeExecutorFromBridge(RCTBridge*)::$_0::operator()(std::__1::function<void (facebook::jsi::Runtime&)>&&) const::'lambda'()>, void ()>::operator()() + 52 (RCTRuntimeExecutorFromBridge.mm:52)
22 PerfectDraftMobileApp          0x9fffe8 std::__1::__function::__func<facebook::react::Instance::JSCallInvoker::scheduleAsync(std::__1::function<void ()>&&)::$_3, std::__1::allocator<facebook::react::Instance::JSCallInvoker::scheduleAsync(std::__1::function<void ()>&&)::$_3>, void (facebook::react::JSExecutor*)>::operator()(facebook::react::JSExecutor*&&) + 296 (Instance.cpp:296)
23 PerfectDraftMobileApp          0xa0984c std::__1::__function::__func<facebook::react::NativeToJsBridge::runOnExecutorQueue(std::__1::function<void (facebook::react::JSExecutor*)>)::$_8, std::__1::allocator<facebook::react::NativeToJsBridge::runOnExecutorQueue(std::__1::function<void (facebook::react::JSExecutor*)>)::$_8>, void ()>::operator()() + 356 (function.h:356)
24 PerfectDraftMobileApp          0x77f23c facebook::react::tryAndReturnError(std::__1::function<void ()> const&) + 510 (function.h:510)
25 PerfectDraftMobileApp          0x78a768 facebook::react::RCTMessageThread::tryFunc(std::__1::function<void ()> const&) + 69 (RCTMessageThread.mm:69)
26 PerfectDraftMobileApp          0x78a534 invocation function for block in facebook::react::RCTMessageThread::runAsync(std::__1::function<void ()>) + 46 (RCTMessageThread.mm:46)
27 CoreFoundation                 0x371b8 __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 28
28 CoreFoundation                 0x359ac __CFRunLoopDoBlocks + 356
29 CoreFoundation                 0x33ee4 __CFRunLoopRun + 2440
30 CoreFoundation                 0x33478 CFRunLoopRunSpecific + 608
31 PerfectDraftMobileApp          0x774420 +[RCTCxxBridge runRunLoop] + 337 (RCTCxxBridge.mm:337)
32 Foundation                     0xafde0 __NSThread__start__ + 732
33 libsystem_pthread.dylib        0x24d4 _pthread_start + 136
34 libsystem_pthread.dylib        0x1a10 thread_start + 8

It seems to be related to the same problem. We already have 150 crash today alone since upgrading.

I can provide more informations if needed but the native logs we have are pretty much that

tomekzaw commented 8 months ago

@LouisKraemer Thanks for reporting the crash, we will need to investigate it.

It seems to be related to the same problem.

Why do you think so? In the provided stack traces there's no ReanimatedReentrancyCheck::before so this is not the same crash as reported in this issue.

LouisKraemer commented 8 months ago

My bad I just saw the ReetrancyCheck and assumed so Please disregard that

tomekzaw commented 8 months ago

Fixed in 3.7.0.

LouisKraemer commented 8 months ago

Fixed in 3.7.0.

The logs I've put in my last message are coming from a release with reanimated 3.7.0

tomekzaw commented 8 months ago

The logs I've put in my last message are coming from a release with reanimated 3.7.0

Yes, but at the same time there's no occurrence of reanimated::ReanimatedReentrancyCheck::before() so this looks like a different problem not related to this issue.

Do you mind submitting these stack traces in a separate issue?

sagar-tomar-groww commented 8 months ago

@tomekzaw updated to v3.7.0 to solve the above crash but ended up getting more crashes citing below

facebook::jsi::JSError: [Reanimated] Data type not recognized by value unpacker.

Error: [Reanimated] Data type not recognized by value unpacker. at valueUnpacker (WorkletRuntime::WorkletRuntime:1:1477)

0 unknown file -0x4 unknown method

can you help here

tomekzaw commented 8 months ago

@sagar-tomar-groww The error "[Reanimated] Data type not recognized by value unpacker." has already been reported in #5660. Are you able to reproduce this error consistently? We're looking for a reproduction so we can fix it. If yes, please respond in #5660.