1

As i am using PJSIP library for Sip calls and as i m facing one problem of JNI. As when i call from one sip device to other sip device sometimes it works fine. but sometimes it crashes on picking up phone.

Here is my error logs:

    04-06 14:45:31.605 17940-17992/com.xxx.xxx:sipStack A/art: art/runtime/java_vm_ext.cc:470] JNI DETECTED ERROR IN APPLICATION: use of invalid jobject 0x84ba9d14
04-06 14:45:31.605 17940-17992/com.xxx.xxx:sipStack A/art: art/runtime/java_vm_ext.cc:470]     from byte[] org.pjsip.pjsua.pjsuaJNI.acc_get_user_data(int)
04-06 14:45:31.605 17940-17992/com.xxx.xxx:sipStack A/art: art/runtime/java_vm_ext.cc:470] "SipService.Executor" prio=5 tid=21 Runnable
04-06 14:45:31.605 17940-17992/com.xxx.xxx:sipStack A/art: art/runtime/java_vm_ext.cc:470]   | group="main" sCount=0 dsCount=0 obj=0x12c30280 self=0x6c7e5200
04-06 14:45:31.605 17940-17992/com.xxx.xxx:sipStack A/art: art/runtime/java_vm_ext.cc:470]   | sysTid=17992 nice=0 cgrp=default sched=0/0 handle=0x7a304920
04-06 14:45:31.605 17940-17992/com.xxx.xxx:sipStack A/art: art/runtime/java_vm_ext.cc:470]   | state=R schedstat=( 638596942 799712450 3515 ) utm=45 stm=18 core=3 HZ=100
04-06 14:45:31.605 17940-17992/com.xxx.xxx:sipStack A/art: art/runtime/java_vm_ext.cc:470]   | stack=0x7a202000-0x7a204000 stackSize=1038KB
04-06 14:45:31.605 17940-17992/com.xxx.xxx:sipStack A/art: art/runtime/java_vm_ext.cc:470]   | held mutexes= "mutator lock"(shared held)
04-06 14:45:31.605 17940-17992/com.xxx.xxx:sipStack A/art: art/runtime/java_vm_ext.cc:470]   native: #00 pc 00351b41  /system/lib/libart.so (_ZN3art15DumpNativeStackERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEEiP12BacktraceMapPKcPNS_9ArtMethodEPv+128)
04-06 14:45:31.605 17940-17992/com.xxx.xxx:sipStack A/art: art/runtime/java_vm_ext.cc:470]   native: #01 pc 00332139  /system/lib/libart.so (_ZNK3art6Thread9DumpStackERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEEbP12BacktraceMap+304)
04-06 14:45:31.605 17940-17992/com.xxx.xxx:sipStack A/art: art/runtime/java_vm_ext.cc:470]   native: #02 pc 0023a3f3  /system/lib/libart.so (_ZN3art9JavaVMExt8JniAbortEPKcS2_+846)
04-06 14:45:31.605 17940-17992/com.xxx.xxx:sipStack A/art: art/runtime/java_vm_ext.cc:470]   native: #03 pc 0023a99f  /system/lib/libart.so (_ZN3art9JavaVMExt9JniAbortFEPKcS2_z+66)
04-06 14:45:31.605 17940-17992/com.xxx.xxx:sipStack A/art: art/runtime/java_vm_ext.cc:470]   native: #04 pc 00335bd7  /system/lib/libart.so (_ZNK3art6Thread13DecodeJObjectEP8_jobject+302)
04-06 14:45:31.605 17940-17992/com.xxx.xxx:sipStack A/art: art/runtime/java_vm_ext.cc:470]   native: #05 pc 003f53d7  /system/lib/libart.so (_ZN3art25JniMethodEndWithReferenceEP8_jobjectjPNS_6ThreadE+30)
04-06 14:45:31.605 17940-17992/com.xxx.xxx:sipStack A/art: art/runtime/java_vm_ext.cc:470]   native: #06 pc 000cc6d7  /data/app/com.xxx.xxx-2/oat/arm/base.odex (Java_org_pjsip_pjsua_pjsuaJNI_acc_1get_1user_1data__I+90)
04-06 14:45:31.605 17940-17992/com.xxx.xxx:sipStack A/art: art/runtime/java_vm_ext.cc:470]   at org.pjsip.pjsua.pjsuaJNI.acc_get_user_data(Native method)
04-06 14:45:31.605 17940-17992/com.xxx.xxx:sipStack A/art: art/runtime/java_vm_ext.cc:470]   at org.pjsip.pjsua.pjsua.acc_get_user_data(pjsua.java:275)
04-06 14:45:31.605 17940-17992/com.xxx.xxx:sipStack A/art: art/runtime/java_vm_ext.cc:470]   - locked <0x072777df> (a java.lang.Class<org.pjsip.pjsua.pjsua>)
04-06 14:45:31.605 17940-17992/com.xxx.xxx:sipStack A/art: art/runtime/java_vm_ext.cc:470]   at com.xxx.xxx.pjsip.UAStateReceiver.on_call_media_state(UAStateReceiver.java:404)
04-06 14:45:31.605 17940-17992/com.xxx.xxx:sipStack A/art: art/runtime/java_vm_ext.cc:470]   at org.pjsip.pjsua.pjsuaJNI.SwigDirector_Callback_on_call_media_state(pjsuaJNI.java:1395)
04-06 14:45:31.605 17940-17992/com.xxx.xxx:sipStack A/art: art/runtime/java_vm_ext.cc:470]   at org.pjsip.pjsua.pjsuaJNI.call_answer2(Native method)
04-06 14:45:31.605 17940-17992/com.xxx.xxx:sipStack A/art: art/runtime/java_vm_ext.cc:470]   at org.pjsip.pjsua.pjsua.call_answer2(pjsua.java:399)
04-06 14:45:31.605 17940-17992/com.xxx.xxx:sipStack A/art: art/runtime/java_vm_ext.cc:470]   - locked <0x072777df> (a java.lang.Class<org.pjsip.pjsua.pjsua>)
04-06 14:45:31.605 17940-17992/com.xxx.xxx:sipStack A/art: art/runtime/java_vm_ext.cc:470]   at com.xxx.xxx.pjsip.PjSipService.callAnswer(PjSipService.java:1178)
04-06 14:45:31.605 17940-17992/com.xxx.xxx:sipStack A/art: art/runtime/java_vm_ext.cc:470]   at com.xxx.xxx.service.SipService$1$7.runWithReturn(SipService.java:352)
04-06 14:45:31.605 17940-17992/com.xxx.xxx:sipStack A/art: art/runtime/java_vm_ext.cc:470]   at com.xxx.xxx.service.SipService$ReturnRunnable.doRun(SipService.java:2116)
04-06 14:45:31.605 17940-17992/com.xxx.xxx:sipStack A/art: art/runtime/java_vm_ext.cc:470]   at com.xxx.xxx.service.SipService$SipRunnable.run(SipService.java:2086)
04-06 14:45:31.605 17940-17992/com.xxx.xxx:sipStack A/art: art/runtime/java_vm_ext.cc:470]   at com.xxx.xxx.service.SipService$SipServiceExecutor.executeInternal(SipService.java:1964)
04-06 14:45:31.605 17940-17992/com.xxx.xxx:sipStack A/art: art/runtime/java_vm_ext.cc:470]   at com.xxx.xxx.service.SipService$SipServiceExecutor.handleMessage(SipService.java:1956)
04-06 14:45:31.605 17940-17992/com.xxx.xxx:sipStack A/art: art/runtime/java_vm_ext.cc:470]   at android.os.Handler.dispatchMessage(Handler.java:102)
04-06 14:45:31.605 17940-17992/com.xxx.xxx:sipStack A/art: art/runtime/java_vm_ext.cc:470]   at android.os.Looper.loop(Looper.java:154)
04-06 14:45:31.605 17940-17992/com.xxx.xxx:sipStack A/art: art/runtime/java_vm_ext.cc:470]   at android.os.HandlerThread.run(HandlerThread.java:61)
04-06 14:45:31.605 17940-17992/com.xxx.xxx:sipStack A/art: art/runtime/java_vm_ext.cc:470] 
04-06 14:45:31.777 17940-17992/com.xxx.xxx:sipStack A/art: art/runtime/runtime.cc:422] Runtime aborting...
04-06 14:45:31.777 17940-17992/com.xxx.xxx:sipStack A/art: art/runtime/runtime.cc:422] Aborting thread:
04-06 14:45:31.777 17940-17992/com.xxx.xxx:sipStack A/art: art/runtime/runtime.cc:422] "SipService.Executor" prio=5 tid=21 Native
04-06 14:45:31.777 17940-17992/com.xxx.xxx:sipStack A/art: art/runtime/runtime.cc:422]   | group="" sCount=0 dsCount=0 obj=0x12c30280 self=0x6c7e5200
04-06 14:45:31.777 17940-17992/com.xxx.xxx:sipStack A/art: art/runtime/runtime.cc:422]   | sysTid=17992 nice=0 cgrp=default sched=0/0 handle=0x7a304920
04-06 14:45:31.777 17940-17992/com.xxx.xxx:sipStack A/art: art/runtime/runtime.cc:422]   | state=R schedstat=( 668576109 799991992 3519 ) utm=46 stm=20 core=3 HZ=100
04-06 14:45:31.777 17940-17992/com.xxx.xxx:sipStack A/art: art/runtime/runtime.cc:422]   | stack=0x7a202000-0x7a204000 stackSize=1038KB
04-06 14:45:31.777 17940-17992/com.xxx.xxx:sipStack A/art: art/runtime/runtime.cc:422]   | held mutexes= "abort lock"
04-06 14:45:31.777 17940-17992/com.xxx.xxx:sipStack A/art: art/runtime/runtime.cc:422]   native: #00 pc 00351b41  /system/lib/libart.so (_ZN3art15DumpNativeStackERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEEiP12BacktraceMapPKcPNS_9ArtMethodEPv+128)
04-06 14:45:31.777 17940-17992/com.xxx.xxx:sipStack A/art: art/runtime/runtime.cc:422]   native: #01 pc 00332139  /system/lib/libart.so (_ZNK3art6Thread9DumpStackERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEEbP12BacktraceMap+304)
04-06 14:45:31.777 17940-17992/com.xxx.xxx:sipStack A/art: art/runtime/runtime.cc:422]   native: #02 pc 003251b1  /system/lib/libart.so (_ZNK3art10AbortState10DumpThreadERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEEPNS_6ThreadE+24)
04-06 14:45:31.777 17940-17992/com.xxx.xxx:sipStack A/art: art/runtime/runtime.cc:422]   native: #03 pc 00325039  /system/lib/libart.so (_ZNK3art10AbortState4DumpERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEE+424)
04-06 14:45:31.777 17940-17992/com.xxx.xxx:sipStack A/art: art/runtime/runtime.cc:422]   native: #04 pc 0031bd45  /system/lib/libart.so (_ZN3art7Runtime5AbortEPKc+92)
04-06 14:45:31.777 17940-17992/com.xxx.xxx:sipStack A/art: art/runtime/runtime.cc:422]   native: #05 pc 000b52eb  /system/lib/libart.so (_ZN3art10LogMessageD2Ev+1134)
04-06 14:45:31.777 17940-17992/com.xxx.xxx:sipStack A/art: art/runtime/runtime.cc:422]   native: #06 pc 0023a6d5  /system/lib/libart.so (_ZN3art9JavaVMExt8JniAbortEPKcS2_+1584)
04-06 14:45:31.777 17940-17992/com.xxx.xxx:sipStack A/art: art/runtime/runtime.cc:422]   native: #07 pc 0023a99f  /system/lib/libart.so (_ZN3art9JavaVMExt9JniAbortFEPKcS2_z+66)
04-06 14:45:31.777 17940-17992/com.xxx.xxx:sipStack A/art: art/runtime/runtime.cc:422]   native: #08 pc 00335bd7  /system/lib/libart.so (_ZNK3art6Thread13DecodeJObjectEP8_jobject+302)
04-06 14:45:31.777 17940-17992/com.xxx.xxx:sipStack A/art: art/runtime/runtime.cc:422]   native: #09 pc 003f53d7  /system/lib/libart.so (_ZN3art25JniMethodEndWithReferenceEP8_jobjectjPNS_6ThreadE+30)
04-06 14:45:31.777 17940-17992/com.xxx.xxx:sipStack A/art: art/runtime/runtime.cc:422]   native: #10 pc 000cc6d7  /data/app/com.xxx.xxx-2/oat/arm/base.odex (???)
04-06 14:45:31.777 17940-17992/com.xxx.xxx:sipStack A/art: art/runtime/runtime.cc:422]   at org.pjsip.pjsua.pjsuaJNI.acc_get_user_data(Native method)
04-06 14:45:31.777 17940-17992/com.xxx.xxx:sipStack A/art: art/runtime/runtime.cc:422]   at org.pjsip.pjsua.pjsua.acc_get_user_data(pjsua.java:275)
04-06 14:45:31.777 17940-17992/com.xxx.xxx:sipStack A/art: art/runtime/runtime.cc:422]   - locked <0x072777df> (a java.lang.Class<org.pjsip.pjsua.pjsua>)
04-06 14:45:31.777 17940-17992/com.xxx.xxx:sipStack A/art: art/runtime/runtime.cc:422]   at com.xxx.xxx.pjsip.UAStateReceiver.on_call_media_state(UAStateReceiver.java:404)
04-06 14:45:31.777 17940-17992/com.xxx.xxx:sipStack A/art: art/runtime/runtime.cc:422]   at org.pjsip.pjsua.pjsuaJNI.SwigDirector_Callback_on_call_media_state(pjsuaJNI.java:1395)
04-06 14:45:31.777 17940-17992/com.xxx.xxx:sipStack A/art: art/runtime/runtime.cc:422]   at org.pjsip.pjsua.pjsuaJNI.call_answer2(Native method)
04-06 14:45:31.777 17940-17992/com.xxx.xxx:sipStack A/art: art/runtime/runtime.cc:422]   at org.pjsip.pjsua.pjsua.call_answer2(pjsua.java:399)
04-06 14:45:31.777 17940-17992/com.xxx.xxx:sipStack A/art: art/runtime/runtime.cc:422]   - locked <0x072777df> (a java.lang.Class<org.pjsip.pjsua.pjsua>)
04-06 14:45:31.777 17940-17992/com.xxx.xxx:sipStack A/art: art/runtime/runtime.cc:422]   at com.xxx.xxx.pjsip.PjSipService.callAnswer(PjSipService.java:1178)
04-06 14:45:31.777 17940-17992/com.xxx.xxx:sipStack A/art: art/runtime/runtime.cc:422]   at com.xxx.xxx.service.SipService$1$7.runWithReturn(SipService.java:352)
04-06 14:45:31.777 17940-17992/com.xxx.xxx:sipStack A/art: art/runtime/runtime.cc:422]   at com.xxx.xxx.service.SipService$ReturnRunnable.doRun(SipService.java:2116)
04-06 14:45:31.777 17940-17992/com.xxx.xxx:sipStack A/art: art/runtime/runtime.cc:422]   at com.xxx.xxx.service.SipService$SipRunnable.run(SipService.java:2086)
04-06 14:45:31.777 17940-17992/com.xxx.xxx:sipStack A/art: art/runtime/runtime.cc:422]   at com.xxx.xxx.service.SipService$SipServiceExecutor.executeInternal(SipService.java:1964)
04-06 14:45:31.777 17940-17992/com.xxx.xxx:sipStack A/art: art/runtime/runtime.cc:422]   at com.xxx.xxx.service.SipService$SipServiceExecutor.handleMessage(SipService.java:1956)
04-06 14:45:31.777 17940-17992/com.xxx.xxx:sipStack A/art: art/runtime/runtime.cc:422]   at android.os.Handler.dispatchMessage(Handler.java:102)
04-06 14:45:31.777 17940-17992/com.xxx.xxx:sipStack A/art: art/runtime/runtime.cc:422]   at android.os.Looper.loop(Looper.java:154)
04-06 14:45:31.777 17940-17992/com.xxx.xxx:sipStack A/art: art/runtime/runtime.cc:422]   at android.os.HandlerThread.run(HandlerThread.java:61)
04-06 14:45:31.777 17940-17992/com.xxx.xxx:sipStack A/art: art/runtime/runtime.cc:422] Dumping all threads without appropriate locks held: thread list lock mutator lock
04-06 14:45:31.777 17940-17992/com.xxx.xxx:sipStack A/art: art/runtime/runtime.cc:422] All threads:

