weixin_39928993
weixin_39928993
2021-01-02 09:35

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<: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

</:string8></false></false></false></false></false></false></false>

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

该提问来源于开源项目:opentok/opentok-react-native

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

24条回答

  • weixin_39767322 weixin_39767322 4月前

    Hi , just pinging here to see if there's been any progress. Thanks!

    点赞 评论 复制链接分享
  • weixin_39594191 weixin_39594191 4月前

    Hey , yesterday we released Android 2.16.2 (https://tokbox.com/developer/sdks/android/release-notes.html).

    Let me know if you have the chance to try it

    点赞 评论 复制链接分享
  • weixin_39767322 weixin_39767322 4月前

    Great news , 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.

    点赞 评论 复制链接分享
  • weixin_40006185 weixin_40006185 4月前

    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.

    The issue is still here. Please, reopen it!

    点赞 评论 复制链接分享
  • weixin_39594191 weixin_39594191 4月前

    please make sure to clean the project and build, and if you're still experiencing the issue, feel free to open an issue with steps to repro

    点赞 评论 复制链接分享
  • weixin_40006185 weixin_40006185 4月前

    thanks, tried clean and rebuild, but it did not help. I use the latest version of native SDK (2.16.5), so maybe this should be asked in another thread Added try - catch for now as it seems to be the only solution

    点赞 评论 复制链接分享
  • weixin_39603598 weixin_39603598 4月前

    Same problem here

    点赞 评论 复制链接分享
  • weixin_39763683 weixin_39763683 4月前

    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.

    点赞 评论 复制链接分享
  • weixin_39898550 weixin_39898550 4月前

    Same problem here and I tried with 0.10.1 as , it works but I had bug #286 with that version. So this solution fixes android crash but audio is affected. I would prefer a new release fixing these issues together

    点赞 评论 复制链接分享
  • weixin_39605647 weixin_39605647 4月前

    This one seems to be fixed for us with 0.11.1 release.

    点赞 评论 复制链接分享
  • weixin_39636102 weixin_39636102 4月前

    Facing the same issue, crash while unmounting the OTSession? Any solution yet ?

    点赞 评论 复制链接分享
  • weixin_39636102 weixin_39636102 4月前

    Already tried "0.11.1" but still crashing on unmounting.

    点赞 评论 复制链接分享
  • weixin_39594191 weixin_39594191 4月前

    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.

    点赞 评论 复制链接分享
  • weixin_39594191 weixin_39594191 4月前

    Look: https://github.com/opentok/opentok-react-native/issues/304#issuecomment-505342760

    点赞 评论 复制链接分享
  • weixin_39763683 weixin_39763683 4月前

    As I understand, this can't be fixed until the native Android SDK is patched yes? Is there any info on when that's coming?

    点赞 评论 复制链接分享
  • weixin_39594191 weixin_39594191 4月前

    I hope to have it fixed in the next few weeks

    点赞 评论 复制链接分享
  • weixin_39972567 weixin_39972567 4月前

    It works fine if I set the OpenTok Android SDK version to 2.15.3 in build.gradle instead of 2.16.1. So you should probably update it to that one. 2.16.1 hangs in 100% cases if i try to disconnect after somebody was subscribed to the stream

    点赞 评论 复制链接分享
  • weixin_39940714 weixin_39940714 4月前

    Is there a way that I can overwrite the opentok-react-native build.gradle to ensure my project is using 2.15.3 instead of 2.16.1? Currently I have to modify it in their build.gradle and then remember to confirm that it hasn't been reverted before building.

    点赞 评论 复制链接分享
  • weixin_39940714 weixin_39940714 4月前

    I think I may have figured this out. I've added the following to my app-level build.gradle, directly above the dependencies block:

    
    configurations.all {
        resolutionStrategy {
            force 'com.opentok.android:opentok-android-sdk:2.15.3'
        }
    }
    

    The output of ./gradlew app:androidDependencies contains a line that says the following, so it looks like I'm good.

    
    +--- com.opentok.android:opentok-android-sdk:2.15.3
    
    点赞 评论 复制链接分享
  • weixin_39972567 weixin_39972567 4月前

    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

    点赞 评论 复制链接分享
  • weixin_39744606 weixin_39744606 4月前

    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.

    点赞 评论 复制链接分享
  • weixin_39605647 weixin_39605647 4月前

    Hi ! Any updates on the native SDK release date for Android yet? Thanks!

    点赞 评论 复制链接分享
  • weixin_40003478 weixin_40003478 4月前

    Echoing question - what is the progress on this?

    I have found this crash occurs consistently when between 2 Android devices and 50% of the time when publishing from iOS and subscribing on Android. This is with the most current version opentok-react-native 0.12.0 and the Opentok 2.16.1 as well as opentok-react-native 0.11.3 and the Opentok 2.16.0.

    I've extended the sample code which when run on two different devices will reproduce the issue: https://github.com/BenAllenUK/opentok-react-native-samples/tree/crash

    This was tested on the Pixel 3a & 3, OnePlus 5, Huawei v8 and Samsung Galaxy J6. On Android 8 & 9.

    I've submitted a ticket for this which includes session ID and other information etc.

    Downgrading the Android SDK is not an option for us as we also require solutions to other bugs in those previous versions.

    I'm not sure why this issue is closed as it still exists and it makes it harder for others to find.

    点赞 评论 复制链接分享
  • weixin_39744606 weixin_39744606 4月前

    Hi , sorry for the late response. The new version of Android SDK is going to be released soon, we're close. I'll keep you posted.

    点赞 评论 复制链接分享

相关推荐