I'm working with this library (tess_two) for a few weeks and everything was good. But today Tesseract starts crashes with this error A/libc: Fatal signal 6 (SIGABRT), code -6 in tid 31890 (Thread-13571). Nothing have changed from yesterday, same phone, same code. Crashes on method getUTF8Text()
Last logs:
10-31 11:31:05.879 31029-31890/ru.ckdigital.priceconverter E/OcrRecognizeAsyncTask: thresholding completed. converting to bmp. size:432x256
10-31 11:31:05.884 31029-31890/ru.ckdigital.priceconverter I/Leptonica(native): Writing 32bpp RGBA bitmap (w=432, h=256, stride=1728) from 1bpp Pix (wpl=14)
10-31 11:31:06.375 31029-31890/ru.ckdigital.priceconverter A/libc: Fatal signal 6 (SIGABRT), code -6 in tid 31890 (Thread-13571)
backtrace from tombstone file:
backtrace:
#00 pc 0001764c /system/lib/libc.so (syscall+28)
#01 pc 0003fc6b /system/lib/libc.so (_ZL33__pthread_cond_timedwait_relativeP23pthread_cond_internal_tP15pthread_mutex_tPK8timespec+56)
#02 pc 0001f0b7 /system/lib/libhwui.so
#03 pc 00010139 /system/lib/libutils.so (_ZN7android6Thread11_threadLoopEPv+112)
#04 pc 0005e2fb /system/lib/libandroid_runtime.so (_ZN7android14AndroidRuntime15javaThreadShellEPv+70)
#05 pc 0003fe4b /system/lib/libc.so (_ZL15__pthread_startPv+30)
#06 pc 00019c85 /system/lib/libc.so (__start_thread+6)
Build fingerprint: GiONEE/F103/GiONEE_GBL7319:5.0/LRX21M/1433132360:user/release-keys
pid: 28431, tid: 28459 >>> com.lily.web <<<
signal 11 (SIGSEGV), code 2 (SEGV_ACCERR), fault addr d3b0f000
#00 pc 0x0 /data/data/***/jars_fusion.dex (???)
#01 pc 0xa1eb7 /system/lib/libart.so (???)
#02 pc 0xb1cc8 [heap] (???)
java.lang.Throwable:
******* Java stack for JNI crash *******
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.lily.web.DexLoader.invokeStaticMethod(SourceFile:70)
at com.lily.web.t.<init>(SourceFile:77)
at com.lily.web.d.o(SourceFile:250)
at com.lily.web.e$2.run(SourceFile:1090)
And the related code is as following:
public Object invokeStaticMethod(String className, String methodName, Class<?>[] parameterTypes, Object... args)
{
try {
Method method = mClassLoader.loadClass(className).getMethod(methodName, parameterTypes);
method.setAccessible(true);
return method.**invoke**(null, args);
} catch {...}
}
Another stack trace:
Build fingerprint: htc/htccn_chs_cu/htc_a5dug:5.0.2/LRX22G/510432.3:user/release-keys
pid: 11542, tid: 11613 >>> com.lily.web:tools <<<
signal 11 (SIGSEGV), code 2 (SEGV_ACCERR), fault addr 90876000
#00 pc 0x0 /data/data/com.lily.web/jars_dex.dex (???)
#01 pc 0xa0a47 /system/lib/libart.so (???)
#02 pc 0xf4f49 /data/dalvik-cache/arm/system#framework#boot.oat (oatexec+1003337)
java.lang.Throwable:
******* Java stack for JNI crash *******
at java.lang.reflect.Method.**invoke**(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
As you can see, jars_fusion.dex is a big dex file of our app on Android platform. And there is a JNI crash while invoking a method in that dex, although the method is found successfully in the dex. Moreover, this issue can not be reproduced by my device or our testers, but is reported from crash auto collector system.
So what it can be the real cause of the issue, or it is just a system fault?
my android crashes sometimes for some of the users which i am able to see google developer console.
Below is the crash log for the entire crash which i extracted out of google break pad. The crash clearly says that in the following function
js_cocos2dx_TextFieldTTF_textFieldWithPlaceHolder
but i am not able to uderstand as to why this is happening. I am currently using cocos2dx-js v 3.5.
Any help or idea as to why this crash happens would be highly useful.
Build fingerprint: 'motorola/falcon_bwaca/falcon_umts:4.4.4/KXB21.14-L1.50-1/1:user/release-keys'
pid: 30910, tid: 31705, name: Thread-6337 >>> in..test <<<
signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
Stack frame #00 pc 00022160 /system/lib/libc.so (tgkill+12)
Stack frame #01 pc 000131b1 /system/lib/libc.so (pthread_kill+48)
Stack frame #02 pc 000133c5 /system/lib/libc.so (raise+10)
Stack frame #03 pc 000120fb /system/lib/libc.so
Stack frame #04 pc 00021a14 /system/lib/libc.so (abort+4)
Stack frame #05 pc 00c41251 libcocos2djs.so (__gnu_cxx::__verbose_terminate_handler()+228): Routine js_cocos2dx_TextFieldTTF_textFieldWithPlaceHolder(JSContext*, unsigned int, JS::Value*) at jsb_cocos2dx_auto.cpp:60716
I am using cocos2dx-3.3 with ndk-r10d on eclipse and my testing device is samsung galaxy S3.
There is a object of Class derived from CClayer added to the CCScene object. The game is crashing when a new layer is added and old layer is removing from the scene. The layer has TMXLayer object as child on which other Node objects are added like TTFLabel, Node etc.
The error in eclipse logs is as below:
11-20 14:25:56.964: A/libc(23300): ### ABORTING: invalid address or address of corrupt block 0x6fa7dce8 passed to dlfree
11-20 14:25:56.964: A/libc(23300): Fatal signal 11 (SIGSEGV) at 0xdeadbaad (code=1), thread 23319 (Thread-5050)
The probable error is when some node is clearing its children vector and the vector is releasing its elements.
The ndk crash dump shows this:
********** Crash dump: **********
Build fingerprint: 'samsung/m0xx/m0:4.3/JSS15J/I9300XXUGND3:user/release-keys'
pid: 6306, tid: 6344, name: Thread-553 >>> com.playbuff.BOWFinal <<<
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr deadbaad
Stack frame #00 pc 0001e824 /system/lib/libc.so
Stack frame #01 pc 0001c76c /system/lib/libc.so (abort+4)
Stack frame #02 pc 000122ed /system/lib/libc.so
Stack frame #03 pc 00010f9d /system/lib/libc.so (dlfree+1184)
Stack frame #04 pc 0000dabf /system/lib/libc.so (free+10)
Stack frame #05 pc 00782c4b /data/app-lib/com.playbuff.BOWFinal-1/libcocos2dcpp.so (operator delete(void*)+8): Routine operator delete(void*) at /tmp/ndk-user/tmp/build-libc++/ndk/sources/cxx-stl/llvm-libc++/../llvm-libc++abi/libcxxabi/src/cxa_new_delete.cpp:144
Stack frame #06 pc 00456e47 /data/app-lib/com.playbuff.BOWFinal-1/libcocos2dcpp.so (cocos2d::Sprite::~Sprite()+10): Routine cocos2d::Sprite::~Sprite() at /Users/PB037/Desktop/DKT/BOW-3.3-May11/BOWFinal/proj.android/jni/../../cocos2d/cocos/./2d/CCSprite.cpp:296 (discriminator 2)
Stack frame #07 pc 00478997 /data/app-lib/com.playbuff.BOWFinal-1/libcocos2dcpp.so (cocos2d::Ref::release()+30): Routine cocos2d::Ref::release() at /Users/PB037/Desktop/DKT/BOW-3.3-May11/BOWFinal/proj.android/jni/../../cocos2d/cocos/./base/CCRef.cpp:146 (discriminator 1)
Stack frame #08 pc 00316cbd /data/app-lib/com.playbuff.BOWFinal-1/libcocos2dcpp.so (cocos2d::Vector<cocos2d::Node*>::clear()+14): Routine cocos2d::Vector<cocos2d::Node*>::clear() at /Users/PB037/Desktop/DKT/BOW-3.3-May11/BOWFinal/proj.android/jni/../../cocos2d/cocos/./base/CCVector.h:396 (discriminator 1)
Stack frame #09 pc 0044abfd /data/app-lib/com.playbuff.BOWFinal-1/libcocos2dcpp.so (cocos2d::Node::~Node()+244): Routine _ZN7cocos2d6VectorIPNS_4NodeEED4Ev at /Users/PB037/Desktop/DKT/BOW-3.3-May11/BOWFinal/proj.android/jni/../../cocos2d/cocos/./base/CCVector.h:88
Stack frame #10 pc 004585c5 /data/app-lib/com.playbuff.BOWFinal-1/libcocos2dcpp.so (cocos2d::SpriteBatchNode::~SpriteBatchNode()+84): Routine cocos2d::SpriteBatchNode::~SpriteBatchNode() at /Users/PB037/Desktop/DKT/BOW-3.3-May11/BOWFinal/proj.android/jni/../../cocos2d/cocos/./2d/CCSpriteBatchNode.cpp:119 (discriminator 3)
Stack frame #11 pc 004585e9 /data/app-lib/com.playbuff.BOWFinal-1/libcocos2dcpp.so (cocos2d::SpriteBatchNode::~SpriteBatchNode()+4): Routine cocos2d::SpriteBatchNode::~SpriteBatchNode() at /Users/PB037/Desktop/DKT/BOW-3.3-May11/BOWFinal/proj.android/jni/../../cocos2d/cocos/./2d/CCSpriteBatchNode.cpp:122
Stack frame #12 pc 00478997 /data/app-lib/com.playbuff.BOWFinal-1/libcocos2dcpp.so (cocos2d::Ref::release()+30): Routine cocos2d::Ref::release() at /Users/PB037/Desktop/DKT/BOW-3.3-May11/BOWFinal/proj.android/jni/../../cocos2d/cocos/./base/CCRef.cpp:146 (discriminator 1)
Stack frame #13 pc 00316cbd /data/app-lib/com.playbuff.BOWFinal-1/libcocos2dcpp.so (cocos2d::Vector<cocos2d::Node*>::clear()+14): Routine cocos2d::Vector<cocos2d::Node*>::clear() at /Users/PB037/Desktop/DKT/BOW-3.3-May11/BOWFinal/proj.android/jni/../../cocos2d/cocos/./base/CCVector.h:396 (discriminator 1)
Stack frame #14 pc 0044abfd /data/app-lib/com.playbuff.BOWFinal-1/libcocos2dcpp.so (cocos2d::Node::~Node()+244): Routine _ZN7cocos2d6VectorIPNS_4NodeEED4Ev at /Users/PB037/Desktop/DKT/BOW-3.3-May11/BOWFinal/proj.android/jni/../../cocos2d/cocos/./base/CCVector.h:88
Stack frame #15 pc 00456e17 /data/app-lib/com.playbuff.BOWFinal-1/libcocos2dcpp.so (cocos2d::Sprite::~Sprite()+170): Routine cocos2d::Sprite::~Sprite() at /Users/PB037/Desktop/DKT/BOW-3.3-May11/BOWFinal/proj.android/jni/../../cocos2d/cocos/./2d/CCSprite.cpp:286 (discriminator 7)
Stack frame #16 pc 00456e41 /data/app-lib/com.playbuff.BOWFinal-1/libcocos2dcpp.so (cocos2d::Sprite::~Sprite()+4): Routine cocos2d::Sprite::~Sprite() at /Users/PB037/Desktop/DKT/BOW-3.3-May11/BOWFinal/proj.android/jni/../../cocos2d/cocos/./2d/CCSprite.cpp:296
Stack frame #17 pc 00478997 /data/app-lib/com.playbuff.BOWFinal-1/libcocos2dcpp.so (cocos2d::Ref::release()+30): Routine cocos2d::Ref::release() at /Users/PB037/Desktop/DKT/BOW-3.3-May11/BOWFinal/proj.android/jni/../../cocos2d/cocos/./base/CCRef.cpp:146 (discriminator 1)
Stack frame #18 pc 00316cbd /data/app-lib/com.playbuff.BOWFinal-1/libcocos2dcpp.so (cocos2d::Vector<cocos2d::Node*>::clear()+14): Routine cocos2d::Vector<cocos2d::Node*>::clear() at /Users/PB037/Desktop/DKT/BOW-3.3-May11/BOWFinal/proj.android/jni/../../cocos2d/cocos/./base/CCVector.h:396 (discriminator 1)
Stack frame #19 pc 0044abfd /data/app-lib/com.playbuff.BOWFinal-1/libcocos2dcpp.so (cocos2d::Node::~Node()+244): Routine _ZN7cocos2d6VectorIPNS_4NodeEED4Ev at /Users/PB037/Desktop/DKT/BOW-3.3-May11/BOWFinal/proj.android/jni/../../cocos2d/cocos/./base/CCVector.h:88
Stack frame #20 pc 0045c197 /data/app-lib/com.playbuff.BOWFinal-1/libcocos2dcpp.so (cocos2d::TMXTiledMap::~TMXTiledMap()+130): Routine cocos2d::TMXTiledMap::~TMXTiledMap() at /Users/PB037/Desktop/DKT/BOW-3.3-May11/BOWFinal/proj.android/jni/../../cocos2d/cocos/./2d/CCTMXTiledMap.cpp:97 (discriminator 3)
Stack frame #21 pc 00390303 /data/app-lib/com.playbuff.BOWFinal-1/libcocos2dcpp.so (TileMap::~TileMap()+26): Routine TileMap::~TileMap() at /Users/PB037/Desktop/DKT/BOW-3.3-May11/BOWFinal/proj.android/jni/../../Classes/model/TileMap.cpp:25 (discriminator 1)
Stack frame #22 pc 00390315 /data/app-lib/com.playbuff.BOWFinal-1/libcocos2dcpp.so (TileMap::~TileMap()+4): Routine TileMap::~TileMap() at /Users/PB037/Desktop/DKT/BOW-3.3-May11/BOWFinal/proj.android/jni/../../Classes/model/TileMap.cpp:30
Stack frame #23 pc 00478997 /data/app-lib/com.playbuff.BOWFinal-1/libcocos2dcpp.so (cocos2d::Ref::release()+30): Routine cocos2d::Ref::release() at /Users/PB037/Desktop/DKT/BOW-3.3-May11/BOWFinal/proj.android/jni/../../cocos2d/cocos/./base/CCRef.cpp:146 (discriminator 1)
The problem is this crash is not happening on IOS devices and I couldn't find the Node object which is causing this crash. Please tell me a method to find the defective Node. Thanks.
PS: I've tried with the ndk-r9d also.
I followed the pjsip 'get started' document and built the pjsip libs for android 9 successfully. But when I use it in my android project (though JNI calls), it usually crash when I register user to sip sever or make calls out.I create pjsua modules in the main thread with APIs such as pjsua_create and pjsua_init, then I call pjsua_acc_add or pjsua_call_make_call in another thread, it usually crash.However, the point it crashed on is quite random.Besides, some times it doesn't crash, but it failed on pjsip_resolve function.It make sip message destination IP and port information, something like '192.168.0.1:5060', to a string without IP information, something like ':5060'.And I have made pj thread check yet, so it doesn't crash for that.Anybody met this problem yet? I had searched out through google and trac.pjsip.org, but can't get any useful information.
Any help will be very appreciated!
********** Crash dump: **********
Build fingerprint: 'Xiaomi/aries/aries:4.1.1/JRO03L/JLB22.0:user/release-keys'
pid: 3927, tid: 4082, name: Thread-1052 >>> com.ailiao.vp <<<
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 00000017
Stack frame #00 pc 0013c124 /data/data/com.ailiao.vp/lib/libsua.so: Routine ioqueue_on_accept_complete in ../src/pj/activesock.c:916
Stack frame #01 pc 0013c3e4 /data/data/com.ailiao.vp/lib/libsua.so (pj_hash_get_lower+76): Routine pj_array_erase in ../src/pj/array.c:46
Crash dump is completed
********** Crash dump: **********
Build fingerprint: 'Xiaomi/aries/aries:4.1.1/JRO03L/JLB22.0:user/release-keys'
pid: 4387, tid: 4415, name: Thread-1051 >>> com.ailiao.vp <<<
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 00000f09
Stack frame #00 pc 0013c124/data/data/com.ailiao.vp/lib/libsua.so: Routine ioqueue_on_accept_complete in ../src/pj/activesock.c:916
Stack frame #01 pc 0013c3e4 /data/data/com.ailiao.vp/lib/libsua.so (pj_hash_get_lower+76): Routine pj_array_erase in ../src/pj/array.c:46
Crash dump is completed
********** Crash dump: **********
Build fingerprint: 'Xiaomi/aries/aries:4.1.1/JRO03L/JLB22.0:user/release-keys'
pid: 4532, tid: 4613, name: Thread-1060 >>> com.ailiao.vp <<<
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 00000038
Stack frame #00 pc 0013c124 /data/data/com.ailiao.vp/lib/libsua.so: Routine ioqueue_on_accept_complete in ../src/pj/activesock.c:916
Stack frame #01 pc 0013c468 /data/data/com.ailiao.vp/lib/libsua.so: Routine pj_array_find in ../src/pj/array.c:60
Crash dump is completed
********** Crash dump: **********
Build fingerprint: 'Xiaomi/aries/aries:4.1.1/JRO03L/JLB22.0:user/release-keys'
pid: 6317, tid: 6572, name: Thread-1115 >>> com.ailiao.vp <<<
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr e92d4808
Stack frame #00 pc 0013f484 /data/data/com.ailiao.vp/lib/libsua.so: Routine pj_list_insert_nodes_before in ../include/pj/list_i.h:54
Stack frame #01 pc 0013f744 /data/data/com.ailiao.vp/lib/libsua.so (pj_hash_get_lower+76): Routine pj_list_init in ../include/pj/list.h:90
Stack frame #02 pc 0008e80c /data/data/com.ailiao.vp/lib/libsua.so (pjsip_ua_register_dlg+360): Routine pjsip_ua_destroy in ../src/pjsip/sip_ua_layer.c:230
Stack frame #03 pc 0008934c /data/data/com.ailiao.vp/lib/libsua.so (pjsip_dlg_create_uac+1880): Routine pjsip_dlg_create_uac in ../src/pjsip/sip_dialog.c:240
Stack frame #04 pc 00032f50 /data/data/com.ailiao.vp/lib/libsua.so (pjsua_call_make_call+1152): Routine on_make_call_med_tp_complete in ../src/pjsua-lib/pjsua_call.c:459
Stack frame #05 pc 00026038 /data/data/com.ailiao.vp/lib/libsua.so (Java_sua_Pjsua_makeCall+728): Routine Java_sua_Pjsua_InnerInit in jni/../src/pjsuawrapper.cc:767
Stack frame #06 pc 0001fb70 /system/lib/libdvm.so (dvmPlatformInvoke+112)
Stack frame #07 pc 0004e8b9 /system/lib/libdvm.so (dvmCallJNIMethod(unsigned int const*, JValue*, Method const*, Thread*)+360)
Stack frame #08 pc 00050603 /system/lib/libdvm.so (dvmResolveNativeMethod(unsigned int const*, JValue*, Method const*, Thread*)+174)
Stack frame #09 pc 00029020 /system/lib/libdvm.so
Stack frame #10 pc 0002d7e8 /system/lib/libdvm.so (dvmInterpret(Thread*, Method const*, JValue*)+180)
Stack frame #11 pc 0005fed5 /system/lib/libdvm.so (dvmCallMethodV(Thread*, Method const*, Object*, bool, JValue*, std::__va_list)+272)
Stack frame #12 pc 0005feff /system/lib/libdvm.so (dvmCallMethod(Thread*, Method const*, Object*, JValue*, ...)+20)
Stack frame #13 pc 00055327 /system/lib/libdvm.so
Stack frame #14 pc 00012e70 /system/lib/libc.so (__thread_entry+48)
Stack frame #15 pc 000125c8 /system/lib/libc.so (pthread_create+172)
Stack frame #16 pc ffffffff <unknown>: Unable to open symbol file obj\local\armeabi-v7a/<unknown>. Error (123): Unknown error
Crash dump is completed
********** Crash dump: **********
Build fingerprint: 'Xiaomi/aries/aries:4.1.1/JRO03L/JLB22.0:user/release-keys'
pid: 7766, tid: 8023, name: Thread-1123 >>> com.ailiao.vp <<<
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 20e7a813
Stack frame #00 pc 00014682 /system/lib/libc.so (dlmalloc+1589)
Stack frame #01 pc 00016fef /system/lib/libc.so (malloc+10)
Stack frame #02 pc 0014a728 /data/data/com.ailiao.vp/lib/libsua.so: Routine default_block_alloc in ../src/pj/pool_policy_malloc.c:46
Build with NDK_DEBUG=1 and you will get a more verbose stack trace. For me, the crash is coming from:
: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
I: Build fingerprint: 'asus/WW_Z00T/ASUS_Z00T:5.0.2/LRX22G/WW_user_1.17.40.1234_20160304:user/release-keys'
I: Revision: '0'
I: ABI: 'arm64'
I: pid: 5618, tid: 5924, name: OutgoingCall-si >>> com.siptest.android <<<
I: signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
I: Abort message: '../src/pjsip/sip_ua_layer.c:290: pjsip_ua_register_dlg: assertion "dlg->local.info && dlg->local.info->tag.slen && dlg->local.tag_hval != 0" failed'
I: x0 0000000000000000 x1 0000000000001724 x2 0000000000000006 x3 000000558de365b0
I: x4 000000558de365b0 x5 0000000000000005 x6 0000000000000001 x7 0000000000000020
I: x8 0000000000000083 x9 fefefefeff63646b x10 7f7f7f7f7f7f7f7f x11 0000000000000001
I: x12 0000000000000001 x13 0000000000000000 x14 0000000000000000 x15 002dee82e7a00ada
I: x16 0000007f7d43e483 x17 0000000000000001 x18 0000000000000000 x19 000000558de365b0
I: x20 0000007f7d43fbb0 x21 0000007fa017a000 x22 0000000000000058 x23 0000000000000006
I: x24 00000000130e4360 x25 00000000130785a0 x26 000000558dd88930 x27 00000000130e4a20
I: x28 00000000130785a0 x29 0000007f7d43e720 x30 0000007fa00f48bc
I: sp 0000007f7d43e720 pc 0000007fa0139de8 pstate 0000000060000000
I: #00 pc 000000000005ede8 /system/lib64/libc.so (tgkill+8)
I: #01 pc 00000000000198b8 /system/lib64/libc.so (pthread_kill+160)
I: #02 pc 000000000001ae18 /system/lib64/libc.so (raise+28)
I: #03 pc 000000000001467c /system/lib64/libc.so (abort+60)
I: #04 pc 0000000000016ca8 /system/lib64/libc.so (__libc_fatal+128)
I: #05 pc 0000000000014754 /system/lib64/libc.so (__assert2+40)
I: #06 pc 00000000001d5ddc /data/app/com.siptest.android-2/lib/arm64/libpjsua2.so (pjsip_ua_register_dlg+248)
I: #07 pc 00000000001d1588 /data/app/com.siptest.android-2/lib/arm64/libpjsua2.so (pjsip_dlg_create_uac+1688)
I: #08 pc 00000000001634a8 /data/app/com.siptest.android-2/lib/arm64/libpjsua2.so (pjsua_call_make_call+1088)
I: #09 pc 0000000000145ce0 /data/app/com.siptest.android-2/lib/arm64/libpjsua2.so (pj::Call::makeCall(std::string const&, pj::CallOpParam const&)+168)
I: #10 pc 00000000000fd1f8 /data/app/com.siptest.android-2/lib/arm64/libpjsua2.so (Java_org_pjsip_pjsua2_pjsua2JNI_Call_1makeCall+256)
I: #11 pc 000000000075b9d4 /data/dalvik-cache/arm64/data#app#com.siptest.android-2#base.apk#classes.dex
W: RecordThread: buffer overflow
Which seems to indicate a problem with the registration credentials. I dug into the C source, and discovered one of the following fields is NULL sip_dialog.c:
/*
* Create an UAC dialog.
*/
PJ_DEF(pj_status_t) pjsip_dlg_create_uac( pjsip_user_agent *ua,
const pj_str_t *local_uri,
const pj_str_t *local_contact,
const pj_str_t *remote_uri,
const pj_str_t *target,
pjsip_dialog **p_dlg)
{
pj_status_t status;
pj_str_t tmp;
pjsip_dialog *dlg;
/* Check arguments. */
PJ_ASSERT_RETURN(ua && local_uri && remote_uri && p_dlg, PJ_EINVAL);
I've also read other users complain that multi-threading on Android has issues. Be sure you attach the JVM before making pjsip library calls. Maybe try:
ua_cfg.setThreadCnt(1);
ua_cfg.setMainThreadOnly(true);
And then you will have to pass that thread any action. Alternatively, you can enable multiple threads and then attach like this:
static boolean attachJVM()
{
// ensure after possibly sleeping on take()
final Endpoint ep = endpoint();
try { if (!ep.libIsThreadRegistered()) ep.libRegisterThread(Thread.currentThread().getName()); return true; }
catch (Exception e) { log().e(e); return false; }
}
I realize I'm making calls to my own utilities there, but I think it's pretty self-descriptive (i.e. log() is a log file and endpoint() returns the instance of Endpoing you built at init).
I had some issues with this library for a long time - it crashes.
After some investigations on nicely caught error log I have found a common reason for most of the library crashes.
See my answer and comments here (not sure if copy-paste is allowed here):
https://stackoverflow.com/a/46111654/6248423