进行任何调用之前,必须先向PjSip线程注册外部线程 [英] You must register external thread with PjSip thread before making any call

查看:748
本文介绍了进行任何调用之前,必须先向PjSip线程注册外部线程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在浏览应用程序时,应用程序由于pjsip而崩溃,这意味着您必须向pjsip线程注册外部线程.我还用这样的主线程重新注册了pjsip

When navigating through app app got crashed due to pjsip and it's says you must register external thread with pjsip thread. I've also regsitered pjsip with the main thread like this

  try {
            mEndpoint.libRegisterThread(Thread.currentThread().getName());
            Log.d(TAG, "Registering with thread "+Thread.currentThread().getName());
        } catch (Exception e) {
            e.printStackTrace();
        }

此崩溃是如此随机发生的,并且不完全知道是什么原因导致的,并且当崩溃发生时,我也没有调用任何pjsip方法.那么这里出了什么问题?

This crashed happend so randomly and don't exactly know what causing this and I also not calling any pjsip method when that crashed happend. So what's going wrong here?

07-04 14:36:18.183 32089-32097/com.safarifone.waafi A/libc: ../src/pj/os_core_unix.c:692: pj_thread_this: assertion "!"Calling pjlib from unknown/external thread. You must " "register external threads with pj_thread_register() " "before calling any pjlib functions."" failed
    07-04 14:36:18.183 32089-32097/com.safarifone.waafi A/libc: Fatal signal 6 (SIGABRT), code -6 in tid 32097 (FinalizerDaemon)
    07-04 14:36:18.193 32089-32089/com.safarifone.waafi D/ContactListAdapter: user which is recently added and not sync...
    07-04 14:36:18.203 32089-32089/com.safarifone.waafi D/ContactListAdapter: user which is recently added and not sync...
    07-04 14:36:18.213 32089-32089/com.safarifone.waafi D/ContactListAdapter: user which is recently added and not sync...
    07-04 14:36:18.243 326-326/? A/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
    07-04 14:36:18.243 326-326/? A/DEBUG: Build fingerprint: 'samsung/grandpplteser/grandpplte:6.0.1/MMB29T/G532FXWU1APK6:user/release-keys'
    07-04 14:36:18.243 326-326/? A/DEBUG: Revision: '0'
    07-04 14:36:18.243 326-326/? A/DEBUG: ABI: 'arm'
    07-04 14:36:18.243 326-326/? A/DEBUG: pid: 32089, tid: 32097, name: FinalizerDaemon  >>> com.safarifone.waafi <<<
    07-04 14:36:18.243 326-326/? A/DEBUG: signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
    07-04 14:36:18.273 326-326/? A/DEBUG: Abort message: '../src/pj/os_core_unix.c:692: pj_thread_this: assertion "!"Calling pjlib from unknown/external thread. You must " "register external threads with pj_thread_register() " "before calling any pjlib functions."" failed'
    07-04 14:36:18.273 326-326/? A/DEBUG:     r0 00000000  r1 00007d61  r2 00000006  r3 b37c2978
    07-04 14:36:18.273 326-326/? A/DEBUG:     r4 b37c2980  r5 b37c2930  r6 0000000b  r7 0000010c
    07-04 14:36:18.273 326-326/? A/DEBUG:     r8 00000000  r9 b4424f00  sl b37c1b20  fp b37c1a64
    07-04 14:36:18.273 326-326/? A/DEBUG:     ip 00000006  sp b37c19d0  lr b6d4cdcd  pc b6d4f1bc  cpsr 400e0010
    07-04 14:36:18.293 326-326/? A/DEBUG: backtrace:
    07-04 14:36:18.293 326-326/? A/DEBUG:     #00 pc 000431bc  /system/lib/libc.so (tgkill+12)
    07-04 14:36:18.293 326-326/? A/DEBUG:     #01 pc 00040dc9  /system/lib/libc.so (pthread_kill+32)
    07-04 14:36:18.293 326-326/? A/DEBUG:     #02 pc 0001c7e7  /system/lib/libc.so (raise+10)
    07-04 14:36:18.293 326-326/? A/DEBUG:     #03 pc 00019a65  /system/lib/libc.so (__libc_android_abort+34)
    07-04 14:36:18.293 326-326/? A/DEBUG:     #04 pc 00017600  /system/lib/libc.so (abort+4)
    07-04 14:36:18.293 326-326/? A/DEBUG:     #05 pc 0001b3fb  /system/lib/libc.so (__libc_fatal+16)
    07-04 14:36:18.293 326-326/? A/DEBUG:     #06 pc 00019aed  /system/lib/libc.so (__assert2+20)
    07-04 14:36:18.293 326-326/? A/DEBUG:     #07 pc 0034be3c  /data/app/com.safarifone.waafi-2/lib/arm/libpjsua2.so (pj_thread_this+84)
    07-04 14:36:18.293 326-326/? A/DEBUG:     #08 pc 0034c9b8  /data/app/com.safarifone.waafi-2/lib/arm/libpjsua2.so (pj_mutex_lock+124)
    07-04 14:36:18.293 326-326/? A/DEBUG:     #09 pc 001931c0  /data/app/com.safarifone.waafi-2/lib/arm/libpjsua2.so (PJSUA_LOCK+32)
    07-04 14:36:18.293 326-326/? A/DEBUG:     #10 pc 00194e1c  /data/app/com.safarifone.waafi-2/lib/arm/libpjsua2.so (pjsua_acc_set_user_data+268)
    07-04 14:36:18.293 326-326/? A/DEBUG:     #11 pc 00156464  /data/app/com.safarifone.waafi-2/lib/arm/libpjsua2.so (_ZN2pj7AccountD2Ev+232)
    07-04 14:36:18.293 326-326/? A/DEBUG:     #12 pc 000d6584  /data/app/com.safarifone.waafi-2/lib/arm/libpjsua2.so (_ZN20SwigDirector_AccountD2Ev+116)
    07-04 14:36:18.293 326-326/? A/DEBUG:     #13 pc 000d65fc  /data/app/com.safarifone.waafi-2/lib/arm/libpjsua2.so (_ZN20SwigDirector_AccountD0Ev+20)
    07-04 14:36:18.293 326-326/? A/DEBUG:     #14 pc 00114764  /data/app/com.safarifone.waafi-2/lib/arm/libpjsua2.so (Java_org_pjsip_pjsua2_pjsua2JNI_delete_1Account+76)
    07-04 14:36:18.293 326-326/? A/DEBUG:     #15 pc 000ea539  /system/lib/libart.so (art_quick_generic_jni_trampoline+40)
    07-04 14:36:18.293 326-326/? A/DEBUG:     #16 pc 000e5e41  /system/lib/libart.so (art_quick_invoke_stub_internal+64)
    07-04 14:36:18.293 326-326/? A/DEBUG:     #17 pc 003e92d9  /system/lib/libart.so (art_quick_invoke_static_stub+172)
    07-04 14:36:18.293 326-326/? A/DEBUG:     #18 pc 00101c4c  [stack:32097]

推荐答案

GC似乎从您注册的线程之外的线程中收集了一个PjSip对象.

Looks like one of PjSip objects is getting collected by GC from the thread other than the one you've registered.

根据文档:

... application ‘’‘MUST immediately destroy PJSUA2 objects using object’s delete() 
method (in Java)’‘’, instead of relying on the GC to clean up the object

因此,您必须手动删除PjSip对象,例如:

So you MUST delete PjSip objects manually, for example:

account.delete();

中的GC链接官方文件

这篇关于进行任何调用之前,必须先向PjSip线程注册外部线程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