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

Intermittent App crash when showing Alert from "react-native" #2

Closed
bhaskarGyan opened this issue Jul 5, 2019 · 2 comments
Closed
Assignees
Labels
bug Something isn't working

Comments

@bhaskarGyan
Copy link

App is crashing when using Alert module from react-native.

Same App (release APK) is working fine with jsc-android@latest, jsc-android@next and with RN debugger(while running in dev mode)

I am getting two different stack trace but every time there is Intermittent App crash while showing the Alert

Stack-trace 1

07-04 20:59:21.821 23725-23742/com.reactnativememoryprofile E/ReactNativeJS: TypeError: s.DialogManagerAndroid.showAlert is not a function
    
    This error is located at:
        in n
        in withNavigationFocus(n)
        in withNavigation(withNavigationFocus(n))
        in p
        in RCTView
        in RCTView
        in RCTView
        in u
        in RCTView
        in u
        in C
        in n
        in E
        in RCTView
        in n
        in RCTView
        in u
        in PanGestureHandler
        in n
        in L
        in RCTView
        in n
        in t
        in P
        in v
        in A
        in RCTView
        in RCTView
        in c

Stack-trace 2

--------- beginning of crash
07-04 21:00:05.195 23799-23816/com.reactnativememoryprofile A/libc: Fatal signal 11 (SIGSEGV), code 128, fault addr 0x0 in tid 23816 (mqt_js)
07-04 21:00:05.198 23799-23814/com.reactnativememoryprofile E/Surface: getSlotFromBufferLocked: unknown buffer: 0x7f6c2cf47da0
07-04 21:00:05.200 23799-23814/com.reactnativememoryprofile D/OpenGLRenderer: endAllStagingAnimators on 0x7f6c20fff000 (RippleDrawable) with handle 0x7f6c2497a3e0
07-04 21:00:05.205 4454-15974/system_process W/InputMethodManagerService: Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@77d2719 attribute=null, token = android.os.BinderProxy@ff90afb
07-04 21:00:05.299 4065-4065/? A/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
07-04 21:00:05.299 4065-4065/? A/DEBUG: Build fingerprint: 'Android/sdk_google_phone_x86_64/generic_x86_64:6.0/MASTER/5525988:userdebug/test-keys'
07-04 21:00:05.299 4065-4065/? A/DEBUG: Revision: '0'
07-04 21:00:05.299 4065-4065/? A/DEBUG: ABI: 'x86_64'
07-04 21:00:05.300 4065-4065/? A/DEBUG: pid: 23799, tid: 23816, name: mqt_js  >>> com.reactnativememoryprofile <<<
07-04 21:00:05.300 4065-4065/? A/DEBUG: signal 11 (SIGSEGV), code 128 (SI_KERNEL), fault addr 0x0
07-04 21:00:05.307 4065-4065/? A/DEBUG:     rax 00007f6c30b17800  rbx 00007f6c2220b900  rcx ffffffffffffff00  rdx 0000000000000017
07-04 21:00:05.307 4065-4065/? A/DEBUG:     rsi 0000000000000018  rdi 00007f6c30b17800
07-04 21:00:05.307 4065-4065/? A/DEBUG:     r8  0000000000000001  r9  0000000000000010  r10 0000000000000014  r11 0000000000000001
07-04 21:00:05.307 4065-4065/? A/DEBUG:     r12 00007f6c2283c520  r13 00007f6c22242018  r14 00007f6c30b17800  r15 1baffed00bac0000
07-04 21:00:05.307 4065-4065/? A/DEBUG:     cs  0000000000000033  ss  000000000000002b
07-04 21:00:05.307 4065-4065/? A/DEBUG:     rip 00007f6c23efd922  rbp 00007f6c30c0a6c8  rsp 00007f6c227be080  eflags 0000000000010206
07-04 21:00:05.310 4065-4065/? A/DEBUG: backtrace:
07-04 21:00:05.310 4065-4065/? A/DEBUG:     #00 pc 0000000000c3b922  /data/app/com.reactnativememoryprofile-1/lib/x86_64/libv8.so (v8::internal::GlobalHandles::Create(v8::internal::Object)+450)
07-04 21:00:05.310 4065-4065/? A/DEBUG:     #01 pc 0000000000ae6966  /data/app/com.reactnativememoryprofile-1/lib/x86_64/libv8.so (v8::V8::GlobalizeReference(v8::internal::Isolate*, unsigned long*)+86)
07-04 21:00:05.310 4065-4065/? A/DEBUG:     #02 pc 0000000000031347  /data/app/com.reactnativememoryprofile-1/lib/x86_64/libjscexecutor.so (facebook::V8PointerValue::V8PointerValue(v8::Isolate*, v8::Local<v8::Value> const&)+39)
07-04 21:00:05.310 4065-4065/? A/DEBUG:     #03 pc 000000000002abab  /data/app/com.reactnativememoryprofile-1/lib/x86_64/libjscexecutor.so (facebook::V8Runtime::cloneObject(facebook::jsi::Runtime::PointerValue const*)+139)
07-04 21:00:05.310 4065-4065/? A/DEBUG:     #04 pc 000000000002750a  /data/app/com.reactnativememoryprofile-1/lib/x86_64/libjscexecutor.so (facebook::react::JSINativeModules::getModule(facebook::jsi::Runtime&, facebook::jsi::PropNameID const&)+106)
07-04 21:00:05.310 4065-4065/? A/DEBUG:     #05 pc 00000000000244dc  /data/app/com.reactnativememoryprofile-1/lib/x86_64/libjscexecutor.so (facebook::react::JSIExecutor::NativeModuleProxy::get(facebook::jsi::Runtime&, facebook::jsi::PropNameID const&)+236)
07-04 21:00:05.310 4065-4065/? A/DEBUG:     #06 pc 000000000002e0cc  /data/app/com.reactnativememoryprofile-1/lib/x86_64/libjscexecutor.so (facebook::HostObjectProxy::Getter(v8::Local<v8::Name>, v8::PropertyCallbackInfo<v8::Value> const&)+220)
07-04 21:00:05.310 4065-4065/? A/DEBUG:     #07 pc 0000000000cf5f77  /data/app/com.reactnativememoryprofile-1/lib/x86_64/libv8.so
07-04 21:00:05.310 4065-4065/? A/DEBUG:     #08 pc 0000000000dc2067  /data/app/com.reactnativememoryprofile-1/lib/x86_64/libv8.so
07-04 21:00:05.310 4065-4065/? A/DEBUG:     #09 pc 0000000000d73807  /data/app/com.reactnativememoryprofile-1/lib/x86_64/libv8.so (v8::internal::Object::GetProperty(v8::internal::LookupIterator*, v8::internal::OnNonExistent)+87)
07-04 21:00:05.310 4065-4065/? A/DEBUG:     #10 pc 0000000000ce5502  /data/app/com.reactnativememoryprofile-1/lib/x86_64/libv8.so
07-04 21:00:05.310 4065-4065/? A/DEBUG:     #11 pc 0000000000cec03f  /data/app/com.reactnativememoryprofile-1/lib/x86_64/libv8.so
07-04 21:00:05.311 4065-4065/? A/DEBUG:     #12 pc 0000000001332258  /data/app/com.reactnativememoryprofile-1/lib/x86_64/libv8.so
07-04 21:00:05.311 4065-4065/? A/DEBUG:     #13 pc 000000000137d94a  /data/app/com.reactnativememoryprofile-1/lib/x86_64/libv8.so
07-04 21:00:05.311 4065-4065/? A/DEBUG:     #14 pc 00000000012a7523  /data/app/com.reactnativememoryprofile-1/lib/x86_64/libv8.so
07-04 21:00:05.311 4065-4065/? A/DEBUG:     #15 pc 00000000012a7523  /data/app/com.reactnativememoryprofile-1/lib/x86_64/libv8.so
07-04 21:00:05.311 4065-4065/? A/DEBUG:     #16 pc 00000000012a7523  /data/app/com.reactnativememoryprofile-1/lib/x86_64/libv8.so
07-04 21:00:05.311 4065-4065/? A/DEBUG:     #17 pc 00000000012a7523  /data/app/com.reactnativememoryprofile-1/lib/x86_64/libv8.so
07-04 21:00:05.311 4065-4065/? A/DEBUG:     #18 pc 00000000012a7523  /data/app/com.reactnativememoryprofile-1/lib/x86_64/libv8.so
07-04 21:00:05.311 4065-4065/? A/DEBUG:     #19 pc 00000000012a4e9c  /data/app/com.reactnativememoryprofile-1/lib/x86_64/libv8.so
07-04 21:00:05.311 4065-4065/? A/DEBUG:     #20 pc 00000000012a4c17  /data/app/com.reactnativememoryprofile-1/lib/x86_64/libv8.so
07-04 21:00:05.311 4065-4065/? A/DEBUG:     #21 pc 0000000000c22e43  /data/app/com.reactnativememoryprofile-1/lib/x86_64/libv8.so
07-04 21:00:05.311 4065-4065/? A/DEBUG:     #22 pc 000000000001d990  <unknown>
07-04 21:00:05.370 4065-4065/? A/DEBUG: Tombstone written to: /data/tombstones/tombstone_01
07-04 21:00:05.370 4065-4065/? E/DEBUG: AM write failed: Broken pipe

