[vlc-devel] [HELP] Tracking down an audio transcoding segfault with the mpgatofixed32 filter

Kevin DuBois kdub432 at gmail.com
Fri Jun 20 16:24:30 CEST 2008


I have fixed the problem. The patch is attached. The segfault was caused by
a too small conversion buffer being specified in mpgatofixed32 due to an
incorrect value in p_filter->fmt_out.audio.i_bitspersample. Namely, if
mpga->s16l is requested, , a filter that is mgpa to fl32 is returned, and
transcode is aware of that the output is fl32, although it requested s16l.
This is the reason for the "FIXME FIXME ..." in transcode.c:1212, that code
will account for a filter returning a format that it hasnt requested. This
also caused a segfault in mpgatofixed32 because it relies on
p_filter->fmt_out.audio.i_bitspersample being correct when it allocates its
buffers. p_filter->fmt_out.audio.i_bitspersample incorrectly held the value
16, which is only half the buffer size requested.

 I modified the  filters chain to account for this difference. This is
pretty much the exact same thing the old filters code did. My next step is
to revamp the filters/transcode code so that any number of audio filters can
be requested, and the filter chain will intelligently hook them up together,
and account for any format differences that arise.

On Fri, Jun 13, 2008 at 11:17 AM, Rafaël Carré <rcarre at m2x.nl> wrote:

> On Fri, 2008-06-13 at 10:49 -0400, Kevin DuBois wrote:
> > So the when using the mpgatofixed32 filter in the new audio
> > transcoding chain configuration, segfaulting occurs. This filter is
> > used whenever mpga is input, so this effectively breaks the streaming
> > of dvb, mpeg files, etc.  I beleive that this bug would also manifest
> > itself in other audio filter2 modules like headphone, but it does not
> > exist in format. This bug was not present before about june 4th.
> >
> > I have seen it segfault in three different ways (i.e. different
> > backtraces for different runs), all with the same binary/libraries.
> > They are listed below, the third one being the rarest to see.
> >
> > I've spent some time looking into it, and only got pretty confused as
> > to where to look, so even if no one can fix it, pointers as to how to
> > procede would be most appreciated. The best i can come up with for an
> > explanation is that something is getting improperly allocated or
> > deallocated in the code for the audio buffers. I'm a bit new to coding
> > in such a big project, so I appreciate any help I can get!
> >
> > configuration:
> > ./configure --prefix=/usr/local --enable-dvb --enable-ffmpeg
> > --disable-qt4 --disable-skins2 --enable-debug
> >
> > (gdb) show args
> > Argument list to give program being debugged when it is started is
> > "dvb:// --dvb-frequency=12020000 --dvb-srate=2034000
> > --dvb-lnb-lof1=10750000 --dvb-satno=0 --dvb-high-voltage
> > --dvb-voltage=18 -vvv --sout
> > '#transcode{acodec=mp4a}:rtp{dst=10.0.9.121,
> > sdp=file:///home/kdubois/test.sdp}'".
> >
> >
> > SEGFAULT 1
> >
> > *** glibc detected *** double free or corruption (!prev): 0x082da820
> > ***
>
> That message makes me want to use valgrind
>
> > Program received signal SIGABRT, Aborted.
> > [Switching to Thread -1362109520 (LWP 16179)]
> > 0xffffe410 in __kernel_vsyscall ()
> > (gdb) bt
> > #0  0xffffe410 in __kernel_vsyscall ()
> > #1  0xb7d1d811 in raise () from /lib/tls/i686/cmov/libc.so.6
> > #2  0xb7d1efb9 in abort () from /lib/tls/i686/cmov/libc.so.6
> > #3  0xb7d52dfa in __fsetlocking () from /lib/tls/i686/cmov/libc.so.6
> > #4  0xb7d5a68f in mallopt () from /lib/tls/i686/cmov/libc.so.6
> > #5  0xb7d5a732 in free () from /lib/tls/i686/cmov/libc.so.6
>
> Use valgrind
>
> > SEGFAULT 2
> >
> > Program received signal SIGSEGV, Segmentation fault.
> > [Switching to Thread -1362109520 (LWP 16249)]
> > 0xb7da036f in mallopt () from /lib/tls/i686/cmov/libc.so.6
> > (gdb) bt
> > #0  0xb7da036f in mallopt () from /lib/tls/i686/cmov/libc.so.6
> > #1  0xb7da0732 in free () from /lib/tls/i686/cmov/libc.so.6
>
> Use valgrind
>
> --
> Rafaël Carré <rcarre at m2x.nl>
>
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> http://mailman.videolan.org/listinfo/vlc-devel
>



-- 
Kevin DuBois
kdub432 at gmail.com
PGP Key fingerprint = 80CF 7C1D 0A1C BE03 2203 95B6 1515 C3DC B6BE 7E88
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20080620/94c388e4/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mpgatofixed32fix.patch
Type: text/x-patch
Size: 3081 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20080620/94c388e4/attachment.bin>


More information about the vlc-devel mailing list