]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Fixes related to Bug 392331
authorPaul Floyd <pjfloyd@wanadoo.fr>
Mon, 26 Dec 2022 08:04:17 +0000 (09:04 +0100)
committerPaul Floyd <pjfloyd@wanadoo.fr>
Mon, 26 Dec 2022 08:04:17 +0000 (09:04 +0100)
1. Added C++17 check to configure.ac
2. Needed Linux version of suppression
3. Added a filter for pthread_cond_signal

13 files changed:
configure.ac
helgrind/tests/Makefile.am
helgrind/tests/bug392331.supp
helgrind/tests/bug392331.vgtest
helgrind/tests/bug392331_supp.vgtest
helgrind/tests/filter_stderr.in
helgrind/tests/tc20_verifywrap.stderr.exp
helgrind/tests/tc20_verifywrap.stderr.exp-glibc-2.18
helgrind/tests/tc20_verifywrap.stderr.exp-glibc-2.21
helgrind/tests/tc20_verifywrap.stderr.exp-mips32
helgrind/tests/tc20_verifywrap.stderr.exp-mips32-b
helgrind/tests/tc20_verifywrap.stderr.exp-s390x
helgrind/tests/tc20_verifywrap.stderr.exp-solaris

index 5ae93771195ac9488a3e5a6763cf1dff1d521655..467c98e023458fbbf21df683a61bdeac09b4a30a 100755 (executable)
@@ -2009,6 +2009,26 @@ AC_MSG_RESULT([no])
 # clang 3.3 cannot process <thread> from e.g.
 # gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3
 
+AC_MSG_CHECKING([that C++ compiler can compile C++17 code])
+AC_LANG(C++)
+safe_CXXFLAGS=$CXXFLAGS
+CXXFLAGS=-std=c++17
+
+AC_COMPILE_IFELSE([AC_LANG_SOURCE([
+int x;
+])],
+[
+ac_have_cxx_17=yes
+AC_MSG_RESULT([yes])
+], [
+ac_have_cxx_17=no
+AC_MSG_RESULT([no])
+])
+CXXFLAGS=$safe_CXXFLAGS
+AC_LANG(C)
+
+AM_CONDITIONAL(HAVE_CXX17, test x$ac_have_cxx_17 = xyes)
+
 AC_MSG_CHECKING([that C++ compiler can include <thread> header file])
 AC_LANG(C++)
 safe_CXXFLAGS=$CXXFLAGS
index 926a367c7e091608286d2cc763c7fd109d2baffb..2286e220f1ed236f466cc6c17d103bd4531092d0 100755 (executable)
@@ -142,7 +142,6 @@ noinst_HEADERS = safe-pthread.h safe-semaphore.h
 # should be conditionally compiled like tc20_verifywrap is.
 check_PROGRAMS = \
        annotate_hbefore \
-       bug392331 \
        cond_init_destroy \
        cond_timedwait_invalid \
        cond_timedwait_test \
@@ -242,6 +241,9 @@ annotate_hbefore_CFLAGS = $(AM_CFLAGS)
 endif
 
 bug322621_SOURCES = bug322621.cpp
+if HAVE_CXX17
+check_PROGRAMS += bug392331
 bug392331_SOURCES = bug392331.cpp
 bug392331_CXXFLAGS = $(AM_CXXFLAGS) -std=c++17
+endif
 
index 8262d142e1b3feb34d6d0fe77cdcd12821988fe5..6b8c5e1174dd72851258558786cfce320ad1a7f2 100644 (file)
@@ -1,7 +1,25 @@
 {
-   Check that Dubious suppression works
+   Check that Dubious suppression works FreeBSD
    Helgrind:Dubious
    fun:pthread_cond_signal_WRK
    fun:pthread_cond_signal
    fun:_ZNSt3__118condition_variable10notify_oneEv
 }
+{
+   Check that Dubious suppression works Linux standalone
+   Helgrind:Dubious
+   fun:pthread_cond_signal_WRK
+   fun:pthread_cond_signal@*
+   fun:__gthread_cond_signal
+   fun:UnknownInlinedFun
+   fun:_ZNSt18condition_variable10notify_oneEv
+}
+# for some very strange reason the suppression is different
+# when running under regtest
+{
+   Check that Dubious suppression works Linux regtest
+   Helgrind:Dubious
+   fun:pthread_cond_signal_WRK
+   fun:pthread_cond_signal@*
+   fun:_ZNSt18condition_variable10notify_oneEv
+}
index 6c4aff6bf147582e8d2a302747e24298e55828d8..c160dcd40e33d79992e570efd3c5523a0bd4626a 100644 (file)
@@ -1,2 +1,3 @@
+prereq: test -e bug392331
 vgopts: -q
 prog: bug392331
index 611b4ca8142d416ab84162df6c98895a6147ba95..64fc729607db4d41f052db28f5eac22b554a58b0 100644 (file)
@@ -1,2 +1,3 @@
+prereq: test -e bug392331
 vgopts: -q --suppressions=bug392331.supp
 prog: bug392331