Environment:
React Native Version 0.60.0
OS: Mac OS Mojave 10.14.5
Android Studio: Version 3.4.1
Android Device : Emulator

CPU/ABI: Google APIs Intel Atom (x86_64)
Target: google_apis [Google APIs] (API level 23)
Skin: 720x1280
SD Card: 512M
fastboot.chosenSnapshotFile:
runtime.network.speed: full
hw.accelerometer: yes
hw.lcd.width: 1280
hw.initialOrientation: Portrait
image.androidVersion.api: 23
tag.id: google_apis
hw.mainKeys: yes
hw.camera.front: emulated
hw.gpu.mode: auto
hw.ramSize: 1536
PlayStore.enabled: false
fastboot.forceColdBoot: no
hw.cpu.ncore: 4
hw.keyboard: yes
hw.sensors.proximity: yes
hw.dPad: no
hw.lcd.height: 720
vm.heapSize: 80
skin.dynamic: yes
hw.device.manufacturer: User
hw.gps: yes
skin.path.backup: _no_skin
hw.audioInput: yes
image.sysdir.1: system-images/android-23/google_apis/x86_64/
showDeviceFrame: no
hw.camera.back: virtualscene
hw.lcd.density: 320
hw.arc: false
hw.device.hash2: MD5:76591743eff70968fb44614cfd0d863d
fastboot.forceChosenSnapshotBoot: no
fastboot.forceFastBoot: yes
hw.trackBall: no
hw.battery: yes
hw.sdCard: yes
tag.display: Google APIs
runtime.network.latency: none
disk.dataPartition.size: 800M
hw.sensors.orientation: yes
avd.ini.encoding: UTF-8
hw.gpu.enabled: yes

