[theora] oggz-chop gives segmentation fault

Ondrej Certik ondrej at certik.cz
Tue Jun 16 21:05:39 PDT 2009


On Tue, Jun 16, 2009 at 8:21 PM, Conrad Parker<conrad at metadecks.org> wrote:
> 2009/6/17 Ondrej Certik <ondrej at certik.cz>:
>> On Mon, Jun 15, 2009 at 5:01 AM, Conrad Parker<conrad at metadecks.org> wrote:
>>> 2009/6/15 Ondrej Certik <ondrej at certik.cz>:
>>>> On Mon, Jun 15, 2009 at 12:09 AM, Conrad Parker<conrad at metadecks.org> wrote:
>>>>> 2009/6/15 Ondrej Certik <ondrej at certik.cz>:
>>>>>> Hi,
>>>>>>
>>>>>> I am using oggz-chop in the ubuntu jaunty, am I doing something wrong?
>>>>>>
>>>>>> $ oggz-chop -o yt1.ogv -s0 -e500 ondrej.ogv
>>>>>> Segmentation fault
>>>>>>
>>>>>
>>>>> Hi Ondrej,
>>>>>
>>>>> can I get a copy of the file that triggers that, eg. can you upload it
>>>>> somewhere?
>>>>
>>>> It's here:
>>>>
>>>> http://sage.math.washington.edu/home/ondrej/scratch/video/ondrej.ogv
>>>>
>>>> But I am still uploading, ETA: 42min.
>>>>
>>>> Maybe you can regenerate the segfault even with the partial file in
>>>> there. Thanks for looking into this.
>>>
>>> ok, I tried this with liboggz HEAD and with the latest release
>>> (0.9.9). Neither of these segfault, so I think it might have been a
>>> bug in an older version, now fixed.
>>>
>>> Please try with a more recent version of oggz-chop, and let me know if
>>> that works for you.
>>
>> Right, 0.9.9 works, but it doesn't produce any output:
>>
>> $ which oggz-chop
>> /home/ondrej/usr/bin/oggz-chop
>> $ oggz-chop -v
>> oggz-chop version 0.9.9
>> $ oggz-chop -o yt1.ogv -s 0 -e 500 ondrej.ogv
>> $ ll yt1.ogv
>> ls: cannot access yt1.ogv: No such file or directory
>>
>>
>> am I using it the right way?
>
> hmm, yes you are, but I can't reproduce that failure:
>
> $ which oggz-chop
> /home/conrad/usr/bin/oggz-chop
> $ oggz-chop -v
> oggz-chop version 0.9.9
> $ rm yt1.ogv
> $ oggz-chop -o yt1.ogv -s 0 -e 500 ondrej.ogv
> $ ls -l yt1.ogv
> -rw-r--r-- 1 conrad conrad 59548832 2009-06-17 11:17 yt1.ogv
>
> can you help with debugging to see where it is failing on your system?

Yes, I instrumented the file src/tools/oggz-chop/oggz-chop.c:


  printf("I am here\n");
  if (state == NULL || state->infilename == NULL) {
    fprintf (stderr, "oggz-chop: Initialization state invalid\n");
    return -1;
  }

  printf("1\n");
  state_init (state);

  printf("2\n");
  if (strcmp (state->infilename, "-") == 0) {
    oggz = oggz_open_stdio (stdin, OGGZ_READ|OGGZ_AUTO);
  } else {
    oggz = oggz_open (state->infilename, OGGZ_READ|OGGZ_AUTO);
  }

  printf("3\n");
  if (oggz == NULL) return -1;
  printf("4\n");



and it prints:

$ oggz-chop -o yt1.ogv -s 0 -e 500 ondrej.ogv
I am here
1
2
3

So it's clear that it ends because oggz is NULL. I am not good at
debugging C (I mostly work with Python) ---- what is the best way to
figure out why it is NULL? Should I continue using print statements,
or some debugger? Do you use plain gdb, or some gui for it (like ddd)?

Ondrej


More information about the theora mailing list