opentok-react-native: Android ANR or crash when disconnecting from session
When unmounting the OTSession component while there are two parties connected to it the app UI hangs and I get ANR. Unfortunately there were no helpful logs what is causing it. Only when I tested on emulator with Android API 28 I got the following crash log:
--------- beginning of crash
06-07 15:02:13.347 17562-17562/bg.consento.pro.staging A/libc: FORTIFY: pthread_mutex_lock called on a destroyed mutex (0x7b3cfba8fe18)
06-07 15:02:13.422 17562-17573/bg.consento.pro.staging I/nto.pro.stagin: Background concurrent copying GC freed 100134(3MB) AllocSpace objects, 4(72KB) LOS objects, 49% free, 5MB/11MB, paused 1.153ms total 140.622ms
06-07 15:02:13.427 1995-2890/? I/Camera2ClientBase: Closed Camera 1. Client was: bg.consento.pro.staging (PID 17562, UID 10089)
06-07 15:02:13.429 17562-17562/bg.consento.pro.staging W/google-breakpad: Failed to generate minidump.
06-07 15:02:13.489 17901-17562/? A/google-breakpad: Microdump skipped (uninteresting)
06-07 15:02:13.522 17562-17562/bg.consento.pro.staging W/google-breakpad: ### ### ### ### ### ### ### ### ### ### ### ### ###
Chrome build fingerprint:
69.0.3497.100
349710067
### ### ### ### ### ### ### ### ### ### ### ### ###
06-07 15:02:13.523 17562-17562/bg.consento.pro.staging A/libc: Fatal signal 6 (SIGABRT), code -6 (SI_TKILL) in tid 17562 (nto.pro.staging), pid 17562 (nto.pro.staging)
06-07 15:02:13.596 17904-17904/? I/crash_dump64: obtaining output fd from tombstoned, type: kDebuggerdTombstone
06-07 15:02:13.596 1813-1813/? I//system/bin/tombstoned: received crash request for pid 17562
06-07 15:02:13.597 17904-17904/? I/crash_dump64: performing dump of process 17562 (target tid = 17562)
06-07 15:02:13.603 17904-17904/? A/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
Build fingerprint: 'google/sdk_gphone_x86_64/generic_x86_64:9/PSR1.180720.093/5456446:userdebug/dev-keys'
Revision: '0'
ABI: 'x86_64'
pid: 17562, tid: 17562, name: nto.pro.staging >>> bg.consento.pro.staging <<<
signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
Abort message: 'FORTIFY: pthread_mutex_lock called on a destroyed mutex (0x7b3cfba8fe18)'
rax 0000000000000000 rbx 000000000000449a rcx 00007b3dd8366b98 rdx 0000000000000006
r8 00007ffcf5915390 r9 00007ffcf5915390 r10 00007ffcf5915390 r11 0000000000000246
r12 00007ffcf5915410 r13 00007b3cec11ec60 r14 000000000000449a r15 00007ffcf5915208
rdi 000000000000449a rsi 000000000000449a
rbp 00007b3cfba8fe18 rsp 00007ffcf59151f8 rip 00007b3dd8366b98
06-07 15:02:13.688 17904-17904/? A/DEBUG: backtrace:
#00 pc 0000000000026b98 /system/lib64/libc.so (syscall+24)
#01 pc 0000000000029775 /system/lib64/libc.so (abort+101)
#02 pc 0000000000093efa /system/lib64/libc.so (__fortify_fatal(char const*, ...)+154)
#03 pc 0000000000093738 /system/lib64/libc.so (HandleUsingDestroyedMutex(pthread_mutex_t*, char const*)+40)
#04 pc 0000000000093602 /system/lib64/libc.so (pthread_mutex_lock+130)
#05 pc 000000000013167c /data/app/bg.consento.pro.staging-MCLGR4nefarErH2FEYJ9yQ==/lib/x86_64/libopentok.so
#06 pc 00000000001018e0 /data/app/bg.consento.pro.staging-MCLGR4nefarErH2FEYJ9yQ==/lib/x86_64/libopentok.so
#07 pc 00000000000fa764 /data/app/bg.consento.pro.staging-MCLGR4nefarErH2FEYJ9yQ==/lib/x86_64/libopentok.so (otc_session_get_connection+20)
#08 pc 0000000000031d9d /data/app/bg.consento.pro.staging-MCLGR4nefarErH2FEYJ9yQ==/oat/x86_64/base.odex (offset 0x2f000) (com.facebook.yoga.YogaNode.jni_YGNodeNewWithConfig [DEDUPED]+173)
#09 pc 00000000005c3ab4 /system/lib64/libart.so (art_quick_invoke_stub+756)
#10 pc 00000000000cf5f2 /system/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+226)
#11 pc 00000000002a1b91 /system/lib64/libart.so (art::interpreter::ArtInterpreterToCompiledCodeBridge(art::Thread*, art::ArtMethod*, art::ShadowFrame*, unsigned short, art::JValue*)+321)
#12 pc 000000000029ac6d /system/lib64/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+1261)
#13 pc 0000000000590f9a /system/lib64/libart.so (MterpInvokeDirect+314)
#14 pc 00000000005b5099 /system/lib64/libart.so (ExecuteMterpImpl+14489)
#15 pc 000000000095fbd4 /data/app/bg.consento.pro.staging-MCLGR4nefarErH2FEYJ9yQ==/oat/x86_64/base.vdex (com.opentok.android.v3.Session.getConnection+28)
#16 pc 0000000000271ee1 /system/lib64/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadERKNS_20CodeItemDataAccessorERNS_11ShadowFrameENS_6JValueEb.llvm.2620325170+561)
#17 pc 0000000000277a4e /system/lib64/libart.so (art::interpreter::ArtInterpreterToInterpreterBridge(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame*, art::JValue*)+222)
#18 pc 000000000029ac54 /system/lib64/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+1236)
#19 pc 0000000000592de8 /system/lib64/libart.so (MterpInvokeVirtualQuick+632)
#20 pc 00000000005b8d19 /system/lib64/libart.so (ExecuteMterpImpl+29977)
#21 pc 000000000094ef00 /data/app/bg.consento.pro.staging-MCLGR4nefarErH2FEYJ9yQ==/oat/x86_64/base.vdex (com.opentok.android.Session.getConnection+8)
#22 pc 0000000000271ee1 /system/lib64/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadERKNS_20CodeItemDataAccessorERNS_11ShadowFrameENS_6JValueEb.llvm.2620325170+561)
#23 pc 0000000000277a4e /system/lib64/libart.so (art::interpreter::ArtInterpreterToInterpreterBridge(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame*, art::JValue*)+222)
06-07 15:02:13.689 17904-17904/? A/DEBUG: #24 pc 000000000029ac54 /system/lib64/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+1236)
#25 pc 0000000000592de8 /system/lib64/libart.so (MterpInvokeVirtualQuick+632)
#26 pc 00000000005b8d19 /system/lib64/libart.so (ExecuteMterpImpl+29977)
#27 pc 0000000000966a86 /data/app/bg.consento.pro.staging-MCLGR4nefarErH2FEYJ9yQ==/oat/x86_64/base.vdex (com.opentokreactnative.utils.EventUtils.prepareJSSessionMap+26)
#28 pc 0000000000271ee1 /system/lib64/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadERKNS_20CodeItemDataAccessorERNS_11ShadowFrameENS_6JValueEb.llvm.2620325170+561)
#29 pc 0000000000277a4e /system/lib64/libart.so (art::interpreter::ArtInterpreterToInterpreterBridge(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame*, art::JValue*)+222)
#30 pc 000000000029ac54 /system/lib64/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+1236)
#31 pc 000000000059116d /system/lib64/libart.so (MterpInvokeStatic+189)
#32 pc 00000000005b5119 /system/lib64/libart.so (ExecuteMterpImpl+14617)
#33 pc 00000000009649d8 /data/app/bg.consento.pro.staging-MCLGR4nefarErH2FEYJ9yQ==/oat/x86_64/base.vdex (com.opentokreactnative.OTSessionManager.onDisconnected+8)
#34 pc 0000000000271ee1 /system/lib64/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadERKNS_20CodeItemDataAccessorERNS_11ShadowFrameENS_6JValueEb.llvm.2620325170+561)
#35 pc 0000000000277a4e /system/lib64/libart.so (art::interpreter::ArtInterpreterToInterpreterBridge(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame*, art::JValue*)+222)
#36 pc 000000000029ac54 /system/lib64/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+1236)
#37 pc 0000000000590b58 /system/lib64/libart.so (MterpInvokeInterface+1480)
#38 pc 00000000005b5199 /system/lib64/libart.so (ExecuteMterpImpl+14745)
#39 pc 000000000094f732 /data/app/bg.consento.pro.staging-MCLGR4nefarErH2FEYJ9yQ==/oat/x86_64/base.vdex (com.opentok.android.Session.onDisconnected+14)
#40 pc 0000000000271ee1 /system/lib64/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadERKNS_20CodeItemDataAccessorERNS_11ShadowFrameENS_6JValueEb.llvm.2620325170+561)
#41 pc 0000000000277a4e /system/lib64/libart.so (art::interpreter::ArtInterpreterToInterpreterBridge(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame*, art::JValue*)+222)
#42 pc 000000000029ac54 /system/lib64/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+1236)
#43 pc 0000000000592de8 /system/lib64/libart.so (MterpInvokeVirtualQuick+632)
06-07 15:02:13.690 17904-17904/? A/DEBUG: #44 pc 00000000005b8d19 /system/lib64/libart.so (ExecuteMterpImpl+29977)
#45 pc 000000000094e542 /data/app/bg.consento.pro.staging-MCLGR4nefarErH2FEYJ9yQ==/oat/x86_64/base.vdex (com.opentok.android.Session$3.onDisconnected+10)
#46 pc 0000000000271ee1 /system/lib64/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadERKNS_20CodeItemDataAccessorERNS_11ShadowFrameENS_6JValueEb.llvm.2620325170+561)
#47 pc 0000000000277a4e /system/lib64/libart.so (art::interpreter::ArtInterpreterToInterpreterBridge(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame*, art::JValue*)+222)
#48 pc 000000000029ac54 /system/lib64/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+1236)
#49 pc 0000000000590b58 /system/lib64/libart.so (MterpInvokeInterface+1480)
#50 pc 00000000005b5199 /system/lib64/libart.so (ExecuteMterpImpl+14745)
#51 pc 000000000095ee84 /data/app/bg.consento.pro.staging-MCLGR4nefarErH2FEYJ9yQ==/oat/x86_64/base.vdex (com.opentok.android.v3.Session$2.run+140)
#52 pc 0000000000271ee1 /system/lib64/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadERKNS_20CodeItemDataAccessorERNS_11ShadowFrameENS_6JValueEb.llvm.2620325170+561)
#53 pc 000000000057e547 /system/lib64/libart.so (artQuickToInterpreterBridge+1223)
#54 pc 00000000005ce1ec /system/lib64/libart.so (art_quick_to_interpreter_bridge+140)
06-07 15:02:13.691 17904-17904/? A/DEBUG: #55 pc 0000000000abcd56 /system/framework/x86_64/boot-framework.oat (offset 0x3c3000) (android.os.Handler.dispatchMessage+86)
#56 pc 0000000000abfcff /system/framework/x86_64/boot-framework.oat (offset 0x3c3000) (android.os.Looper.loop+1119)
#57 pc 00000000008921f7 /system/framework/x86_64/boot-framework.oat (offset 0x3c3000) (android.app.ActivityThread.main+583)
#58 pc 00000000005c3e16 /system/lib64/libart.so (art_quick_invoke_static_stub+806)
#59 pc 00000000000cf603 /system/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+243)
#60 pc 00000000004b7569 /system/lib64/libart.so (art::(anonymous namespace)::InvokeWithArgArray(art::ScopedObjectAccessAlreadyRunnable const&, art::ArtMethod*, art::(anonymous namespace)::ArgArray*, art::JValue*, char const*)+89)
#61 pc 00000000004b9347 /system/lib64/libart.so (art::InvokeMethod(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jobject*, _jobject*, unsigned long)+1447)
#62 pc 00000000004338e8 /system/lib64/libart.so (art::Method_invoke(_JNIEnv*, _jobject*, _jobject*, _jobjectArray*)+56)
#63 pc 000000000011c623 /system/framework/x86_64/boot.oat (offset 0x110000) (java.lang.Class.getDeclaredMethodInternal [DEDUPED]+227)
#64 pc 0000000000bfd84d /system/framework/x86_64/boot-framework.oat (offset 0x3c3000) (com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run+141)
#65 pc 0000000000c04ae4 /system/framework/x86_64/boot-framework.oat (offset 0x3c3000) (com.android.internal.os.ZygoteInit.main+2804)
#66 pc 00000000005c3e16 /system/lib64/libart.so (art_quick_invoke_static_stub+806)
#67 pc 00000000000cf603 /system/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+243)
#68 pc 00000000004b7569 /system/lib64/libart.so (art::(anonymous namespace)::InvokeWithArgArray(art::ScopedObjectAccessAlreadyRunnable const&, art::ArtMethod*, art::(anonymous namespace)::ArgArray*, art::JValue*, char const*)+89)
#69 pc 00000000004b7132 /system/lib64/libart.so (art::InvokeWithVarArgs(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jmethodID*, __va_list_tag*)+434)
#70 pc 00000000003a0c97 /system/lib64/libart.so (art::JNI::CallStaticVoidMethodV(_JNIEnv*, _jclass*, _jmethodID*, __va_list_tag*)+791)
#71 pc 00000000000ffd44 /system/lib64/libart.so (art::(anonymous namespace)::CheckJNI::CallMethodV(char const*, _JNIEnv*, _jobject*, _jclass*, _jmethodID*, __va_list_tag*, art::Primitive::Type, art::InvokeType)+2772)
#72 pc 00000000000ef581 /system/lib64/libart.so (art::(anonymous namespace)::CheckJNI::CallStaticVoidMethodV(_JNIEnv*, _jclass*, _jmethodID*, __va_list_tag*)+33)
#73 pc 00000000000b2089 /system/lib64/libandroid_runtime.so (_JNIEnv::CallStaticVoidMethod(_jclass*, _jmethodID*, ...)+153)
06-07 15:02:13.692 17904-17904/? A/DEBUG: #74 pc 00000000000b5250 /system/lib64/libandroid_runtime.so (android::AndroidRuntime::start(char const*, android::Vector<android::String8> const&, bool)+736)
#75 pc 00000000000021fd /system/bin/app_process64 (main+1357)
#76 pc 00000000000c278c /system/lib64/libc.so (__libc_init+92)
06-07 15:02:13.903 1813-1813/? E//system/bin/tombstoned: Tombstone written to: /data/tombstones/tombstone_11
06-07 15:02:13.909 2048-17913/system_process W/ActivityManager: Force finishing activity bg.consento.pro.staging/bg.consento.pro.MainActivity
This I think is an error in the native android sdk, because I forked this project and downgraded to com.opentok.android:opentok-android-sdk:2.15.3 and the problem was gone. But 2.15.3 has another problem - it crashes when built for x86_64 architecture
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 24 (11 by maintainers)
Great news @enricop89, just in time! šš» Lotās of bugs seem to be fixed, however thereās a few issues left on Android. I will try to isolate them (with sample code) and report as issues.
@Tracklous can you please share some sample code + steps to reproduce the issue? I tried to unmount OTSession component with two parties connected but I am not able to reproduce it.
Closing this one since the main issue is in the native SDK. If the issue continues after the new patch is released, we can re-open it.
@timhuff It is easier just to add implementation with the force parameter after the opentok-react-native: implementation project(ā:opentok-react-nativeā) implementation (ācom.opentok.android:opentok-android-sdk:2.14.3ā) { force = true } Note: I used the 2.14 version because the 2.15 has bug with TextureView
I think I hit this problem when trying to upgrade to 10.2+ as well, but Iāll have to try it again to see if I can get crash logs this time. An Android crash triggered by unmounting the session was why I downgraded to 10.1 of this lib though. I didnāt have time to look into it more at the time, but Iāll come back to it and try to provide more info.