2017-05-25 71 views
0

我在使用Marmalade構建在Android上運行的應用程序,該應用程序可以將視頻呼叫轉移到移動設備上的其他應用程序。視頻通話由PJSIP庫處理。當連接視頻源時,出現以下錯誤:A/libc致命信號11(SIGSEGV) - PJSIP,Android&Marmalade

A/libc: Fatal signal 11 (SIGSEGV) at 0x00000000 (code=1), thread 7813 (Thread-146) 

這導致應用程序崩潰。這是什麼原因?

我認爲這可能與Marmalade在某些時候會導致與PJSIP的空指針引用有關,但是由於此PJSIP構建在PJSUA示例應用程序中完美工作,因此我在此停留。

我測試過這個沒有視頻,它按預期運行。我已經在我的設備上測試了PJSUA示例應用程序,並且可以按照預期使用視頻。

這墓碑圖案的一部分:

01-02 12:04:11.580 1228-1228/? I/DEBUG: Revision: '0' 
01-02 12:04:11.580 1228-1228/? I/DEBUG: pid: 7657, tid: 7813, name: Thread-146 >>> com.x.x<<< 
01-02 12:04:11.580 1228-1228/? I/DEBUG: signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 00000000 
01-02 12:04:11.590 1233-1635/? W/V4L2CameraDevice: GetPreviewFrame: VIDIOC_DQBUF Failed, Invalid argument 
01-02 12:04:11.590 1233-1635/? D/V4L2CameraDevice: preview_num: 6, picture_num: 0 
01-02 12:04:11.740 1228-1228/? I/DEBUG:  r0 00000000 r1 00000001 r2 00000000 r3 00000000 
01-02 12:04:11.740 1228-1228/? I/DEBUG:  r4 623a2c64 r5 5ddcefb0 r6 62327098 r7 5e1d4a98 
01-02 12:04:11.740 1228-1228/? I/DEBUG:  r8 62327098 r9 00100000 sl 5e1d4a98 fp 627c3904 
01-02 12:04:11.740 1228-1228/? I/DEBUG:  ip 00004000 sp 627c3060 lr 62328310 pc 621141e0 cpsr 000f0010 
01-02 12:04:11.740 1228-1228/? I/DEBUG:  d0 0000000300000004 d1 0000000100000001 
01-02 12:04:11.740 1228-1228/? I/DEBUG:  d2 3164626130316330 d3 3836312e32393140 
01-02 12:04:11.740 1228-1228/? I/DEBUG:  d4 a20f000200000000 d5 00000000d201a8c0 
01-02 12:04:11.740 1228-1228/? I/DEBUG:  d6 0000000000000000 d7 0000000000000000 
01-02 12:04:11.740 1228-1228/? I/DEBUG:  d8 0000000000000000 d9 0000000000000000 
01-02 12:04:11.740 1228-1228/? I/DEBUG:  d10 0000000000000000 d11 0000000000000000 
01-02 12:04:11.740 1228-1228/? I/DEBUG:  d12 0000000000000000 d13 0000000000000000 
01-02 12:04:11.740 1228-1228/? I/DEBUG:  d14 0000000000000000 d15 0000000000000000 
01-02 12:04:11.740 1228-1228/? I/DEBUG:  d16 40f5180800000000 d17 3fe0000000000000 
01-02 12:04:11.740 1228-1228/? I/DEBUG:  d18 3fdffffffffffe48 d19 0000000000000000 
01-02 12:04:11.740 1228-1228/? I/DEBUG:  d20 3fe00000000000dc d21 3ff0000000000000 
01-02 12:04:11.740 1228-1228/? I/DEBUG:  d22 8000000000000000 d23 0000000000000000 
01-02 12:04:11.740 1228-1228/? I/DEBUG:  d24 0000000000000000 d25 8000000000000000 
01-02 12:04:11.740 1228-1228/? I/DEBUG:  d26 3ff0000000000000 d27 0000000000000000 
01-02 12:04:11.740 1228-1228/? I/DEBUG:  d28 0000000000000000 d29 0000000000000000 
01-02 12:04:11.740 1228-1228/? I/DEBUG:  d30 0000000000000000 d31 0000000000000000 
01-02 12:04:11.740 1228-1228/? I/DEBUG:  scr 80000010 
01-02 12:04:11.740 1228-1228/? I/DEBUG: backtrace: 
01-02 12:04:11.740 1228-1228/? I/DEBUG:  #00 pc 000301e0 /data/app-lib/com.x.x-1/libpjsua.so (on_call_media_state(int)+180) 
01-02 12:04:11.740 1228-1228/? I/DEBUG:  #01 pc 0024430c /data/app-lib/com.x.x-1/libpjsua.so (pj_mutex_unlock+224) 
01-02 12:04:11.740 1228-1228/? I/DEBUG: stack: 
01-02 12:04:11.740 1228-1228/? I/DEBUG:   627c3020 6235c590 /data/app-lib/com.x.x-1/libpjsua.so 
01-02 12:04:11.740 1228-1228/? I/DEBUG:   627c3024 00000008 
01-02 12:04:11.740 1228-1228/? I/DEBUG:   627c3028 627c306c [stack:7813] 
01-02 12:04:11.740 1228-1228/? I/DEBUG:   627c302c 00000000 
01-02 12:04:11.740 1228-1228/? I/DEBUG:   627c3030 623b8e70 
01-02 12:04:11.740 1228-1228/? I/DEBUG:   627c3034 623b8568 
01-02 12:04:11.740 1228-1228/? I/DEBUG:   627c3038 63164fa4 
01-02 12:04:11.740 1228-1228/? I/DEBUG:   627c303c 623b8470 
01-02 12:04:11.740 1228-1228/? I/DEBUG:   627c3040 00000001 
01-02 12:04:11.740 1228-1228/? I/DEBUG:   627c3044 00000001 
01-02 12:04:11.740 1228-1228/? I/DEBUG:   627c3048 0000001b 
01-02 12:04:11.740 1228-1228/? I/DEBUG:   627c304c 00000002 
01-02 12:04:11.740 1228-1228/? I/DEBUG:   627c3050 00000000 
01-02 12:04:11.740 1228-1228/? I/DEBUG:   627c3054 623a2c64 /data/app-lib/com.x.x-1/libpjsua.so 
01-02 12:04:11.740 1228-1228/? I/DEBUG:   627c3058 df0027ad 
01-02 12:04:11.740 1228-1228/? I/DEBUG:   627c305c 00000000 
01-02 12:04:11.740 1228-1228/? I/DEBUG:  #00 627c3060 00000000 
01-02 12:04:11.740 1228-1228/? I/DEBUG:   ........ ........ 
01-02 12:04:11.740 1228-1228/? I/DEBUG:  #01 627c3060 00000000 
01-02 12:04:11.740 1228-1228/? I/DEBUG:   627c3064 00000000 
01-02 12:04:11.740 1228-1228/? I/DEBUG:   627c3068 00000000 
01-02 12:04:11.740 1228-1228/? I/DEBUG:   627c306c 00000000 
01-02 12:04:11.740 1228-1228/? I/DEBUG:   627c3070 00000001 
01-02 12:04:11.740 1228-1228/? I/DEBUG:   627c3074 00000000 
01-02 12:04:11.740 1228-1228/? I/DEBUG:   627c3078 627c33f8 [stack:7813] 
01-02 12:04:11.740 1228-1228/? I/DEBUG:   627c307c 00000019 
01-02 12:04:11.740 1228-1228/? I/DEBUG:   627c3080 627c34f8 [stack:7813] 
01-02 12:04:11.740 1228-1228/? I/DEBUG:   627c3084 00000018 
01-02 12:04:11.740 1228-1228/? I/DEBUG:   627c3088 627c35f8 [stack:7813] 
01-02 12:04:11.740 1228-1228/? I/DEBUG:   627c308c 0000001b 
01-02 12:04:11.740 1228-1228/? I/DEBUG:   627c3090 627c36f8 [stack:7813] 
01-02 12:04:11.740 1228-1228/? I/DEBUG:   627c3094 0000001b 
01-02 12:04:11.740 1228-1228/? I/DEBUG:   627c3098 627c37f8 [stack:7813] 
01-02 12:04:11.740 1228-1228/? I/DEBUG:   627c309c 00000033 

