aboutgitcodebugslistschat
path: root/test/valgrind.supp
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2023-11-16 20:15:58 +1100
committerStefano Brivio <sbrivio@redhat.com>2023-11-19 09:10:12 +0100
commitf7724647b19e0e20d6a11e0405f15e4ff169394e (patch)
treeb0064ee7a8ab08fb353cf98f95cf482fea6dd422 /test/valgrind.supp
parent457ff122e33cf6a6e559b073f41c530e42d9c597 (diff)
downloadpasst-f7724647b19e0e20d6a11e0405f15e4ff169394e.tar
passt-f7724647b19e0e20d6a11e0405f15e4ff169394e.tar.gz
passt-f7724647b19e0e20d6a11e0405f15e4ff169394e.tar.bz2
passt-f7724647b19e0e20d6a11e0405f15e4ff169394e.tar.lz
passt-f7724647b19e0e20d6a11e0405f15e4ff169394e.tar.xz
passt-f7724647b19e0e20d6a11e0405f15e4ff169394e.tar.zst
passt-f7724647b19e0e20d6a11e0405f15e4ff169394e.zip
valgrind: Adjust suppression for MSG_TRUNC with NULL buffer
valgrind complains if we pass a NULL buffer to recv(), even if we use MSG_TRUNC, in which case it's actually safe. For a long time we've had a valgrind suppression for this. It singles out the recv() in tcp_sock_consume(), the only place we use MSG_TRUNC. However, tcp_sock_consume() only has a single caller, which makes it a prime candidate for inlining. If inlined, it won't appear on the stack and valgrind won't match the correct suppression. It appears that certain compiler versions (for example gcc-13.2.1 in Fedora 39) will inline this function even with the -O0 we use for valgrind builds. This breaks the suppression leading to a spurious failure in the tests. There's not really any way to adjust the suppression itself without making it overly broad (we don't want to match other recv() calls). So, as a hack explicitly prevent inlining of this function when we're making a valgrind build. To accomplish this add an explicit -DVALGRIND when making such a build. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'test/valgrind.supp')
-rw-r--r--test/valgrind.supp3
1 files changed, 1 insertions, 2 deletions
diff --git a/test/valgrind.supp b/test/valgrind.supp
index 1228056..a158394 100644
--- a/test/valgrind.supp
+++ b/test/valgrind.supp
@@ -3,7 +3,6 @@
passt_recv_MSG_TRUNC_into_NULL_buffer
Memcheck:Param
socketcall.recvfrom(buf)
- fun:recv
...
- fun:tcp_sock_consume*
+ fun:tcp_sock_consume
}