]> git.ipfire.org Git - thirdparty/nettle.git/commitdiff
Fix problem with configure invocation of valgrind hanging if msan is enabled.
authorNiels Möller <nisse@lysator.liu.se>
Fri, 13 Dec 2024 14:19:44 +0000 (15:19 +0100)
committerNiels Möller <nisse@lysator.liu.se>
Fri, 13 Dec 2024 14:19:44 +0000 (15:19 +0100)
ChangeLog
aclocal.m4

index 8573c7862dc90b2ced3acddbdc6ebe0aa25c94ab..83d4c982f1d989d218aa30d1cd1ead9b6c47790a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2024-12-13  Niels Möller  <nisse@lysator.liu.se>
+
+       * 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  <nisse@lysator.liu.se>
 
        * run-tests: Cleanup, guided by shellcheck warnings. Use $()
index 629db8a7d20b9ea91b2fd333f4ab8d31da0dd46f..de7f23316694c8ec8f92438f03afa4f42d04c03e 100644 (file)
@@ -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