MetaMask / metamask-mobile

Mobile web browser providing access to websites that use the Ethereum blockchain
https://metamask.io
Other
2.15k stars 1.11k forks source link

Android crash on first run after install #5392

Open sethkfman opened 1 year ago

sethkfman commented 1 year ago

Description

We started to see spike in the crash after install/upgrade on the first time the application is run after the install/upgrade. This occurs approximately 25% of the time when running on Samsung devices with OS 12 or greater. The spike in crashes seem to occur with the updates in 5.9.1.

This crash currently makes up 40% of our crashes on Android and is blocking QA automation.

Stacktrace Below:

*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
pid: 0, tid: 17719 >>> io.metamask <<<

backtrace:
  #00  pc 0x0000000000857fb4  /data/app/~~6301V8kqN7pkl_97N7XSsg==/io.metamask-h_NLgpJZNuodU6eUJUl1Zw==/split_config.arm64_v8a.apk!libjsc.so
  #01  pc 0x0000000000000668  [vdso] (__kernel_rt_sigreturn)
  #02  pc 0x00000000000a3068  /apex/com.android.runtime/lib64/bionic/libc.so (__epoll_pwait+8)
  #03  pc 0x0000000000017ea8  /system/lib64/libutils.so (android::Looper::pollInner(int)+184)
  #04  pc 0x0000000000017d84  /system/lib64/libutils.so (android::Looper::pollOnce(int, int*, int*, void**)+116)
  #05  pc 0x000000000015914c  /system/lib64/libandroid_runtime.so (android::android_os_MessageQueue_nativePollOnce(_JNIEnv*, _jobject*, long, int)+48)
  #06  pc 0x000000000023d44c  /system/framework/arm64/boot-framework.oat (art_jni_trampoline+108)
  #07  pc 0x0000000000792828  /system/framework/arm64/boot-framework.oat (android.os.MessageQueue.next+232)
  #08  pc 0x000000000078fa24  /system/framework/arm64/boot-framework.oat (android.os.Looper.loopOnce+100)
  #09  pc 0x000000000078f924  /system/framework/arm64/boot-framework.oat (android.os.Looper.loop+516)
  #10  pc 0x000000000050d650  /system/framework/arm64/boot-framework.oat (android.app.ActivityThread.main+800)
  #11  pc 0x0000000000218be8  /apex/com.android.art/lib64/libart.so (art_quick_invoke_static_stub+568)
  #12  pc 0x000000000028600c  /apex/com.android.art/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+220)
  #13  pc 0x000000000062d0ec  /apex/com.android.art/lib64/libart.so (_jobject* art::InvokeMethod<(art::PointerSize)8>(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jobject*, _jobject*, unsigned long)+1388)
  #14  pc 0x000000000059b46c  /apex/com.android.art/lib64/libart.so (art::Method_invoke(_JNIEnv*, _jobject*, _jobject*, _jobjectArray*)+56)
  #15  pc 0x00000000000b2f74  /apex/com.android.art/javalib/arm64/boot.oat (art_jni_trampoline+132)
  #16  pc 0x0000000000ae1e6c  /system/framework/arm64/boot-framework.oat (com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run+140)
  #17  pc 0x0000000000aeb298  /system/framework/arm64/boot-framework.oat (com.android.internal.os.ZygoteInit.main+2376)
  #18  pc 0x0000000000218be8  /apex/com.android.art/lib64/libart.so (art_quick_invoke_static_stub+568)
  #19  pc 0x000000000028600c  /apex/com.android.art/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+220)
  #20  pc 0x000000000062d874  /apex/com.android.art/lib64/libart.so (art::JValue art::InvokeWithVarArgs<art::ArtMethod*>(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, art::ArtMethod*, std::__va_list)+452)
  #21  pc 0x000000000062dd68  /apex/com.android.art/lib64/libart.so (art::JValue art::InvokeWithVarArgs<_jmethodID*>(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jmethodID*, std::__va_list)+96)
  #22  pc 0x0000000000503df8  /apex/com.android.art/lib64/libart.so (art::JNI<true>::CallStaticVoidMethodV(_JNIEnv*, _jclass*, _jmethodID*, std::__va_list)+620)
  #23  pc 0x00000000000b3bf8  /system/lib64/libandroid_runtime.so (_JNIEnv::CallStaticVoidMethod(_jclass*, _jmethodID*, ...)+124)
  #24  pc 0x00000000000c01e4  /system/lib64/libandroid_runtime.so (android::AndroidRuntime::start(char const*, android::Vector<android::String8> const&, bool)+852)
  #25  pc 0x00000000000025a8  /system/bin/app_process64 (main+1360)
  #26  pc 0x000000000004a068  /apex/com.android.runtime/lib64/bionic/libc.so (__libc_init+100)

Technical Requirements

Acceptance Criteria

tommasini commented 1 year ago

Update:

tommasini commented 1 year ago

I built from 5.9.1 until 5.1.0 and I'm having the fresh install crash with the Samsung Galaxy 22 and I'm always having the fresh install crash randomly, but 1/3 of the times that I install it crashes

I downgraded react-native-screens on a build alone and I'm having the same behaviour.

With this analysis, I can't explain the spike between 5.9.0 and 5.9.1 by the packages update on our package.json, the only thing that I can think of it's that more devices got updated to Android 12 and we are having more reports because of that.

Regarding the crash I have one question:

tommasini commented 1 year ago

With the last research on my point of view, we can try to upgrade the react native version in order to try to solve it, since there is some fixes about crashing on the new versions

sethkfman commented 1 year ago

More context on issue: https://github.com/facebook/react-native/issues/33083

github-actions[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity in the last 90 days. It will be closed in 7 days. Thank you for your contributions.

AftabUfaq commented 1 year ago

pid: 0, tid: 4439 >>> <<<

backtrace:

00 pc 0x00000000006703bc /data/app/~~xjC8BxgMEpVhej0iaXigDg==/-28lCjLhN7uGGatCJHO_s5g==/split_config.arm64_v8a.apk!libjsc.so

01 pc 0x0000000000000628 [vdso] (__kernel_rt_sigreturn)

02 pc 0x00000000000d9ae4 /apex/com.android.runtime/lib64/bionic/libc.so (__epoll_pwait+4)

03 pc 0x00000000000168d4 /system/lib64/libutils.so (android::Looper::pollInner(int)+180)

04 pc 0x00000000000167b8 /system/lib64/libutils.so (android::Looper::pollOnce(int, int, int, void**)+112)

05 pc 0x00000000001537fc /system/lib64/libandroid_runtime.so (android::android_os_MessageQueue_nativePollOnce(_JNIEnv, _jobject, long, int)+44)

06 pc 0x000000000045f504 /data/misc/apexdata/com.android.art/dalvik-cache/arm64/boot.oat (art_jni_trampoline+116)