hermes: RN0.64 Android crash with Hermes Debugger in Flipper
Bug Description
I’m trying to use the Hermes Debugger in Flipper on an existing RN0.64 app which we recently tried to use Hermes on.
- I have run
gradle cleanand confirmed this bug does not occur with JSC
Hermes version: Same as RN 0.64 React Native version (if any): 0.64 OS version (if any): Android 11 Platform (most likely one of arm64-v8a, armeabi-v7a, x86, x86_64):
Steps To Reproduce
- Start app on device.
- Go to Hermes Debugger (RN) in Flipper
- Crashes with
Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0 in tid 32085 (Thread-13)
The crash dump shows:
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0
Cause: null pointer dereference
#00 pc 000000000001d8d8 /data/app/~~XKMe7YzatnzZ3bppE8Hs3g==/com.app-JpLF1sF9vptsqfIbCTNcRw==/lib/arm64/libhermes-executor-common-debug.so (BuildId: f45383ff790ccc1692f3c61165ee8f75d3d66eaf)
#01 pc 00000000001e7efc /data/app/~~XKMe7YzatnzZ3bppE8Hs3g==/com.app-JpLF1sF9vptsqfIbCTNcRw==/lib/arm64/libhermes.so (BuildId: 6f52702204565e62fc1d0d9a58755bb7a4b543a7)
#02 pc 00000000001e7e68 /data/app/~~XKMe7YzatnzZ3bppE8Hs3g==/com.app-JpLF1sF9vptsqfIbCTNcRw==/lib/arm64/libhermes.so (BuildId: 6f52702204565e62fc1d0d9a58755bb7a4b543a7)
#03 pc 000000000013ced4 /apex/com.android.art/lib64/libart.so (art_quick_generic_jni_trampoline+148) (BuildId: 91ea3336584f5c23cca0c4a4a9b7d164)
#04 pc 0000000000133564 /apex/com.android.art/lib64/libart.so (art_quick_invoke_stub+548) (BuildId: 91ea3336584f5c23cca0c4a4a9b7d164)
#05 pc 00000000001a8a78 /apex/com.android.art/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+200) (BuildId: 91ea3336584f5c23cca0c4a4a9b7d164)
#06 pc 0000000000318278 /apex/com.android.art/lib64/libart.so (art::interpreter::ArtInterpreterToCompiledCodeBridge(art::Thread*, art::ArtMethod*, art::ShadowFrame*, unsigned short, art::JValue*)+376) (BuildId: 91ea3336584f5c23cca0c4a4a9b7d164)
#07 pc 000000000030e5a4 /apex/com.android.art/lib64/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+996) (BuildId: 91ea3336584f5c23cca0c4a4a9b7d164)
#08 pc 000000000067e9ac /apex/com.android.art/lib64/libart.so (MterpInvokeInterface+1032) (BuildId: 91ea3336584f5c23cca0c4a4a9b7d164)
#09 pc 000000000012da14 /apex/com.android.art/lib64/libart.so (mterp_op_invoke_interface+20) (BuildId: 91ea3336584f5c23cca0c4a4a9b7d164)
#10 pc 00000000000eb89c /apex/com.android.art/javalib/core-oj.jar (java.lang.Thread.run+8)
#11 pc 0000000000305ba0 /apex/com.android.art/lib64/libart.so (art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool) (.llvm.3685415019599751405)+268) (BuildId: 91ea3336584f5c23cca0c4a4a9b7d164)
#12 pc 000000000066bcf4 /apex/com.android.art/lib64/libart.so (artQuickToInterpreterBridge+780) (BuildId: 91ea3336584f5c23cca0c4a4a9b7d164)
#13 pc 000000000013cff8 /apex/com.android.art/lib64/libart.so (art_quick_to_interpreter_bridge+88) (BuildId: 91ea3336584f5c23cca0c4a4a9b7d164)
#14 pc 0000000000133564 /apex/com.android.art/lib64/libart.so (art_quick_invoke_stub+548) (BuildId: 91ea3336584f5c23cca0c4a4a9b7d164)
#15 pc 00000000001a8a78 /apex/com.android.art/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+200) (BuildId: 91ea3336584f5c23cca0c4a4a9b7d164)
#16 pc 00000000005557a8 /apex/com.android.art/lib64/libart.so (art::JValue art::InvokeVirtualOrInterfaceWithJValues<art::ArtMethod*>(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, art::ArtMethod*, jvalue const*)+460) (BuildId: 91ea3336584f5c23cca0c4a4a9b7d164)
#17 pc 00000000005a4b0c /apex/com.android.art/lib64/libart.so (art::Thread::CreateCallback(void*)+1308) (BuildId: 91ea3336584f5c23cca0c4a4a9b7d164)
#18 pc 00000000000da278 /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+64) (BuildId: 1ca28d785d6567d2b225cf978ef04de5)
#19 pc 000000000007a448 /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64) (BuildId: 1ca28d785d6567d2b225cf978ef04de5)
Not sure how to get the tombstone file from the phone, as it isn’t rooted.
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 8
- Comments: 16 (3 by maintainers)
Still having an issue with Sampling Profiler like @andreialecu said - intermittently.
@neildhar I think the issue is related to the fact the hermes runetime used by reanimated is created on a different thread than the one it is being used on (ui thread). Heres where the init code is https://github.com/software-mansion/react-native-reanimated/blob/main/android/src/main/cpp/NativeProxy.cpp#L125. Hermes using current thread for profiler https://github.com/facebook/hermes/blob/main/lib/VM/Profiler/SamplingProfilerPosix.cpp#L381.
Not sure what be best solution is here, but I submitted a patch to disable profiler for the reanimated hermes runtime as a workaround. https://github.com/software-mansion/react-native-reanimated/pull/2842
It’s still happening to me. I tried with hermes enabled and disabled and both crashes my app when I turn on remote debugging. Here is what I can scrape from adb logcat.
RN 0.66.4 react-native-reanimated 2.3.1
The Hermes Debugger was fixed in that PR and it works in Reanimated 2.2.0, but the Sampling Profiler still crashes.
I opened https://github.com/software-mansion/react-native-reanimated/issues/2143 on Reanimated’s side.