From: Martin Cermak Date: Wed, 28 May 2025 16:04:46 +0000 (+0200) Subject: Hide "client tried to modify addresses" warnings when -q (quiet) is set X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=47f2f1df4112e9befe2d0039d7e4f6c957669b6e;p=thirdparty%2Fvalgrind.git Hide "client tried to modify addresses" warnings when -q (quiet) is set When -q is set, that is when verbosity is 0, the "client tried to modify addresses" warning should be hidden. Also remove the warning from {freebsd,solaris}/scalar.stderr.exp Reproducer: TESTS=munmap03 make -j$(nproc) ltpchecks https://bugs.kde.org/show_bug.cgi?id=504919 --- diff --git a/NEWS b/NEWS index dab995c63..041d7afdf 100644 --- a/NEWS +++ b/NEWS @@ -38,6 +38,7 @@ are not entered into bugzilla tend to get forgotten about or ignored. 504466 Double close causes SEGV 504904 Hide "bad act handler address" warnings when -q (quiet) flag is set 504909 Hide "Bad oldset address" warnings when -q (quiet) flag is set +504919 Hide "client tried to modify addresses" warnings when -q (quiet) set 504936 Add FreeBSD amd64 sysarch subcommands AMD64_SET_TLSBASE and AMD64_GET_TLSBASE diff --git a/coregrind/m_syswrap/syswrap-generic.c b/coregrind/m_syswrap/syswrap-generic.c index 98cbb172f..f8d73e197 100644 --- a/coregrind/m_syswrap/syswrap-generic.c +++ b/coregrind/m_syswrap/syswrap-generic.c @@ -121,9 +121,11 @@ Bool ML_(valid_client_addr)(Addr start, SizeT size, ThreadId tid, syscallname, start, start+size-1, (Int)ret); if (!ret && syscallname != NULL) { - VG_(message)(Vg_UserMsg, "Warning: client syscall %s tried " - "to modify addresses %#lx-%#lx\n", - syscallname, start, start+size-1); + if (VG_(clo_verbosity) >= 1) { + VG_(message)(Vg_UserMsg, "Warning: client syscall %s tried " + "to modify addresses %#lx-%#lx\n", + syscallname, start, start+size-1); + } if (VG_(clo_verbosity) > 1) { VG_(get_and_pp_StackTrace)(tid, VG_(clo_backtrace_size)); } diff --git a/memcheck/tests/freebsd/scalar.stderr.exp b/memcheck/tests/freebsd/scalar.stderr.exp index 59ed18524..24b7ba2bb 100644 --- a/memcheck/tests/freebsd/scalar.stderr.exp +++ b/memcheck/tests/freebsd/scalar.stderr.exp @@ -610,7 +610,6 @@ Syscall param mprotect(len) contains uninitialised byte(s) Syscall param mprotect(prot) contains uninitialised byte(s) ... -Warning: client syscall mprotect tried to modify addresses 0x........-0x........ --------------------------------------------------------- 75: SYS_madvise 3s 0m --------------------------------------------------------- diff --git a/memcheck/tests/freebsd/scalar.stderr.exp-x86 b/memcheck/tests/freebsd/scalar.stderr.exp-x86 index 091a1770d..788dfbd7c 100644 --- a/memcheck/tests/freebsd/scalar.stderr.exp-x86 +++ b/memcheck/tests/freebsd/scalar.stderr.exp-x86 @@ -610,7 +610,6 @@ Syscall param mprotect(len) contains uninitialised byte(s) Syscall param mprotect(prot) contains uninitialised byte(s) ... -Warning: client syscall mprotect tried to modify addresses 0x........-0x........ --------------------------------------------------------- 75: SYS_madvise 3s 0m --------------------------------------------------------- diff --git a/memcheck/tests/solaris/scalar.stderr.exp b/memcheck/tests/solaris/scalar.stderr.exp index d80bc27d0..e7951dae7 100644 --- a/memcheck/tests/solaris/scalar.stderr.exp +++ b/memcheck/tests/solaris/scalar.stderr.exp @@ -618,7 +618,6 @@ Syscall param shmsys_shmdt(opcode) contains uninitialised byte(s) Syscall param shmsys_shmdt(shmaddr) contains uninitialised byte(s) ... -Warning: client syscall shmdt tried to modify addresses 0x........-0x........ --------------------------------------------------------- 52: SYS_shmsys (SHMGET) 4s 0m ---------------------------------------------------------