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

Reimar Döffinger Reimar.Doeffinger at gmx.de
Fri Jan 20 20:57:51 CET 2012


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"
 
 # 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_
+}
+{
+   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
+}
-- 
1.7.8.3



More information about the ffmpeg-devel mailing list