Steps To Reproduce

  1. Download Apk from Crash_test_app-release.apk
    1.1 Or Clone https://github.com/bhaskarGyan/react-native-memory-profile.git
    1.2 checkout bug/rn-alert-crash
    1.3 npm i

2.Install downloaded APK or react-native run-android on real device/ emulator or cd android && ./gradlew assembleRelease
3. Open App
4. Click on Crash Test button
5. In there is no crash, go back to home and repeat step 4
6. App generally crash in 4-5 attempts

@Kudo
Copy link
Owner

Kudo commented Jul 5, 2019

I could reproduce this crash, will try to troubleshoot and fix the problem.
Thank you.

@Kudo Kudo added the bug Something isn't working label Jul 5, 2019
@Kudo Kudo self-assigned this Jul 5, 2019
Kudo added a commit that referenced this issue Jul 8, 2019
Summary:
    JSI uses PointerValue to allocate String, Object, ...etc,
    and JSI controls life cycle itself from invalidate().
    JSCRuntime did use JSValueUnprotect() to prevent these values being GCed.
    For V8Runtime, we just need to keep they wrapped as v8::Glocal<> and not as weak.
@Kudo Kudo closed this as completed in 87c8526 Jul 8, 2019
@Kudo
Copy link
Owner

Kudo commented Jul 8, 2019

@bhaskarGyan Thanks for reporting this.
I've published @0.60.0-patch.2 for this issue and assuming this will help about the crash.

Kudo added a commit that referenced this issue Jul 6, 2023
# Why

follow up #187

# How

add the missing the hermes-android

# Test Plan

try the reproducible example from expo/expo#23312
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants