Skip to content

Commit

Permalink
Valgrind: Suppress a bogus invalid read on FreeBSD.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
tokkee committed Jun 4, 2016
1 parent e9b1ff6 commit 6f8642c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/valgrind.FreeBSD.suppress
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
strlen_bogus_invalid_read_after_strdup
Memcheck:Addr4
fun:parse_value
fun:parse_values
fun:test_parse_values
fun:main
}
8 changes: 8 additions & 0 deletions testwrapper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 "$@"
Expand Down

0 comments on commit 6f8642c

Please sign in to comment.