Android ART loading dex failure - android

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?

Related

Native crash reports contains offsetted addresses

I have integrated Huawei Crash Service as per documentation, and I am able to see NDK crashes in web console. However, the addresses in reports are offsetted by 4, so when I want to symbolicate crash, I get wrong result.
For example, in logcat I can see
2020-12-10 15:23:51.981 5914-5914/? D/formatEventInfo: statck
#00 pc 00c57c10 /data/app/package-name-w5yGIc9ek_yTyk1ARvNP-w==/lib/arm64/libName.so(std::set_unexpected(void (*)())) [arm64-v8a::]
#01 pc 00c57d88 /data/app/package-name-w5yGIc9ek_yTyk1ARvNP-w==/lib/arm64/libName.so(unknow) [arm64-v8a::]
#02 pc 00c54b54 /data/app/package-name-w5yGIc9ek_yTyk1ARvNP-w==/lib/arm64/libName.so(unknow) [arm64-v8a::]
#03 pc 00c5425c /data/app/package-name-w5yGIc9ek_yTyk1ARvNP-w==/lib/arm64/libName.so(__cxa_get_exception_ptr) [arm64-v8a::]
#04 pc 00c541dc /data/app/package-name-w5yGIc9ek_yTyk1ARvNP-w==/lib/arm64/libName.so(unknow) [arm64-v8a::]
and that addresses appear in web console, while valid logcat crash stack trace is
--------- beginning of crash
2020-12-10 15:23:52.067 6246-6246/? I/crash_dump64: obtaining output fd from tombstoned, type: kDebuggerdTombstone
2020-12-10 15:23:52.068 871-871/? I//system/bin/tombstoned: received crash request for pid 5914
2020-12-10 15:23:52.069 6246-6246/? I/crash_dump64: performing dump of process 5914 (target tid = 5914)
2020-12-10 15:23:52.099 6246-6246/? A/DEBUG: pid: 5914, tid: 5914, name: o.a.b >>> package-name <<<
2020-12-10 15:23:52.104 6246-6246/? A/DEBUG: #01 pc 0000000000c57c0c /data/app/package-name-w5yGIc9ek_yTyk1ARvNP-w==/lib/arm64/libName.so
2020-12-10 15:23:52.104 6246-6246/? A/DEBUG: #02 pc 0000000000c57d84 /data/app/package-name-w5yGIc9ek_yTyk1ARvNP-w==/lib/arm64/libName.so
2020-12-10 15:23:52.104 6246-6246/? A/DEBUG: #03 pc 0000000000c54b50 /data/app/package-name-w5yGIc9ek_yTyk1ARvNP-w==/lib/arm64/libName.so
2020-12-10 15:23:52.104 6246-6246/? A/DEBUG: #04 pc 0000000000c54258 /data/app/package-name-w5yGIc9ek_yTyk1ARvNP-w==/lib/arm64/libName.so
2020-12-10 15:23:52.104 6246-6246/? A/DEBUG: #05 pc 0000000000c541d8 /data/app/package-name-w5yGIc9ek_yTyk1ARvNP-w==/lib/arm64/libName.so (__cxa_throw+120)
Any ideas?
The Crash Report you got is correct. Line numbers (00c57c10, 00c57c0c, etc) do not need to be exactly matched. Because an address segment is a range, for example, your 00c57c10 and the c57c0c are may in the same address of your file. If you upload the native symbol file, you may get a readable crash report.
Here you can see an example: Obtaining an NDK Crash Report
It seems you lost your uuid because of some mistakes of your files: [arm64-v8a::];[arm64-v8a::]... They should be with uuid.
Documentation of the AppGallery Connect Crash service

How to find which method caused crash from NDK stack trace