當我檢查這一切看起來正常的遠程登錄,它只是停止,當應用程序崩潰:

12:04:11.410 pjsua_call.c !Answering call 0: code=200 
12:04:11.411 pjsua_media.c ...Call 0: updating media.. 
12:04:11.412 pjsua_media.c .....Media stream call00:0 is destroyed 
12:04:11.412 pjsua_aud.c ....Audio channel update.. 
12:04:11.412 strm0x5e1cf4f4 .....VAD temporarily disabled 
12:04:11.413 strm0x5e1cf4f4 .....Encoder stream started 
12:04:11.413 strm0x5e1cf4f4 .....Decoder stream started 
12:04:11.414 pjsua_media.c ....Audio updated, stream #0: PCMU (sendrecv) 
12:04:11.414 pjsua_media.c .....Media stream call00:1 is destroyed 
12:04:11.415 pjsua_vid.c ....Video channel update.. 
12:04:11.475 vstenc0x632ef4 .....Encoder stream started 
12:04:11.475 vstdec0x632ef4 .....Decoder stream started 
12:04:11.475 pjsua_vid.c .....Setting up RX.. 
12:04:11.475 pjsua_vid.c ......Creating video window: type=stream, cap_id=-1, rend_id=0 
12:04:11.475  vid_port.c .......Opening device OpenGL renderer [OpenGL] for render: format=I420, size=656x656 @22:1 fps 
12:04:11.476 android_opengl .......Re-initializing OpenGL due to format change 
12:04:11.476 android_opengl .......Android OpenGL ES renderer successfully created 
12:04:11.476  vid_port.c .......Device OpenGL renderer [OpenGL] opened: format=I420, size=656x656 @22:1 fps 
12:04:11.476 pjsua_vid.c .......stream window id 0 created for cap_dev=-1 rend_dev=0 
12:04:11.477 pjsua_vid.c .......Window 0 created 
12:04:11.477 android_opengl ......Starting Android opengl stream 
12:04:11.478 pjsua_vid.c .....Setting up TX.. 
12:04:11.478 pjsua_vid.c ......Creating video window: type=preview, cap_id=1, rend_id=0 
12:04:11.478  vid_port.c .......Opening device Colorbar generator [Colorbar] for capture: format=I420, size=352x288 @15:1 fps 
12:04:11.478  vid_port.c .......Device Colorbar generator [Colorbar] opened: format=I420, size=352x288 @15:1 fps 
12:04:11.479  vid_port.c .......Opening device OpenGL renderer [OpenGL] for render: format=I420, size=352x288 @15:1 fps 
12:04:11.479 android_opengl .......Re-initializing OpenGL due to format change 
12:04:11.479 android_opengl .......Android OpenGL ES renderer successfully created 
12:04:11.479  vid_port.c .......Device OpenGL renderer [OpenGL] opened: format=I420, size=352x288 @15:1 fps 
12:04:11.480 pjsua_vid.c .......preview window id 1 created for cap_dev=1 rend_dev=0 
12:04:11.480 pjsua_vid.c .......Window 1 created 
12:04:11.480 colorbar_dev.c ......Starting cbar video stream 
12:04:11.480 pjsua_media.c ....Video updated, stream #1: H264 (sendrecv) 

