You can subscribe to this list here.
| 2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
(122) |
Nov
(152) |
Dec
(69) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2003 |
Jan
(6) |
Feb
(25) |
Mar
(73) |
Apr
(82) |
May
(24) |
Jun
(25) |
Jul
(10) |
Aug
(11) |
Sep
(10) |
Oct
(54) |
Nov
(203) |
Dec
(182) |
| 2004 |
Jan
(307) |
Feb
(305) |
Mar
(430) |
Apr
(312) |
May
(187) |
Jun
(342) |
Jul
(487) |
Aug
(637) |
Sep
(336) |
Oct
(373) |
Nov
(441) |
Dec
(210) |
| 2005 |
Jan
(385) |
Feb
(480) |
Mar
(636) |
Apr
(544) |
May
(679) |
Jun
(625) |
Jul
(810) |
Aug
(838) |
Sep
(634) |
Oct
(521) |
Nov
(965) |
Dec
(543) |
| 2006 |
Jan
(494) |
Feb
(431) |
Mar
(546) |
Apr
(411) |
May
(406) |
Jun
(322) |
Jul
(256) |
Aug
(401) |
Sep
(345) |
Oct
(542) |
Nov
(308) |
Dec
(481) |
| 2007 |
Jan
(427) |
Feb
(326) |
Mar
(367) |
Apr
(255) |
May
(244) |
Jun
(204) |
Jul
(223) |
Aug
(231) |
Sep
(354) |
Oct
(374) |
Nov
(497) |
Dec
(362) |
| 2008 |
Jan
(322) |
Feb
(482) |
Mar
(658) |
Apr
(422) |
May
(476) |
Jun
(396) |
Jul
(455) |
Aug
(267) |
Sep
(280) |
Oct
(253) |
Nov
(232) |
Dec
(304) |
| 2009 |
Jan
(486) |
Feb
(470) |
Mar
(458) |
Apr
(423) |
May
(696) |
Jun
(461) |
Jul
(551) |
Aug
(575) |
Sep
(134) |
Oct
(110) |
Nov
(157) |
Dec
(102) |
| 2010 |
Jan
(226) |
Feb
(86) |
Mar
(147) |
Apr
(117) |
May
(107) |
Jun
(203) |
Jul
(193) |
Aug
(238) |
Sep
(300) |
Oct
(246) |
Nov
(23) |
Dec
(75) |
| 2011 |
Jan
(133) |
Feb
(195) |
Mar
(315) |
Apr
(200) |
May
(267) |
Jun
(293) |
Jul
(353) |
Aug
(237) |
Sep
(278) |
Oct
(611) |
Nov
(274) |
Dec
(260) |
| 2012 |
Jan
(303) |
Feb
(391) |
Mar
(417) |
Apr
(441) |
May
(488) |
Jun
(655) |
Jul
(590) |
Aug
(610) |
Sep
(526) |
Oct
(478) |
Nov
(359) |
Dec
(372) |
| 2013 |
Jan
(467) |
Feb
(226) |
Mar
(391) |
Apr
(281) |
May
(299) |
Jun
(252) |
Jul
(311) |
Aug
(352) |
Sep
(481) |
Oct
(571) |
Nov
(222) |
Dec
(231) |
| 2014 |
Jan
(185) |
Feb
(329) |
Mar
(245) |
Apr
(238) |
May
(281) |
Jun
(399) |
Jul
(382) |
Aug
(500) |
Sep
(579) |
Oct
(435) |
Nov
(487) |
Dec
(256) |
| 2015 |
Jan
(338) |
Feb
(357) |
Mar
(330) |
Apr
(294) |
May
(191) |
Jun
(108) |
Jul
(142) |
Aug
(261) |
Sep
(190) |
Oct
(54) |
Nov
(83) |
Dec
(22) |
| 2016 |
Jan
(49) |
Feb
(89) |
Mar
(33) |
Apr
(50) |
May
(27) |
Jun
(34) |
Jul
(53) |
Aug
(53) |
Sep
(98) |
Oct
(206) |
Nov
(93) |
Dec
(53) |
| 2017 |
Jan
(65) |
Feb
(82) |
Mar
(102) |
Apr
(86) |
May
(187) |
Jun
(67) |
Jul
(23) |
Aug
(93) |
Sep
(65) |
Oct
(45) |
Nov
(35) |
Dec
(17) |
| 2018 |
Jan
(26) |
Feb
(35) |
Mar
(38) |
Apr
(32) |
May
(8) |
Jun
(43) |
Jul
(27) |
Aug
(30) |
Sep
(43) |
Oct
(42) |
Nov
(38) |
Dec
(67) |
| 2019 |
Jan
(32) |
Feb
(37) |
Mar
(53) |
Apr
(64) |
May
(49) |
Jun
(18) |
Jul
(14) |
Aug
(53) |
Sep
(25) |
Oct
(30) |
Nov
(49) |
Dec
(31) |
| 2020 |
Jan
(87) |
Feb
(45) |
Mar
(37) |
Apr
(51) |
May
(99) |
Jun
(36) |
Jul
(11) |
Aug
(14) |
Sep
(20) |
Oct
(24) |
Nov
(40) |
Dec
(23) |
| 2021 |
Jan
(14) |
Feb
(53) |
Mar
(85) |
Apr
(15) |
May
(19) |
Jun
(3) |
Jul
(14) |
Aug
(1) |
Sep
(57) |
Oct
(73) |
Nov
(56) |
Dec
(22) |
| 2022 |
Jan
(3) |
Feb
(22) |
Mar
(6) |
Apr
(55) |
May
(46) |
Jun
(39) |
Jul
(15) |
Aug
(9) |
Sep
(11) |
Oct
(34) |
Nov
(20) |
Dec
(36) |
| 2023 |
Jan
(79) |
Feb
(41) |
Mar
(99) |
Apr
(169) |
May
(48) |
Jun
(16) |
Jul
(16) |
Aug
(57) |
Sep
(32) |
Oct
|
Nov
|
Dec
|
|
From: Paul F. <pa...@so...> - 2023-02-25 14:20:18
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=b861458d3dcb8340a47c342ef161089594b18898 commit b861458d3dcb8340a47c342ef161089594b18898 Author: Paul Floyd <pj...@wa...> Date: Sat Feb 25 15:16:35 2023 +0100 FreeBSD: make rfork() fail more gracefully rfork() is barely used in base FreeBSD. The main use is in posix_spawn(). If rfork() fails with EINVAL then it falls back to using vfork(). This is preferable to Valgrind bombing. ksh93 uses posix_spawn. I tested bash and csh and they had no problems. Also add 'hello world" smoke tests for bash csh and ksh Diff: --- NEWS | 1 + coregrind/m_syswrap/syswrap-amd64-freebsd.c | 13 +++++++++---- coregrind/m_syswrap/syswrap-x86-freebsd.c | 11 ++++++++--- include/vki/vki-freebsd.h | 3 +++ none/tests/freebsd/Makefile.am | 14 +++++++++++++- none/tests/freebsd/bash_test.sh | 2 ++ none/tests/freebsd/bash_test.stderr.exp | 0 none/tests/freebsd/bash_test.stdout.exp | 1 + none/tests/freebsd/bash_test.vgtest | 4 ++++ none/tests/freebsd/csh_test.csh | 2 ++ none/tests/freebsd/csh_test.stderr.exp | 0 none/tests/freebsd/csh_test.stdout.exp | 1 + none/tests/freebsd/csh_test.vgtest | 2 ++ none/tests/freebsd/ksh_test.ksh | 2 ++ none/tests/freebsd/ksh_test.stderr.exp | 0 none/tests/freebsd/ksh_test.stdout.exp | 1 + none/tests/freebsd/ksh_test.vgtest | 4 ++++ 17 files changed, 53 insertions(+), 8 deletions(-) diff --git a/NEWS b/NEWS index 7fcfc667a2..c6ebdcb252 100644 --- a/NEWS +++ b/NEWS @@ -95,6 +95,7 @@ are not entered into bugzilla tend to get forgotten about or ignored. 464859 Build failures with GCC-13 (drd tsan_unittest) 464969 D language demangling 465435 m_libcfile.c:66 (vgPlain_safe_fd): Assertion 'newfd >= VG_(fd_hard_limit)' failed. +n-i-bz FreeBSD rfork syscall fail with EINVAL or EINVAL rather than VG_(unimplemented) To see details of a given bug, visit https://bugs.kde.org/show_bug.cgi?id=XXXXXX diff --git a/coregrind/m_syswrap/syswrap-amd64-freebsd.c b/coregrind/m_syswrap/syswrap-amd64-freebsd.c index dfbca4d7b5..4372e6b719 100644 --- a/coregrind/m_syswrap/syswrap-amd64-freebsd.c +++ b/coregrind/m_syswrap/syswrap-amd64-freebsd.c @@ -305,12 +305,17 @@ PRE(sys_clock_getcpuclockid2) PRE(sys_rfork) { PRINT("sys_rfork ( %#" FMT_REGWORD "x )", ARG1 ); - PRE_REG_READ1(long, "rfork", int, flags); + PRE_REG_READ1(pid_t, "rfork", int, flags); - VG_(message)(Vg_UserMsg, "rfork() not implemented"); - VG_(unimplemented)("Valgrind does not support rfork()."); + VG_(message)(Vg_UserMsg, "warning: rfork() not implemented\n"); - SET_STATUS_Failure(VKI_ENOSYS); + if ((UInt)ARG1 == VKI_RFSPAWN) { + // posix_spawn uses RFSPAWN and it will fall back to vfork + // if it sees EINVAL + SET_STATUS_Failure(VKI_EINVAL); + } else { + SET_STATUS_Failure(VKI_ENOSYS); + } } // SYS_preadv 289 diff --git a/coregrind/m_syswrap/syswrap-x86-freebsd.c b/coregrind/m_syswrap/syswrap-x86-freebsd.c index e28183d943..e8e5a2f89d 100644 --- a/coregrind/m_syswrap/syswrap-x86-freebsd.c +++ b/coregrind/m_syswrap/syswrap-x86-freebsd.c @@ -740,9 +740,14 @@ PRE(sys_rfork) *flags |= SfYieldAfter; } #else - VG_(message)(Vg_UserMsg, "rfork() not implemented"); - VG_(unimplemented)("Valgrind does not support rfork() yet."); - SET_STATUS_Failure( VKI_ENOSYS ); + VG_(message)(Vg_UserMsg, "rfork() not implemented\n"); + if ((UInt)ARG1 == VKI_RFSPAWN) { + // posix_spawn uses RFSPAWN and it will fall back to vfork + // if it sees EINVAL + SET_STATUS_Failure(VKI_EINVAL); + } else { + SET_STATUS_Failure(VKI_ENOSYS); + } #endif } diff --git a/include/vki/vki-freebsd.h b/include/vki/vki-freebsd.h index 2bbaa44188..f9ca51c036 100644 --- a/include/vki/vki-freebsd.h +++ b/include/vki/vki-freebsd.h @@ -1608,6 +1608,9 @@ struct vki_dirent { #define VKI_W_OK 0x02 /* test for write permission */ #define VKI_R_OK 0x04 /* test for read permission */ +#define VKI_RFSPAWN (1U<<31U) + + //---------------------------------------------------------------------- // From sys/msg.h //---------------------------------------------------------------------- diff --git a/none/tests/freebsd/Makefile.am b/none/tests/freebsd/Makefile.am index f956078d68..8148245c79 100644 --- a/none/tests/freebsd/Makefile.am +++ b/none/tests/freebsd/Makefile.am @@ -37,7 +37,19 @@ EXTRA_DIST = \ usrstack.stderr.exp \ usrstack.stdout.exp \ proc_pid_file.vgtest \ - proc_pid_file.stderr.exp + proc_pid_file.stderr.exp \ + bash_test.vgtest \ + bash_test.sh \ + bash_test.stderr.exp \ + bash_test.stdout.exp \ + csh_test.vgtest \ + csh_test.csh \ + csh_test.stderr.exp \ + csh_test.stdout.exp \ + ksh_test.vgtest \ + ksh_test.ksh \ + ksh_test.stderr.exp \ + ksh_test.stdout.exp check_PROGRAMS = \ auxv osrel swapcontext hello_world fexecve 452275 usrstack \ diff --git a/none/tests/freebsd/bash_test.sh b/none/tests/freebsd/bash_test.sh new file mode 100755 index 0000000000..de85e3bc8d --- /dev/null +++ b/none/tests/freebsd/bash_test.sh @@ -0,0 +1,2 @@ +#!/usr/local/bin/bash +echo Bash Hello, World! diff --git a/none/tests/freebsd/bash_test.stderr.exp b/none/tests/freebsd/bash_test.stderr.exp new file mode 100644 index 0000000000..e69de29bb2 diff --git a/none/tests/freebsd/bash_test.stdout.exp b/none/tests/freebsd/bash_test.stdout.exp new file mode 100644 index 0000000000..1826a62d1d --- /dev/null +++ b/none/tests/freebsd/bash_test.stdout.exp @@ -0,0 +1 @@ +Bash Hello, World! diff --git a/none/tests/freebsd/bash_test.vgtest b/none/tests/freebsd/bash_test.vgtest new file mode 100644 index 0000000000..604cd133cb --- /dev/null +++ b/none/tests/freebsd/bash_test.vgtest @@ -0,0 +1,4 @@ +# bash isn't part of base +prereq: test -e /usr/local/bin/bash +prog: bash_test.sh +vgopts: -q diff --git a/none/tests/freebsd/csh_test.csh b/none/tests/freebsd/csh_test.csh new file mode 100755 index 0000000000..7e7b4a6bf2 --- /dev/null +++ b/none/tests/freebsd/csh_test.csh @@ -0,0 +1,2 @@ +#!/bin/csh +echo Csh Hello, World! diff --git a/none/tests/freebsd/csh_test.stderr.exp b/none/tests/freebsd/csh_test.stderr.exp new file mode 100644 index 0000000000..e69de29bb2 diff --git a/none/tests/freebsd/csh_test.stdout.exp b/none/tests/freebsd/csh_test.stdout.exp new file mode 100644 index 0000000000..f91c2ec681 --- /dev/null +++ b/none/tests/freebsd/csh_test.stdout.exp @@ -0,0 +1 @@ +Csh Hello, World! diff --git a/none/tests/freebsd/csh_test.vgtest b/none/tests/freebsd/csh_test.vgtest new file mode 100644 index 0000000000..eaa5460ac1 --- /dev/null +++ b/none/tests/freebsd/csh_test.vgtest @@ -0,0 +1,2 @@ +prog: csh_test.csh +vgopts: -q diff --git a/none/tests/freebsd/ksh_test.ksh b/none/tests/freebsd/ksh_test.ksh new file mode 100755 index 0000000000..8dc470d990 --- /dev/null +++ b/none/tests/freebsd/ksh_test.ksh @@ -0,0 +1,2 @@ +#!/usr/local/bin/ksh93 +print Ksh Hello, World! diff --git a/none/tests/freebsd/ksh_test.stderr.exp b/none/tests/freebsd/ksh_test.stderr.exp new file mode 100644 index 0000000000..e69de29bb2 diff --git a/none/tests/freebsd/ksh_test.stdout.exp b/none/tests/freebsd/ksh_test.stdout.exp new file mode 100644 index 0000000000..ebd37bca8b --- /dev/null +++ b/none/tests/freebsd/ksh_test.stdout.exp @@ -0,0 +1 @@ +Ksh Hello, World! diff --git a/none/tests/freebsd/ksh_test.vgtest b/none/tests/freebsd/ksh_test.vgtest new file mode 100644 index 0000000000..af99583f54 --- /dev/null +++ b/none/tests/freebsd/ksh_test.vgtest @@ -0,0 +1,4 @@ +# ksh isn't part of base +prereq: test -e /usr/local/bin/ksh93 +prog: ksh_test.ksh +vgopts: -q |
|
From: Paul F. <pa...@so...> - 2023-02-24 20:33:08
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=e61a04babcc3de8c1c86638f8ccdb4ef1b74a4d0 commit e61a04babcc3de8c1c86638f8ccdb4ef1b74a4d0 Author: Paul Floyd <pj...@wa...> Date: Fri Feb 24 21:31:35 2023 +0100 bug465435 - m_libcfile.c:66 (vgPlain_safe_fd): Assertion 'newfd >= VG_(fd_hard_limit)' failed. Diff: --- NEWS | 1 + coregrind/m_libcfile.c | 24 ++++++++++++++++++++---- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/NEWS b/NEWS index 5e61efbbfe..7fcfc667a2 100644 --- a/NEWS +++ b/NEWS @@ -94,6 +94,7 @@ are not entered into bugzilla tend to get forgotten about or ignored. 464476 Firefox fails to start under Valgrind 464859 Build failures with GCC-13 (drd tsan_unittest) 464969 D language demangling +465435 m_libcfile.c:66 (vgPlain_safe_fd): Assertion 'newfd >= VG_(fd_hard_limit)' failed. To see details of a given bug, visit https://bugs.kde.org/show_bug.cgi?id=XXXXXX diff --git a/coregrind/m_libcfile.c b/coregrind/m_libcfile.c index e98de3e96f..5d3a349f2b 100644 --- a/coregrind/m_libcfile.c +++ b/coregrind/m_libcfile.c @@ -57,13 +57,25 @@ Int VG_(safe_fd)(Int oldfd) vg_assert(VG_(fd_hard_limit) != -1); newfd = VG_(fcntl)(oldfd, VKI_F_DUPFD, VG_(fd_hard_limit)); - if (newfd != -1) - VG_(close)(oldfd); + + if (newfd == -1) { + VG_(debugLog)(0, "libcfile", "Valgrind: FATAL: " + "Private file creation failed.\n" + " The current file descriptor limit is %d.\n" + " If you are running in Docker please consider\n" + " lowering this limit with the shell built-in limit command.\n", + VG_(fd_hard_limit)); + VG_(debugLog)(0, "libcfile", "Exiting now.\n"); + VG_(exit)(1); + } + + vg_assert(newfd >= VG_(fd_hard_limit)); + + VG_(close)(oldfd); /* Set the close-on-exec flag for this fd. */ VG_(fcntl)(newfd, VKI_F_SETFD, VKI_FD_CLOEXEC); - vg_assert(newfd >= VG_(fd_hard_limit)); return newfd; } @@ -753,7 +765,11 @@ Int VG_(fcntl) ( Int fd, Int cmd, Addr arg ) # else # error "Unknown OS" # endif - return sr_isError(res) ? -1 : sr_Res(res); + if (sr_isError(res)) { + VG_(debugLog)(1, "VG_(fcntl)", "fcntl error %lu %s\n", sr_Err(res), VG_(strerror)(sr_Err(res))); + return -1; + } + return (Int)sr_Res(res); } Int VG_(rename) ( const HChar* old_name, const HChar* new_name ) |
|
From: Paul F. <pa...@so...> - 2023-02-23 21:16:27
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=342e76ced1bcdadcc5824d4f1c55778833796619 commit 342e76ced1bcdadcc5824d4f1c55778833796619 Author: Paul Floyd <pj...@wa...> Date: Thu Feb 23 22:15:59 2023 +0100 One small typo Diff: --- README.freebsd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.freebsd b/README.freebsd index e92dfd5932..90eefc89b9 100644 --- a/README.freebsd +++ b/README.freebsd @@ -32,7 +32,7 @@ Known Limitations (June 2022) 1. There are some limitations when running Valgrind on code that was compiled with clang. These issues are not present with code compiled with GCC. a) There may be missing source information concerning variables due - to DWARF extensions ised by GCC. + to DWARF extensions used by GCC. b) Code that uses OpenMP will generate spurious errors. 2. vgdb invoker, which uses ptrace, may cause system calls to be interrupted. As an example, if the debuggee seems to have be |
|
From: Paul F. <pa...@so...> - 2023-02-21 22:06:15
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=7136cd987635e8c323fc7da35c8c9f0d3ba25ebd commit 7136cd987635e8c323fc7da35c8c9f0d3ba25ebd Author: Paul Floyd <pj...@wa...> Date: Tue Feb 21 23:05:22 2023 +0100 musl regtest : fix warnings and badly initialized struct msghdr Diff: --- memcheck/tests/badpoll.c | 2 +- memcheck/tests/linux/syscalls-2007.c | 4 +--- memcheck/tests/linux/timerfd-syscall.c | 4 +--- none/tests/fdleak_cmsg.c | 14 ++++++++++++-- 4 files changed, 15 insertions(+), 9 deletions(-) diff --git a/memcheck/tests/badpoll.c b/memcheck/tests/badpoll.c index 61b8d31bb1..beae44aa31 100644 --- a/memcheck/tests/badpoll.c +++ b/memcheck/tests/badpoll.c @@ -1,6 +1,6 @@ #include <assert.h> #include <stdlib.h> -#include <sys/poll.h> +#include <poll.h> // At one point, poll()'s checking was not done accurately. This test // exposes this -- previously Memcheck only found one error, now if finds diff --git a/memcheck/tests/linux/syscalls-2007.c b/memcheck/tests/linux/syscalls-2007.c index 54946237eb..b91df82a5e 100644 --- a/memcheck/tests/linux/syscalls-2007.c +++ b/memcheck/tests/linux/syscalls-2007.c @@ -20,9 +20,7 @@ #if defined(HAVE_SYS_EVENTFD_H) #include <sys/eventfd.h> #endif -#if defined(HAVE_SYS_POLL_H) -#include <sys/poll.h> -#endif +#include <poll.h> #if defined(HAVE_SYS_SIGNALFD_H) #include <sys/signalfd.h> #endif diff --git a/memcheck/tests/linux/timerfd-syscall.c b/memcheck/tests/linux/timerfd-syscall.c index 4af622cc48..61d75b5545 100644 --- a/memcheck/tests/linux/timerfd-syscall.c +++ b/memcheck/tests/linux/timerfd-syscall.c @@ -35,9 +35,7 @@ #include <string.h> #include <time.h> #include <unistd.h> -#if defined(HAVE_SYS_SIGNAL_H) -#include <sys/signal.h> -#endif +#include <signal.h> #if defined(HAVE_SYS_SYSCALL_H) #include <sys/syscall.h> #endif diff --git a/none/tests/fdleak_cmsg.c b/none/tests/fdleak_cmsg.c index 7927045f5b..d4300bcf2d 100644 --- a/none/tests/fdleak_cmsg.c +++ b/none/tests/fdleak_cmsg.c @@ -91,8 +91,18 @@ void client (void) struct cmsghdr cm; char control[CMSG_SPACE(sizeof(int) * 2)]; } control_un; - struct msghdr msg = { NULL, 0, iov, 1, control_un.control, - sizeof(control_un), 0 }; + struct msghdr msg; + /* this was using brace initialization + * but that doesn't work on MSL because of padding fields + * C99 designated initializers would be nicer + * but I'll just do it the simple way */ + msg.msg_name = NULL; + msg.msg_namelen = 0; + msg.msg_iov = iov; + msg.msg_iovlen = 1; + msg.msg_control = control_un.control; + msg.msg_controllen = sizeof(control_un); + msg.msg_flags = 0; struct cmsghdr *cmsg = &control_un.cm; char buf[1024]; |
|
From: Paul F. <pa...@so...> - 2023-02-21 21:08:14
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=a6101db6920d12c4d61f1ace19d931670b9d8141 commit a6101db6920d12c4d61f1ace19d931670b9d8141 Author: Paul Floyd <pj...@wa...> Date: Tue Feb 21 22:05:13 2023 +0100 Try to correct configure script for warning flags with values Some -W flags come with and without an = (usually for warning levels) But some only have the form -Wfoo=42 and -Wno-foo Diff: --- configure.ac | 17 ++++++++++++++++- memcheck/tests/Makefile.am | 6 +++--- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index 546e874b4b..696c967ee1 100755 --- a/configure.ac +++ b/configure.ac @@ -2519,6 +2519,20 @@ AC_DEFUN([AC_GCC_WARNING_SUBST_NO],[ CFLAGS=$safe_CFLAGS ]) +# A variation of the above for arguments that +# take a value +AC_DEFUN([AC_GCC_WARNING_SUBST_NO_VAL],[ + AC_MSG_CHECKING([if gcc accepts -W$1=$2]) + safe_CFLAGS=$CFLAGS + CFLAGS="-W$1=$2 -Werror" + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[;]])], [ + AC_SUBST([$3], [-Wno-$1]) + AC_MSG_RESULT([yes])], [ + AC_SUBST([$3], []) + AC_MSG_RESULT([no])]) + CFLAGS=$safe_CFLAGS +]) + # Convenience function. Like AC_GCC_WARNING_SUBST_NO, except it substitutes # -W$1 (instead of -Wno-$1). AC_DEFUN([AC_GCC_WARNING_SUBST],[ @@ -2553,7 +2567,8 @@ AC_GCC_WARNING_SUBST_NO([stringop-truncation], [FLAG_W_NO_STRINGOP_TRUNCATION]) AC_GCC_WARNING_SUBST_NO([format-overflow], [FLAG_W_NO_FORMAT_OVERFLOW]) AC_GCC_WARNING_SUBST_NO([use-after-free], [FLAG_W_NO_USE_AFTER_FREE]) AC_GCC_WARNING_SUBST_NO([free-nonheap-object], [FLAG_W_NO_FREE_NONHEAP_OBJECT]) -AC_GCC_WARNING_SUBST_NO([alloc-size-larger-than], [FLAG_W_NO_ALOC_SIZE_LARGER_THAN]) + +AC_GCC_WARNING_SUBST_NO_VAL([alloc-size-larger-than], [1677216], [FLAG_W_NO_ALLOC_SIZE_LARGER_THAN]) AC_GCC_WARNING_SUBST([write-strings], [FLAG_W_WRITE_STRINGS]) AC_GCC_WARNING_SUBST([empty-body], [FLAG_W_EMPTY_BODY]) diff --git a/memcheck/tests/Makefile.am b/memcheck/tests/Makefile.am index 281d8f55a4..efffe7b1c2 100644 --- a/memcheck/tests/Makefile.am +++ b/memcheck/tests/Makefile.am @@ -525,11 +525,11 @@ leak_cpp_interior_SOURCES = leak_cpp_interior.cpp # Suppress various gcc warnings which are correct, but for things # we are actually testing for at runtime. -accounting_CFLAGS = $(AM_CFLAGS) @FLAG_W_NO_ALOC_SIZE_LARGER_THAN@ +accounting_CFLAGS = $(AM_CFLAGS) @FLAG_W_NO_ALLOC_SIZE_LARGER_THAN@ badfree_CFLAGS = $(AM_CFLAGS) @FLAG_W_NO_FREE_NONHEAP_OBJECT@ -bug155125_CFLAGS = $(AM_CFLAGS) -Wno-unused-result @FLAG_W_NO_ALOC_SIZE_LARGER_THAN@ +bug155125_CFLAGS = $(AM_CFLAGS) -Wno-unused-result @FLAG_W_NO_ALLOC_SIZE_LARGER_THAN@ mallinfo_CFLAGS = $(AM_CFLAGS) -Wno-deprecated-declarations -malloc3_CFLAGS = $(AM_CFLAGS) @FLAG_W_NO_ALOC_SIZE_LARGER_THAN@ +malloc3_CFLAGS = $(AM_CFLAGS) @FLAG_W_NO_ALLOC_SIZE_LARGER_THAN@ sbfragment_CFLAGS = $(AM_CFLAGS) -Wno-deprecated-declarations strchr_CFLAGS = $(AM_CFLAGS) @FLAG_W_NO_UNINITIALIZED@ |
|
From: Paul F. <pa...@so...> - 2023-02-21 20:33:17
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=7b97ba6f17f73c0859d4186aa8637b5c1e888714 commit 7b97ba6f17f73c0859d4186aa8637b5c1e888714 Author: Paul Floyd <pj...@wa...> Date: Tue Feb 21 21:29:18 2023 +0100 musl: fix a couple of warnings musl doesn't have sys/poll.h GCC moans and then uses poll.h On glibc linux and FreeBSD poll.h is a symlink to sys/poll.h Illumos poll.h includes sys/poll.h Diff: --- auxprogs/valgrind-di-server.c | 2 +- auxprogs/valgrind-listener.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/auxprogs/valgrind-di-server.c b/auxprogs/valgrind-di-server.c index a3357c004a..028948db04 100644 --- a/auxprogs/valgrind-di-server.c +++ b/auxprogs/valgrind-di-server.c @@ -98,7 +98,7 @@ #include <fcntl.h> #include <stdlib.h> #include <signal.h> -#include <sys/poll.h> +#include <poll.h> #include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> diff --git a/auxprogs/valgrind-listener.c b/auxprogs/valgrind-listener.c index 29f0744f75..158f11c088 100644 --- a/auxprogs/valgrind-listener.c +++ b/auxprogs/valgrind-listener.c @@ -47,7 +47,7 @@ #include <fcntl.h> #include <stdlib.h> #include <signal.h> -#include <sys/poll.h> +#include <poll.h> #include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> |
|
From: Paul F. <pa...@so...> - 2023-02-19 09:11:48
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=fe008c8739f1e23624411c233c88026cf5a1aff0 commit fe008c8739f1e23624411c233c88026cf5a1aff0 Author: Paul Floyd <pj...@wa...> Date: Sun Feb 19 10:10:59 2023 +0100 regtest: remove compiler warnings with clang Diff: --- configure.ac | 2 ++ memcheck/tests/Makefile.am | 12 ++++++------ none/tests/Makefile.am | 2 +- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/configure.ac b/configure.ac index 625063beb4..546e874b4b 100755 --- a/configure.ac +++ b/configure.ac @@ -2549,9 +2549,11 @@ AC_GCC_WARNING_SUBST_NO([non-power-of-two-alignment], [FLAG_W_NO_NON_POWER_OF_TW AC_GCC_WARNING_SUBST_NO([sign-compare], [FLAG_W_NO_SIGN_COMPARE]) AC_GCC_WARNING_SUBST_NO([stringop-overflow], [FLAG_W_NO_STRINGOP_OVERFLOW]) AC_GCC_WARNING_SUBST_NO([stringop-overread], [FLAG_W_NO_STRINGOP_OVERREAD]) +AC_GCC_WARNING_SUBST_NO([stringop-truncation], [FLAG_W_NO_STRINGOP_TRUNCATION]) AC_GCC_WARNING_SUBST_NO([format-overflow], [FLAG_W_NO_FORMAT_OVERFLOW]) AC_GCC_WARNING_SUBST_NO([use-after-free], [FLAG_W_NO_USE_AFTER_FREE]) AC_GCC_WARNING_SUBST_NO([free-nonheap-object], [FLAG_W_NO_FREE_NONHEAP_OBJECT]) +AC_GCC_WARNING_SUBST_NO([alloc-size-larger-than], [FLAG_W_NO_ALOC_SIZE_LARGER_THAN]) AC_GCC_WARNING_SUBST([write-strings], [FLAG_W_WRITE_STRINGS]) AC_GCC_WARNING_SUBST([empty-body], [FLAG_W_EMPTY_BODY]) diff --git a/memcheck/tests/Makefile.am b/memcheck/tests/Makefile.am index 55eea450b9..281d8f55a4 100644 --- a/memcheck/tests/Makefile.am +++ b/memcheck/tests/Makefile.am @@ -525,18 +525,18 @@ leak_cpp_interior_SOURCES = leak_cpp_interior.cpp # Suppress various gcc warnings which are correct, but for things # we are actually testing for at runtime. -accounting_CFLAGS = $(AM_CFLAGS) -Wno-alloc-size-larger-than +accounting_CFLAGS = $(AM_CFLAGS) @FLAG_W_NO_ALOC_SIZE_LARGER_THAN@ badfree_CFLAGS = $(AM_CFLAGS) @FLAG_W_NO_FREE_NONHEAP_OBJECT@ -bug155125_CFLAGS = $(AM_CFLAGS) -Wno-unused-result -Wno-alloc-size-larger-than +bug155125_CFLAGS = $(AM_CFLAGS) -Wno-unused-result @FLAG_W_NO_ALOC_SIZE_LARGER_THAN@ mallinfo_CFLAGS = $(AM_CFLAGS) -Wno-deprecated-declarations -malloc3_CFLAGS = $(AM_CFLAGS) -Wno-alloc-size-larger-than +malloc3_CFLAGS = $(AM_CFLAGS) @FLAG_W_NO_ALOC_SIZE_LARGER_THAN@ sbfragment_CFLAGS = $(AM_CFLAGS) -Wno-deprecated-declarations strchr_CFLAGS = $(AM_CFLAGS) @FLAG_W_NO_UNINITIALIZED@ big_debuginfo_symbol_SOURCES = big_debuginfo_symbol.cpp big_debuginfo_symbol_CXXFLAGS = $(AM_CXXFLAGS) -std=c++0x -bug340392_CFLAGS = $(AM_CFLAGS) -O3 -Wno-maybe-uninitialized +bug340392_CFLAGS = $(AM_CFLAGS) -O3 @FLAG_W_NO_MAYBE_UNINITIALIZED@ if HAVE_ALIGNED_CXX_ALLOC cxx17_aligned_new_SOURCES = cxx17_aligned_new.cpp @@ -633,7 +633,7 @@ sized_delete_CXXFLAGS = $(AM_CXXFLAGS) @FLAG_FSIZED_DEALLOCATION@ endif str_tester_CFLAGS = $(AM_CFLAGS) -Wno-shadow @FLAG_W_NO_STRINGOP_OVERFLOW@ \ - -Wno-stringop-truncation \ + @FLAG_W_NO_STRINGOP_TRUNCATION@ \ -Wno-fortify-source -Wno-suspicious-bzero \ @FLAG_W_NO_MEMSET_TRANSPOSED_ARGS@ @FLAG_W_NO_STRINGOP_OVERREAD@ @@ -691,7 +691,7 @@ else varinfo5so_so_LDFLAGS = -fpic $(AM_FLAG_M3264_PRI) -shared \ -Wl,-soname -Wl,varinfo5so.so endif -varinforestrict_CFLAGS = $(AM_CFLAGS) -O0 -g -Wno-maybe-uninitialized +varinforestrict_CFLAGS = $(AM_CFLAGS) -O0 -g @FLAG_W_NO_MAYBE_UNINITIALIZED@ # Build shared object for wrap7 wrap7_SOURCES = wrap7.c diff --git a/none/tests/Makefile.am b/none/tests/Makefile.am index ee2181f2dc..c0dd7c21db 100644 --- a/none/tests/Makefile.am +++ b/none/tests/Makefile.am @@ -369,7 +369,7 @@ thread_exits_LDADD = -lpthread threaded_fork_LDADD = -lpthread threadederrno_CFLAGS = $(AM_CFLAGS) threadederrno_LDADD = -lpthread -timestamp_CFLAGS = -lpthread @FLAG_W_NO_USE_AFTER_FREE@ +timestamp_CFLAGS = @FLAG_W_NO_USE_AFTER_FREE@ tls_SOURCES = tls.c tls2.c tls_DEPENDENCIES = tls.so tls2.so tls_LDFLAGS = -Wl,-rpath,$(abs_top_builddir)/none/tests |
|
From: Paul F. <pa...@so...> - 2023-02-17 21:30:21
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=3a92995a8524a406857d599666cfc49869141bc2 commit 3a92995a8524a406857d599666cfc49869141bc2 Author: Paul Floyd <pj...@wa...> Date: Fri Feb 17 22:25:41 2023 +0100 DRD aarch64: Add some suppressions for DRD libstdc++ Also fix building drd/tests/std_mutex, needs -pthread. Diff: --- drd/tests/Makefile.am | 1 + glibc-2.X-drd.supp.in | 16 +++++++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/drd/tests/Makefile.am b/drd/tests/Makefile.am index e3366a18a0..7ea83cbf7e 100755 --- a/drd/tests/Makefile.am +++ b/drd/tests/Makefile.am @@ -621,6 +621,7 @@ std_list_CXXFLAGS = $(AM_CXXFLAGS) -std=c++0x @FLAG_W_NO_SIGN_COMPARE@ std_mutex_SOURCES = std_mutex.cpp std_mutex_CXXFLAGS = $(AM_CXXFLAGS) -std=c++0x @FLAG_W_NO_SIGN_COMPARE@ +std_mutex_LDFLAGS = -pthread std_string_SOURCES = std_string.cpp std_string_CXXFLAGS = $(AM_CXXFLAGS) -std=c++0x @FLAG_W_NO_SIGN_COMPARE@ diff --git a/glibc-2.X-drd.supp.in b/glibc-2.X-drd.supp.in index b8c8ac0ad5..4c6bdb6a1a 100644 --- a/glibc-2.X-drd.supp.in +++ b/glibc-2.X-drd.supp.in @@ -79,7 +79,21 @@ ... fun:_ZNSo9_M_insertIlEERSoT_ } - +{ + drd-libstdc++-std::~__shared_count() + drd:ConflictingAccess + fun:_ZNSt14__shared_countILN9__gnu_cxx12_Lock_policyE2EED1Ev +} +{ + drd-libstdc++-std::thread::~_Impl_base() + drd:ConflictingAccess + fun:_ZNSt6thread10_Impl_baseD1Ev +} +{ + drd-libstdc++-std::thread::~_Impl() + drd:ConflictingAccess + fun:_ZNSt6thread5_ImplISt12_Bind_simpleIFZ4mainEUlvE_vEEED1Ev +} # # Suppression patterns for libpthread. |
|
From: Mark W. <ma...@so...> - 2023-02-16 12:44:57
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=61da760afe83f566835b3b718e875c1eed904172 commit 61da760afe83f566835b3b718e875c1eed904172 Author: Mark Wielaard <ma...@kl...> Date: Thu Feb 16 13:44:08 2023 +0100 README_DEVELOPERS: Explain how to set VALGRIND_LIB to gdb valgrind Diff: --- README_DEVELOPERS | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README_DEVELOPERS b/README_DEVELOPERS index 6f7d1a9eee..5b0a1bc6ad 100644 --- a/README_DEVELOPERS +++ b/README_DEVELOPERS @@ -96,6 +96,11 @@ without too much problem by following these steps: or for an uninstalled version in a source directory $DIR: export VALGRIND_LAUNCHER=$DIR/coregrind/valgrind + export VALGRIND_LIB=$DIR/.in_place + + VALGRIND_LIB is where the default.supp and vgpreload_ libraries + are found (which is under /usr/libexec/valgrind for an installed + version). (2) Run gdb on the tool executable. Eg: |
|
From: Alexandra P. H. <aha...@re...> - 2023-02-13 19:08:03
|
Hi, I've been coworking with Mark Wielaard on work which would allow to run valgrind from inside gdb. I've submitted our valgrind side of the project here: https://bugs.kde.org/show_bug.cgi?id=434057. My experimental branch can be found on sourcehut: https://git.sr.ht/~sasshka/valgrind. I also described this project on my personal blog: http://sasshkas.blogspot.com/search/label/gdb%0Avalgrind We'll appreciate any review or comments, any feedback is welcome. Also we'd like ideas about what we could do on the gdb side to make this nicer/smoother. Thank you, Alexandra |
|
From: Mark W. <ma...@kl...> - 2023-02-13 17:36:34
|
Hi valgrind developers, Thanks for those that could join. I didn't really take notes, so this is very brief. If I got something wrong, please feel free to correct. On Fri, 2023-02-03 at 11:52 +0100, Mark Wielaard wrote: > Paul suggested that we should have a developer video chat again to > discuss development issues. And I agree that would be a good thing to > set some goals for the next release in April. We would like to meet > on Friday February 10 at 16:00 UTC (17:00 CET, 11:00 EST). > > https://meet.jit.si/ValgrindDevMeeting > > Some issues we can discuss: > > - Pick a date for the April 3.21.0 release > Critical bugs that are must fix? We picked Friday April 14 for the RC and Friday April 28 for the final release. But we didn't designate any critical must fix bugs (yet?) > - Upstreaming risc-v - https://github.com/petrpavlu/valgrind-riscv64 Petr explained the current status, it is fairly far along, but probably won't make the next release. https://github.com/petrpavlu/valgrind-riscv64/blob/riscv64-linux/README.md Note that the gcc compile farm has riscv hardware now: https://cfarm.tetaneutral.net/machines/list/ In general valgrind developers can request access to these machines. https://cfarm.tetaneutral.net/users/new/ > - AVX512 status - https://bugs.kde.org/show_bug.cgi?id=383010 We lost contact with the Intel group that was working on this. There are still some issues with it. It needs someone with enough time to work on it. > - loongarch - https://bugs.kde.org/show_bug.cgi?id=457504 This is split in several small patches and the contributor is really responsive. We should split the patches in those that change the core code and those that are are just for the loongarch backend. The gcc compiler farm does have two (experimental) machines: https://cfarm.tetaneutral.net/news/37 > - The macOS port status - do we have any users/developers? There is an active fork: https://github.com/LouisBrunner/valgrind-macos > - https://bugs.kde.org/show_bug.cgi?id=433859 aligned and sized stuff. > Do we have enough bits to track this efficiently? This is for C23, which isn't standard yet. So it won't need to go in soon. Julian said that he often disables the alloc/free/new/delete matching because it gets confused with some c++ allocators (?). It wasn't clear if there is a good solution for that. > - Plugging into the new FORTIFY_SOURCE=3 support in glibc. valgrind > memcheck should be able to show useful information about the memory > block that triggered the fault. After the meeting Sam found a glibc bug describing the idea: https://sourceware.org/bugzilla/show_bug.cgi?id=20644 > - Infrastructure stuff. We are still using the sourcefore mailinglist > and the kde bugzilla. But our git repo and website are at > sourceware. Should we migrate everything to sourceware? It is all a little clunky not having everything in one place. But nobody seemed to look forward to having to migrate. Also do we need people's opt-in/out consent for moving subscriptions? > - Would that be a good point to switch from "master" to "main" for the > main git branch name? We already largely avoid terms like > black/whitelist and master/slave in the code and it would be a good > transition towards more inclusive language as described in > https://inclusivenaming.org/ We'll switch the default branch to main (with master being an alias) after the release. > These are all just suggestions. Please feel free to join and/or > propose other topics, features or bugs to discuss. We also briefly discussed: - https://bugs.kde.org/show_bug.cgi?id=402833 memcheck/tests/overlap testcase fails, memcpy seen as memmove The issue is if through ifuncs both memcpy and memmove point to the same address/function. It isn't clear whether there is a good solution (we probably need to recognize these functions before doing the ifunc resolving?). If not, maybe we should stop doing overlap checks for memcpy by default. - https://bugs.kde.org/show_bug.cgi?id=434057 Add stdio mode to valgrind's gdbserver This is something which Sasha and I have been working on so you can run a program under valgrind from gdb directly. Sasha will post a little overview of the current state. |
|
From: Paul F. <pj...@wa...> - 2023-02-09 21:32:41
|
On 09-02-23 20:29, Louis Brunner wrote: > I would love to hear your thoughts Paul, you can message me directly if > you want (or forward me any notes from the meetup if there are any). Thanks! Salut Louis No time like the present. Here are the main problems that I see. 1. The biggest problem. The dyld cache (dsc) since macOS 11 Big Sur. macOS no longer has physical files for the system libraries. They are loaded from a memory cache. That means no di_notify_mmap and that means no redirs, which greatly restricts the functionality of memcheck and massif and drd, helgrind and dhat don't work. Callgrind and cachegrind are a bit less impacted. lldb and gdb both have ways of getting round this. Remember that in their configuration there are two processes communicating via clunky ptrace. Since both will have loaded the systems libs lldb just uses reads everything from its own memory. I still only have a basic understanding of how that works. I also look briefly at gdb. The code looks a lot simpler - fairly flat C rather than several widely spread C++ classes. There are also a few tools that can extract files from the cache which might be enough for di_notify_mmap to read. The last big problem here is GPLv2. I believe that we can reuse code from gdb, but we can't reuse anything from llvm/lldb or Apple XNU. 2. Thread termination. Valgrind is using a mach message to kill threads that fall off the end. That no longer works (since macOS 10.14 I think) The thread continues to run and hits a panic. There's a comment in the code about using bsdthread_terminate instead. If I single step through the assembler the is indeed how threads die. There are two things that I need to see - how to get the arguments for bsdthread_terminate and are there any consequences on not cleaning up the pthread resources cleanly? 3. I was seeing an assert on all DRD runs, but I fixed that upstream yesterday 6e4eb0b674db465c9c332ec72b5c7f5202de7d71. 4. Apple ARM hardware. I haven't looked at this (I have an Intel macbook) so I can't estimate how much is missing. After that, quite a lot of smaller problems (a few hangs, some readdwarf errors quite a few varinfo diffs and quite a few more I haven't looked at). There may be more hidden behind the issues listed above. I don't know how many people (and more particularly developers) use older versions of macOS. macOS is the number 1 item in bugzilla, and there are frequent requests on stack overflow. I believe that Louis' port does get a fair amount of traffic from one of the two main macOS package systems. My feeling is that if we can get fixes for the first two then the port will be a lot more usable. A+ Paul |
|
From: Louis B. <lou...@gm...> - 2023-02-09 19:29:32
|
On 03/02/2023 11:52, Mark Wielaard wrote: > Hi valgrind developers, > > - The macOS port status - do we have any users/developers? I was planning to join the meetup (like last year) but I won't be able to attend. I would be happy to support the port more directly (my mirror has x86 support for all macOS versions, with some caveats for some versions), how can I get more involved? On Thu, 9 Feb 2023 at 17:25, Floyd, Paul <pj...@wa...> wrote: > Been having a fairly long look at this. Will update on Friday. I would love to hear your thoughts Paul, you can message me directly if you want (or forward me any notes from the meetup if there are any). Thanks! Louis Brunner |
|
From: Floyd, P. <pj...@wa...> - 2023-02-09 17:24:52
|
On 03/02/2023 11:52, Mark Wielaard wrote: > Hi valgrind developers, > > - The macOS port status - do we have any users/developers? Been having a fairly long look at this. Will update on Friday. There has been a lot of noise about memory safety recently. https://media.defense.gov/2022/Nov/10/2003112742/-1/-1/0/CSI_SOFTWARE_MEMORY_SAFETY.PDF https://advocacy.consumerreports.org/wp-content/uploads/2023/01/Memory-Safety-Convening-Report-1-1.pdf And some responses from C++ (I don't follow C standards evolution so closely) https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2739r0.pdf https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2759r0.pdf https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2687r0.pdf If they do "fix" C and C++ we might be out of a job ;-) A+ Paul |
|
From: Paul F. <pa...@so...> - 2023-02-08 21:58:10
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=6e4eb0b674db465c9c332ec72b5c7f5202de7d71 commit 6e4eb0b674db465c9c332ec72b5c7f5202de7d71 Author: Paul Floyd <pj...@wa...> Date: Wed Feb 8 22:54:57 2023 +0100 Darwin: try to fix assert in DRD The hard coded memory mapping trigger drd_start_using_mem_w_perms which will lead to tl_assert(vg_tid != VG_INVALID_THREADID); But vg_tid was just set to VG_INVALID_THREADID before the hard coded memory map. Diff: --- coregrind/m_main.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/coregrind/m_main.c b/coregrind/m_main.c index 0a7e96e500..b5501b5f31 100644 --- a/coregrind/m_main.c +++ b/coregrind/m_main.c @@ -2047,10 +2047,6 @@ Int valgrind_main ( Int argc, HChar **argv, HChar **envp ) True /* executable? */, 0 /* di_handle: no associated debug info */ ); - /* Clear the running thread indicator */ - VG_(running_tid) = VG_INVALID_THREADID; - vg_assert(VG_(running_tid) == VG_INVALID_THREADID); - /* Darwin only: tell the tools where the client's kernel commpage is. It would be better to do this by telling aspacemgr about it -- see the now disused record_system_memory() in @@ -2068,6 +2064,10 @@ Int valgrind_main ( Int argc, HChar **argv, HChar **envp ) True, False, True, /* r-x */ 0 /* di_handle: no associated debug info */ ); # endif + + /* Clear the running thread indicator */ + VG_(running_tid) = VG_INVALID_THREADID; + vg_assert(VG_(running_tid) == VG_INVALID_THREADID); } //-------------------------------------------------------------- |
|
From: Paul F. <pa...@so...> - 2023-02-05 11:50:55
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=9fb974c359e127caa930fc2ccf49218778e7c584 commit 9fb974c359e127caa930fc2ccf49218778e7c584 Author: Paul Floyd <pj...@wa...> Date: Sun Feb 5 12:50:13 2023 +0100 Regtest: rationalize filters for new/delete Diff: --- memcheck/tests/Makefile.am | 3 +-- memcheck/tests/filter_sized_delete | 4 ---- memcheck/tests/sized_delete.vgtest | 2 +- 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/memcheck/tests/Makefile.am b/memcheck/tests/Makefile.am index e5b2ae5863..55eea450b9 100644 --- a/memcheck/tests/Makefile.am +++ b/memcheck/tests/Makefile.am @@ -80,8 +80,7 @@ dist_noinst_SCRIPTS = \ filter_varinfo3 \ filter_memcheck \ filter_overlaperror \ - filter_malloc_free \ - filter_sized_delete + filter_malloc_free noinst_HEADERS = leak.h diff --git a/memcheck/tests/filter_sized_delete b/memcheck/tests/filter_sized_delete deleted file mode 100755 index 54dea76b5d..0000000000 --- a/memcheck/tests/filter_sized_delete +++ /dev/null @@ -1,4 +0,0 @@ -#! /bin/sh - -./filter_stderr "$@" | -grep -v free | grep -v malloc diff --git a/memcheck/tests/sized_delete.vgtest b/memcheck/tests/sized_delete.vgtest index 9f483e01c4..1ad6b68f3a 100644 --- a/memcheck/tests/sized_delete.vgtest +++ b/memcheck/tests/sized_delete.vgtest @@ -1,4 +1,4 @@ prog: sized_delete prereq: test -e sized_delete vgopts: -q "--trace-malloc=yes" --show-mismatched-frees=yes -stderr_filter: filter_sized_delete +stderr_filter: filter_malloc_free |
|
From: Paul F. <pa...@so...> - 2023-02-05 10:36:52
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=0eb7257254c55a9d9a28194986fa1efd0f96ad87 commit 0eb7257254c55a9d9a28194986fa1efd0f96ad87 Author: Paul Floyd <pj...@wa...> Date: Sun Feb 5 11:35:28 2023 +0100 Darwin regtest: add filtering for zone functions and realloc For test of C++17 new/delete variations Diff: --- memcheck/tests/filter_malloc_free | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/memcheck/tests/filter_malloc_free b/memcheck/tests/filter_malloc_free index 9d4c52559c..3927792ef0 100755 --- a/memcheck/tests/filter_malloc_free +++ b/memcheck/tests/filter_malloc_free @@ -2,5 +2,5 @@ ./filter_stderr "$@" | ./filter_allocs | -sed -e '/^malloc/d;/^free/d;/^calloc/d' +sed -e '/^malloc/d;/^free/d;/^calloc/d;/^zone/d;/^realloc/d' |
|
From: Paul F. <pa...@so...> - 2023-02-05 10:36:47
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=60303f4316008f0ba9553cb14d6530dfdd3c3760 commit 60303f4316008f0ba9553cb14d6530dfdd3c3760 Author: Paul Floyd <pj...@wa...> Date: Fri Feb 3 19:27:39 2023 +0100 DRD regtest: try to make timed_mutex more reliable On RHEL 7.6 ARM I see this with the lock returning false but without the 11 second timeout. Try adding some sleeps. Diff: --- docs/Makefile.am | 1 + docs/internals/Darwin-debug.txt | 62 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 63 insertions(+) diff --git a/docs/Makefile.am b/docs/Makefile.am index 3850d7b744..f9ba4e3958 100644 --- a/docs/Makefile.am +++ b/docs/Makefile.am @@ -46,6 +46,7 @@ EXTRA_DIST = \ internals/arm_thumb_notes_gdbserver.txt \ internals/avx-notes.txt \ internals/BIG_APP_NOTES.txt \ + internals/Darwin-debug.txt \ internals/Darwin-notes.txt \ internals/SPEC-notes.txt \ internals/directory-structure.txt \ diff --git a/docs/internals/Darwin-debug.txt b/docs/internals/Darwin-debug.txt new file mode 100644 index 0000000000..5bc9b56633 --- /dev/null +++ b/docs/internals/Darwin-debug.txt @@ -0,0 +1,62 @@ +Some general notes on debugging on macOS +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Written early 2023, based on macOS 13.1 / Darwin 22.2.0 Intel + +If you need to use ssh then you can't use lldb directly because, by default, +it wants to open a dialog for your password/fingerprint. You can disable this +with: + +sudo DevToolsSecurity --enable + +Tracing syscalls looks rather scary and involves rebooting and disabling security. + +Launcher and initimg +~~~~~~~~~~~~~~~~~~~~ + +Things are a bit different on Darwin. Quick reminder for other platforms: + +1. Early command line processing, specifically tool and verbosity +2. Select the platform by looking at the ELF headers. Default + to the build platform if the client is a script and the shebangs + don't lead to an ELF binary. +3. Add VALGRIND_LAUNCHER to the environment. This is based on the path. +4. Get the tool path. This uses either the path baked into the build + by the configure --prefix option (VG_LIBDIR) or the VALGRIND_LIB + environment variable (set by the vg-in-place script for running + in the build directory). +5. exec the tool. + +On Darwin that is + +1. Early command line processing. As above but also the undocumented + --arch option. +2. The client exename can be an app bundle which means expanding + "client" to "client.app/Contents/MacOS/client". +3. Platform detection is complicated by the macOS history of + having dual-platform fat binaries. A list of supported platforms + is considered and compared against the Valgrind install. Then + the mach_header is examined to make the final decision. +4. The additions to the environment variables are also a bit more + complicated. Like on ELF based systems there is VALGRIND_LAUNCHER. + Additionally there is + VALGRIND_STARTUP_PWD_%PID_XYZZY=current_working_dir + which is used to work out the working directory. + Darwin doesn't have a cwd syscall? I wonder how 'pwd' works. + Looks like it does open(.) fstat to check then fcntl(F_GETPATH). + The seems to only matter for %p and %q log filename expansion + and reading any .valgrindrc in the working directory. Not + big problems for debugging. +5. Another slight complication is that dylib environment variables need + protecting. Maybe because the tool is statically linked? In any + case all env vars that start with "DYLD_" get changed to "VYLD_". +6. The tool path is determined along the same lines as ELF. +7. exec the tool. + + +In stage2 on Darwin the "VYLD_" munging is undone. DYLD_INSERT_LIBRARIES +gets set for core and tool preloads (the equivalent of LD_PRELOAD). +DYLD_SHARED_REGION gets set to "avoid" (but note that for macOS 11 +Big Sur and later "avoid" is no longer an option). + +The Darwin calstack is a bit simpler to synthesise than the ones on +ELF platforms. There is no auxiliary vector (auxv) to construct. |
|
From: Paul F. <pa...@so...> - 2023-02-03 18:29:09
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=add5fe983292106d62196a77c57e9416c26ef1b8 commit add5fe983292106d62196a77c57e9416c26ef1b8 Author: Paul Floyd <pj...@wa...> Date: Fri Feb 3 19:27:39 2023 +0100 DRD regtest: try to make timed_mutex more reliable On RHEL 7.6 ARM I see this with the lock returning false but without the 11 second timeout. Try adding some sleeps. Diff: --- drd/tests/timed_mutex.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drd/tests/timed_mutex.cpp b/drd/tests/timed_mutex.cpp index b1bb61efa6..fa7464ea5b 100644 --- a/drd/tests/timed_mutex.cpp +++ b/drd/tests/timed_mutex.cpp @@ -12,16 +12,19 @@ void f() auto now=std::chrono::steady_clock::now(); test_mutex.try_lock_until(now + std::chrono::seconds(11)); --global; + std::this_thread::sleep_for(std::chrono::seconds(1)); test_mutex.unlock(); } - + + int main() { global = 0; + std::thread t(f); + std::this_thread::sleep_for(std::chrono::seconds(1)); auto now=std::chrono::steady_clock::now(); test_mutex.try_lock_until(now + std::chrono::seconds(11)); ++global; - std::thread t(f); test_mutex.unlock(); t.join(); assert(global == 0); |
|
From: Paul F. <pa...@so...> - 2023-02-03 18:12:20
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=dfaf01873391977d2863da0c227a8b363f762019 commit dfaf01873391977d2863da0c227a8b363f762019 Author: Paul Floyd <pj...@wa...> Date: Fri Feb 3 19:10:50 2023 +0100 DRD regtesat: update suppression file for std_threads2 On RHEL 7.6 ARM glibc 2.17 is used which doesn't match the 2.2* wildard, so widen the wildcard to just 2.* Diff: --- drd/tests/std_thread2.supp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drd/tests/std_thread2.supp b/drd/tests/std_thread2.supp index 2e41bac503..69b210c469 100644 --- a/drd/tests/std_thread2.supp +++ b/drd/tests/std_thread2.supp @@ -11,13 +11,13 @@ { pthread_create drd:ConflictingAccess - fun:pthread_create@@GLIBC_2.2* + fun:pthread_create@@GLIBC_2.* } { pthread_create drd:ConflictingAccess fun:allocate_stack - fun:pthread_create@@GLIBC_2.2* + fun:pthread_create@@GLIBC_2.* } { drd-gcc-runtims |
|
From: Paul F. <pa...@so...> - 2023-02-03 12:52:17
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=4c80a467a93fd3e4be04b567fbaae6146b2b23de commit 4c80a467a93fd3e4be04b567fbaae6146b2b23de Author: Paul Floyd <pj...@wa...> Date: Fri Feb 3 13:51:04 2023 +0100 FreeBSD: fix internal sysctlbyname I used the libc interface rather than the syscall interface. The syscall also has the name length which libc adds. Diff: --- coregrind/m_libcproc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/coregrind/m_libcproc.c b/coregrind/m_libcproc.c index 55bb7cbf97..592d69bf13 100644 --- a/coregrind/m_libcproc.c +++ b/coregrind/m_libcproc.c @@ -1200,8 +1200,9 @@ void VG_(do_atfork_child)(ThreadId tid) #if defined(VGO_freebsd) Int VG_(sysctlbyname)(const HChar *name, void *oldp, SizeT *oldlenp, const void *newp, SizeT newlen) { + vg_assert(name); #if (FREEBSD_VERS >= FREEBSD_12_2) - SysRes res = VG_(do_syscall5)(__NR___sysctlbyname, (UWord)name, (UWord)oldp, (UWord)oldlenp, (UWord)newp, (UWord)newlen); + SysRes res = VG_(do_syscall6)(__NR___sysctlbyname, (RegWord)name, VG_(strlen)(name), (RegWord)oldp, (RegWord)oldlenp, (RegWord)newp, (RegWord)newlen); return sr_isError(res) ? -1 : sr_Res(res); #else Int oid[2]; |
|
From: Paul F. <pa...@so...> - 2023-02-03 12:51:12
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=cdabd4ba74ea653515a1bf9a6e9067f3179c2d54 commit cdabd4ba74ea653515a1bf9a6e9067f3179c2d54 Author: Paul Floyd <pj...@wa...> Date: Fri Feb 3 13:48:22 2023 +0100 Regtest: foix warning from drd test pth_mutex_signal.c GCC on RHEL 7.6 ARM complains about the empty init list. I also noticed that we are using the SA_NOTIFY form of sigaction (with that union member and handler prototype) but not setting the SA_NOTIFY flag. Seems harmless in this case as we don't use the siginfo or context. Diff: --- drd/tests/pth_mutex_signal.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drd/tests/pth_mutex_signal.c b/drd/tests/pth_mutex_signal.c index 38fafdba8a..916afdfe59 100644 --- a/drd/tests/pth_mutex_signal.c +++ b/drd/tests/pth_mutex_signal.c @@ -42,12 +42,12 @@ int main () pthread_mutexattr_t mutex_attr; pthread_attr_t thread_attr_contender; pthread_t contender; - struct sigaction signalAction = { }; + struct sigaction signalAction; // install signal handler signalAction.sa_sigaction = nullHandler; sigfillset(&signalAction.sa_mask); - signalAction.sa_flags = 0; + signalAction.sa_flags = SA_SIGINFO; sigaction(SIGINT, &signalAction, NULL); // initialize the mutex |
|
From: Mark W. <ma...@kl...> - 2023-02-03 10:53:00
|
Hi valgrind developers, Paul suggested that we should have a developer video chat again to discuss development issues. And I agree that would be a good thing to set some goals for the next release in April. We would like to meet on Friday February 10 at 16:00 UTC (17:00 CET, 11:00 EST). https://meet.jit.si/ValgrindDevMeeting Some issues we can discuss: - Pick a date for the April 3.21.0 release Critical bugs that are must fix? - Upstreaming risc-v - https://github.com/petrpavlu/valgrind-riscv64 - AVX512 status - https://bugs.kde.org/show_bug.cgi?id=383010 - loongarch - https://bugs.kde.org/show_bug.cgi?id=457504 - The macOS port status - do we have any users/developers? - https://bugs.kde.org/show_bug.cgi?id=433859 aligned and sized stuff. Do we have enough bits to track this efficiently? - Plugging into the new FORTIFY_SOURCE=3 support in glibc. valgrind memcheck should be able to show useful information about the memory block that triggered the fault. - Infrastructure stuff. We are still using the sourcefore mailinglist and the kde bugzilla. But our git repo and website are at sourceware. Should we migrate everything to sourceware? - Would that be a good point to switch from "master" to "main" for the main git branch name? We already largely avoid terms like black/whitelist and master/slave in the code and it would be a good transition towards more inclusive language as described in https://inclusivenaming.org/ These are all just suggestions. Please feel free to join and/or propose other topics, features or bugs to discuss. Cheers, Mark |
|
From: Paul F. <pa...@so...> - 2023-02-02 21:08:49
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=7003f40be9de1e10796578cba9e40ea6a548fc16 commit 7003f40be9de1e10796578cba9e40ea6a548fc16 Author: Paul Floyd <pj...@wa...> Date: Thu Feb 2 22:06:38 2023 +0100 FreeBSD: improve internal syscallbyname Post FreeBSD 12.2 this is a syscall that does everything (rather than needing an undocumented syscall). Diff: --- coregrind/m_libcproc.c | 7 ++++++- coregrind/pub_core_libcproc.h | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/coregrind/m_libcproc.c b/coregrind/m_libcproc.c index b94cabcf1f..55bb7cbf97 100644 --- a/coregrind/m_libcproc.c +++ b/coregrind/m_libcproc.c @@ -1194,12 +1194,16 @@ void VG_(do_atfork_child)(ThreadId tid) } /* --------------------------------------------------------------------- - FreeBSD sysctlbyname(), modfind(), etc + FreeBSD sysctlbyname, getosreldate, is32on64 ------------------------------------------------------------------ */ #if defined(VGO_freebsd) Int VG_(sysctlbyname)(const HChar *name, void *oldp, SizeT *oldlenp, const void *newp, SizeT newlen) { +#if (FREEBSD_VERS >= FREEBSD_12_2) + SysRes res = VG_(do_syscall5)(__NR___sysctlbyname, (UWord)name, (UWord)oldp, (UWord)oldlenp, (UWord)newp, (UWord)newlen); + return sr_isError(res) ? -1 : sr_Res(res); +#else Int oid[2]; Int real_oid[10]; SizeT oidlen; @@ -1214,6 +1218,7 @@ Int VG_(sysctlbyname)(const HChar *name, void *oldp, SizeT *oldlenp, const void oidlen /= sizeof(int); error = VG_(sysctl)(real_oid, oidlen, oldp, oldlenp, newp, newlen); return error; + #endif } Int VG_(getosreldate)(void) diff --git a/coregrind/pub_core_libcproc.h b/coregrind/pub_core_libcproc.h index d63a4f7c47..ff056ec408 100644 --- a/coregrind/pub_core_libcproc.h +++ b/coregrind/pub_core_libcproc.h @@ -86,7 +86,7 @@ extern void VG_(do_atfork_parent) ( ThreadId tid ); extern void VG_(do_atfork_child) ( ThreadId tid ); #if defined(VGO_freebsd) -// sysctl, modfind +// sysctlbyname, getosreldate, is32on64 extern Int VG_(sysctlbyname)(const HChar *name, void *oldp, SizeT *oldlenp, const void *newp, SizeT newlen); extern Int VG_(getosreldate)(void); extern Bool VG_(is32on64)(void); |
|
From: Paul F. <pa...@so...> - 2023-02-02 20:52:41
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=a8e350c6d1b2a64e9515d29134b4217bccb62382 commit a8e350c6d1b2a64e9515d29134b4217bccb62382 Author: Paul Floyd <pj...@wa...> Date: Thu Feb 2 21:51:21 2023 +0100 GDB regtest: add filter for gdb python load, RHEL 7.4 ARM Diff: --- gdbserver_tests/filter_vgdb.in | 1 + 1 file changed, 1 insertion(+) diff --git a/gdbserver_tests/filter_vgdb.in b/gdbserver_tests/filter_vgdb.in index c1844e90c0..7c42a1849f 100755 --- a/gdbserver_tests/filter_vgdb.in +++ b/gdbserver_tests/filter_vgdb.in @@ -38,6 +38,7 @@ $SED -e '/warning: Missing auto-load script.*/d' | $SED -e '/of file .*vgpreload.*so.*/d' | $SED -e '/Use.*info auto-load python-scripts.*/d' | $SED -e '/warning: Invalid entry in .debug_gdb_scripts section/d' | +$SED -e "/Use .info auto-load python .REGEXP.. to list them./d" | # and filter out any remaining empty lines $SED -e '/^$/d' |