Skip to content

[iOS Crash] EXC_BAD_ACCESS in folly::dynamic::hash() via ShadowNode clone — intermittent crash on Reanimated 3.17.1 #7666

Open
@Nagoorkani27

Description

@Nagoorkani27

Description

Description

I’m encountering an intermittent crash on iOS when running my React Native app using react-native-reanimated. The crash doesn't happen consistently, but it occurs occasionally during normal usage. It seems related to the native folly::dynamic::hash() call via ShadowNode::clone().

This crash occurs on real iOS devices.

Stack Trace Screenshot

Please find the crash log screenshot below:

Crash Screenshot

Key lines:
EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x0000000000000000
folly::dynamic::hash() const + 490
ShadowNode::clone(facebook::react::ShadowNodeFragment const&) + 144
reanimated::cloneShadowTreeWithNewPropsRecursive(...)

Image
Image
Image

Steps to reproduce

EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x0000000000000000
folly::dynamic::hash() const + 490
ShadowNode::clone(facebook::react::ShadowNodeFragment const&) + 144
reanimated::cloneShadowTreeWithNewPropsRecursive(...)

  • This seems to be a native-level crash related to folly::dynamic being used as a key in an unordered map.
  • I’m not directly using folly, but I believe it's used internally by Reanimated or React Native core.
  • I suspect a null or improperly initialized dynamic value may be passed during ShadowNode cloning.

Reanimated Setup

  • Reanimated plugin added in babel.config.js
  • Ran npx react-native-reanimated patch
  • Linked properly with CocoaPods (pod install done)

What I've Tried

  • Cleaned build: npx react-native-clean, xcodebuild clean
  • Rebuilt the app multiple times
  • Crash still happens occasionally, only on iOS, not Android

Additional Notes

  • This seems to be a native-level crash related to folly::dynamic being used as a key in an unordered map.
  • I’m not directly using folly, but I believe it's used internally by Reanimated or React Native core.
  • I suspect a null or improperly initialized dynamic value may be passed during ShadowNode cloning.

Request

Please let me know:

  • If this is a known issue
  • Any workaround or patch
  • If I can provide a minimal repro (currently it's hard to reproduce consistently)

Snack or a link to a repository

This issue occurs intermittently on a real iOS device and involves a crash inside native code (folly::dynamic::hash() via ShadowNode::clone). Since the crash involves React Native Fabric internals triggered via react-native-reanimated, it cannot be reproduced in Snack (which does not support native modules or Hermes). Due to the native nature and randomness of this crash, creating a minimal reproduction repo is extremely difficult. However, I’ve attached the crash log screenshot and full environment info to help with investigation.

Reanimated version

^3.17.1

React Native version

0.79.1

Platforms

iOS

JavaScript runtime

None

Workflow

React Native

Architecture

Fabric (New Architecture)

Build type

Debug app & production bundle, Release app & production bundle

Device

Real device, iOS simulator

Host machine

macOS

Device model

iphone 12 , iphone 6s, iphone 7

Acknowledgements

Yes

Metadata

Metadata

Assignees

No one assigned

    Labels

    Missing infoThe user didn't precise the problem enoughMissing reproThis issue need minimum repro scenarioPlatform: iOSThis issue is specific to iOS

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions