From bab4cd48c05263e187a3bc27439b1714359137ba Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Tue, 21 Nov 2023 11:40:13 +0100 Subject: [PATCH] valgrind: add valgrind suppression for memmove() overlap This valgrind error is raised by Ubuntu 23:10, with valgrind 1:3.21.0-0ubuntu1 and glibc 2.38-1ubuntu6: ==141967== Source and destination overlap in memcpy_chk(0x1ffefffe98, 0x1ffefffe92, 8) ==141967== at 0x4851042: __memcpy_chk (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so) ==141967== by 0x502A9CC: memmove (string_fortified.h:36) ==141967== by 0x502A9CC: inet_pton6 (inet_pton.c:226) ==141967== by 0x502A9CC: __inet_pton_length (inet_pton.c:56) ==141967== by 0x502A9CC: inet_pton (inet_pton.c:69) ==141967== by 0x114FA3: nmtst_inet6_from_string_p (nm-test-utils.h:1764) ==141967== by 0x114FA3: _nmtst_assert_ip6_address (nm-test-utils.h:1856) ==141967== by 0x114FA3: test_stable_privacy (test-utils.c:26) ==141967== by 0x4DEC85D: ??? (in /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.7800.0) ==141967== by 0x4DEC78A: ??? (in /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.7800.0) ==141967== by 0x4DECD2A: g_test_run_suite (in /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.7800.0) ==141967== by 0x4DECE07: g_test_run (in /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.7800.0) ==141967== by 0x4F070CF: (below main) (libc_start_call_main.h:58) ==141967== { Memcheck:Overlap fun:__memcpy_chk fun:memmove fun:inet_pton6 fun:__inet_pton_length fun:inet_pton fun:nmtst_inet6_from_string_p fun:_nmtst_assert_ip6_address fun:test_stable_privacy obj:/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.7800.0 obj:/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.7800.0 fun:g_test_run_suite fun:g_test_run fun:(below main) } Its not clear to me, why this would happen. In any case, it seems like a false positive. Add a suppression. --- valgrind.suppressions | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/valgrind.suppressions b/valgrind.suppressions index 3109671ae6..0552625192 100644 --- a/valgrind.suppressions +++ b/valgrind.suppressions @@ -499,3 +499,13 @@ fun:btrfs_reflink_with_progress ... } +{ + _memmove_overlap + Memcheck:Overlap + fun:__memcpy_chk + fun:memmove + fun:inet_pton6 + fun:__inet_pton_length + fun:inet_pton + ... +}