[FFmpeg-devel] [PATCH]Do not free non-allocated memory

Vitor Sessak vitor1001
Sun Oct 18 16:41:36 CEST 2009


Reimar D?ffinger wrote:
> On Sat, Oct 17, 2009 at 10:11:23PM +0200, Michael Niedermayer wrote:
>> On Fri, Oct 16, 2009 at 05:40:47PM +0200, Reimar D?ffinger wrote:
>>> On Fri, Oct 16, 2009 at 06:14:11PM +0300, Kostya wrote:
>>>> On Fri, Oct 16, 2009 at 05:00:53PM +0200, Carl Eugen Hoyos wrote:
>>>>> Hi!
>>>>>
>>>>> As spotted by Alex Converse in a patch I sent recently. I believe his  
>>>>> comment is also true for these files.
>>>>>
>>>>> Please comment, Carl Eugen
>>>> Indeed, seems so.
>>>> Please apply.
>>> Maybe someone could be convinced to write a test program that just calls
>>> init() and close() or whatever it is called on all "things" (codecs,
>>> muxers,...) that would allow to easily spot such things with valgrind?
>> and/or run the regression tests or fate under valgrind
> 
> - will take really, really long, there is no way you can get people to run
>   it before every commit, and running FATE like this would make it slow down
>   enough that e.g. the AVR32 targets would be able to test far fewer revisions
>   and with far more delay

It takes about one hour in a single core in a core 2 machine. Running it 
nice'd and once a day should be a very not be a resource hog. Of course, 
I don't think there is a point in running it in more than one arch.

> - will not test the codecs without regression test, i.e. it would have found
>   almost none of those where there was an issue

The whole point of FATE is testing as many codecs as possible

> - the errors will be hidden in the middle of thousands of lines of other output

The tests will fail if one add --error-exitcode=1 to valgrind. I run it 
with the following command:

valgrind --leak-check=full --suppressions=sup.txt --error-exitcode=1 
--malloc-fill=0xff $BUILD_PATH/ffmpeg

and for making "make test" have the same command, add

--target-exec=\"valgrind --leak-check=full --suppressions=sup.txt 
--error-exitcode=1 --malloc-fill=0xff $BUILD_PATH/ffmpeg\"

to configure.

In the sup.txt suppressions file, I put


{
    <insert a suppression name here>
    Memcheck:Cond
    fun:*
    obj:*
    obj:*
    obj:*
    obj:*
    obj:*
}
{
    <insert a suppression name here>
    Memcheck:Value4
    fun:*
    obj:*
    obj:*
    obj:*
    obj:*
    obj:*
}

to suppress warnings about reading uninitialized memory, since if output 
does not change with --malloc-fill=0xff, it is most likely not a real bug.

I also had to hack fate-script.py to multiply the timeout delay by 20 
since tests take much more time running under valgrind.

The only reason it is not done already by FATE is that Mike wanted first 
to have a framework in place for daily and weekly tests before, but if 
someone wants to donate a few cpu cycles it can be done now.

-Vitor



More information about the ffmpeg-devel mailing list