index 9953b6527f84786892ab57d0edf39da8fc3bb1a1..e7fecf5916a2a607d7baa4500dfd6b3662b14632 100755 (executable)
@@ -60,6 +60,9 @@ $SED \
 # Some arches return ENOSYS instead of EINVAL for undefined futex operations.
 $SED -e "s/with error code 38 (ENOSYS: Function not implemented)/with error code 22 (EINVAL: Invalid argument)/" |
 
+# filter differences in pthread_cond_signal
+$SED -e "s/pthread_cond_signal@\*/pthread_cond_signal/" |
+
 $dir/../../helgrind/tests/filter_helgrind "$@"
 
 exit 0
index 372daeab76e9ffffaef8208ef521cfbc382478c7..e5e128d837f611729f9eee5ec4b9138284cadac5 100644 (file)
@@ -124,7 +124,7 @@ Thread #x's call to pthread_cond_wait failed
 
 Thread #x: pthread_cond_{signal,broadcast}: dubious: associated lock is not held by any thread
    at 0x........: pthread_cond_signal_WRK (hg_intercepts.c:...)
-   by 0x........: pthread_cond_signal@* (hg_intercepts.c:...)
+   by 0x........: pthread_cond_signal (hg_intercepts.c:...)
    by 0x........: main (tc20_verifywrap.c:167)
 
 
index b823d4000c4f5740f5df75adabfb303668247a49..8b691ab83861f0b72ec28c3961d99a66aa11404c 100644 (file)
@@ -116,7 +116,7 @@ Thread #x's call to pthread_cond_wait failed
 
 Thread #x: pthread_cond_{signal,broadcast}: dubious: associated lock is not held by any thread
    at 0x........: pthread_cond_signal_WRK (hg_intercepts.c:...)
-   by 0x........: pthread_cond_signal@* (hg_intercepts.c:...)
+   by 0x........: pthread_cond_signal (hg_intercepts.c:...)
    by 0x........: main (tc20_verifywrap.c:167)
 
 
index 2a2ee9b5d2964a69e0b07b60f4ffa4ea5dd66928..cef930f2ad3ae3d3395ed6f3e05b807e8bbb1e2d 100644 (file)
@@ -124,7 +124,7 @@ Thread #x's call to pthread_cond_wait failed
 
 Thread #x: pthread_cond_{signal,broadcast}: dubious: associated lock is not held by any thread
    at 0x........: pthread_cond_signal_WRK (hg_intercepts.c:...)
-   by 0x........: pthread_cond_signal@* (hg_intercepts.c:...)
+   by 0x........: pthread_cond_signal (hg_intercepts.c:...)
    by 0x........: main (tc20_verifywrap.c:167)
 
 
index be739007902d00f128e8dc368b39f3c9cbb56ca4..7aecc1df2d9ac5bc89b910e96d9b1da88909341e 100644 (file)
@@ -124,7 +124,7 @@ Thread #x's call to pthread_cond_wait failed
 
 Thread #x: pthread_cond_{signal,broadcast}: dubious: associated lock is not held by any thread
    at 0x........: pthread_cond_signal_WRK (hg_intercepts.c:...)
-   by 0x........: pthread_cond_signal@* (hg_intercepts.c:...)
+   by 0x........: pthread_cond_signal (hg_intercepts.c:...)
    by 0x........: main (tc20_verifywrap.c:167)
 
 
index d3f17d15060f054f00e402fa3f7ec93a9e6b6cb7..d5bb6f83d8d28826f8ee0fff3edad2bbcb998885 100644 (file)
@@ -124,7 +124,7 @@ Thread #x's call to pthread_cond_wait failed
 
 Thread #x: pthread_cond_{signal,broadcast}: dubious: associated lock is not held by any thread
    at 0x........: pthread_cond_signal_WRK (hg_intercepts.c:...)
-   by 0x........: pthread_cond_signal@* (hg_intercepts.c:...)
+   by 0x........: pthread_cond_signal (hg_intercepts.c:...)
    by 0x........: main (tc20_verifywrap.c:167)
 
 
index f19215efb5200aa2468ba45bb08cb4d0a4e907f9..7737447ba4fd890ee440f020894111b202b3749e 100644 (file)
@@ -126,7 +126,7 @@ Thread #x's call to pthread_cond_wait failed
 
 Thread #x: pthread_cond_{signal,broadcast}: dubious: associated lock is not held by any thread
    at 0x........: pthread_cond_signal_WRK (hg_intercepts.c:...)
-   by 0x........: pthread_cond_signal@* (hg_intercepts.c:...)
+   by 0x........: pthread_cond_signal (hg_intercepts.c:...)
    by 0x........: main (tc20_verifywrap.c:167)
 
 
index 891b504908b73d3ee81dc5ce2c6a93467dbd4049..64edaaca2f3834c78551e066bc77ec6934633c1e 100644 (file)
@@ -116,7 +116,7 @@ Thread #x's call to pthread_cond_wait failed
 
 Thread #x: pthread_cond_{signal,broadcast}: dubious: associated lock is not held by any thread
    at 0x........: pthread_cond_signal_WRK (hg_intercepts.c:...)
-   by 0x........: pthread_cond_signal@* (hg_intercepts.c:...)
+   by 0x........: pthread_cond_signal (hg_intercepts.c:...)
    by 0x........: main (tc20_verifywrap.c:167)