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
(83) |
Oct
(89) |
Nov
(97) |
Dec
(30) |
2024 |
Jan
(25) |
Feb
(73) |
Mar
(76) |
Apr
(122) |
May
(46) |
Jun
(44) |
Jul
(27) |
Aug
(30) |
Sep
(33) |
Oct
(67) |
Nov
(91) |
Dec
(70) |
2025 |
Jan
(44) |
Feb
(36) |
Mar
(85) |
Apr
(100) |
May
(138) |
Jun
(55) |
Jul
(107) |
Aug
(22) |
Sep
|
Oct
|
Nov
|
Dec
|
From: Mark W. <ma...@kl...> - 2025-05-14 23:02:58
|
Hi Adhemerval, On Tue, May 13, 2025 at 09:22:21AM +0100, Adhemerval Zanella Netto wrote: > On 12/05/25 12:12, Mark Wielaard wrote: > >> I am trying to check if patch to inline the cancellation wrappers [1] > >> would help it, but I am not sure how exactly would handle stacktraces > >> that should be artificial and only represented for debug information. > > > > I got that patch [1] working so I could test it myself (only on x86_64 > > for now). How do you properly test a glibc installed in a non-default > > location though? Currently I am doing something like: > > > > export LD_LIBRARY_PATH=/usr/local/glibc/lib > > /usr/local/glibc/lib/ld-linux-x86-64.so.2 memcheck/tests/sendmsg > > > > This can also work with valgrind in between because it doesn't use > > glibc dynamically itself. But it is not the easiest way to test > > things. > > I used -Wl,-dynamic-linker and -Wl,-rpath instead at configure: > > --enable-only64bit \ > LDFLAGS="-Wl,--dynamic-linker,/path/to/glibc-build/testroot.pristine/lib/ld-linux-aarch64.so.1 \ > -Wl,--rpath,/path/to/glibc-build/testroot.pristine/lib64" > > It won't use glibc startup object (*ct*.o), neither the headers; but > using a recent systems it should not be a problem (the difference > should be minimal). O, thanks, that makes things much more convenient to test. > > It isn't an "error" but any extra frames (either "real" or inlined) on > > top of the function that does the actual system call causes existing > > suppressions and test wrappers to no longer work. So valgrind is > > responsible for filtering them out. For actual extra frames we now do > > (since 3.25.0). If the extra syscall frame wrappers are inlined they > > don't show up if no debuginfo/DWARF is available for glibc. But if it > > is available we'll have to filter them out and/or don't look them up > > for the top-level syscalls. > > > > Selectively removing these inlined calls is a little fragile at the > > moment in valgrind, since it is done at a later time than capturing > > the backtrace addresses. So either we have to pass through that we are > > handling a syscall at the moment and so don't want to "expand" the > > top-level frame with any inlines. And/Or we match on the "magic" > > inlined syscall cancel frames (everywhere). > > If I understood correctly these seems to be an issue only for valgrind > regression tests, right? If so, could this be handled solely on test > validation? > > Or does valgrind aims to hide such inlined calls on stacktrace reports > as well? We do aim to hide these in general since it invalidates any existing suppressions people might be using. In theory we can of course not guarantee these work between glibc versions, but for most glibc syscall wrappers they are surprisingly stable. It also allows people to generate new suppressions that should work across versions. > > You could use __attribute__(__artificial__)) which should mark the > > function with DW_AT_artificial. Valgrind doesn't know about this > > attribute yet, but we could probably with some extra work. > > Yeah, this is the first thing I tried to see if valgrind could handle > it. Doing this on glibc should be easy enough if you think it would > be way to handle it on valgrind. I currently have something working based on matching the function names, but checking for DW_AT_artificial would be nicer. Also because I think in general users are not interested in inlined artificial functions in their stack traces. So it should be a general improvement if we filter those out. I post when I have a patch that does that (there is one tricky issue if the abstract origin ends up in a dwz partial units, but that is completely an internal valgrind DWARF reader issue, nothing to do with glibc). > >> [1] https://sourceware.org/git/?p=glibc.git;a=shortlog;h=refs/heads/azanella/cancel-wrappers-inline > Thanks, Mark |
From: Paul F. <pa...@so...> - 2025-05-14 19:44:08
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=568ce38ac76e1cefc20b006c7da8cf7bf2209596 commit 568ce38ac76e1cefc20b006c7da8cf7bf2209596 Author: Paul Floyd <pj...@wa...> Date: Tue May 13 20:34:48 2025 +0200 Bug 504101 - Add a "vgstack" script This works just like pstack/gstack (and bstack on FreeBSD). Run "vgstack [valgrind pid]" and you will get the guest backtraces. Diff: --- .gitignore | 1 + NEWS | 1 + configure.ac | 3 +- coregrind/Makefile.am | 2 + coregrind/vgstack.in | 158 ++++++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 164 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index fa0fa0d349..962c97606b 100644 --- a/.gitignore +++ b/.gitignore @@ -178,6 +178,7 @@ /coregrind/valgrind /coregrind/vgdb /coregrind/vgpreload_core-x86-darwin.so.dSYM +/coregrind/vgstack /coregrind/vg_intercept.c /coregrind/vg_replace_malloc.c /coregrind/vg_toolint.c diff --git a/NEWS b/NEWS index a1833ad409..065f32fd5c 100644 --- a/NEWS +++ b/NEWS @@ -28,6 +28,7 @@ are not entered into bugzilla tend to get forgotten about or ignored. 503677 duplicated-cond compiler warning in dis_RV64M 503817 s390x: fix 'ordered comparison of pointer with integer zero' compiler warnings 503914 mount syscall param filesystemtype may be NULL +504101 Add a "vgstack" script 504177 FILE DESCRIPTORS banner shows when closing some inherited fds To see details of a given bug, visit diff --git a/configure.ac b/configure.ac index 84a69f810e..00cf62d47c 100755 --- a/configure.ac +++ b/configure.ac @@ -5692,7 +5692,8 @@ AC_CONFIG_FILES([ include/Makefile auxprogs/Makefile mpi/Makefile - coregrind/Makefile + coregrind/Makefile + coregrind/vgstack memcheck/Makefile memcheck/tests/Makefile memcheck/tests/common/Makefile diff --git a/coregrind/Makefile.am b/coregrind/Makefile.am index 700751dea4..784459569d 100644 --- a/coregrind/Makefile.am +++ b/coregrind/Makefile.am @@ -34,6 +34,8 @@ bin_PROGRAMS = \ valgrind \ vgdb +bin_SCRIPTS = vgstack + if VGCONF_OS_IS_LINUX valgrind_SOURCES = \ launcher-linux.c \ diff --git a/coregrind/vgstack.in b/coregrind/vgstack.in new file mode 100755 index 0000000000..75ed868e96 --- /dev/null +++ b/coregrind/vgstack.in @@ -0,0 +1,158 @@ +#!/bin/sh + +# Copyright (C) 2024-2025 Free Software Foundation, Inc. +# Copyright (C) 2025 Paul Floyd +# pj...@wa... + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +# Print a stack trace of a running process. +# Similar to the gcore command, but instead of creating a core file, +# we simply have gdb print out the stack backtrace to the terminal. + +# This script is largely based on gstack/pstack from gdb. +# There is a bit of extra filtering to remove gdb warnings, +# the shell used is /bin/sh rather than bash. +# The main functional change is that it 'uses target remote | vgdb' +# instead of 'attach'. + +GDB=${GDB:-$(command -v gdb)} +GDBARGS=${GDBARGS:-} +AWK=${AWK:-} +VERSION="@VERSION@" + +# Find an appropriate awk interpreter if one was not specified +# via the environment. +awk_prog="" +if [ -z "$AWK" ]; then + for prog in gawk mawk nawk awk; do + awk_prog=$(command -v $prog) + test -n "$awk_prog" && break + done + AWK="$awk_prog" +fi +if [ ! -x "$AWK" ]; then + echo "$0: could not find usable awk interpreter" 1>&2 + exit 2 +fi + +print_usage() { + echo "Usage: $0 [-h|--help] [-v|--version] PID" +} + +print_try_help() { + echo "Try '$0 --help' for more information." +} + +print_help() { + print_usage + echo "Print a stack trace of a running program" + echo + echo " -h, --help Print this message then exit." + echo " -v, --version Print version information then exit." +} + +print_version() { + echo "${0}-${VERSION}" +} + +# Parse options. +while getopts hv-: OPT; do + if [ "$OPT" = "-" ]; then + OPT="${OPTARG%%=*}" + OPTARG="${OPTARG#'$OPT'}" + OPTARG="${OPTARG#=}" + fi + + case "$OPT" in + h | help) + print_help + exit 0 + ;; + v | version) + print_version + exit 0 + ;; + \?) + # getopts has already output an error message. + print_try_help 1>&2 + exit 2 ;; + *) + echo "$0: unrecognized option '--$OPT'" 1>&2 + print_try_help 1>&2 + exit 2 + ;; + esac +done +shift $((OPTIND-1)) + +# The sole remaining argument should be the PID of the process +# whose backtrace is desired. +if [ $# -ne 1 ]; then + print_usage 1>&2 + exit 1 +fi + +PID=$1 + +awk_script=$(cat << EOF +BEGIN { + first=1 + attach_okay=0 +} + +/ATTACHED/ { + attach_okay=1 +} + +/^#/ { + if (attach_okay) { + print \$0 + } +} + +/^Thread/ { + if (attach_okay) { + if (first == 0) + print "" + first=0 + print \$0 + } +} + +/warning:/ { + next +} + +END { +if (attach_okay == 0) + exit 2 +} +EOF + ) + +# Run GDB and remove some unwanted noise. +"$GDB" --quiet -nx $GDBARGS <<EOF 2>&1 | +set width 0 +set height 0 +set pagination no +set debuginfod enabled off +define vgdb-bt +target remote | vgdb --pid=\$arg0 +echo "ATTACHED" +thread apply all bt +end +vgdb-bt $PID +EOF +$AWK -- "$awk_script" |
From: Mark W. <ma...@kl...> - 2025-05-14 18:47:49
|
Hi, On Sat, May 10, 2025 at 02:13:25AM +0200, Mark Wielaard wrote: > Hi developers and packagers, > > I created a VALGRIND_3_25_BRANCH where I hope to put commits > which I think distros should pick up. The idea would be to first > commit to the main branch. Then git cherry-pick -x the commit to the > branch (updating NEWS to list all bugs fixed on the branch). > > The patches I put on the VALGRIND_3_25_BRANCH are to fix the > close_range syscall, a fixlet for the mount syscall type param and a > workaround for missing riscv_hwprobe syscall support. I put two more commits on the branch: - Don't count closed inherited file descriptors - regtest: use /bin/cat in none/tests/fdleak_cat.vgtest This resolves a regression seen in the elfutils testsuite which runs with -q --track-fds=yes. > I saw multiple reports about users having issues with the close_range > syscall being broken. So it might be good to do a 3.25.1 release from > the branch. I hope distros will pick up these fixes, I have already > added them to the Fedora package. But having an explicit release might > trigger more distros to update. Lets discuss next week if others feel > it is urgent enough. Any opinions on this? Everything is ready to do a 3.25.1 release from the branch, but it is a little extra work. Does anybody feel this is a good idea? Or should we just ask distros to take the fixes from the branch? > Please let me know if you find other fixes on trunk you believe really > should be backported to the 3.25 branch/3.25.1 release. > > Thanks, > > Mark > > Set version to 3.25.1.GIT > Prepare NEWS for branch 3.25 fixes > FreeBSD close_range syscall > Bug 503641 - close_range syscalls started failing with 3.25.0 > mount syscall param filesystemtype may be NULL > Add workaround for missing riscv_hwprobe syscall (258) |
From: Mark W. <ma...@so...> - 2025-05-14 18:38:52
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=02de5973dcfe1c470838da733fdc058bb0c796e4 commit 02de5973dcfe1c470838da733fdc058bb0c796e4 Author: Paul Floyd <pj...@wa...> Date: Wed May 14 07:47:43 2025 +0200 regtest: use /bin/cat in none/tests/fdleak_cat.vgtest There's no /usr/bin/cat on FreeBSD or Darwin. (cherry picked from commit 045adc91f364e97fcc522fdf6b8915fd3cfeb24b) Diff: --- none/tests/fdleak_cat.vgtest | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/none/tests/fdleak_cat.vgtest b/none/tests/fdleak_cat.vgtest index 11a618d855..2cf78a0d0f 100644 --- a/none/tests/fdleak_cat.vgtest +++ b/none/tests/fdleak_cat.vgtest @@ -1,3 +1,3 @@ -prog: /usr/bin/cat +prog: /bin/cat vgopts: -q --track-fds=yes args: /dev/null |
From: Mark W. <ma...@so...> - 2025-05-14 18:38:47
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=46c50747724c70c4200257361b55ebb615a2fb35 commit 46c50747724c70c4200257361b55ebb615a2fb35 Author: Mark Wielaard <ma...@kl...> Date: Wed May 14 00:13:06 2025 +0200 Don't count closed inherited file descriptors Programs which close some inherited file descriptors and are run under valgrind with -q and --track-fds=yes would still show the FILE DESCRIPTORS banner even if there were no non-inherited file descriptors still open. Fix this by not counting already closed inherited file descriptors. Add a simple testcase to show /usr/bin/cat /dev/null doesn't produce any output running under valgrind -q --track-fds=yes. https://bugs.kde.org/show_bug.cgi?id=504177 (cherry picked from commit 29a5fcb3f6371584f89f9b54c793cc0f29802553) Diff: --- NEWS | 1 + coregrind/m_syswrap/syswrap-generic.c | 2 +- none/tests/Makefile.am | 1 + none/tests/fdleak_cat.stderr.exp | 0 none/tests/fdleak_cat.vgtest | 3 +++ 5 files changed, 6 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 3f084a52be..533b008166 100644 --- a/NEWS +++ b/NEWS @@ -7,6 +7,7 @@ The following bugs have been fixed or resolved on this branch. 503641 close_range syscalls started failing with 3.25.0 503914 mount syscall param filesystemtype may be NULL +504177 FILE DESCRIPTORS banner shows when closing some inherited fds To see details of a given bug, visit https://bugs.kde.org/show_bug.cgi?id=XXXXXX diff --git a/coregrind/m_syswrap/syswrap-generic.c b/coregrind/m_syswrap/syswrap-generic.c index 82a682a5ce..81c8fc028d 100644 --- a/coregrind/m_syswrap/syswrap-generic.c +++ b/coregrind/m_syswrap/syswrap-generic.c @@ -987,7 +987,7 @@ void VG_(show_open_fds) (const HChar* when) int inherited = 0; for (i = allocated_fds; i; i = i->next) { - if (i->where == NULL) + if (i->where == NULL && !i->fd_closed) inherited++; } diff --git a/none/tests/Makefile.am b/none/tests/Makefile.am index 043454828a..bebc2f4dd1 100644 --- a/none/tests/Makefile.am +++ b/none/tests/Makefile.am @@ -140,6 +140,7 @@ EXTRA_DIST = \ execve.vgtest execve.stdout.exp execve.stderr.exp \ faultstatus.vgtest faultstatus.stderr.exp faultstatus.stderr.exp-s390x \ fcntl_setown.vgtest fcntl_setown.stdout.exp fcntl_setown.stderr.exp \ + fdleak_cat.vgtest fdleak_cat.stderr.exp \ fdleak_cmsg.stderr.exp fdleak_cmsg.vgtest \ fdleak_cmsg_xml.stderr.exp-ppc64le \ fdleak_cmsg_xml.stderr.exp fdleak_cmsg_xml.vgtest \ diff --git a/none/tests/fdleak_cat.stderr.exp b/none/tests/fdleak_cat.stderr.exp new file mode 100644 index 0000000000..e69de29bb2 diff --git a/none/tests/fdleak_cat.vgtest b/none/tests/fdleak_cat.vgtest new file mode 100644 index 0000000000..11a618d855 --- /dev/null +++ b/none/tests/fdleak_cat.vgtest @@ -0,0 +1,3 @@ +prog: /usr/bin/cat +vgopts: -q --track-fds=yes +args: /dev/null |
From: Petr V. <pv...@su...> - 2025-05-14 08:45:30
|
Add valgrind-developers at sourceware.org based on their request. While at it, also note which ML need a subscription. [1] https://lore.kernel.org/ltp/3c5...@kl.../ Signed-off-by: Petr Vorel <pv...@su...> --- doc/maintainers/ltp_release_procedure.rst | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/doc/maintainers/ltp_release_procedure.rst b/doc/maintainers/ltp_release_procedure.rst index 6259afe0ea..6dbafa4f81 100644 --- a/doc/maintainers/ltp_release_procedure.rst +++ b/doc/maintainers/ltp_release_procedure.rst @@ -154,9 +154,10 @@ Send release announcement The announcement is sent to: -* ltp at lists.linux.it +* ltp at lists.linux.it (requires a subscription) * linux-kernel at vger.kernel.org -* libc-alpha at sourceware.org +* libc-alpha at sourceware.org (requires a subscription) +* valgrind-developers at lists.sourceforge.net (requires a subscription) CCed to: -- 2.49.0 |
From: Paul F. <pa...@so...> - 2025-05-14 05:52:25
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=045adc91f364e97fcc522fdf6b8915fd3cfeb24b commit 045adc91f364e97fcc522fdf6b8915fd3cfeb24b Author: Paul Floyd <pj...@wa...> Date: Wed May 14 07:47:43 2025 +0200 regtest: use /bin/cat in none/tests/fdleak_cat.vgtest There's no /usr/bin/cat on FreeBSD or Darwin. Diff: --- none/tests/fdleak_cat.vgtest | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/none/tests/fdleak_cat.vgtest b/none/tests/fdleak_cat.vgtest index 11a618d855..2cf78a0d0f 100644 --- a/none/tests/fdleak_cat.vgtest +++ b/none/tests/fdleak_cat.vgtest @@ -1,3 +1,3 @@ -prog: /usr/bin/cat +prog: /bin/cat vgopts: -q --track-fds=yes args: /dev/null |
From: Mark W. <ma...@so...> - 2025-05-13 22:29:16
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=29a5fcb3f6371584f89f9b54c793cc0f29802553 commit 29a5fcb3f6371584f89f9b54c793cc0f29802553 Author: Mark Wielaard <ma...@kl...> Date: Wed May 14 00:13:06 2025 +0200 Don't count closed inherited file descriptors Programs which close some inherited file descriptors and are run under valgrind with -q and --track-fds=yes would still show the FILE DESCRIPTORS banner even if there were no non-inherited file descriptors still open. Fix this by not counting already closed inherited file descriptors. Add a simple testcase to show /usr/bin/cat /dev/null doesn't produce any output running under valgrind -q --track-fds=yes. https://bugs.kde.org/show_bug.cgi?id=504177 Diff: --- NEWS | 1 + coregrind/m_syswrap/syswrap-generic.c | 2 +- none/tests/Makefile.am | 1 + none/tests/fdleak_cat.stderr.exp | 0 none/tests/fdleak_cat.vgtest | 3 +++ 5 files changed, 6 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 460eb56569..a1833ad409 100644 --- a/NEWS +++ b/NEWS @@ -28,6 +28,7 @@ are not entered into bugzilla tend to get forgotten about or ignored. 503677 duplicated-cond compiler warning in dis_RV64M 503817 s390x: fix 'ordered comparison of pointer with integer zero' compiler warnings 503914 mount syscall param filesystemtype may be NULL +504177 FILE DESCRIPTORS banner shows when closing some inherited fds To see details of a given bug, visit https://bugs.kde.org/show_bug.cgi?id=XXXXXX diff --git a/coregrind/m_syswrap/syswrap-generic.c b/coregrind/m_syswrap/syswrap-generic.c index 82a682a5ce..81c8fc028d 100644 --- a/coregrind/m_syswrap/syswrap-generic.c +++ b/coregrind/m_syswrap/syswrap-generic.c @@ -987,7 +987,7 @@ void VG_(show_open_fds) (const HChar* when) int inherited = 0; for (i = allocated_fds; i; i = i->next) { - if (i->where == NULL) + if (i->where == NULL && !i->fd_closed) inherited++; } diff --git a/none/tests/Makefile.am b/none/tests/Makefile.am index 043454828a..bebc2f4dd1 100644 --- a/none/tests/Makefile.am +++ b/none/tests/Makefile.am @@ -140,6 +140,7 @@ EXTRA_DIST = \ execve.vgtest execve.stdout.exp execve.stderr.exp \ faultstatus.vgtest faultstatus.stderr.exp faultstatus.stderr.exp-s390x \ fcntl_setown.vgtest fcntl_setown.stdout.exp fcntl_setown.stderr.exp \ + fdleak_cat.vgtest fdleak_cat.stderr.exp \ fdleak_cmsg.stderr.exp fdleak_cmsg.vgtest \ fdleak_cmsg_xml.stderr.exp-ppc64le \ fdleak_cmsg_xml.stderr.exp fdleak_cmsg_xml.vgtest \ diff --git a/none/tests/fdleak_cat.stderr.exp b/none/tests/fdleak_cat.stderr.exp new file mode 100644 index 0000000000..e69de29bb2 diff --git a/none/tests/fdleak_cat.vgtest b/none/tests/fdleak_cat.vgtest new file mode 100644 index 0000000000..11a618d855 --- /dev/null +++ b/none/tests/fdleak_cat.vgtest @@ -0,0 +1,3 @@ +prog: /usr/bin/cat +vgopts: -q --track-fds=yes +args: /dev/null |
From: Mark W. <ma...@so...> - 2025-05-13 12:38:30
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=40b67282da1463090f9e19ccc68d9a719375a92c commit 40b67282da1463090f9e19ccc68d9a719375a92c Author: Martin Cermak <mc...@re...> Date: Tue May 13 14:21:08 2025 +0200 auxprogs/ltp-tester.sh: Fix typo in summary log grep This does point out a couple more failures. In case the test results differ when running under valgrind, but there are no other error indicators. e.g. openat202 now reports: openat202: diff -u log1summary log2summary: --- log1summary +++ log2summary @@ -1,5 +1,5 @@ -passed 9 -failed 0 +passed 8 +failed 1 broken 0 skipped 0 warnings 0 Which points out we have a bug in our openat wrapper when given /proc/self/exe with RESOLVE_NO_MAGICLINKS (which should fail with ELOOP, but succeeds when running under valgrind, probably because we have a "magic" /proc/self/exe wrapper). Diff: --- auxprogs/ltp-tester.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/auxprogs/ltp-tester.sh b/auxprogs/ltp-tester.sh index e31f8a6b12..b5ba83c0b0 100755 --- a/auxprogs/ltp-tester.sh +++ b/auxprogs/ltp-tester.sh @@ -49,9 +49,9 @@ doTest () # output ordering changes and more. They aren't trivially # comparable. We resort to comparing at least the final # summary of individual test results - tail -10 $l/log1err | grep -E "^(passed|failed|broken|skipped|warnings):" > $l/log1summary ||: - tail -10 $l/log2err | grep -E "^(passed|failed|broken|skipped|warnings):" > $l/log2summary ||: - tail -10 $l/log3err | grep -E "^(passed|failed|broken|skipped|warnings):" > $l/log3summary ||: + tail -10 $l/log1err | grep -E "^(passed|failed|broken|skipped|warnings)" > $l/log1summary ||: + tail -10 $l/log2err | grep -E "^(passed|failed|broken|skipped|warnings)" > $l/log2summary ||: + tail -10 $l/log3err | grep -E "^(passed|failed|broken|skipped|warnings)" > $l/log3summary ||: # Check logs, report errors pushd $l >/dev/null |
From: Adhemerval Z. N. <adh...@li...> - 2025-05-13 08:29:50
|
On 12/05/25 12:12, Mark Wielaard wrote: > Hi Adhemerval, > > On Fri, May 09, 2025 at 11:08:42AM -0300, Adhemerval Zanella Netto wrote: >> On 25/04/25 19:06, Mark Wielaard wrote: >>> valgrind 3.25.0 have been released and is now in Fedora rawhide and >>> Fedora 42 with the new glibc syscall_cancel frames. The tail calls on >>> aarch64 still seem to be a problem for observability of the syscall >>> call stack. >> >> I am trying to check if patch to inline the cancellation wrappers [1] >> would help it, but I am not sure how exactly would handle stacktraces >> that should be artificial and only represented for debug information. > > I got that patch [1] working so I could test it myself (only on x86_64 > for now). How do you properly test a glibc installed in a non-default > location though? Currently I am doing something like: > > export LD_LIBRARY_PATH=/usr/local/glibc/lib > /usr/local/glibc/lib/ld-linux-x86-64.so.2 memcheck/tests/sendmsg > > This can also work with valgrind in between because it doesn't use > glibc dynamically itself. But it is not the easiest way to test > things. I used -Wl,-dynamic-linker and -Wl,-rpath instead at configure: --enable-only64bit \ LDFLAGS="-Wl,--dynamic-linker,/path/to/glibc-build/testroot.pristine/lib/ld-linux-aarch64.so.1 \ -Wl,--rpath,/path/to/glibc-build/testroot.pristine/lib64" It won't use glibc startup object (*ct*.o), neither the headers; but using a recent systems it should not be a problem (the difference should be minimal). > >> With the patch applied, both x86_64 and aarch64 should inline the >> syscall_cancel and internal_syscall_cancel call, only required an >> extra __syscall_cancel_arch call for the case when the process it >> multithread. >> >> On x86_64 it does shows as expected: >> >> valgrind-git (x86_64)$ ./coregrind/valgrind memcheck/tests/sendmsg >> [...] >> ==2131145== Syscall param sendmsg(msg) points to uninitialised byte(s) >> ==2131145== at 0x4972EE0: syscall_cancel (sysdep-cancel.h:83) >> ==2131145== by 0x4972EE0: sendmsg (sendmsg.c:28) >> ==2131145== by 0x4001332: main (sendmsg.c:46) >> ==2131145== Address 0x1ffefff850 is on thread 1's stack >> ==2131145== in frame #1, created by main (sendmsg.c:13) >> [...] >> >> But on aarch64 it shows internal_syscall_cancel, which is indeed >> inlined: >> >> valgrind-git (aarch64)$ ./coregrind/valgrind memcheck/tests/sendmsg >> [...] >> ==483437== Syscall param sendmsg(msg) points to uninitialised byte(s) >> ==483437== at 0x49D250C: internal_syscall_cancel (sysdep-cancel.h:44) >> ==483437== by 0x49D250C: syscall_cancel (sysdep-cancel.h:79) >> ==483437== by 0x49D250C: sendmsg (sendmsg.c:28) >> ==483437== by 0x4000B4B: main (sendmsg.c:46) >> ==483437== Address 0x1ffefffaf8 is on thread 1's stack >> ==483437== in frame #1, created by main (sendmsg.c:13) >> >> I am not sure if valgrind consider this an error, nor if it should be >> valgrind or compiler to handle this correctly. I am not aware of any >> attribute if can properly used to 'hide' internal_syscall_cancel in >> this case, or even if it makes sense. > > It isn't an "error" but any extra frames (either "real" or inlined) on > top of the function that does the actual system call causes existing > suppressions and test wrappers to no longer work. So valgrind is > responsible for filtering them out. For actual extra frames we now do > (since 3.25.0). If the extra syscall frame wrappers are inlined they > don't show up if no debuginfo/DWARF is available for glibc. But if it > is available we'll have to filter them out and/or don't look them up > for the top-level syscalls. > > Selectively removing these inlined calls is a little fragile at the > moment in valgrind, since it is done at a later time than capturing > the backtrace addresses. So either we have to pass through that we are > handling a syscall at the moment and so don't want to "expand" the > top-level frame with any inlines. And/Or we match on the "magic" > inlined syscall cancel frames (everywhere). If I understood correctly these seems to be an issue only for valgrind regression tests, right? If so, could this be handled solely on test validation? Or does valgrind aims to hide such inlined calls on stacktrace reports as well? > > You could use __attribute__(__artificial__)) which should mark the > function with DW_AT_artificial. Valgrind doesn't know about this > attribute yet, but we could probably with some extra work. Yeah, this is the first thing I tried to see if valgrind could handle it. Doing this on glibc should be easy enough if you think it would be way to handle it on valgrind. > > Thanks, > > Mark > >> [1] https://sourceware.org/git/?p=glibc.git;a=shortlog;h=refs/heads/azanella/cancel-wrappers-inline |
From: Florian K. <fl...@ei...> - 2025-05-12 20:19:16
|
Hi Paul, thanks for the review. On 12.05.25 21:49, Paul Floyd via Valgrind-developers wrote: > > One little nit, there's a missing second underscore in the first #ifdef in this > part of the diff > > +#ifdef __GNUC_ yep.. > LLVM clang also defines __GNUC__ so to make things GCC only you also need "&& > !defined(__clang__)" > I didn't know that. Thx for pointing that out. I'll fix both issues. > I think that it would be cleaner just to fix the printf: > > printf("%s", ""); Oh, absolutely. I tried that but then the sem_open_traced testcase failed. The code in question is a hack to work around a presumed to be GCC 9.2.1 miscompile. I'm using GCC 11.4 by default. So not sure whether the problem there is actually a miscompile or something else. But that is for Bart to figure out :) I presume the patch is OK with those fixes? Cheers, Florian |
From: Paul F. <pj...@wa...> - 2025-05-12 19:49:31
|
On 5/11/25 15:27, Florian Krohm wrote: > > To get -Wformat warnings for those the only thing to do is to add > -fhosted at the end of the CFLAGS thereby overriding -fno-builtin. > > drd/drd_intercepts > helgrind/hg_intercepts > preload shared objects > > These get compiled with AM_CFLAGS_PSO_BASE but adding -fhosted to > those made memcheck/tests/wcpncpy fail. It seems to me that those > flags are particularly crafted. So I left it alone. > > Attached patch regtested on x86_64-linux-gnu and s390x-ibm-linux-gnu > with no failures. > Hi Florian, I played around with this patch and it seems OK. One little nit, there's a missing second underscore in the first #ifdef in this part of the diff +#ifdef __GNUC_ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wformat-zero-length" +#endif printf(""); +#ifdef __GNUC__ +#pragma GCC diagnostic pop +#endif LLVM clang also defines __GNUC__ so to make things GCC only you also need "&& !defined(__clang__)" I think that it would be cleaner just to fix the printf: printf("%s", ""); A+ Paul |
From: Paul F. <pa...@so...> - 2025-05-12 19:42:44
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=21a098eadf71c4ce75e2b288a23835f403b065ae commit 21a098eadf71c4ce75e2b288a23835f403b065ae Author: Paul Floyd <pj...@wa...> Date: Mon May 12 21:38:46 2025 +0200 illumos regtest: mask a leak in memcheck/tests/realloc_size_zero_xml There's what looks like a libc printf buffer possible leak in this test on illumos. With xml output leak reporting is hard coded to on. So to avoid this extra error add --show-possibly-lost=no Maybe this should be suppressed. I haven't managed to reproduce it without xml and outside of perl regtest. Diff: --- memcheck/tests/realloc_size_zero_xml.vgtest | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/memcheck/tests/realloc_size_zero_xml.vgtest b/memcheck/tests/realloc_size_zero_xml.vgtest index 1b88b523bc..226289cb0a 100644 --- a/memcheck/tests/realloc_size_zero_xml.vgtest +++ b/memcheck/tests/realloc_size_zero_xml.vgtest @@ -1,5 +1,5 @@ prog: realloc_size_zero -vgopts: -q --xml=yes --xml-fd=2 --log-file=/dev/null +vgopts: -q --xml=yes --xml-fd=2 --log-file=/dev/null --show-possibly-lost=no stderr_filter: filter_xml |
From: Petr V. <pv...@su...> - 2025-05-12 18:06:32
|
Hi Cyril, > This commit adds an environment variable LTP_REPRODUCIBLE_OUTPUT that > when set skips printing parts of the test messages that may contain data > that differ on subsequent runs (e.g. pids). > With this you can run a test twice under a different conditions and > check if the test codeflow was identical by simply doing diff of the > outputs from the two runs. LGTM, thanks! Reviewed-by: Petr Vorel <pv...@su...> Could you please add before the commit the variable to print_help() and to the docs doc/users/setup_tests.rst? I suggest the diff below, which also sort the entries (ideally it'd be separated, but it's before the release, feel free to do it). > Signed-off-by: Cyril Hrubis <ch...@su...> > Suggested-by: Martin Doucha <md...@su...> > CC: val...@li... > --- > lib/tst_test.c | 7 +++++++ > 1 file changed, 7 insertions(+) > diff --git a/lib/tst_test.c b/lib/tst_test.c > index 2bb4519dd..f14627544 100644 > --- a/lib/tst_test.c > +++ b/lib/tst_test.c > @@ -64,6 +64,7 @@ static int mntpoint_mounted; > static int ovl_mounted; > static struct timespec tst_start_time; /* valid only for test pid */ > static int tdebug; > +static int reproducible_output; > struct results { > int passed; > @@ -312,6 +313,9 @@ static void print_result(const char *file, const int lineno, int ttype, > str += ret; > size -= ret; > + if (reproducible_output) > + goto print; > + > ssize = size - 2; > ret = vsnprintf(str, size, fmt, va); > str += MIN(ret, ssize); > @@ -329,6 +333,7 @@ static void print_result(const char *file, const int lineno, int ttype, > "Next message is too long and truncated:"); > } > +print: > snprintf(str, size, "\n"); > /* we might be called from signal handler, so use write() */ > @@ -1312,6 +1317,8 @@ static void do_setup(int argc, char *argv[]) > if (tst_test->supported_archs && !tst_is_on_arch(tst_test->supported_archs)) > tst_brk(TCONF, "This arch '%s' is not supported for test!", tst_arch.name); > + reproducible_output = !!getenv("LTP_REPRODUCIBLE_OUTPUT"); LTP_COLORIZE_OUTPUT allows more complicated setup (y/1 always, n/0: never), but any value here enables the feature (e.g. LTP_COLORIZE_OUTPUT=0). This would be nice to unify, but I'm ok to ignore it as it's before release. > + > assert_test_fn(); > TCID = tid = get_tid(argv); Adding docs (+ sort variables while at it). Kind regards, Petr +++ doc/users/setup_tests.rst @@ -49,11 +49,12 @@ users. * - LTP_DEV_FS_TYPE - Filesystem used for testing (default: ``ext2``). - * - LTP_TIMEOUT_MUL - - Multiplies timeout, must be number >= 0.1 (> 1 is useful for slow - machines to avoid unexpected timeout). It's mainly for shell API, which - does not have LTP_RUNTIME_MUL. In C API it scales the default 30 sec - safety margin, probably LTP_RUNTIME_MUL should be used instead. + * - LTP_IMA_LOAD_POLICY + - Load IMA example policy, see :master:`testcases/kernel/security/integrity/ima/README.md`. + + * - LTP_REPRODUCIBLE_OUTPUT + - Dischard the actual content of the messages printed by the test + (suitable for a reproducible output). * - LTP_RUNTIME_MUL - Multiplies maximal test iteration runtime. Tests that run for more than a @@ -61,8 +62,11 @@ users. both up and down with this multiplier. This is not yet implemented in the shell API. - * - LTP_IMA_LOAD_POLICY - - Load IMA example policy, see :master:`testcases/kernel/security/integrity/ima/README.md`. + * - LTP_TIMEOUT_MUL + - Multiplies timeout, must be number >= 0.1 (> 1 is useful for slow + machines to avoid unexpected timeout). It's mainly for shell API, which + does not have LTP_RUNTIME_MUL. In C API it scales the default 30 sec + safety margin, probably LTP_RUNTIME_MUL should be used instead. * - LTP_VIRT_OVERRIDE - Overrides virtual machine detection in the test library. Setting it to diff --git lib/tst_test.c lib/tst_test.c index f14627544f..a014ddc278 100644 --- lib/tst_test.c +++ lib/tst_test.c @@ -613,9 +613,10 @@ static void print_help(void) fprintf(stderr, "LTP_COLORIZE_OUTPUT Force colorized output behaviour (y/1 always, n/0: never)\n"); fprintf(stderr, "LTP_DEV Path to the block device to be used (for .needs_device)\n"); fprintf(stderr, "LTP_DEV_FS_TYPE Filesystem used for testing (default: %s)\n", DEFAULT_FS_TYPE); + fprintf(stderr, "LTP_REPRODUCIBLE_OUTPUT Dischard the actual content of the messages printed by the test\n"); + fprintf(stderr, "LTP_RUNTIME_MUL Runtime multiplier (must be a number >=1)\n"); fprintf(stderr, "LTP_SINGLE_FS_TYPE Testing only - specifies filesystem instead all supported (for .all_filesystems)\n"); fprintf(stderr, "LTP_TIMEOUT_MUL Timeout multiplier (must be a number >=1)\n"); - fprintf(stderr, "LTP_RUNTIME_MUL Runtime multiplier (must be a number >=1)\n"); fprintf(stderr, "LTP_VIRT_OVERRIDE Overrides virtual machine detection (values: \"\"|kvm|microsoft|xen|zvm)\n"); fprintf(stderr, "TMPDIR Base directory for template directory (for .needs_tmpdir, default: %s)\n", TEMPDIR); fprintf(stderr, "\n"); |
From: Mark W. <ma...@kl...> - 2025-05-12 11:12:38
|
Hi Adhemerval, On Fri, May 09, 2025 at 11:08:42AM -0300, Adhemerval Zanella Netto wrote: > On 25/04/25 19:06, Mark Wielaard wrote: > > valgrind 3.25.0 have been released and is now in Fedora rawhide and > > Fedora 42 with the new glibc syscall_cancel frames. The tail calls on > > aarch64 still seem to be a problem for observability of the syscall > > call stack. > > I am trying to check if patch to inline the cancellation wrappers [1] > would help it, but I am not sure how exactly would handle stacktraces > that should be artificial and only represented for debug information. I got that patch [1] working so I could test it myself (only on x86_64 for now). How do you properly test a glibc installed in a non-default location though? Currently I am doing something like: export LD_LIBRARY_PATH=/usr/local/glibc/lib /usr/local/glibc/lib/ld-linux-x86-64.so.2 memcheck/tests/sendmsg This can also work with valgrind in between because it doesn't use glibc dynamically itself. But it is not the easiest way to test things. > With the patch applied, both x86_64 and aarch64 should inline the > syscall_cancel and internal_syscall_cancel call, only required an > extra __syscall_cancel_arch call for the case when the process it > multithread. > > On x86_64 it does shows as expected: > > valgrind-git (x86_64)$ ./coregrind/valgrind memcheck/tests/sendmsg > [...] > ==2131145== Syscall param sendmsg(msg) points to uninitialised byte(s) > ==2131145== at 0x4972EE0: syscall_cancel (sysdep-cancel.h:83) > ==2131145== by 0x4972EE0: sendmsg (sendmsg.c:28) > ==2131145== by 0x4001332: main (sendmsg.c:46) > ==2131145== Address 0x1ffefff850 is on thread 1's stack > ==2131145== in frame #1, created by main (sendmsg.c:13) > [...] > > But on aarch64 it shows internal_syscall_cancel, which is indeed > inlined: > > valgrind-git (aarch64)$ ./coregrind/valgrind memcheck/tests/sendmsg > [...] > ==483437== Syscall param sendmsg(msg) points to uninitialised byte(s) > ==483437== at 0x49D250C: internal_syscall_cancel (sysdep-cancel.h:44) > ==483437== by 0x49D250C: syscall_cancel (sysdep-cancel.h:79) > ==483437== by 0x49D250C: sendmsg (sendmsg.c:28) > ==483437== by 0x4000B4B: main (sendmsg.c:46) > ==483437== Address 0x1ffefffaf8 is on thread 1's stack > ==483437== in frame #1, created by main (sendmsg.c:13) > > I am not sure if valgrind consider this an error, nor if it should be > valgrind or compiler to handle this correctly. I am not aware of any > attribute if can properly used to 'hide' internal_syscall_cancel in > this case, or even if it makes sense. It isn't an "error" but any extra frames (either "real" or inlined) on top of the function that does the actual system call causes existing suppressions and test wrappers to no longer work. So valgrind is responsible for filtering them out. For actual extra frames we now do (since 3.25.0). If the extra syscall frame wrappers are inlined they don't show up if no debuginfo/DWARF is available for glibc. But if it is available we'll have to filter them out and/or don't look them up for the top-level syscalls. Selectively removing these inlined calls is a little fragile at the moment in valgrind, since it is done at a later time than capturing the backtrace addresses. So either we have to pass through that we are handling a syscall at the moment and so don't want to "expand" the top-level frame with any inlines. And/Or we match on the "magic" inlined syscall cancel frames (everywhere). You could use __attribute__(__artificial__)) which should mark the function with DW_AT_artificial. Valgrind doesn't know about this attribute yet, but we could probably with some extra work. Thanks, Mark > [1] https://sourceware.org/git/?p=glibc.git;a=shortlog;h=refs/heads/azanella/cancel-wrappers-inline |
From: Avinesh K. <ak...@su...> - 2025-05-12 09:47:22
|
Hi, Reviewed-by: Avinesh Kumar <ak...@su...> On Friday, May 9, 2025 11:28:13 AM CEST Cyril Hrubis wrote: > This commit adds an environment variable LTP_REPRODUCIBLE_OUTPUT that > when set skips printing parts of the test messages that may contain data > that differ on subsequent runs (e.g. pids). > > With this you can run a test twice under a different conditions and > check if the test codeflow was identical by simply doing diff of the > outputs from the two runs. > > Signed-off-by: Cyril Hrubis <ch...@su...> > Suggested-by: Martin Doucha <md...@su...> > CC: val...@li... > --- > lib/tst_test.c | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/lib/tst_test.c b/lib/tst_test.c > index 2bb4519dd..f14627544 100644 > --- a/lib/tst_test.c > +++ b/lib/tst_test.c > @@ -64,6 +64,7 @@ static int mntpoint_mounted; > static int ovl_mounted; > static struct timespec tst_start_time; /* valid only for test pid */ > static int tdebug; > +static int reproducible_output; > > struct results { > int passed; > @@ -312,6 +313,9 @@ static void print_result(const char *file, const int lineno, int ttype, > str += ret; > size -= ret; > > + if (reproducible_output) > + goto print; > + > ssize = size - 2; > ret = vsnprintf(str, size, fmt, va); > str += MIN(ret, ssize); > @@ -329,6 +333,7 @@ static void print_result(const char *file, const int lineno, int ttype, > "Next message is too long and truncated:"); > } > > +print: > snprintf(str, size, "\n"); > > /* we might be called from signal handler, so use write() */ > @@ -1312,6 +1317,8 @@ static void do_setup(int argc, char *argv[]) > if (tst_test->supported_archs && !tst_is_on_arch(tst_test->supported_archs)) > tst_brk(TCONF, "This arch '%s' is not supported for test!", tst_arch.name); > > + reproducible_output = !!getenv("LTP_REPRODUCIBLE_OUTPUT"); > + > assert_test_fn(); > > TCID = tid = get_tid(argv); > Regards, Avinesh |
From: Paul F. <pa...@so...> - 2025-05-12 05:21:43
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=05631e8f0541bb918a48cd6616b340ffb5966647 commit 05631e8f0541bb918a48cd6616b340ffb5966647 Author: Paul Floyd <pj...@wa...> Date: Mon May 12 07:20:59 2025 +0200 Linux regtest: add an expected for memcheck realloc_size_zero_xml Diff: --- memcheck/tests/Makefile.am | 1 + memcheck/tests/realloc_size_zero_xml.stdout.exp-glibc | 2 ++ 2 files changed, 3 insertions(+) diff --git a/memcheck/tests/Makefile.am b/memcheck/tests/Makefile.am index 06d97ae5aa..eb3b6f9ee0 100644 --- a/memcheck/tests/Makefile.am +++ b/memcheck/tests/Makefile.am @@ -355,6 +355,7 @@ EXTRA_DIST = \ realloc_size_zero.vgtest \ realloc_size_zero_xml.stderr.exp \ realloc_size_zero_xml.stdout.exp \ + realloc_size_zero_xml.stdout.exp-glibc \ realloc_size_zero_xml.vgtest \ realloc_size_zero_yes.stderr.exp realloc_size_zero_yes.stdout.exp \ realloc_size_zero_yes.vgtest \ diff --git a/memcheck/tests/realloc_size_zero_xml.stdout.exp-glibc b/memcheck/tests/realloc_size_zero_xml.stdout.exp-glibc new file mode 100644 index 0000000000..ed2bcf0cd4 --- /dev/null +++ b/memcheck/tests/realloc_size_zero_xml.stdout.exp-glibc @@ -0,0 +1,2 @@ +p is NULL after realloc 0 +p2 not NULL after realloc 0 |
From: Mark W. <ma...@so...> - 2025-05-11 21:15:50
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=3404f081ed2027ccdb756c87bcaea7f95fd0525a commit 3404f081ed2027ccdb756c87bcaea7f95fd0525a Author: Mark Wielaard <ma...@kl...> Date: Sun May 11 23:12:15 2025 +0200 More gdb filtering for glibc 2.41 with debuginfo installed Diff: --- gdbserver_tests/filter_gdb.in | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gdbserver_tests/filter_gdb.in b/gdbserver_tests/filter_gdb.in index 7f7862a889..98f28d13c7 100755 --- a/gdbserver_tests/filter_gdb.in +++ b/gdbserver_tests/filter_gdb.in @@ -137,6 +137,12 @@ s/in _dl_sysinfo_int80 () from \/lib\/ld-linux.so.*/in syscall .../ # in __syscall_cancel_arch is just in a syscall s/in __syscall_cancel_arch .*/in syscall .../ +# as is just __syscall_cancel_arch +s/__syscall_cancel_arch .*/0x........ in syscall .../ + +# gdb with source might figure out there is just a ret instruction +/^[1-9][0-9\t ]*ret$/d + # do_syscall is in syscall s/__libc_do_syscall ().*/0x........ in syscall .../ |
From: Paul F. <pa...@so...> - 2025-05-11 19:25:49
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=c00d3a54ddeac43af72ca624bef2451ddea35789 commit c00d3a54ddeac43af72ca624bef2451ddea35789 Author: Paul Floyd <pj...@wa...> Date: Sun May 11 21:25:11 2025 +0200 Regtest: add an xml version of memcheck realloc_size_zero Diff: --- memcheck/tests/Makefile.am | 3 + memcheck/tests/realloc_size_zero_xml.stderr.exp | 90 +++++++++++++++++++++++++ memcheck/tests/realloc_size_zero_xml.stdout.exp | 2 + memcheck/tests/realloc_size_zero_xml.vgtest | 6 ++ 4 files changed, 101 insertions(+) diff --git a/memcheck/tests/Makefile.am b/memcheck/tests/Makefile.am index 401fe8ca8e..06d97ae5aa 100644 --- a/memcheck/tests/Makefile.am +++ b/memcheck/tests/Makefile.am @@ -353,6 +353,9 @@ EXTRA_DIST = \ realloc_size_zero.stderr.exp realloc_size_zero.stdout.exp-glibc \ realloc_size_zero.stdout.exp-other \ realloc_size_zero.vgtest \ + realloc_size_zero_xml.stderr.exp \ + realloc_size_zero_xml.stdout.exp \ + realloc_size_zero_xml.vgtest \ realloc_size_zero_yes.stderr.exp realloc_size_zero_yes.stdout.exp \ realloc_size_zero_yes.vgtest \ realloc_size_zero_again_yes.stderr.exp \ diff --git a/memcheck/tests/realloc_size_zero_xml.stderr.exp b/memcheck/tests/realloc_size_zero_xml.stderr.exp new file mode 100644 index 0000000000..3b6450ff4e --- /dev/null +++ b/memcheck/tests/realloc_size_zero_xml.stderr.exp @@ -0,0 +1,90 @@ +<?xml version="1.0"?> + +<valgrindoutput> + +<protocolversion>4</protocolversion> +<protocoltool>memcheck</protocoltool> + +<preamble> + <line>...</line> + <line>...</line> + <line>...</line> + <line>...</line> +</preamble> + +<pid>...</pid> +<ppid>...</ppid> +<tool>memcheck</tool> + +<args> + <vargv>...</vargv> + <argv> + <exe>./realloc_size_zero</exe> + </argv> +</args> + +<status> + <state>RUNNING</state> + <time>...</time> +</status> + +<error> + <unique>0x........</unique> + <tid>...</tid> + <kind>ReallocSizeZero</kind> + <what>realloc() with size 0</what> + <stack> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>realloc</fn> + <dir>...</dir> + <file>vg_replace_malloc.c</file> + <line>...</line> + </frame> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>main</fn> + <dir>...</dir> + <file>realloc_size_zero.c</file> + <line>...</line> + </frame> + </stack> + <auxwhat>Address 0x........ is 0 bytes inside a block of size 1,024 alloc'd</auxwhat> + <stack> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>malloc</fn> + <dir>...</dir> + <file>vg_replace_malloc.c</file> + <line>...</line> + </frame> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>main</fn> + <dir>...</dir> + <file>realloc_size_zero.c</file> + <line>...</line> + </frame> + </stack> +</error> + + +<status> + <state>FINISHED</state> + <time>...</time> +</status> + +<errorcounts> + <pair> + <count>...</count> + <unique>0x........</unique> + </pair> +</errorcounts> + + +</valgrindoutput> + diff --git a/memcheck/tests/realloc_size_zero_xml.stdout.exp b/memcheck/tests/realloc_size_zero_xml.stdout.exp new file mode 100644 index 0000000000..103f1d5ebc --- /dev/null +++ b/memcheck/tests/realloc_size_zero_xml.stdout.exp @@ -0,0 +1,2 @@ +p not NULL after realloc 0 +p2 not NULL after realloc 0 diff --git a/memcheck/tests/realloc_size_zero_xml.vgtest b/memcheck/tests/realloc_size_zero_xml.vgtest new file mode 100644 index 0000000000..1b88b523bc --- /dev/null +++ b/memcheck/tests/realloc_size_zero_xml.vgtest @@ -0,0 +1,6 @@ +prog: realloc_size_zero +vgopts: -q --xml=yes --xml-fd=2 --log-file=/dev/null +stderr_filter: filter_xml + + + |
From: Paul F. <pa...@so...> - 2025-05-11 17:42:14
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=f23b5b7257356ed39e89f941eb1856ff52a78bdf commit f23b5b7257356ed39e89f941eb1856ff52a78bdf Author: Paul Floyd <pj...@wa...> Date: Sun May 11 19:40:22 2025 +0200 FreeBSD warnings: a couple of signatures that warn of mismatches when -fno-bultin is specified. There's still infinite recursion and crashes with clang though. 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 55ffd769b3..ff82e3a505 100644 --- a/coregrind/m_main.c +++ b/coregrind/m_main.c @@ -3544,12 +3544,12 @@ void *memcpy(void *dest, const void *src, size_t n); void *memcpy(void *dest, const void *src, size_t n) { return VG_(memcpy)(dest, src, n); } -void* memmove(void *dest, const void *src, SizeT n); -void* memmove(void *dest, const void *src, SizeT n) { +void* memmove(void *dest, const void *src, size_t n); +void* memmove(void *dest, const void *src, size_t n) { return VG_(memmove)(dest,src,n); } -void* memset(void *s, int c, SizeT n); -void* memset(void *s, int c, SizeT n) { +void* memset(void *s, int c, size_t n); +void* memset(void *s, int c, size_t n) { return VG_(memset)(s,c,n); } |
From: Florian K. <fl...@ei...> - 2025-05-11 13:28:06
|
Hi Paul, thx for the experiments.. On 11.05.25 12:01, Paul Floyd via Valgrind-developers wrote: > > The only alternative I have for the moment is to drop the optimization level to > 01 as in the godbolt link above. There are 4 places in the code where I had to > do that (3 strlen replacements and drd_pre_mem_read_asciiz which is effectively > doing an strlen as a check before calling DRD_(trace_load)). > I just realise, that we will not miss any -Wformat warnings in most of valgrind code because we're not calling any functions from C library headers there. VEX, the core and the tools get compiled for a freestanding environment and we run our own versions of printf: VG_(printf) vex_printf etc. which have proper attributes. And they are complex enough that GCC will not do anything clever with them. That's good news in the sense that we do not need to change Makefile.all.am at all. We might want to consider replacing -fno-builtin with -freestanding (which implies the former). That reflects better what we do. There are only a few bits that are linked against libc: auxprogs/valgrind-listener auxprogs/getoff-<platform> auxprogs/valgrind-di-server coregrind/valgrind coregrind/vgdb memcheck/tests/vbit-test/vbit-test none/s390x/tests/disasm-test/disasm-test To get -Wformat warnings for those the only thing to do is to add -fhosted at the end of the CFLAGS thereby overriding -fno-builtin. drd/drd_intercepts helgrind/hg_intercepts preload shared objects These get compiled with AM_CFLAGS_PSO_BASE but adding -fhosted to those made memcheck/tests/wcpncpy fail. It seems to me that those flags are particularly crafted. So I left it alone. Attached patch regtested on x86_64-linux-gnu and s390x-ibm-linux-gnu with no failures. Florian |
From: Mark W. <ma...@kl...> - 2025-05-11 11:43:26
|
Hi Paul, On Sun, May 11, 2025 at 01:18:18PM +0200, Paul Floyd via Valgrind-developers wrote: > I'm about ready to push the changes for > https://bugs.kde.org/show_bug.cgi?id=390310 > > One thing I'd like some other opinion(s) on is the tag used for the > summaries. > > At the moment the non-xml output looks like > > ==3166== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 3 from 3) > > With this patch the corresponding xml summary is > > > <error_summary> > <errors>1</errors> > <from>1</from> > <suppressed>3</suppressed> > <suppressed_from>3</suppressed_from> > </error_summary> > > Do you think that would be clearer using "contexts" rather than "from"? > > > <error_summary> > <errors>1</errors> > <error_contexts>1</error_contexts> > <suppressed>3</suppressed> > <suppressed_contexts>3</suppressed_contexts> > </error_summary> Yes, I think using "contexts" is clearer than using "from". We should probably also update: ./docs/internals/xml-output.txt ./docs/internals/xml-output-protocol4.txt ./docs/internals/xml-output-protocol5.txt 4 is the default output, 5 is with --track-fds enabled (so it includes core error elements). Maybe after this change goes in we should update the (default) protocol version to 6? Cheers, Mark |
From: Paul F. <pj...@wa...> - 2025-05-11 11:18:32
|
Hi all I'm about ready to push the changes for https://bugs.kde.org/show_bug.cgi?id=390310 One thing I'd like some other opinion(s) on is the tag used for the summaries. At the moment the non-xml output looks like ==3166== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 3 from 3) With this patch the corresponding xml summary is <error_summary> <errors>1</errors> <from>1</from> <suppressed>3</suppressed> <suppressed_from>3</suppressed_from> </error_summary> Do you think that would be clearer using "contexts" rather than "from"? <error_summary> <errors>1</errors> <error_contexts>1</error_contexts> <suppressed>3</suppressed> <suppressed_contexts>3</suppressed_contexts> </error_summary> A+ Paul |
From: Paul F. <pj...@wa...> - 2025-05-11 10:01:47
|
On 08/05/2025 11:31, Florian Krohm wrote: > > I am wondering whether adding -nodefaultlibs to the compile flags helps. > > <quote> > '-nodefaultlibs' > Do not use the standard system libraries when linking. ... > </quote> > > If GCC still adds a dependency on a library function that I'm telling > it won't be there - that would be quite odd... Unfortunately it _is_ a bit odd https://godbolt.org/z/86nrE4odb > Could you give that a try? Or may be change VG_(strlen) to return > __builtin_strlen(str) ? > __builtin_strlen() isn't builtin either, it results in a call to strlen(). LLVM has __attribute__((no_builtin("strlen"))) but not GCC so we can't use that. The only alternative I have for the moment is to drop the optimization level to 01 as in the godbolt link above. There are 4 places in the code where I had to do that (3 strlen replacements and drd_pre_mem_read_asciiz which is effectively doing an strlen as a check before calling DRD_(trace_load)). A+ Paul |
From: Paul F. <pa...@so...> - 2025-05-11 08:29:54
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=01f66db19fd91bbe869d1272ab67e441396cabe5 commit 01f66db19fd91bbe869d1272ab67e441396cabe5 Author: Paul Floyd <pj...@wa...> Date: Sun May 11 10:28:01 2025 +0200 Linux PPC64 syscall: add sys_io_pgetevents Diff: --- coregrind/m_syswrap/syswrap-ppc64-linux.c | 1 + include/vki/vki-scnums-ppc64-linux.h | 1 + 2 files changed, 2 insertions(+) diff --git a/coregrind/m_syswrap/syswrap-ppc64-linux.c b/coregrind/m_syswrap/syswrap-ppc64-linux.c index 7a79c6dee3..007fa6336c 100644 --- a/coregrind/m_syswrap/syswrap-ppc64-linux.c +++ b/coregrind/m_syswrap/syswrap-ppc64-linux.c @@ -1022,6 +1022,7 @@ static SyscallTableEntry syscall_table[] = { LINXY(__NR_statx, sys_statx), // 383 GENX_(__NR_rseq, sys_ni_syscall), // 387 + LINX_(__NR_io_pgetevents, sys_io_pgetevents), // 388 LINXY(__NR_io_uring_setup, sys_io_uring_setup), // 425 LINXY(__NR_io_uring_enter, sys_io_uring_enter), // 426 diff --git a/include/vki/vki-scnums-ppc64-linux.h b/include/vki/vki-scnums-ppc64-linux.h index a76fa6d322..6d8b2b508c 100644 --- a/include/vki/vki-scnums-ppc64-linux.h +++ b/include/vki/vki-scnums-ppc64-linux.h @@ -408,6 +408,7 @@ #define __NR_pkey_free 385 #define __NR_pkey_mprotect 386 #define __NR_rseq 387 +#define __NR_io_pgetevents 388 #endif /* __VKI_SCNUMS_PPC64_LINUX_H */ |