From: Niels Möller Date: Fri, 13 Dec 2024 14:19:44 +0000 (+0100) Subject: Fix problem with configure invocation of valgrind hanging if msan is enabled. X-Git-Tag: nettle_3.10.1_release_20241230~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=159cfa5c8645a6020a4e3789417fba916ecfa15f;p=thirdparty%2Fnettle.git Fix problem with configure invocation of valgrind hanging if msan is enabled. --- diff --git a/ChangeLog b/ChangeLog index 8573c786..83d4c982 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2024-12-13 Niels Möller + + * aclocal.m4 (NETTLE_PROG_VALGRIND): Check if executable appears + to include lsan, asan or msan symbols, and if so, don't attempt to + run valgrind. + 2024-10-16 Niels Möller * run-tests: Cleanup, guided by shellcheck warnings. Use $() diff --git a/aclocal.m4 b/aclocal.m4 index 629db8a7..de7f2331 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -552,7 +552,14 @@ AC_DEFUN([NETTLE_PROG_VALGRIND], [AC_CACHE_CHECK([if valgrind is working], nettle_cv_prog_valgrind, [AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])], [ - if valgrind -q ./conftest$EXEEXT 2>&AS_MESSAGE_LOG_FD; then + # Valgrind is known to work poorly and sometimes hang indefinitely + # on executables built with gcc's leak-sanitizer and + # address-sanitizer, and with clang's memory sanitizer. Attempt to + # work around. See https://bugs.kde.org/show_bug.cgi?id=492255 + if "$NM" ./conftest$EXEEXT 2>&AS_MESSAGE_LOG_FD | + grep '_lsan_\|_msan_\|_asan_' >/dev/null; then + nettle_cv_prog_valgrind=no + elif valgrind -q ./conftest$EXEEXT 2>&AS_MESSAGE_LOG_FD; then nettle_cv_prog_valgrind=yes else nettle_cv_prog_valgrind=no