Re: Crash in string_i.h:121: pj_strncpy on android armeabi but not x86

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 03/31/2016 03:45 PM, Roberto Fichera wrote:
On 03/23/2016 10:27 AM, Anton VG wrote:
Yes, forgot to mention, that is true for PJSIP TRUNK. 2.4.5 release works.

I'm also having the same issue.

... and here is the fix. str->slen isn't initialized because comes from a local variable, only the ->ptr is initialized correctly.

diff --git a/pjlib/src/pj/guid_android.c b/pjlib/src/pj/guid_android.c
index 02d473c..f68be20 100644
--- a/pjlib/src/pj/guid_android.c
+++ b/pjlib/src/pj/guid_android.c
@@ -103,7 +103,7 @@ PJ_DEF(pj_str_t*) pj_generate_unique_string(pj_str_t *str)
 
     native_str.ptr = (char *)native_string;
     native_str.slen = pj_ansi_strlen(native_string);
-    pj_strncpy(str, &native_str, str->slen);
+    pj_strncpy(str, &native_str, native_str.slen);
 
     (*jni_env)->ReleaseStringUTFChars(jni_env, uuid_string, native_string);
     detach_jvm(attached);




2016-03-23 11:27 GMT+03:00 Anton VG <anton.vazir@xxxxxxxxx>:
Hi!
Trying to find out the reason the PJSUA2 sample app crashes here:

03-23 11:11:01.198 22964-22964/org.pjsip.pjsua2.app A/libc: ../include/pj/string_i.h:121: pj_strncpy: assertion "max >= 0" failed
03-23 11:11:01.198 22964-22964/org.pjsip.pjsua2.app A/libc: Fatal signal 6 (SIGABRT), code -6 in tid 22964 (jsip.pjsua2.app)

This is the case only while compiled for armeabi (v7a too), but x86 compilation works (on emulator). 
arm lib crashes in emulator, and real devices

I have been trying ndk r10e, r9c and r8 - all got the same.

Thanks in advance
Anton



_______________________________________________
Visit our blog: http://blog.pjsip.org

pjsip mailing list
pjsip@xxxxxxxxxxxxxxx
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org



_______________________________________________
Visit our blog: http://blog.pjsip.org

pjsip mailing list
pjsip@xxxxxxxxxxxxxxx
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org

_______________________________________________
Visit our blog: http://blog.pjsip.org

pjsip mailing list
pjsip@xxxxxxxxxxxxxxx
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org

[Index of Archives]     [Asterisk Users]     [Asterisk App Development]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [Linux API]
  Powered by Linux