react-native-skia: Crashes on Android when navigating back and forth using expo-router

Description

Using Expo Go.

Version

0.1.202

Steps to reproduce

  1. Create an expo-router app with two routes. The home screen contains https://shopify.github.io/react-native-skia/docs/shapes/custom-drawing and the other one is empty. The _layout.tsx file should contain a bottom navigation bar.
  2. Open that app using Expo Go.
  3. Navigate to the second screen.
  4. Navigate to the frist screen.
  5. Repeat 3 & 4 (basically spamming navigation buttons for a few seconds).
  6. RNSkia crashes.

Snack, code example, screenshot, or link to a repository

08-27 18:32:30.352 24655 24655 F DEBUG   : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
08-27 18:32:30.352 24655 24655 F DEBUG   : LineageOS Version: '20.0-20230727-NIGHTLY-sagit'
08-27 18:32:30.352 24655 24655 F DEBUG   : Build fingerprint: 'Xiaomi/sagit/sagit:8.0.0/OPR1.170623.027/V9.2.3.0.OCAMIEK:user/release-keys'
08-27 18:32:30.352 24655 24655 F DEBUG   : Revision: '0'
08-27 18:32:30.352 24655 24655 F DEBUG   : ABI: 'arm64'
08-27 18:32:30.352 24655 24655 F DEBUG   : Timestamp: 2023-08-27 18:32:30.024083481+0200
08-27 18:32:30.352 24655 24655 F DEBUG   : Process uptime: 280s
08-27 18:32:30.352 24655 24655 F DEBUG   : Cmdline: host.exp.exponent
08-27 18:32:30.352 24655 24655 F DEBUG   : pid: 24207, tid: 24612, name: mqt_js  >>> host.exp.exponent <<<
08-27 18:32:30.352 24655 24655 F DEBUG   : uid: 10251
08-27 18:32:30.352 24655 24655 F DEBUG   : signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x000d000042b40008
08-27 18:32:30.352 24655 24655 F DEBUG   :     x0  000000762829d310  x1  00000073231aa2e8  x2  00000076781aa66c  x3  00000073231aa210
08-27 18:32:30.352 24655 24655 F DEBUG   :     x4  00000073231aa208  x5  0000000000000000  x6  0000000000000000  x7  0000000000000000
08-27 18:32:30.352 24655 24655 F DEBUG   :     x8  430d000042b40000  x9  430d000042b40008  x10 0000000000000000  x11 0000000000000000
08-27 18:32:30.352 24655 24655 F DEBUG   :     x12 00000000d83471f8  x13 0000000000000000  x14 0000000000000001  x15 0000000000000000
08-27 18:32:30.352 24655 24655 F DEBUG   :     x16 000000724c576838  x17 000000724bfa00ec  x18 000000731dd56000  x19 00000075d83471b0
08-27 18:32:30.352 24655 24655 F DEBUG   :     x20 00000075f8854b70  x21 00000076781aa66c  x22 00000073231aa358  x23 00000076282af7b8
08-27 18:32:30.352 24655 24655 F DEBUG   :     x24 00000076781aa410  x25 00000076282af7c8  x26 0000000018380001  x27 0000000000000004
08-27 18:32:30.352 24655 24655 F DEBUG   :     x28 00000073231aa700  x29 00000073231aa2c0
08-27 18:32:30.353 24655 24655 F DEBUG   :     lr  000000724bf9fd9c  sp  00000073231aa2c0  pc  000000724bfa0164  pst 0000000020000000
08-27 18:32:30.353 24655 24655 F DEBUG   : backtrace:
08-27 18:32:30.353 24655 24655 F DEBUG   :       #00 pc 0000000000359164  /data/app/~~2DWedoOZAQ1hE-LLNSrrrw==/host.exp.exponent-aOV5J4swAXhOktUOwGTKcA==/split_config.arm64_v8a.apk!librnskia_abi49_0_0.so (offset 0x6408000) (RNSkia::DrawingProp::setPicture(sk_sp<SkPicture>)+120) (BuildId: d0d8073a1a8211642e4272b11d4327d03adaa9a3)
08-27 18:32:30.353 24655 24655 F DEBUG   :       #01 pc 0000000000358d98  /data/app/~~2DWedoOZAQ1hE-LLNSrrrw==/host.exp.exponent-aOV5J4swAXhOktUOwGTKcA==/split_config.arm64_v8a.apk!librnskia_abi49_0_0.so (offset 0x6408000) (RNSkia::JsiCustomDrawingNode::draw(RNSkia::DrawingContext*)::'lambda'()::operator()() const+796) (BuildId: d0d8073a1a8211642e4272b11d4327d03adaa9a3)
08-27 18:32:30.353 24655 24655 F DEBUG   :       #02 pc 000000000000d2e0  /data/app/~~2DWedoOZAQ1hE-LLNSrrrw==/host.exp.exponent-aOV5J4swAXhOktUOwGTKcA==/split_config.arm64_v8a.apk!libreact_render_runtimescheduler_abi49_0_0.so (offset 0x3ec4000) (BuildId: 0f92d224d1d57cfc)
08-27 18:32:30.353 24655 24655 F DEBUG   :       #03 pc 00000000000a3194  /data/app/~~2DWedoOZAQ1hE-LLNSrrrw==/host.exp.exponent-aOV5J4swAXhOktUOwGTKcA==/split_config.arm64_v8a.apk!libreactnativejni_abi49_0_0.so (offset 0x43cb000) (BuildId: a1dfa733c56a7faa)
08-27 18:32:30.353 24655 24655 F DEBUG   :       #04 pc 00000000000ac900  /data/app/~~2DWedoOZAQ1hE-LLNSrrrw==/host.exp.exponent-aOV5J4swAXhOktUOwGTKcA==/split_config.arm64_v8a.apk!libreactnativejni_abi49_0_0.so (offset 0x43cb000) (BuildId: a1dfa733c56a7faa)
08-27 18:32:30.353 24655 24655 F DEBUG   :       #05 pc 0000000000081d5c  /data/app/~~2DWedoOZAQ1hE-LLNSrrrw==/host.exp.exponent-aOV5J4swAXhOktUOwGTKcA==/split_config.arm64_v8a.apk!libreactnativejni_abi49_0_0.so (offset 0x43cb000) (BuildId: a1dfa733c56a7faa)
08-27 18:32:30.353 24655 24655 F DEBUG   :       #06 pc 0000000000015e84  /data/app/~~2DWedoOZAQ1hE-LLNSrrrw==/host.exp.exponent-aOV5J4swAXhOktUOwGTKcA==/split_config.arm64_v8a.apk!libfbjni.so (offset 0x19d5000) (facebook::jni::detail::MethodWrapper<void (facebook::jni::JNativeRunnable::*)(), &(facebook::jni::JNativeRunnable::run()), facebook::jni::JNativeRunnable, void>::dispatch(facebook::jni::alias_ref<facebook::jni::detail::JTypeFor<facebook::jni::HybridClass<facebook::jni::JNativeRunnable, facebook::jni::JRunnable>::JavaPart, facebook::jni::JRunnable, void>::_javaobject*>)+32) (BuildId: 27496b9e5551bff5c79496b936b663bf8868c68b)
08-27 18:32:30.353 24655 24655 F DEBUG   :       #07 pc 0000000000015dfc  /data/app/~~2DWedoOZAQ1hE-LLNSrrrw==/host.exp.exponent-aOV5J4swAXhOktUOwGTKcA==/split_config.arm64_v8a.apk!libfbjni.so (offset 0x19d5000) (facebook::jni::detail::FunctionWrapper<void (*)(facebook::jni::alias_ref<facebook::jni::detail::JTypeFor<facebook::jni::HybridClass<facebook::jni::JNativeRunnable, facebook::jni::JRunnable>::JavaPart, facebook::jni::JRunnable, void>::_javaobject*>), facebook::jni::detail::JTypeFor<facebook::jni::HybridClass<facebook::jni::JNativeRunnable, facebook::jni::JRunnable>::JavaPart, facebook::jni::JRunnable, void>::_javaobject*, void>::call(_JNIEnv*, _jobject*, void (*)(facebook::jni::alias_ref<facebook::jni::detail::JTypeFor<facebook::jni::HybridClass<facebook::jni::JNativeRunnable, facebook::jni::JRunnable>::JavaPart, facebook::jni::JRunnable, void>::_javaobject*>))+60) (BuildId: 27496b9e5551bff5c79496b936b663bf8868c68b)
08-27 18:32:30.353 24655 24655 F DEBUG   :       #08 pc 00000000001882d4  /data/app/~~2DWedoOZAQ1hE-LLNSrrrw==/host.exp.exponent-aOV5J4swAXhOktUOwGTKcA==/oat/arm64/base.odex (art_jni_trampoline+116)
08-27 18:32:30.353 24655 24655 F DEBUG   :       #09 pc 00000000004ef824  /system/framework/arm64/boot-framework.oat (android.os.Handler.dispatchMessage+84) (BuildId: 1a1f6b8e4b13ad3b8896504a407390e4001589e7)
08-27 18:32:30.353 24655 24655 F DEBUG   :       #10 pc 000000000020a2b0  /apex/com.android.art/lib64/libart.so (nterp_helper+4016) (BuildId: 0c537e5efe426a30e9fde84241db9e3e)
08-27 18:32:30.353 24655 24655 F DEBUG   :       #11 pc 0000000000965e68  /data/app/~~2DWedoOZAQ1hE-LLNSrrrw==/host.exp.exponent-aOV5J4swAXhOktUOwGTKcA==/oat/arm64/base.vdex (abi49_0_0.com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage+0)
08-27 18:32:30.353 24655 24655 F DEBUG   :       #12 pc 00000000004f2bd0  /system/framework/arm64/boot-framework.oat (android.os.Looper.loopOnce+1152) (BuildId: 1a1f6b8e4b13ad3b8896504a407390e4001589e7)
08-27 18:32:30.353 24655 24655 F DEBUG   :       #13 pc 00000000004f26b0  /system/framework/arm64/boot-framework.oat (android.os.Looper.loop+560) (BuildId: 1a1f6b8e4b13ad3b8896504a407390e4001589e7)
08-27 18:32:30.353 24655 24655 F DEBUG   :       #14 pc 0000000000209398  /apex/com.android.art/lib64/libart.so (nterp_helper+152) (BuildId: 0c537e5efe426a30e9fde84241db9e3e)
08-27 18:32:30.353 24655 24655 F DEBUG   :       #15 pc 0000000000965ff6  /data/app/~~2DWedoOZAQ1hE-LLNSrrrw==/host.exp.exponent-aOV5J4swAXhOktUOwGTKcA==/oat/arm64/base.vdex (abi49_0_0.com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run+74)
08-27 18:32:30.353 24655 24655 F DEBUG   :       #16 pc 000000000017f020  /system/framework/arm64/boot.oat (java.lang.Thread.run+80) (BuildId: 92c3edca9b2db78441b99fc40084dcac0121a9dd)
08-27 18:32:30.353 24655 24655 F DEBUG   :       #17 pc 000000000021096c  /apex/com.android.art/lib64/libart.so (art_quick_invoke_stub+556) (BuildId: 0c537e5efe426a30e9fde84241db9e3e)
08-27 18:32:30.353 24655 24655 F DEBUG   :       #18 pc 000000000027975c  /apex/com.android.art/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+184) (BuildId: 0c537e5efe426a30e9fde84241db9e3e)
08-27 18:32:30.353 24655 24655 F DEBUG   :       #19 pc 0000000000603a10  /apex/com.android.art/lib64/libart.so (art::JValue art::InvokeVirtualOrInterfaceWithJValues<art::ArtMethod*>(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, art::ArtMethod*, jvalue const*)+460) (BuildId: 0c537e5efe426a30e9fde84241db9e3e)
08-27 18:32:30.353 24655 24655 F DEBUG   :       #20 pc 000000000064ac98  /apex/com.android.art/lib64/libart.so (art::Thread::CreateCallback(void*)+1288) (BuildId: 0c537e5efe426a30e9fde84241db9e3e)
08-27 18:32:30.353 24655 24655 F DEBUG   :       #21 pc 00000000000b6380  /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+208) (BuildId: f73b4091a9c819a21763f5bf11b53c2b)
08-27 18:32:30.353 24655 24655 F DEBUG   :       #22 pc 00000000000530a8  /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64) (BuildId: f73b4091a9c819a21763f5bf11b53c2b)

About this issue

  • Original URL
  • State: closed
  • Created 10 months ago
  • Comments: 17

Most upvoted comments

I’m experiencing the same issue when navigating between screens. SkiaView -> View -> SkiaView results in the app crashing on Android.

React-Native 0.72.3 Expo 49 React-Native-Skia 0.1.196

For navigation we use React Navigation and we can reproduce the crash every time (no need to stress the navigation by spamming buttons).

Thanks for reporting this, it would be really helpful if you could share a small repository to reproduce the issue (or a snack).