The suppression file has been originally proposed by Reimar Doeffinger.
The idea of using set_defaults is from Luca Barbato.
---
 configure                |    8 ++++++--
 doc/developer.texi       |    8 ++++++++
 tests/fate-valgrind.supp |   31 +++++++++++++++++++++++++++++++
 3 files changed, 45 insertions(+), 2 deletions(-)
 create mode 100644 tests/fate-valgrind.supp

I see no objection to the location and content of the suppression file
as suggested by Raimar, therefore I'd suggest to keep it.

In order to increase the visibility, I've added a note in the developer
documentation.


diff --git a/configure b/configure
index f690db1..953092b 100755
--- a/configure
+++ b/configure
@@ -2155,6 +2155,10 @@ case "$toolchain" in
         add_cflags  -fthread-sanitizer
         add_ldflags -fthread-sanitizer
     ;;
+    valgrind-memcheck)
+        target_exec_default="valgrind"
+        target_exec_args="--track-origins=yes --leak-check=full 
--suppressions=$source_path/tests/fate-valgrind.supp"
+    ;;
     msvc)
         cc_default="c99wrap cl"
         ld_default="c99wrap link"
@@ -2167,7 +2171,7 @@ case "$toolchain" in
     ;;
 esac
 
-set_default arch cc pkg_config sysinclude target_os
+set_default arch cc pkg_config sysinclude target_os target_exec
 enabled cross_compile || host_cc_default=$cc
 set_default host_cc
 
@@ -3959,7 +3963,7 @@ HOSTCC_DEPFLAGS=$HOSTCC_DEPFLAGS
 HOSTCC_C=$HOSTCC_C
 HOSTCC_O=$HOSTCC_O
 HOSTLD_O=$HOSTLD_O
-TARGET_EXEC=$target_exec
+TARGET_EXEC=$target_exec $target_exec_args
 TARGET_PATH=$target_path
 LIBS-avplay=$sdl_libs
 CFLAGS-avplay=$sdl_cflags
diff --git a/doc/developer.texi b/doc/developer.texi
index 1a87859..e9a6e7f 100644
--- a/doc/developer.texi
+++ b/doc/developer.texi
@@ -547,6 +547,14 @@ why the expected result changed.
 
 Please refer to @url{fate.html}.
 
+@subsection Using Valgrind
+
+The configure script provides a shortcut for using valgrind to spot bugs
+related to memory handling. Just add the option
+@code{--toolchain=valgrind-memcheck} to your configure line, and
+reasonable defaults will be set for running FATE under the supervision
+of the @strong{memcheck} tool of the valgrind suite.
+
 @anchor{Release process}
 @section Release process
 
diff --git a/tests/fate-valgrind.supp b/tests/fate-valgrind.supp
new file mode 100644
index 0000000..db72c54
--- /dev/null
+++ b/tests/fate-valgrind.supp
@@ -0,0 +1,31 @@
+# seems fixed in newer versions
+# http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=577135
+{
+   zlib-inflate
+   Memcheck:Cond
+   fun:inflateReset2
+   fun:inflateInit2_
+}
+# libc overreads on purpose
+# http://sourceware.org/bugzilla/show_bug.cgi?id=12424
+{
+   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.9.5

_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to