My app crashes due to .so file.
I followed this link https://developer.android.com/ndk/guides/ndk-stack.html
Using the above link i am able to take stack-trace dump from log cat.
And from stack trace it shows me all functions name using ndk-stack tool.But i am unable to find out which method exactly caused my app to crash??
This is the log from my app stating fatal signal.
id: 26940, tid: 27543, name: Thread-579 >>> com.nexge.nexgeotpdialer <<<
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x34
Its stating fault address 0x34.but using ndk-stack tool it shows all threads with function names but which one caused crash??
********** Crash dump: **********
Build fingerprint: 'Xiaomi/land/land:6.0.1/MMB29M/V8.5.4.0.MALMIED:user/release-keys'
pid: 26940, tid: 27543, name: Thread-579 >>> com.nexge.nexgeotpdialer <<<
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x34
Stack frame #00 pc 00155638 /data/app/com.nexge.nexgeotpdialer-1/lib/arm/libpjsua2.so (pj_thread_destroy+3): Routine pj_thread_create at /home/protocol/Jeeva/PJSIPWorks/AESEncryption/pjlib/build/../src/pj/os_core_unix.c:570 (discriminator 5)
Stack frame #01 pc 0011973f /data/app/com.nexge.nexgeotpdialer-1/lib/arm/libpjsua2.so (start_signal+238): Routine check_rx_late_pkt at /home/protocol/Jeeva/PJSIPWorks/AESEncryption/pjmedia/build/../src/pjmedia/compressed_rtp.c:667 (discriminator 2)
Stack frame #02 pc 00155471 /data/app/com.nexge.nexgeotpdialer-1/lib/arm/libpjsua2.so (thread_main+40): Routine pj_init at /home/protocol/Jeeva/PJSIPWorks/AESEncryption/pjlib/build/../src/pj/os_core_unix.c:214 (discriminator 2)
Stack frame #03 pc 0004185b /system/lib/libc.so (_ZL15__pthread_startPv+30)
Stack frame #04 pc 000192a5 /system/lib/libc.so (__start_thread+6)
Crash dump is completed
********** Crash dump: **********
Build fingerprint: 'Xiaomi/land/land:6.0.1/MMB29M/V8.5.4.0.MALMIED:user/release-keys'
pid: 28169, tid: 28422, name: Thread-618 >>> com.nexge.nexgeotpdialer <<<
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x34
Stack frame #00 pc 00155638 /data/app/com.nexge.nexgeotpdialer-1/lib/arm/libpjsua2.so (pj_thread_destroy+3): Routine pj_thread_create at /home/protocol/Jeeva/PJSIPWorks/AESEncryption/pjlib/build/../src/pj/os_core_unix.c:570 (discriminator 5)
Stack frame #01 pc 0011973f /data/app/com.nexge.nexgeotpdialer-1/lib/arm/libpjsua2.so (start_signal+238): Routine check_rx_late_pkt at /home/protocol/Jeeva/PJSIPWorks/AESEncryption/pjmedia/build/../src/pjmedia/compressed_rtp.c:667 (discriminator 2)
Stack frame #02 pc 00155471 /data/app/com.nexge.nexgeotpdialer-1/lib/arm/libpjsua2.so (thread_main+40): Routine pj_init at /home/protocol/Jeeva/PJSIPWorks/AESEncryption/pjlib/build/../src/pj/os_core_unix.c:214 (discriminator 2)
Stack frame #03 pc 0004185b /system/lib/libc.so (_ZL15__pthread_startPv+30)
Stack frame #04 pc 000192a5 /system/lib/libc.so (__start_thread+6)
Crash dump is completed
********** Crash dump: **********
Build fingerprint: 'Xiaomi/land/land:6.0.1/MMB29M/V8.5.4.0.MALMIED:user/release-keys'
pid: 29519, tid: 30349, name: Thread-620 >>> com.nexge.nexgeotpdialer <<<
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x34
Stack frame #00 pc 00155660 /data/app/com.nexge.nexgeotpdialer-2/lib/arm/libpjsua2.so (pj_thread_destroy+3): Routine pj_enter_critical_section at /home/protocol/Jeeva/PJSIPWorks/AESEncryption/pjlib/build/../src/pj/os_core_unix.c:1094
Stack frame #01 pc 00119763 /data/app/com.nexge.nexgeotpdialer-2/lib/arm/libpjsua2.so (start_signal+238): Routine check_rx_late_pkt at /home/protocol/Jeeva/PJSIPWorks/AESEncryption/pjmedia/build/../src/pjmedia/compressed_rtp.c:672
Stack frame #02 pc 00155499 /data/app/com.nexge.nexgeotpdialer-2/lib/arm/libpjsua2.so (thread_main+40): Routine pj_init at /home/protocol/Jeeva/PJSIPWorks/AESEncryption/pjlib/build/../src/pj/os_core_unix.c:218
Stack frame #03 pc 0004185b /system/lib/libc.so (_ZL15__pthread_startPv+30)
Stack frame #04 pc 000192a5 /system/lib/libc.so (__start_thread+6)
Crash dump is completed
********** Crash dump: **********
Build fingerprint: 'Xiaomi/land/land:6.0.1/MMB29M/V8.5.4.0.MALMIED:user/release-keys'
pid: 10036, tid: 10963, name: Thread-755 >>> com.nexge.nexgeotpdialer <<<
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x34
Stack frame #00 pc 00155660 /data/app/com.nexge.nexgeotpdialer-1/lib/arm/libpjsua2.so (pj_thread_destroy+3): Routine pj_enter_critical_section at /home/protocol/Jeeva/PJSIPWorks/AESEncryption/pjlib/build/../src/pj/os_core_unix.c:1094
Stack frame #01 pc 00119763 /data/app/com.nexge.nexgeotpdialer-1/lib/arm/libpjsua2.so (start_signal+238): Routine check_rx_late_pkt at /home/protocol/Jeeva/PJSIPWorks/AESEncryption/pjmedia/build/../src/pjmedia/compressed_rtp.c:672
Stack frame #02 pc 00155499 /data/app/com.nexge.nexgeotpdialer-1/lib/arm/libpjsua2.so (thread_main+40): Routine pj_init at /home/protocol/Jeeva/PJSIPWorks/AESEncryption/pjlib/build/../src/pj/os_core_unix.c:218
Stack frame #03 pc 0004185b /system/lib/libc.so (_ZL15__pthread_startPv+30)
Stack frame #04 pc 000192a5 /system/lib/libc.so (__start_thread+6)
Crash dump is completed
********** Crash dump: **********
Build fingerprint: 'Xiaomi/land/land:6.0.1/MMB29M/V8.5.4.0.MALMIED:user/release-keys'
pid: 11338, tid: 11813, name: Thread-751 >>> com.nexge.nexgeotpdialer <<<
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x34
Stack frame #00 pc 00155660 /data/app/com.nexge.nexgeotpdialer-2/lib/arm/libpjsua2.so (pj_thread_destroy+3): Routine pj_enter_critical_section at /home/protocol/Jeeva/PJSIPWorks/AESEncryption/pjlib/build/../src/pj/os_core_unix.c:1094
Stack frame #01 pc 00119763 /data/app/com.nexge.nexgeotpdialer-2/lib/arm/libpjsua2.so (start_signal+238): Routine check_rx_late_pkt at /home/protocol/Jeeva/PJSIPWorks/AESEncryption/pjmedia/build/../src/pjmedia/compressed_rtp.c:672
Stack frame #02 pc 00155499 /data/app/com.nexge.nexgeotpdialer-2/lib/arm/libpjsua2.so (thread_main+40): Routine pj_init at /home/protocol/Jeeva/PJSIPWorks/AESEncryption/pjlib/build/../src/pj/os_core_unix.c:218
Stack frame #03 pc 0004185b /system/lib/libc.so (_ZL15__pthread_startPv+30)
Stack frame #04 pc 000192a5 /system/lib/libc.so (__start_thread+6)
Crash dump is completed
********** Crash dump: **********
Build fingerprint: 'Xiaomi/land/land:6.0.1/MMB29M/V8.5.4.0.MALMIED:user/release-keys'
pid: 12197, tid: 12384, name: Thread-801 >>> com.nexge.nexgeotpdialer <<<
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x34
Stack frame #00 pc 00155660 /data/app/com.nexge.nexgeotpdialer-2/lib/arm/libpjsua2.so (pj_thread_destroy+3): Routine pj_enter_critical_section at /home/protocol/Jeeva/PJSIPWorks/AESEncryption/pjlib/build/../src/pj/os_core_unix.c:1094
Stack frame #01 pc 00119763 /data/app/com.nexge.nexgeotpdialer-2/lib/arm/libpjsua2.so (start_signal+238): Routine check_rx_late_pkt at /home/protocol/Jeeva/PJSIPWorks/AESEncryption/pjmedia/build/../src/pjmedia/compressed_rtp.c:672
Stack frame #02 pc 00155499 /data/app/com.nexge.nexgeotpdialer-2/lib/arm/libpjsua2.so (thread_main+40): Routine pj_init at /home/protocol/Jeeva/PJSIPWorks/AESEncryption/pjlib/build/../src/pj/os_core_unix.c:218
Stack frame #03 pc 0004185b /system/lib/libc.so (_ZL15__pthread_startPv+30)
Stack frame #04 pc 000192a5 /system/lib/libc.so (__start_thread+6)
Crash dump is completed
********** Crash dump: **********
Build fingerprint: 'Xiaomi/land/land:6.0.1/MMB29M/V8.5.4.0.MALMIED:user/release-keys'
pid: 14140, tid: 14798, name: Thread-808 >>> com.nexge.nexgeotpdialer <<<
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x34
Stack frame #00 pc 00155660 /data/app/com.nexge.nexgeotpdialer-1/lib/arm/libpjsua2.so (pj_thread_destroy+3): Routine pj_enter_critical_section at /home/protocol/Jeeva/PJSIPWorks/AESEncryption/pjlib/build/../src/pj/os_core_unix.c:1094
Stack frame #01 pc 00119763 /data/app/com.nexge.nexgeotpdialer-1/lib/arm/libpjsua2.so (start_signal+238): Routine check_rx_late_pkt at /home/protocol/Jeeva/PJSIPWorks/AESEncryption/pjmedia/build/../src/pjmedia/compressed_rtp.c:672
Stack frame #02 pc 00155499 /data/app/com.nexge.nexgeotpdialer-1/lib/arm/libpjsua2.so (thread_main+40): Routine pj_init at /home/protocol/Jeeva/PJSIPWorks/AESEncryption/pjlib/build/../src/pj/os_core_unix.c:218
Stack frame #03 pc 0004185b /system/lib/libc.so (_ZL15__pthread_startPv+30)
Stack frame #04 pc 000192a5 /system/lib/libc.so (__start_thread+6)
Crash dump is completed
********** Crash dump: **********
Build fingerprint: 'Xiaomi/land/land:6.0.1/MMB29M/V8.5.4.0.MALMIED:user/release-keys'
pid: 15644, tid: 16119, name: Thread-839 >>> com.nexge.nexgeotpdialer <<<
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x34
Stack frame #00 pc 00155660 /data/app/com.nexge.nexgeotpdialer-1/lib/arm/libpjsua2.so (pj_thread_destroy+3): Routine pj_enter_critical_section at /home/protocol/Jeeva/PJSIPWorks/AESEncryption/pjlib/build/../src/pj/os_core_unix.c:1094
Stack frame #01 pc 00119763 /data/app/com.nexge.nexgeotpdialer-1/lib/arm/libpjsua2.so (start_signal+238): Routine check_rx_late_pkt at /home/protocol/Jeeva/PJSIPWorks/AESEncryption/pjmedia/build/../src/pjmedia/compressed_rtp.c:672
Stack frame #02 pc 00155499 /data/app/com.nexge.nexgeotpdialer-1/lib/arm/libpjsua2.so (thread_main+40): Routine pj_init at /home/protocol/Jeeva/PJSIPWorks/AESEncryption/pjlib/build/../src/pj/os_core_unix.c:218
Stack frame #03 pc 0004185b /system/lib/libc.so (_ZL15__pthread_startPv+30)
Stack frame #04 pc 000192a5 /system/lib/libc.so (__start_thread+6)
Crash dump is completed
I too was looking for ways to trace SIGSEGV faults. I decided to do my own trace.
https://github.com/claytonfan/trace
Intended usage:
#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
#include "trace.h
void sig_handler(int signo)
{
if( signo == SIGSEGV ) {
traceDump("Signal SIGSEGV");
}
// may handle other signo's
exit( signo );
}
int main(int argc, char **argv)
{
traceInit( "Prgram Test", &printf, 0 );
signal( SIGSEGV, sig_handler );
//
// and possibly other signals
//
// . . . main() logic . . .
return( 0 );
}
Hope that helps.

