From: Sebastian Harl Date: Sat, 4 Jun 2016 20:21:48 +0000 (+0200) Subject: Valgrind: Suppress a bogus invalid read on FreeBSD. X-Git-Tag: collectd-5.6.0~234^2 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=6f8642c6df35a876f2f0bce3557886d45ac41a7a;p=collectd.git Valgrind: Suppress a bogus invalid read on FreeBSD. Valgrind reports an invalid read in common.c:parse_value. The error is supposed to happen in strlen() on a just previously strdup()ed string. Possibly, this is some sort of alignment issue. The read size is reported to be 4 on a buffer of size 3. https://bugzilla.redhat.com/show_bug.cgi?id=678518 may also be related. --- diff --git a/src/valgrind.FreeBSD.suppress b/src/valgrind.FreeBSD.suppress new file mode 100644 index 00000000..28ea6772 --- /dev/null +++ b/src/valgrind.FreeBSD.suppress @@ -0,0 +1,8 @@ +{ + strlen_bogus_invalid_read_after_strdup + Memcheck:Addr4 + fun:parse_value + fun:parse_values + fun:test_parse_values + fun:main +} diff --git a/testwrapper.sh b/testwrapper.sh index f8593a11..a86705fc 100755 --- a/testwrapper.sh +++ b/testwrapper.sh @@ -14,6 +14,14 @@ if test -n "$VALGRIND"; then MEMCHECK="$MEMCHECK --trace-children=yes" MEMCHECK="$MEMCHECK --leak-check=full" MEMCHECK="$MEMCHECK --gen-suppressions=all" + + for f in "valgrind.$( uname -s ).suppress" "valgrind.suppress"; do + filename="$( dirname "$0" )/src/$f" + if test -e "$filename"; then + # Valgrind supports up to 100 suppression files. + MEMCHECK="$MEMCHECK --suppressions=$filename" + fi + done fi exec $MEMCHECK "$@"