在函数的第一行之前的C中的函数调用分段错误

时间:2015-01-30 18:53:44

标签: c fault

我调用register_descriptor函数:

    fprintf(stderr, "Calling register_descriptor\n");
    register_descriptor(
            &rtptxArgs.chan[rtptxId], 
            rtptxArgs.rtspd_handle, rtptxId, 
            inet_ntoa(sin->sin_addr), 
            ntohs(sin->sin_port), 
            gAudio_ctrl.instance[rtptxId].sc_info[0].rtp_port);
}
fprintf(stderr, "after register_descriptor\n");

看起来像这样:

static void register_descriptor(
    VCAPVENC_RTPTX_CHANNEL *pchan,
    z3_rtspd_handle rtspd_handle,
    int chId, char *ip, unsigned short vport, unsigned short aport)
{
    fprintf(stderr, "first line of register_descriptor\n");
    fflush (stderr);
    fsync (fileno (stderr));
    struct z3_rtspd_media_descriptor desc = {
        .uri = "",
        .id = 0,

"first line of register_descriptor\n"消息未打印出来。相反,输出如下所示:

Calling register_descriptor
signal 11 (Segmentation fault) si_code x1, address is 0x4 from 0x44fa8

0 个答案:

没有答案