Android app crashing with Cocos2dx-js

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

Android Nexus 5.0 Crash Fatal signal 11 (SIGSEGV), code 1 0x999e000c

I get this error on the Lollipop 5.0 Nexus.
This is all i get
Fatal signal 11 (SIGSEGV), code 1 0x999e000c
I get this error when I am trying to record using AudioRecorder class of Android.
I used NDK Stack to dump the crash and I am getting the following logs.
********** Crash dump: **********
Build fingerprint: 'google/hammerhead/hammerhead:5.0/LRX21O/1570415:user/release-keys'
pid: 1752, tid: 2184, name: pool-15-thread- >>> de.shopnow <<<
signal 11 (SIGSEGV), code 2 (SEGV_ACCERR), fault addr 0x9b6d2000
Stack frame #00 pc 00012f1c /system/lib/libc.so (__memcpy_base+95)
Stack frame #01 pc 000569b3 /system/lib/libmedia.so (android::AudioRecord::read(void*, unsigned int)+82)
Stack frame #02 pc 00095dbb /system/lib/libandroid_runtime.so
Stack frame #03 pc 00270fd7 /data/dalvik-cache/arm/system#framework#boot.oat
Has anyone experienced this?
I have faced and fixed this issue. This might be happening because of Hardware Acceleration. Go through this link for more details: http://developer.android.com/guide/topics/graphics/hardware-accel.html

Pjsip crashed on android when calling it's functions in multi-threads

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

Categories

Resources