why i am facing this problem of Jni detected error . Any idea then please share here.

Thanks in advance

Jyoti
  • 87
  • 3
  • 12
  • mention complete details about the problem that where the issue got raised. you are calling one sip device to another sip device. At which device the problem occurs? in outgoing call or incoming call? – Nandhakumar Kittusamy Apr 06 '18 at 10:57
  • Hello @NandhaKumar, As this is not according to specific device, but i have some device name in which occuring Samsung Devices like in Samsung Galaxy Note 2 Android 7.1, Xioami Redmi Note 4, Samsung J2, Vivo YY5S ,Samsung J7 Prime. And it is not specific as this issue occurs in both the cases in incoming and outgoing call but generally faced by incoming while on attending it gets hang and get crash. – Jyoti Apr 06 '18 at 11:30
  • check where the error occurs when answering the incoming call. two sip devices are registered right? at the time of incoming call happens on one device? – Nandhakumar Kittusamy Apr 06 '18 at 11:52
  • Yes i have checked from error log it occuring in Pjsua file yes two sip device registered on different devices and and it happens on one device on incoming call. " pjsua.acc_get_user_data(callId);" at this line in Oncallmedia state method – Jyoti Apr 06 '18 at 12:04
  • did you pass call_ID value correct? just print there whether it is correct or not before calling onCallMediaState(prm) method. or else just comment that line if it's not needed for you. – Nandhakumar Kittusamy Apr 06 '18 at 12:23
  • Can u please sugest me or give idea why it is occuring in "pjsuaJNI.acc_get_user_data(int)" as any possibility from which it occuring – Jyoti Apr 06 '18 at 12:24
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/168410/discussion-between-nandhakumar-and-jyoti). – Nandhakumar Kittusamy Apr 06 '18 at 12:24

0 Answers0