1

I call the register_descriptor function:

    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");

which looks like this:

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,

But the "first line of register_descriptor\n" message doesn't get printed out. Instead, the output looks like this:

Calling register_descriptor
signal 11 (Segmentation fault) si_code x1, address is 0x4 from 0x44fa8
4
  • 2
    does your sin contain NULL? why don't you put a check for NULL before dereferencing? Jan 30, 2015 at 18:55
  • 2
    Welcome to Stack Overflow. Please read the About page soon. Have you printed the value in gAudio_ctrl.instance[rtptxId].sc_info[0].rtp_port in the calling code? Is one of the two function calls in the argument list giving trouble? Where does the debugger say the fault is happening? Jan 30, 2015 at 18:57
  • Possibilities - rtptxId is out of range for either rtptxArgs.chan[] or gAudio_ctrl.instance[]; or sin is not a valid pointer; maybe a couple others. Can't really tell without the additional code. What does your debugger tell you?
    – twalberg
    Jan 30, 2015 at 20:55
  • Thank you! The problem was that sin was NULL. Should have checked.
    – augre
    Jan 30, 2015 at 21:15

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.