Inconsistent freezing on iOS
See original GitHub issueDescription
Apologies in advance for vagueness, pretty hard to debug this one.
For the past few weeks I’ve been experiencing random freezing of our app, where the app seemingly stops in its tracks with no crashing/stacktrace/error. Initially I thought this was due to excessive re-rendering or a memory leak, but after reworking our logic to background actions the random freezes continue. Could well still be an error on our side, but struggling to see where/how.
I’ve tried to debug this myself with little joy (can’t remotely debug with reanimated
) - the only nuggets of information I’ve managed to link are EXC_BAD_ACCESS
exceptions which all seem to come from reanimated.
For reference, we’re using both react-native’s Animated
and reanimated
(in different parts of the app), and also frequently use Modalize which itself uses reanimated
.
I found a previous issue that looks pretty similar to this but was fixed last year: https://github.com/software-mansion/react-native-reanimated/issues/1284
Expected behavior
No freezes
Actual behavior & steps to reproduce
Unknown
Snack or minimal code example
Can’t provide a replication unfortunately, but can provide some Sentry error traces from these exceptions.
EXC_BAD_ACCESS
XTUM > Stack overflow in _ZNKSt3__116__hash_node_baseIPNS_11__hash_nodeINS_17__hash_value_typeIiNS_6vectorINS_10shared_ptrIN8facebook3jsi5ValueEEENS_9allocatorIS8_EEEEEEPvEEE6__hashEv
Called from reanimated::StoreUser::~StoreUser::lambda::operator()
EXC_BAD_ACCESS
targetTimestamp > Attempted to dereference garbage pointer 0xce990e2ba698.
Called from reanimated::createReanimatedModule::lambda::operator()
EXC_BAD_ACCESS
Exception 1, Code 2752, Subcode 8 > Attempted to dereference garbage pointer 0xac0.
Called from reanimated::createReanimatedModule::lambda::operator()
Package versions
- React Native: 0.64.1
- React Native Reanimated: ^2.2.0
- NodeJS: v14.15.5
- Xcode: 12.5.1 (12E507)
- Java & Gradle: Not relevant, we’re iOS only
For reference
react-native-modalize
: ^2.0.8react-native-portalize
: ^1.0.7react-native-screens
: 2.17.1@react-navigation/native
: ^5.9.2@react-navigation/stack
: ^5.14.2
Affected platforms
- Android
- iOS
- Web
Issue Analytics
- State:
- Created 2 years ago
- Reactions:6
- Comments:25 (3 by maintainers)
As stated here before by @effektsvk - this seems to be related to https://github.com/facebook/react-native/issues/32329
This causes issues with all libraries that are using Reanimated 2 for animations, starting from RN
0.65.1
(react-native-modal
,react-native-screens
,react-navigation
and a few more).Seems like it’s something with the transition that keeps the native screen in memory, and on top of the main view, leading to an overlay that prevents touch events.
@piaskowyk @Szymon20000 , I saw you were working on RN~66 support in https://github.com/software-mansion/react-native-reanimated/pull/2462 - any idea what could be done to workaround this issue? Any plan for a fix?
Hey, just a small note, there’s new
2.2.3
version that should help for now.