]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Add Helgrind and DRD tests and suppressions for getaddrinfo on Linux
authorPaul Floyd <pjfloyd@wanadoo.fr>
Fri, 5 May 2023 20:05:36 +0000 (22:05 +0200)
committerPaul Floyd <pjfloyd@wanadoo.fr>
Fri, 5 May 2023 20:05:36 +0000 (22:05 +0200)
Bump version to 3.22.0.GIT

The testcase was posted on the freebsd-hackers mailing list.
I had time to get suppressions for FreeBSD into 3.21 but
ran out of time for the test and Linux suppressions.

I did take a look at how thread sanitizer handles this.
Basically it intercepts the call, turns off checking,
calls the resl function then turns checking back on.

I don't see many other similar examples. Might be worth
looking at dlopen and atexit.

12 files changed:
.gitignore
NEWS
configure.ac
drd/tests/Makefile.am
drd/tests/getaddrinfo.stderr.exp [new file with mode: 0644]
drd/tests/getaddrinfo.vgtest [new file with mode: 0644]
glibc-2.X-drd.supp.in
glibc-2.X-helgrind.supp.in
helgrind/tests/Makefile.am
helgrind/tests/getaddrinfo.c [new file with mode: 0644]
helgrind/tests/getaddrinfo.stderr.exp [new file with mode: 0644]
helgrind/tests/getaddrinfo.vgtest [new file with mode: 0644]

index 27183b99b9295d401855f7378a301a97860000f3..6155f8f355a5ae505bd39dbddb7d4f7883652749 100644 (file)
 /helgrind/tests/cond_timedwait_test
 /helgrind/tests/free_is_write
 /helgrind/tests/garbage.filtered.out
+/helgrind/tests/getaddrinfo
 /helgrind/tests/hg01_all_ok
 /helgrind/tests/hg02_deadlock
 /helgrind/tests/hg03_inherit
