Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KeyboardAwareScrollView uses broken scrollTo method from reanimated in new architecture #640

Open
BenIrving opened this issue Oct 16, 2024 · 1 comment
Assignees
Labels
🤖 android Android specific 🎯 crash Library triggers a crash of the app 🏭 fabric Changes specific to new (fabric/jsi) architecture KeyboardAwareScrollView 📜 Anything related to KeyboardAwareScrollView component

Comments

@BenIrving
Copy link

Describe the bug
A clear and concise description of what the bug is.
KeyboardAwareScrollView uses scrollTo from reanimated, which is currently broken in new architecture due to potentially issues arising from a bug internally to react-native.

See reanimated comment describing the issue and cause of the deadlock

Below is the stack trace we see in sentry, this happens on a simple input KeyboardAwareScrollView where the only call to scrollTo happens in this lib. We cannot reliably reproduce it and it appears to happen infrequently.

syscall at line 28 within libc
__futex_wait_ex at line 144 within libc
NonPI::MutexLockWithTimeout at line 384 within libc
offset 726000) (std::__ndk1::mutex::lock at line 12 within split_config.arm64_v8a.apk
offset c01000) (facebook::react::Binding::schedulerDidFinishTransaction at line 84 within split_config.arm64_v8a.apk
offset c01000) (facebook::react::Scheduler::uiManagerDidFinishTransaction at line 68 within split_config.arm64_v8a.apk
offset c01000) (facebook::react::UIManager::shadowTreeDidFinishTransaction const at line 64 within split_config.arm64_v8a.apk
offset c01000) (facebook::react::ShadowTree::mount const at line 348 within split_config.arm64_v8a.apk
offset c01000) (facebook::react::ShadowTree::tryCommit const at line 2612 within split_config.arm64_v8a.apk
offset c01000) (facebook::react::ShadowTree::commit const at line 40 within split_config.arm64_v8a.apk
within split_config.arm64_v8a.apk (offset 2776000) (???) (BuildId: 9db5e3d076e0b75cece1aedfab88a251385fa8e2)
offset c01000) (facebook::react::ShadowTreeRegistry::visit const at line 300 within split_config.arm64_v8a.apk
offset 2776000) (reanimated::NativeReanimatedModule::performOperations at line 1084 within split_config.arm64_v8a.apk
offset 2776000) (facebook::jni::detail::MethodWrapper<void , &reanimated::NativeProxy::performOperations, reanimated::NativeProxy, void>::dispatch at line 60 within split_config.arm64_v8a.apk
offset 2776000) (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 split_config.arm64_v8a.apk
com.swmansion.reanimated.NativeProxy in performOperations
com.swmansion.reanimated.NodesManager in performOperations at line 4
com.swmansion.reanimated.NodesManager in onEventDispatch at line 14
com.facebook.react.uimanager.events.c in h at line 18
com.facebook.react.views.scroll.f in f at line 111
com.facebook.react.views.scroll.f in d at line 2
com.facebook.react.views.scroll.f in s at line 3
com.facebook.react.views.scroll.c in onScrollChanged at line 33
android.view.View in scrollTo at line 20842
android.widget.ScrollView in scrollTo at line 2888
com.facebook.react.views.scroll.c in scrollTo
com.facebook.react.views.scroll.c in onLayoutChange at line 38
android.view.View in layout at line 25792
android.view.ViewGroup in layout at line 6822
com.facebook.react.fabric.mounting.SurfaceMountingManager in updateLayout at line 66
com.facebook.react.fabric.mounting.mountitems.IntBufferBatchMountItem in execute at line 351
com.facebook.react.fabric.mounting.MountItemDispatcher in executeOrEnqueue at line 51
com.facebook.react.fabric.mounting.MountItemDispatcher in dispatchMountItems at line 43
com.facebook.react.fabric.mounting.MountItemDispatcher in tryDispatchMountItems at line 6
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.swmansion.reanimated.NativeProxy in performOperations
com.swmansion.reanimated.NodesManager in performOperations at line 4
com.swmansion.reanimated.NodesManager in onAnimationFrame at line 112
com.swmansion.reanimated.NodesManager in b
com.swmansion.reanimated.NodesManager$2 in doFrameGuarded at line 2
mdi.sdk.qk3 in doFrame
com.facebook.react.modules.core.a$a in doFrame at line 46
android.view.Choreographer$CallbackRecord in run at line 1687
android.view.Choreographer$CallbackRecord in run at line 1698
android.view.Choreographer in doCallbacks at line 1153
android.view.Choreographer in doFrame at line 1069
android.view.Choreographer$FrameDisplayEventReceiver in run at line 1646
android.os.Handler in handleCallback at line 958
android.os.Handler in dispatchMessage at line 99
android.os.Looper in loopOnce at line 230
android.os.Looper in loop at line 319
android.app.ActivityThread in main at line 8919
java.lang.reflect.Method in invoke
com.android.internal.os.RuntimeInit$MethodAndArgsCaller in run at line 578
com.android.internal.os.ZygoteInit in main at line 1103

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Smartphone (please complete the following information):

  • Device: Multiple Android devices
  • OS: Android 11-14
  • RN version: 0.74.6
  • RN architecture: Fabric
  • JS engine: Hermes
  • Library version: 1.13.4

Additional context
Add any other context about the problem here.

@kirillzyusko
Copy link
Owner

Hey @BenIrving

Sorry to hear that scrollTo produces crashes, but without this function it would be impossible to create a KeyboardAwareScrollView that would be perfectly synchronized with keyboard movement.

Have you tried to enable that flag mentioned in reanimated issue? Did it solve crash for you?

@kirillzyusko kirillzyusko added 🤖 android Android specific 🏭 fabric Changes specific to new (fabric/jsi) architecture KeyboardAwareScrollView 📜 Anything related to KeyboardAwareScrollView component 🎯 crash Library triggers a crash of the app labels Oct 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤖 android Android specific 🎯 crash Library triggers a crash of the app 🏭 fabric Changes specific to new (fabric/jsi) architecture KeyboardAwareScrollView 📜 Anything related to KeyboardAwareScrollView component
Projects
None yet
Development

No branches or pull requests

2 participants