tests: Workaround valgrind limitations with ghash

Valgrind can't deal with the space-saving optimisations in GHashTable in
GLib 2.60 which store small pointers into 32bit ints.  Force valgrind to
give out large pointers, effectively disabling the space-saving feature,
allowing valgrind to find the pointers.

Fixes #11766
Closes #11776
This commit is contained in:
Allison Karlitskaya 2019-05-08 18:00:37 +02:00 committed by Martin Pitt
parent 11a24d11e4
commit e3bf88bc2a
2 changed files with 8 additions and 0 deletions

View File

@ -295,6 +295,10 @@ VALGRIND_SUPPRESSIONS = \
tools/json-glib.supp \
$(NULL)
if VALGRIND_MINADDR_HACK
VALGRIND_ARGS += --aspace-minaddr=0x100000000
endif
valgrind-suppressions: $(VALGRIND_SUPPRESSIONS)
$(AM_V_GEN) cat $^ > $@

View File

@ -50,6 +50,10 @@ AC_ISC_POSIX
AC_HEADER_STDC
AC_PROG_LN_S
# HACK - Prevent valgrind false-positives due to GHashTable trickery
AC_CHECK_SIZEOF([void *])
AM_CONDITIONAL([VALGRIND_MINADDR_HACK], [test "$ac_cv_sizeof_void_p" -eq 8])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
AC_MSG_CHECKING([whether to install to prefix only])