software-mansion / react-native-reanimated

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

Android: ANR caused in ApplicationNotResponding 0.75.2 #6462

Open gurbela opened 2 months ago

gurbela commented 2 months ago

Description

I using React Native 0.75.2, new architect of react native enabled.

syscall at line 28 within libc
__futex_wait_ex at line 144 within libc
NonPI::MutexLockWithTimeout at line 328 within libc
offset 6f0000) (std::__ndk1::mutex::lock at line 12 within base.apk
offset 898000) (facebook::react::Binding::schedulerDidFinishTransaction at line 72 within base.apk
offset 898000) (facebook::react::Scheduler::uiManagerDidFinishTransaction at line 68 within base.apk
offset 898000) (facebook::react::UIManager::shadowTreeDidFinishTransaction const at line 64 within base.apk
offset 898000) (facebook::react::ShadowTree::mount const at line 348 within base.apk
offset 898000) (facebook::react::ShadowTree::tryCommit const at line 2596 within base.apk
offset 898000) (facebook::react::ShadowTree::commit const at line 40 within base.apk
within base.apk (offset 1fb0000) (???) (BuildId: 2364370489c4ff00a2950160850d4647cf7f101c)
offset 898000) (facebook::react::ShadowTreeRegistry::visit const at line 300 within base.apk
offset 1fb0000) (reanimated::NativeReanimatedModule::performOperations at line 1060 within base.apk
offset 1fb0000) (facebook::jni::detail::MethodWrapper<void , &, reanimated::NativeProxy, void>::dispatch at line 60 within base.apk
offset 1fb0000) (facebook::jni::detail::FunctionWrapper<void , facebook::jni::detail::JTypeFor<facebook::jni::HybridClass<reanimated::NativeProxy, facebook::jni::detail::BaseHybridClass>::JavaPart, facebook::jni::JObject, void>::_javaobject*, void>::call at line 60 within base.apk
art_quick_generic_jni_trampoline at line 144 within libart
deleted) (offset 2000000) (com.swmansion.reanimated.NodesManager.performOperations at line 104 within memfd:jit-cache
deleted) (offset 2000000) (com.swmansion.reanimated.nativeProxy.NativeProxyCommon.maybeFlushUIUpdatesQueue at line 160 within memfd:jit-cache
art_quick_invoke_stub at line 612 within libart
art::JValue art::InvokeVirtualOrInterfaceWithVarArgs<art::ArtMethod*> at line 772 within libart
art::JNI<false>::CallVoidMethodV at line 192 within libart
offset 1fb0000) (_JNIEnv::CallVoidMethod at line 116 within base.apk
offset 1fb0000) (reanimated::NativeProxy::maybeFlushUIUpdatesQueue at line 72 within base.apk
offset 1fb0000) (std::__ndk1::function<facebook::jsi::Value > reanimated::jsi_utils::createHostFunction<std::__ndk1::function<void > >::'lambda'::operator const at line 240 within base.apk
offset 23a8000) (std::__ndk1::__function::__func<facebook::jsi::DecoratedHostFunction, std::__ndk1::allocator<facebook::jsi::DecoratedHostFunction>, facebook::jsi::Value >::operator at line 72 within base.apk
1
within base.apk (offset ba0000) (???) (BuildId: 3123ef9e74b001a1b40e2240da0d8ab29f0a597d)
13
offset 23a8000) (facebook::jsi::WithRuntimeDecorator<reanimated::AroundLock, facebook::jsi::Runtime, facebook::jsi::Runtime>::call at line 108 within base.apk
offset 23a8000) (facebook::jsi::Value reanimated::runOnRuntimeGuarded<facebook::jsi::Value, facebook::jsi::Value const&> at line 160 within base.apk
offset 23a8000) (reanimated::WorkletEventHandler::process const at line 100 within base.apk
offset 23a8000) (reanimated::EventHandlerRegistry::processEvent at line 856 within base.apk
offset 1fb0000) (reanimated::NativeReanimatedModule::handleEvent at line 64 within base.apk
offset 1fb0000) (reanimated::NativeProxy::handleEvent at line 384 within base.apk
offset 1fb0000) (std::__ndk1::__function::__func<std::__ndk1::function<void > reanimated::NativeProxy::bindThis<void, facebook::jni::alias_ref<facebook::jni::JString>, int, facebook::jni::alias_ref<facebook::react::WritableMap> >::'lambda', std::__ndk1:... at line 76 within base.apk
offset 1fb0000) (facebook::jni::detail::MethodWrapper<void , &, reanimated::EventHandler, void, facebook::jni::alias_ref<facebook::jni::JString>, int, facebook::jni::alias_ref<facebook::react::WritableMap> >::dispatch at line 124 within base.apk
offset 1fb0000) (facebook::jni::detail::FunctionWrapper<void , facebook::jni::detail::JTypeFor<facebook::jni::HybridClass<reanimated::EventHandler, facebook::jni::detail::BaseHybridClass>::JavaPart, facebook::jni::JObject, void>::_javaobject*, void, fac... at line 96 within base.apk
art_quick_generic_jni_trampoline at line 144 within libart
deleted) (offset 2000000) (com.swmansion.reanimated.nativeProxy.EventHandler.receiveEvent at line 196 within memfd:jit-cache
deleted) (offset 2000000) (com.facebook.react.uimanager.events.a.dispatch at line 288 within memfd:jit-cache
deleted) (offset 2000000) (com.swmansion.reanimated.NodesManager.handleEvent at line 108 within memfd:jit-cache
deleted) (offset 2000000) (com.swmansion.reanimated.NodesManager.onEventDispatch at line 116 within memfd:jit-cache
deleted) (offset 2000000) (com.facebook.react.uimanager.events.c.c at line 352 within memfd:jit-cache
deleted) (offset 2000000) (com.facebook.react.views.scroll.f.e at line 1368 within memfd:jit-cache
nterp_helper at line 7468 within libart
within base.vdex.Q0rCOM.tmp (deleted) (???)
deleted) (offset 2000000) (com.facebook.react.views.scroll.c.onScrollChanged at line 388 within memfd:jit-cache
com.swmansion.reanimated.NativeProxy in performOperations
com.swmansion.reanimated.NodesManager in performOperations at line 4
com.swmansion.reanimated.nativeProxy.NativeProxyCommon in maybeFlushUIUpdatesQueue at line 10
com.swmansion.reanimated.nativeProxy.EventHandler in receiveEvent
com.swmansion.reanimated.nativeProxy.EventHandler in receiveEvent at line 2
com.facebook.react.uimanager.events.a in dispatch at line 12
com.swmansion.reanimated.NodesManager in handleEvent at line 1
com.swmansion.reanimated.NodesManager in onEventDispatch at line 11
com.facebook.react.uimanager.events.c in c at line 18
com.facebook.react.views.scroll.f in e at line 120
com.facebook.react.views.scroll.f in s at line 11
com.facebook.react.views.scroll.c in onScrollChanged at line 42
android.view.View in scrollTo at line 19956
android.widget.ScrollView in scrollTo at line 1923
com.facebook.react.views.scroll.c in scrollTo
com.facebook.react.views.scroll.c in onLayout at line 25
android.view.View in layout at line 25277
android.view.ViewGroup in layout at line 6546
com.microsoft.clarity.y0.c in onLayout at line 58
com.microsoft.clarity.P3.a in onLayout
android.view.View in layout at line 25277
android.view.ViewGroup in layout at line 6546
com.facebook.react.fabric.mounting.SurfaceMountingManager in updateLayout at line 86
com.facebook.react.fabric.mounting.mountitems.IntBufferBatchMountItem in execute at line 407
com.facebook.react.fabric.mounting.MountItemDispatcher in executeOrEnqueue at line 51
com.facebook.react.fabric.mounting.MountItemDispatcher in dispatchMountItems at line 46
com.facebook.react.fabric.mounting.MountItemDispatcher in tryDispatchMountItems at line 29
com.facebook.react.fabric.FabricUIManager$3 in runGuarded at line 6
com.facebook.react.bridge.GuardedRunnable in run
com.facebook.react.fabric.FabricUIManager in scheduleMountItem at line 112
com.facebook.react.fabric.SurfaceHandlerBinding in setLayoutConstraintsNative
com.facebook.react.fabric.SurfaceHandlerBinding in setLayoutConstraints at line 38
com.facebook.react.runtime.H in s at line 25
com.facebook.react.runtime.I in onMeasure at line 133
android.view.View in measure at line 28047
android.view.ViewGroup in measureChildWithMargins at line 7119
android.widget.FrameLayout in onMeasure at line 194
androidx.appcompat.widget.ContentFrameLayout in onMeasure at line 154
android.view.View in measure at line 28047
android.view.ViewGroup in measureChildWithMargins at line 7119
android.widget.LinearLayout in measureChildBeforeLayout at line 1608
android.widget.LinearLayout in measureVertical at line 878
android.widget.LinearLayout in onMeasure at line 721
android.view.View in measure at line 28047
android.view.ViewGroup in measureChildWithMargins at line 7119
android.widget.FrameLayout in onMeasure at line 194
android.view.View in measure at line 28047
android.view.ViewGroup in measureChildWithMargins at line 7119
android.widget.LinearLayout in measureChildBeforeLayout at line 1608
android.widget.LinearLayout in measureVertical at line 878
android.widget.LinearLayout in onMeasure at line 721
android.view.View in measure at line 28047
android.view.ViewGroup in measureChildWithMargins at line 7119
android.widget.FrameLayout in onMeasure at line 194
com.android.internal.policy.DecorView in onMeasure at line 813
android.view.View in measure at line 28047
android.view.ViewRootImpl in performMeasure at line 4794
android.view.ViewRootImpl in measureHierarchy at line 3287
android.view.ViewRootImpl in performTraversals at line 3688
android.view.ViewRootImpl in doTraversal at line 2986
android.view.ViewRootImpl$TraversalRunnable in run at line 10423
android.view.Choreographer$CallbackRecord in run at line 1668
android.view.Choreographer$CallbackRecord in run at line 1677
android.view.Choreographer in doCallbacks at line 1190
android.view.Choreographer in doFrame at line 1062
android.view.Choreographer$FrameDisplayEventReceiver in run at line 1647
android.os.Handler in handleCallback at line 958
android.os.Handler in dispatchMessage at line 99
android.os.Looper in loopOnce at line 222
android.os.Looper in loop at line 314
android.app.ActivityThread in main at line 8602
java.lang.reflect.Method in invoke
com.android.internal.os.RuntimeInit$MethodAndArgsCaller in run at line 565
com.android.internal.os.ZygoteInit in main at line 1081

Steps to reproduce

I using React Native 0.75.2, new architect of react native enabled.

"react-native": "0.75.2", "react-native-reanimated": "3.15.0"

Snack or a link to a repository

test

Reanimated version

3.15.0

React Native version

0.75.2

Platforms

Android

JavaScript runtime

None

Workflow

None

Architecture

None

Build type

None

Device

None

Device model

No response

Acknowledgements

Yes

github-actions[bot] commented 2 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?

bogrees commented 2 months ago

I am seeing a similar crash with React Native 0.75.2 and react-native-reanimated 3.15.1 on Android, but the crash only happens on a physical device (emulator does not crash).

MatiPl01 commented 2 months ago

Hey! I think this is the same issue as the one created before here. I can see that you are using scrollTo on android which currently doesn't work while e.g. you are trying to scroll the scrollable during handling the gesture.

Check out this comment which explains why this crash happens. It seems to be a bug on the RN side, not reanimated.