回答

0

我加入解決了這個問題一些登錄到PJSIP源文件以縮小發生這種情況的位置。

在pjsua_app_callback.cpp文件中,它有一個on_call_media_state方法,它在我的跟蹤中提到過。

static void on_call_media_state(pjsua_call_id call_id) 
{ 
#if PJMEDIA_HAS_VIDEO 
    pjsua_call_info call_info; 
    unsigned mi; 

    pjsua_call_get_info(call_id, &call_info); 

    for (mi=0; mi<call_info.media_cnt; ++mi) { 
     pjsua_call_media_info *med_info = &call_info.media[mi]; 
    if (med_info->type == PJMEDIA_TYPE_VIDEO && 
     med_info->status == PJSUA_CALL_MEDIA_ACTIVE && 
     med_info->stream.vid.win_in != PJSUA_INVALID_ID) 
    { 
     winId = med_info->stream.vid.win_in; 
     registeredCallbackObject->onCallVideoStart(); 
     break; 
    } 
    } 
#endif 

    /* Forward to original callback */ 
    if (pjsua_cb_orig.on_call_media_state) 
    (*pjsua_cb_orig.on_call_media_state)(call_id); 
} 

錯誤發生在for循環中,因爲傳入的call_info爲null。

我編輯了這段代碼,以適應我的情況,現在它工作正常。這可能是一個非常具體的問題,可能無法幫助那些致命信號11(SIGSEGV)。

相關問題