6

CSipSimple throwing exception on android lollipop.

JNI DETECTED ERROR IN APPLICATION,input is not valid Modified UTF-8: illegal start byte 0x8e

while doing voip call, here i am sending message to ISipService in interval just to check call is going on or disconnected. and i am getting this exception on pjStr.getPtr() which is in pjSipService.java class. here i am pasting my error log.

12-03 17:26:38.625: A/art(11312): art/runtime/check_jni.cc:65] JNI DETECTED ERROR IN APPLICATION: input is not valid Modified UTF-8: illegal start byte 0x8e
12-03 17:26:38.625: A/art(11312): art/runtime/check_jni.cc:65]     string: 'OKp.p.p.p.p.p.p.p.p.p.p.p.p.p.p.p.p.p.p.p.p.p.p.p.p.p.p.p'
12-03 17:26:38.625: A/art(11312): art/runtime/check_jni.cc:65]     in call to NewStringUTF
12-03 17:26:38.625: A/art(11312): art/runtime/check_jni.cc:65]     from java.lang.String org.pjsip.pjsua.pjsuaJNI.pj_str_t_ptr_get(long, org.pjsip.pjsua.pj_str_t)
12-03 17:26:38.625: A/art(11312): art/runtime/check_jni.cc:65] "Thread-1487" prio=5 tid=34 Runnable
12-03 17:26:38.625: A/art(11312): art/runtime/check_jni.cc:65]   | group="main" sCount=0 dsCount=0 obj=0x13084400 self=0xafe5fc00
12-03 17:26:38.625: A/art(11312): art/runtime/check_jni.cc:65]   | sysTid=11490 nice=0 cgrp=apps sched=0/0 handle=0xafed3a80
12-03 17:26:38.625: A/art(11312): art/runtime/check_jni.cc:65]   | state=R schedstat=( 517221254 1512118979 3817 ) utm=23 stm=28 core=0 HZ=100
12-03 17:26:38.625: A/art(11312): art/runtime/check_jni.cc:65]   | stack=0x9dc06000-0x9dc08000 stackSize=1012KB
12-03 17:26:38.625: A/art(11312): art/runtime/check_jni.cc:65]   | held mutexes= "mutator lock"(shared held)
12-03 17:26:38.625: A/art(11312): art/runtime/check_jni.cc:65]   native: #00 pc 00004c58  /system/lib/libbacktrace_libc++.so (UnwindCurrent::Unwind(unsigned int, ucontext*)+23)
12-03 17:26:38.625: A/art(11312): art/runtime/check_jni.cc:65]   native: #01 pc 000034c1  /system/lib/libbacktrace_libc++.so (Backtrace::Unwind(unsigned int, ucontext*)+8)
12-03 17:26:38.625: A/art(11312): art/runtime/check_jni.cc:65]   native: #02 pc 002526ad  /system/lib/libart.so (art::DumpNativeStack(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, int, char const*, art::mirror::ArtMethod*)+84)
12-03 17:26:38.625: A/art(11312): art/runtime/check_jni.cc:65]   native: #03 pc 0023618b  /system/lib/libart.so (art::Thread::Dump(std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const+162)
12-03 17:26:38.625: A/art(11312): art/runtime/check_jni.cc:65]   native: #04 pc 000b1215  /system/lib/libart.so (art::JniAbort(char const*, char const*)+620)
12-03 17:26:38.625: A/art(11312): art/runtime/check_jni.cc:65]   native: #05 pc 000b1945  /system/lib/libart.so (art::JniAbortF(char const*, char const*, ...)+68)
12-03 17:26:38.625: A/art(11312): art/runtime/check_jni.cc:65]   native: #06 pc 000b3ee3  /system/lib/libart.so (art::ScopedCheck::Check(bool, char const*, ...) (.constprop.128)+922)
12-03 17:26:38.625: A/art(11312): art/runtime/check_jni.cc:65]   native: #07 pc 000bd9e5  /system/lib/libart.so (art::CheckJNI::NewStringUTF(_JNIEnv*, char const*)+44)
12-03 17:26:38.625: A/art(11312): art/runtime/check_jni.cc:65]   native: #08 pc 000f5885  /data/app/com.xpointers.careteam-2/lib/arm/libpjsipjni.so (_JNIEnv::NewStringUTF(char const*)+8)

any idea? or any alternative to get notify if call had been disconnected by other party? or wifi get disconnected on other device and for that i will get notification that call is disconnected.

2 Answers2

1

This error will throw for lollipop and higher version, because they are using ART, and some symbols are unable to detect by it.

Pratibha sarve
  • 369
  • 2
  • 11
  • you are right! The same code that is working pretty fine on Android version previous to Lollipop. what can be the possible solution for the same! Please help ! – New Coder Feb 19 '16 at 12:59
1

Maybe there is something in this post that will help.

Do not use the JNI call to NewStringUTF unless you control the input 100%

In short, see the above link. Try avoiding the use of NewStringUTF and send a byte array of your input into java and have it make the jstring.

I won't pretend to understand CSipSimple's implementation, but I would not be surprised if this is indeed the source of your problem. I hope that helps. This problem plagues us since Android 5 came out and has slowly become a large problem with using the JNI with user created strings using their soft keyboards.

Community
  • 1
  • 1
Hunter-Orionnoir
  • 2,015
  • 1
  • 18
  • 23