diff --git a/NEWS b/NEWS
index 342a733650a7247ebc0ba0da91cfa802440fc319..e269d128b98ad6b65bbd3ff2a8d50106bbf61676 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,37 @@
+Release 3.22.0 (?? Oct 2023)
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+This release supports X86/Linux, AMD64/Linux, ARM32/Linux, ARM64/Linux,
+PPC32/Linux, PPC64BE/Linux, PPC64LE/Linux, S390X/Linux, MIPS32/Linux,
+MIPS64/Linux, ARM/Android, ARM64/Android, MIPS32/Android, X86/Android,
+X86/Solaris, AMD64/Solaris, AMD64/MacOSX 10.12, X86/FreeBSD and
+AMD64/FreeBSD.  There is also preliminary support for X86/macOS 10.13,
+AMD64/macOS 10.13 and nanoMIPS/Linux.
+
+* ==================== CORE CHANGES ===================
+
+
+* ================== PLATFORM CHANGES =================
+
+
+* ==================== TOOL CHANGES ===================
+
+
+* ==================== FIXED BUGS ====================
+
+The following bugs have been fixed or resolved.  Note that "n-i-bz"
+stands for "not in bugzilla" -- that is, a bug that was reported to us
+but never got a bugzilla entry.  We encourage you to file bugs in
+bugzilla (https://bugs.kde.org/enter_bug.cgi?product=valgrind) rather
+than mailing the developers (or mailing lists) directly -- bugs that
+are not entered into bugzilla tend to get forgotten about or ignored.
+
+
+
+To see details of a given bug, visit
+  https://bugs.kde.org/show_bug.cgi?id=XXXXXX
+where XXXXXX is the bug number as listed above.
+
 Release 3.21.0 (28 Apr 2023)
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
index 79b17f394000b83f625db80dcd00bedcff437c99..15fbf5ea206d69a7e10c9858ebd00fda5bc2e945 100755 (executable)
 # Also set the (expected/last) release date here.
 # Do not forget to rerun ./autogen.sh
 m4_define([v_major_ver], [3])
-m4_define([v_minor_ver], [21])
+m4_define([v_minor_ver], [22])
 m4_define([v_micro_ver], [0])
-m4_define([v_suffix_ver], [])
-m4_define([v_rel_date], ["28 Apr 2023"])
+m4_define([v_suffix_ver], [GIT])
+m4_define([v_rel_date], ["?? Oct 2023"])
 m4_define([v_version],
          m4_if(v_suffix_ver, [],
                [v_major_ver.v_minor_ver.v_micro_ver],
index 7ea83cbf7e08e9c7a6784e51a96ce639ee4fca35..5482cf7be4309036ac404d5e7ebb3a548dcdd8e8 100755 (executable)
@@ -152,6 +152,8 @@ EXTRA_DIST =                                        \
        hold_lock_1.vgtest                          \
        hold_lock_2.stderr.exp                      \
        hold_lock_2.vgtest                          \
+       getaddrinfo.stderr.exp                      \
+       getaddrinfo.vgtest                          \
        linuxthreads_det.stderr.exp                 \
        linuxthreads_det.stderr.exp-linuxthreads    \
        linuxthreads_det.stdout.exp                 \
diff --git a/drd/tests/getaddrinfo.stderr.exp b/drd/tests/getaddrinfo.stderr.exp
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/drd/tests/getaddrinfo.vgtest b/drd/tests/getaddrinfo.vgtest
new file mode 100644 (file)
index 0000000..6faa2b6
--- /dev/null
@@ -0,0 +1,3 @@
+prereq: ./supported_libpthread
+vgopts: -q
+prog: ../../helgrind/tests/getaddrinfo
index 4c6bdb6a1a97a2535dfd7843540157aedab0e164..9f8fda9f4fc22cfa3cbecd06cc2541ec3a2731e4 100644 (file)
    ...
    fun:_ZN5boost6detail23set_current_thread_dataEPNS0_16thread_data_baseE
 }
+
+#
+# Suppression patterrns for posix functions
+{
+   drd-libc-getaddrinfo
+   drd:ConflictingAccess
+   ...
+   fun:getaddrinfo
+}
+
index 0f76ad0e9a2101afec0f744e141cc87c81cda9fa..d46a7a1166f87fc77ca0da3a0a50214673e7dd0a 100644 (file)
    Helgrind:Race
    fun:gomp_ordered_last
 }
+
+####################################################
+# posix functions that are thread safe
+{
+   helgrind---getaddrinfo
+   Helgrind:Race
+   ...
+   fun:getaddrinfo
+}
index 5338ea4d6db00db5cd37fa61b6a0ba83122a31ee..13e2d4db66d1c5774ebf7e82ca658b759a036b98 100755 (executable)
@@ -33,6 +33,7 @@ EXTRA_DIST = \
        bar_trivial.vgtest bar_trivial.stdout.exp bar_trivial.stderr.exp \
        free_is_write.vgtest free_is_write.stdout.exp \
                free_is_write.stderr.exp \
+       getaddrinfo.vgtest getaddrinfo.stderr.exp \
        hg01_all_ok.vgtest hg01_all_ok.stdout.exp hg01_all_ok.stderr.exp \
        hg02_deadlock.vgtest hg02_deadlock.stdout.exp hg02_deadlock.stderr.exp \
        hg03_inherit.vgtest hg03_inherit.stdout.exp hg03_inherit.stderr.exp \
@@ -153,6 +154,7 @@ check_PROGRAMS = \
        cond_timedwait_invalid \
        cond_timedwait_test \
        free_is_write \
+       getaddrinfo \
        hg01_all_ok \
        hg02_deadlock \
        hg03_inherit \
diff --git a/helgrind/tests/getaddrinfo.c b/helgrind/tests/getaddrinfo.c
new file mode 100644 (file)
index 0000000..bdb8434
--- /dev/null
@@ -0,0 +1,38 @@
+#include <netdb.h>
+#include <pthread.h>
+#include <sys/socket.h>
+#include <sys/types.h>
+
+struct data {
+    const char *hostname;
+    struct addrinfo *res;
+};
+
+struct data threaddat[5] = {
+    { "www.freebsd.org", 0 },
+    { "www.google.com", 0 },
+    { "www.freshports.org", 0 },
+    { "www.github.com", 0 },
+    { "www.kernel.org", 0 }
+};
+
+pthread_t threads[5];
+
+void *resolve(void *d) {
+    struct data *data = d;
+    getaddrinfo(data->hostname, 0, 0, &data->res);
+    return 0;
+}
+
+int main(void) {
+    int i;
+    for (i = 0; i < 5; ++i) {
+        pthread_create(&threads[i], 0, resolve, &threaddat[i]);
+    }
+    for (i = 0; i < 5; ++i) {
+        pthread_join(threads[i], 0);
+        freeaddrinfo(threaddat[i].res);
+    }
+    return 0;
+}
+
diff --git a/helgrind/tests/getaddrinfo.stderr.exp b/helgrind/tests/getaddrinfo.stderr.exp
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/helgrind/tests/getaddrinfo.vgtest b/helgrind/tests/getaddrinfo.vgtest
new file mode 100644 (file)
index 0000000..b58c618
--- /dev/null
@@ -0,0 +1,2 @@
+prog: getaddrinfo
+vgopts: -q