[FFmpeg-devel] [PATCH] Add a --enable-valgrind configure option.

Clément Bœsch ubitux at gmail.com
Fri Jan 20 21:12:58 CET 2012


On Fri, Jan 20, 2012 at 08:57:51PM +0100, Reimar Döffinger wrote:
> Runs "make fate" through valgrind.
> 
> Signed-off-by: Reimar Döffinger <Reimar.Doeffinger at gmx.de>
> ---
>  configure                |    4 ++++
>  tests/fate-valgrind.supp |   27 +++++++++++++++++++++++++++
>  2 files changed, 31 insertions(+), 0 deletions(-)
>  create mode 100644 tests/fate-valgrind.supp
> 
> diff --git a/configure b/configure
> index 3bace2b..c5b566d 100755
> --- a/configure
> +++ b/configure
> @@ -269,6 +269,8 @@ Developer options (useful when working on FFmpeg itself):
>    --disable-optimizations  disable compiler optimizations
>    --enable-extra-warnings  enable more compiler warnings
>    --disable-stripping      disable stripping of executables and shared libraries
> +  --enable-valgrind        run "make fate" tests through valgrind to detect memory
> +                           leaks and errors, cannot be combined with --target-exec
>    --samples=PATH           location of test samples for FATE, if not set use
>                             \$FATE_SAMPLES at make invocation time.
>  
> @@ -1270,6 +1272,7 @@ CMDLINE_SELECT="
>      optimizations
>      stripping
>      symver
> +    valgrind
>      yasm
>  "
>  
> @@ -3239,6 +3242,7 @@ fi
>  
>  enabled debug && add_cflags -g"$debuglevel" && add_asflags -g"$debuglevel"
>  enabled coverage && add_cflags "-fprofile-arcs -ftest-coverage" && add_ldflags "-fprofile-arcs -ftest-coverage"
> +enabled valgrind && target_exec="valgrind --error-exitcode=1 --malloc-fill=0x2a --track-origins=yes --leak-check=full --gen-suppressions=all --suppressions=tests/fate-valgrind.supp"

What if we want extra valgrind flags?

>  
>  # add some useful compiler flags if supported
>  check_cflags -Wdeclaration-after-statement
> diff --git a/tests/fate-valgrind.supp b/tests/fate-valgrind.supp
> new file mode 100644
> index 0000000..6eb4c75
> --- /dev/null
> +++ b/tests/fate-valgrind.supp
> @@ -0,0 +1,27 @@
> +{
> +   zlib-inflate
> +   Memcheck:Cond
> +   fun:inflateReset2
> +   fun:inflateInit2_
> +}

Do you mind adding a reference to the related issue if you have it? So we
can easily see if it is still required in the future.

> +{
> +   eval-strtod
> +   Memcheck:Addr8
> +   fun:__GI___strncasecmp_l
> +   fun:____strtod_l_internal
> +   fun:av_strtod
> +}
> +{
> +   eval-strtod
> +   Memcheck:Value8
> +   fun:__GI___strncasecmp_l
> +   fun:____strtod_l_internal
> +   fun:av_strtod
> +}
> +{
> +   eval-strtod
> +   Memcheck:Cond
> +   fun:__GI___strncasecmp_l
> +   fun:____strtod_l_internal
> +   fun:av_strtod
> +}

For these, I'd be happy with this one in comment:
http://sourceware.org/bugzilla/show_bug.cgi?id=12424

BTW, do you need all the Memcheck entries?

[...]

-- 
Clément B.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 490 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20120120/748026f7/attachment.asc>


More information about the ffmpeg-devel mailing list