Skip to content

Commit 77b90f0

Browse files
committed
Add a --valgrind configure option.
If specified runs "make fate" through valgrind using the given valgrind binary. Signed-off-by: Reimar Döffinger <[email protected]>
1 parent 99a42f3 commit 77b90f0

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed

configure

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,9 @@ Developer options (useful when working on FFmpeg itself):
269269
--disable-optimizations disable compiler optimizations
270270
--enable-extra-warnings enable more compiler warnings
271271
--disable-stripping disable stripping of executables and shared libraries
272+
--valgrind=VALGRIND run "make fate" tests through valgrind to detect memory
273+
leaks and errors, using the specified valgrind binary.
274+
Cannot be combined with --target-exec
272275
--samples=PATH location of test samples for FATE, if not set use
273276
\$FATE_SAMPLES at make invocation time.
274277
@@ -1315,6 +1318,7 @@ CMDLINE_SET="
13151318
target_exec
13161319
target_os
13171320
target_path
1321+
valgrind
13181322
"
13191323

13201324
CMDLINE_APPEND="
@@ -3239,6 +3243,7 @@ fi
32393243

32403244
enabled debug && add_cflags -g"$debuglevel" && add_asflags -g"$debuglevel"
32413245
enabled coverage && add_cflags "-fprofile-arcs -ftest-coverage" && add_ldflags "-fprofile-arcs -ftest-coverage"
3246+
test -n "$valgrind" && target_exec="$valgrind --error-exitcode=1 --malloc-fill=0x2a --track-origins=yes --leak-check=full --gen-suppressions=all --suppressions=tests/fate-valgrind.supp"
32423247

32433248
# add some useful compiler flags if supported
32443249
check_cflags -Wdeclaration-after-statement

tests/fate-valgrind.supp

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# seems fixed in newer versions
2+
# http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=577135
3+
{
4+
zlib-inflate
5+
Memcheck:Cond
6+
fun:inflateReset2
7+
fun:inflateInit2_
8+
}
9+
# libc overreads on purpose
10+
# http://sourceware.org/bugzilla/show_bug.cgi?id=12424
11+
{
12+
eval-strtod
13+
Memcheck:Addr8
14+
fun:__GI___strncasecmp_l
15+
fun:____strtod_l_internal
16+
fun:av_strtod
17+
}
18+
{
19+
eval-strtod
20+
Memcheck:Value8
21+
fun:__GI___strncasecmp_l
22+
fun:____strtod_l_internal
23+
fun:av_strtod
24+
}
25+
{
26+
eval-strtod
27+
Memcheck:Cond
28+
fun:__GI___strncasecmp_l
29+
fun:____strtod_l_internal
30+
fun:av_strtod
31+
}

0 commit comments

Comments
 (0)