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
(60) |
Sep
|
Oct
|
Nov
|
Dec
|
From: Mark W. <ma...@so...> - 2024-06-23 20:08:08
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=2272233d23a5431e14b3c9385d2b4b66e0e8f0fd commit 2272233d23a5431e14b3c9385d2b4b66e0e8f0fd Author: Alexandra Hájková <aha...@re...> Date: Thu Jun 20 07:45:56 2024 -0400 Don't allow programs calling fnctl on valgrind's own file descriptors Add a call to ML_(fd_allowed) in the PRE handler of fcntl and fcntl64 and block syscalls with EBADF when the file descriptor isn't allowed to be used by the program. https://bugs.kde.org/show_bug.cgi?id=337388 (cherry picked from commit 4b83e3d47daaf5eff2ca96867a8c790e13830eb5) Diff: --- NEWS | 1 + coregrind/m_syswrap/syswrap-linux.c | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/NEWS b/NEWS index 94789a04ba..523380a98f 100644 --- a/NEWS +++ b/NEWS @@ -7,6 +7,7 @@ The following bugs have been fixed or resolved on this branch. 202770 open fd at exit --log-socket=127.0.0.1:1500 with --track-fds=yes 311655 --log-file=FILE leads to apparent fd leak +337388 fcntl works on Valgrind's own file descriptors 453044 gbserver_tests failures in aarch64 479661 Valgrind leaks file descriptors 486180 [MIPS] 'VexGuestArchState' has no member named 'guest_IP_AT_SYSCALL' diff --git a/coregrind/m_syswrap/syswrap-linux.c b/coregrind/m_syswrap/syswrap-linux.c index 45413fdd9e..9f3c51c179 100644 --- a/coregrind/m_syswrap/syswrap-linux.c +++ b/coregrind/m_syswrap/syswrap-linux.c @@ -6978,6 +6978,10 @@ PRE(sys_fcntl) if (ARG2 == VKI_F_SETLKW) # endif *flags |= SfMayBlock; + + if (!ML_(fd_allowed)(ARG1, "fcntl", tid, False)) { + SET_STATUS_Failure (VKI_EBADF); + } } POST(sys_fcntl) @@ -7088,6 +7092,10 @@ PRE(sys_fcntl64) if (ARG2 == VKI_F_SETLKW) # endif *flags |= SfMayBlock; + + if (!ML_(fd_allowed)(ARG1, "fcntl64", tid, False)) { + SET_STATUS_Failure (VKI_EBADF); + } } POST(sys_fcntl64) |
From: Mark W. <ma...@so...> - 2024-06-23 20:07:58
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=14cefe7c645a3148165f4b2fa6095d9446e378c7 commit 14cefe7c645a3148165f4b2fa6095d9446e378c7 Author: Mark Wielaard <ma...@kl...> Date: Sun Jun 16 21:23:08 2024 +0200 Don't leave fds created with --log-file, --xml-file or --log-socket open prepare_sink_fd and prepare_sink_socket will create a new file descriptor for the output sink. finalize_sink_fd then copies the fd to the safe range, so it doesn't conflict with any application fds. If we created the original fd ourselves, it was a VgLogTo_File or VgLogTo_Socket, not VgLogTo_Fd, finalize_sink_fd should close it. Also close socket when connecting fails in VG_(connect_via_socket). Add a testcase for --log-file and --xml-file which prints output to /dev/stderr https://bugs.kde.org/show_bug.cgi?id=202770 https://bugs.kde.org/show_bug.cgi?id=311655 https://bugs.kde.org/show_bug.cgi?id=488379 Co-authored-by: Alexandra Hájková <aha...@re... (cherry picked from commit fbd7596f8342f0b0fbbe088d960da839a8bdb839) Diff: --- NEWS | 3 +++ coregrind/m_libcfile.c | 1 + coregrind/m_libcprint.c | 6 +++++ none/tests/Makefile.am | 5 +++- none/tests/filter_xml | 25 ++++++++++++++++++++ none/tests/log-track-fds.stderr.exp | 0 none/tests/log-track-fds.vgtest | 4 ++++ none/tests/xml-track-fds.stderr.exp | 47 +++++++++++++++++++++++++++++++++++++ none/tests/xml-track-fds.vgtest | 5 ++++ 9 files changed, 95 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index fbe0f012ef..10b5ae3195 100644 --- a/NEWS +++ b/NEWS @@ -5,11 +5,14 @@ Branch 3.23 The following bugs have been fixed or resolved on this branch. +202770 open fd at exit --log-socket=127.0.0.1:1500 with --track-fds=yes +311655 --log-file=FILE leads to apparent fd leak 453044 gbserver_tests failures in aarch64 486180 [MIPS] 'VexGuestArchState' has no member named 'guest_IP_AT_SYSCALL' 486293 memccpy false positives 486569 linux inotify_init syscall wrapper missing POST entry in syscall_table 487439 SIGILL in JDK11, JDK17 +488379 --track-fds=yes errors that cannot be suppressed with --xml-file= n-i-bz aarch64 frinta and frinta vector instructions To see details of a given bug, visit diff --git a/coregrind/m_libcfile.c b/coregrind/m_libcfile.c index 6098bc5813..9635b80a68 100644 --- a/coregrind/m_libcfile.c +++ b/coregrind/m_libcfile.c @@ -1333,6 +1333,7 @@ Int VG_(connect_via_socket)( const HChar* str ) res = my_connect(sd, &servAddr, sizeof(servAddr)); if (res < 0) { /* connection failed */ + VG_(close)(sd); return -2; } diff --git a/coregrind/m_libcprint.c b/coregrind/m_libcprint.c index c802f81403..593889da9d 100644 --- a/coregrind/m_libcprint.c +++ b/coregrind/m_libcprint.c @@ -425,6 +425,12 @@ static void finalize_sink_fd(OutputSink *sink, Int new_fd, Bool is_xml) } else { VG_(fcntl)(safe_fd, VKI_F_SETFD, VKI_FD_CLOEXEC); sink->fd = safe_fd; + /* If we created the new_fd (VgLogTo_File or VgLogTo_Socket), then we + don't need the original file descriptor open anymore. We only need + to keep it open if it was an existing fd given by the user (or + stderr). */ + if (sink->type != VgLogTo_Fd) + VG_(close)(new_fd); } } diff --git a/none/tests/Makefile.am b/none/tests/Makefile.am index 185993f204..532cc7632a 100644 --- a/none/tests/Makefile.am +++ b/none/tests/Makefile.am @@ -86,6 +86,7 @@ dist_noinst_SCRIPTS = \ filter_none_discards \ filter_stderr \ filter_timestamp \ + filter_xml \ allexec_prepare_prereq noinst_HEADERS = fdleak.h @@ -229,7 +230,9 @@ EXTRA_DIST = \ sigprocmask.stderr.exp sigprocmask.vgtest \ socket_close.stderr.exp socket_close.vgtest \ file_dclose.stderr.exp file_dclose.vgtest \ - double_close_range.stderr.exp double_close_range.vgtest + double_close_range.stderr.exp double_close_range.vgtest \ + log-track-fds.stderr.exp log-track-fds.vgtest \ + xml-track-fds.stderr.exp xml-track-fds.vgtest check_PROGRAMS = \ diff --git a/none/tests/filter_xml b/none/tests/filter_xml new file mode 100755 index 0000000000..d1ef570a05 --- /dev/null +++ b/none/tests/filter_xml @@ -0,0 +1,25 @@ +#! /bin/sh + +dir=`dirname $0` + +# FreeBSD adds this one extra line +# but after filter_xml_frames it will just be <path>...<\/path> +# which matches other lines, so get rid of it while we can +# uniquely match it +sed "/<path>internet<\/path>/d" | + +$dir/../../tests/filter_xml_frames | +perl -p -e "s/<time>.*<\/time>/<time>...<\/time>/s" | +perl -p -e "s/<what>.*<\/what>/<what>...<\/what>/s" | +perl -p -e "s/<path>.*<\/path>/<path>...<\/path>/s" | +perl -p -e "s/<line>Copyright.*<\/line>/<line>Copyright...<\/line>/s" | +perl -p -e "s/<line>Using Valgrind.*<\/line>/<line>Using Valgrind...<\/line>/s" | +sed "s/<ppid>[0-9]*<\/ppid>/<ppid>...<\/ppid>/" | +sed "s/<tid>[0-9]*<\/tid>/<tid>...<\/tid>/" | +sed "s/<pid>[0-9]*<\/pid>/<pid>...<\/pid>/" | +sed "s/<obj>.*<\/obj>/<obj>...<\/obj>/" | +sed "s/<exe>.*<\/exe>/<exe>...<\/exe>/" | +sed "s/<dir>.*<\/dir>/<dir>...<\/dir>/" | +sed "s/<ppid>[0-9]*<\/ppid>/<ppid>...<\/ppid>/" | +sed "s/<unique>0x[0-9a-fA-F]*<\/unique>/<unique>0x........<\/unique>/" | +sed "s/<ip>0x[0-9a-fA-F]*<\/ip>/<ip>0x........<\/ip>/" diff --git a/none/tests/log-track-fds.stderr.exp b/none/tests/log-track-fds.stderr.exp new file mode 100644 index 0000000000..e69de29bb2 diff --git a/none/tests/log-track-fds.vgtest b/none/tests/log-track-fds.vgtest new file mode 100644 index 0000000000..dfebb5bf3e --- /dev/null +++ b/none/tests/log-track-fds.vgtest @@ -0,0 +1,4 @@ +# Simple test to make sure track-fds doesn't error on (internal) log-file +# See https://bugs.kde.org/show_bug.cgi?id=311655 +prog: ../../tests/true +vgopts: -q --track-fds=yes --log-file=/dev/stderr diff --git a/none/tests/xml-track-fds.stderr.exp b/none/tests/xml-track-fds.stderr.exp new file mode 100644 index 0000000000..b06da9d722 --- /dev/null +++ b/none/tests/xml-track-fds.stderr.exp @@ -0,0 +1,47 @@ +<?xml version="1.0"?> + +<valgrindoutput> + +<protocolversion>5</protocolversion> +<protocoltool>none</protocoltool> + +<preamble> + <line>Nulgrind, the minimal Valgrind tool</line> + <line>Copyright...</line> + <line>Using Valgrind...</line> + <line>Command: ./../../tests/true</line> +</preamble> + +<pid>...</pid> +<ppid>...</ppid> +<tool>none</tool> + +<args> + <vargv> + <exe>...</exe> + <arg>--command-line-only=yes</arg> + <arg>--memcheck:leak-check=no</arg> + <arg>--tool=none</arg> + <arg>--track-fds=yes</arg> + <arg>--xml=yes</arg> + <arg>--xml-file=/dev/stderr</arg> + </vargv> + <argv> + <exe>...</exe> + </argv> +</args> + +<status> + <state>RUNNING</state> + <time>...</time> +</status> + + +<status> + <state>FINISHED</state> + <time>...</time> +</status> + + +</valgrindoutput> + diff --git a/none/tests/xml-track-fds.vgtest b/none/tests/xml-track-fds.vgtest new file mode 100644 index 0000000000..50f1a55a82 --- /dev/null +++ b/none/tests/xml-track-fds.vgtest @@ -0,0 +1,5 @@ +# Simple test to make sure track-fds doesn't error on (internal) xml-file +# See https://bugs.kde.org/show_bug.cgi?id=488379 +prog: ../../tests/true +vgopts: --track-fds=yes --xml=yes --xml-file=/dev/stderr +stderr_filter: filter_xml |
From: Mark W. <ma...@so...> - 2024-06-23 20:07:58
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=0ced5269236c527d2e288b773e3684b6b1673ec2 commit 0ced5269236c527d2e288b773e3684b6b1673ec2 Author: Mark Wielaard <ma...@kl...> Date: Mon Jun 17 00:27:12 2024 +0200 Close both internal pipe fds after VG_(fork) in parent and child An VG_fork() creates a pipe between parent and child to syncronize the two processes. The parent wants to register the child pid before the child can run. This is done in register_sigchld_ignore. Make sure both the parent and the child close both the read and write file descriptors so none leak. https://bugs.kde.org/show_bug.cgi?id=479661 (cherry picked from commit 1263471efdf8405cb0f1a767c6af73bf2eaf7160) Diff: --- NEWS | 1 + coregrind/m_libcproc.c | 7 +++++++ none/tests/Makefile.am | 3 +++ none/tests/track-fds-exec-children.c | 13 +++++++++++++ none/tests/track-fds-exec-children.stderr.exp | 0 none/tests/track-fds-exec-children.vgtest | 3 +++ 6 files changed, 27 insertions(+) diff --git a/NEWS b/NEWS index 10b5ae3195..94789a04ba 100644 --- a/NEWS +++ b/NEWS @@ -8,6 +8,7 @@ The following bugs have been fixed or resolved on this branch. 202770 open fd at exit --log-socket=127.0.0.1:1500 with --track-fds=yes 311655 --log-file=FILE leads to apparent fd leak 453044 gbserver_tests failures in aarch64 +479661 Valgrind leaks file descriptors 486180 [MIPS] 'VexGuestArchState' has no member named 'guest_IP_AT_SYSCALL' 486293 memccpy false positives 486569 linux inotify_init syscall wrapper missing POST entry in syscall_table diff --git a/coregrind/m_libcproc.c b/coregrind/m_libcproc.c index 11dabe768f..8422e9d118 100644 --- a/coregrind/m_libcproc.c +++ b/coregrind/m_libcproc.c @@ -905,6 +905,8 @@ static void register_sigchld_ignore ( Int pid, Int fds[2]) return; if (pid == 0) { + /* We are the child, close writing fd that we don't use. */ + VG_(close)(fds[1]); /* Before proceeding, ensure parent has recorded child PID in map of SIGCHLD to ignore */ while (child_wait == 1) @@ -916,6 +918,7 @@ static void register_sigchld_ignore ( Int pid, Int fds[2]) } } + /* Now close reading fd. */ VG_(close)(fds[0]); return; } @@ -926,11 +929,15 @@ static void register_sigchld_ignore ( Int pid, Int fds[2]) ht_sigchld_ignore = VG_(HT_construct)("ht.sigchld.ignore"); VG_(HT_add_node)(ht_sigchld_ignore, n); + /* We are the parent process, close read fd that we don't use. */ + VG_(close)(fds[0]); + child_wait = 0; if (VG_(write)(fds[1], &child_wait, sizeof(Int)) <= 0) VG_(message)(Vg_DebugMsg, "warning: Unable to record PID of internal process (write)\n"); + /* Now close writing fd. */ VG_(close)(fds[1]); } diff --git a/none/tests/Makefile.am b/none/tests/Makefile.am index 532cc7632a..1751ad3fa2 100644 --- a/none/tests/Makefile.am +++ b/none/tests/Makefile.am @@ -223,6 +223,7 @@ EXTRA_DIST = \ threadederrno.vgtest \ timestamp.stderr.exp timestamp.vgtest \ tls.vgtest tls.stderr.exp tls.stdout.exp \ + track-fds-exec-children.vgtest track-fds-exec-children.stderr.exp \ unit_debuglog.stderr.exp unit_debuglog.vgtest \ vgprintf.stderr.exp vgprintf.vgtest \ vgprintf_nvalgrind.stderr.exp vgprintf_nvalgrind.vgtest \ @@ -276,6 +277,7 @@ check_PROGRAMS = \ tls \ tls.so \ tls2.so \ + track-fds-exec-children \ unit_debuglog \ valgrind_cpp_test \ vgprintf \ @@ -414,6 +416,7 @@ if VGCONF_OS_IS_DARWIN else tls2_so_LDFLAGS = -shared endif +track_fds_exec_children_SOURCES = track-fds-exec-children.c vgprintf_nvalgrind_SOURCES = vgprintf.c vgprintf_nvalgrind_CFLAGS = ${AM_CFLAGS} -DNVALGRIND diff --git a/none/tests/track-fds-exec-children.c b/none/tests/track-fds-exec-children.c new file mode 100644 index 0000000000..7209ee73d5 --- /dev/null +++ b/none/tests/track-fds-exec-children.c @@ -0,0 +1,13 @@ +#include <unistd.h> +#include <sys/wait.h> + +int main() +{ + pid_t pid = fork (); + if (pid == 0) + execlp("true", "true", NULL); + + // Wait till true succeeds + wait (NULL); + return 0; +} diff --git a/none/tests/track-fds-exec-children.stderr.exp b/none/tests/track-fds-exec-children.stderr.exp new file mode 100644 index 0000000000..e69de29bb2 diff --git a/none/tests/track-fds-exec-children.vgtest b/none/tests/track-fds-exec-children.vgtest new file mode 100644 index 0000000000..aa926a6290 --- /dev/null +++ b/none/tests/track-fds-exec-children.vgtest @@ -0,0 +1,3 @@ +env: DEBUGINFOD_URLS=file:/dev/null +prog: track-fds-exec-children +vgopts: -q --track-fds=yes --trace-children=yes |
From: Mark W. <ma...@so...> - 2024-06-23 20:07:53
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=e62c7b4f9ee0a8c20c7211a92ad512f925e9515c commit e62c7b4f9ee0a8c20c7211a92ad512f925e9515c Author: Paul Floyd <pj...@wa...> Date: Sun Jun 16 09:25:51 2024 +0200 Bug 487439 - SIGILL in JDK11, JDK17 (cherry picked from commit c19d19d34a6dadaf4a9d590f516f813e9cbacdd0) Diff: --- .gitignore | 1 + NEWS | 1 + VEX/priv/guest_amd64_toIR.c | 2 +- none/tests/amd64/Makefile.am | 3 ++ none/tests/amd64/bug487439.cpp | 83 +++++++++++++++++++++++++++++++++++ none/tests/amd64/bug487439.stderr.exp | 0 none/tests/amd64/bug487439.stdout.exp | 1 + none/tests/amd64/bug487439.vgtest | 2 + 8 files changed, 92 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index a8b7ce4c7d..e13a9fa935 100644 --- a/.gitignore +++ b/.gitignore @@ -1670,6 +1670,7 @@ /none/tests/amd64/bug137714-amd64 /none/tests/amd64/bug156404-amd64 /none/tests/amd64/bug485148 +/none/tests/amd64/bug487439 /none/tests/amd64/cet_nops /none/tests/amd64/clc /none/tests/amd64/cmpxchg diff --git a/NEWS b/NEWS index c2ad6a207d..fbe0f012ef 100644 --- a/NEWS +++ b/NEWS @@ -9,6 +9,7 @@ The following bugs have been fixed or resolved on this branch. 486180 [MIPS] 'VexGuestArchState' has no member named 'guest_IP_AT_SYSCALL' 486293 memccpy false positives 486569 linux inotify_init syscall wrapper missing POST entry in syscall_table +487439 SIGILL in JDK11, JDK17 n-i-bz aarch64 frinta and frinta vector instructions To see details of a given bug, visit diff --git a/VEX/priv/guest_amd64_toIR.c b/VEX/priv/guest_amd64_toIR.c index f0b1c55162..28c37f0922 100644 --- a/VEX/priv/guest_amd64_toIR.c +++ b/VEX/priv/guest_amd64_toIR.c @@ -14138,7 +14138,7 @@ Long dis_ESC_0F__SSE2 ( Bool* decode_OK, goto decode_success; } /* 66 0F 73 /6 ib = PSLLQ by immediate */ - if (have66noF2noF3(pfx) && sz == 2 + if (have66noF2noF3(pfx) && (sz == 2 || /* ignore redundant REX.W */ sz == 8) && epartIsReg(getUChar(delta)) && gregLO3ofRM(getUChar(delta)) == 6) { delta = dis_SSE_shiftE_imm( pfx, delta, "psllq", Iop_ShlN64x2 ); diff --git a/none/tests/amd64/Makefile.am b/none/tests/amd64/Makefile.am index dc04980182..83029c1559 100644 --- a/none/tests/amd64/Makefile.am +++ b/none/tests/amd64/Makefile.am @@ -44,6 +44,7 @@ EXTRA_DIST = \ bug156404-amd64.vgtest bug156404-amd64.stdout.exp \ bug156404-amd64.stderr.exp \ bug485148.vgtest bug485148.stdout.exp bug485148.stderr.exp \ + bug487439.vgtest bug487439.stdout.exp bug487439.stderr.exp \ cet_nops.vgtest cet_nops.stdout.exp cet_nops.stderr.exp \ clc.vgtest clc.stdout.exp clc.stderr.exp \ crc32.vgtest crc32.stdout.exp crc32.stderr.exp \ @@ -107,6 +108,7 @@ check_PROGRAMS = \ amd64locked \ bt_flags \ bug127521-64 bug132813-amd64 bug132918 bug137714-amd64 \ + bug487439 \ cet_nops \ clc \ cmpxchg \ @@ -204,6 +206,7 @@ amd64locked_CFLAGS = $(AM_CFLAGS) -O bug132918_LDADD = -lm bug485148_CXXFLAGS = ${AM_CXXFLAGS} -mfma bug485148_SOURCES = bug485148.cpp +bug487439_SOURCES = bug487439.cpp cmpxchg_CFLAGS = $(AM_CFLAGS) @FLAG_NO_PIE@ fb_test_amd64_CFLAGS = $(AM_CFLAGS) -O -fno-strict-aliasing fb_test_amd64_LDADD = -lm diff --git a/none/tests/amd64/bug487439.cpp b/none/tests/amd64/bug487439.cpp new file mode 100644 index 0000000000..f86bb65ce9 --- /dev/null +++ b/none/tests/amd64/bug487439.cpp @@ -0,0 +1,83 @@ +// This is more or less a copy/paste from the generated insn_sse2.c +// I didn't want to mess with the perl generator because +// GCC and clang don't agree on the asm syntax +// Using the rex prefix looks like a bug or misfeature in OpenJDK +// so I'm assuming that this is a one-off and not a general issue + +#include <iostream> +#include <csetjmp> +#include <csignal> + +union reg128_t { + char sb[16]; + unsigned char ub[16]; + short sw[8]; + unsigned short uw[8]; + int sd[4]; + unsigned int ud[4]; + long long int sq[2]; + unsigned long long int uq[2]; + float ps[4]; + double pd[2]; +} __attribute__ ((aligned (16))); + +static sigjmp_buf catchpoint; + +static void handle_sigill(int signum) +{ + siglongjmp(catchpoint, 1); +} + +/* with redundant rex.W */ +static void psllq_4(void) +{ + reg128_t arg1 = { .uq = { 0x0123456789abcdefULL, 0x0123456789abcdefULL } }; + reg128_t result0; + char state[108]; + + if (sigsetjmp(catchpoint, 1) == 0) + { + asm( + "ffree %%st(7)\n" + "ffree %%st(6)\n" + "ffree %%st(5)\n" + "ffree %%st(4)\n" + "movlps %2, %%xmm1\n" + "movhps %3, %%xmm1\n" + // only GCC + //".rex.W psllq $12, %%xmm1\n" + // only clang + //"data16 rex64 psllq $12, %mm1\n" + ".byte 0x66,0x48,0x0f,0x73,0xf1,0x0c\n" + "movlps %%xmm1, %0\n" + "movhps %%xmm1, %1\n" + "cld\n" + : "=m" (result0.uq[0]), "=m" (result0.uq[1]) + : "m" (arg1.uq[0]), "m" (arg1.uq[1]), "m" (state[0]) + : "xmm1" + ); + + if (result0.uq[0] == 0x3456789abcdef000ULL && result0.uq[1] == 0x3456789abcdef000ULL ) + { + std::cout << "psllq_4 ... ok\n"; + } + else + { + std::cout << "psllq_4 ... not ok\n"; + std::cout << " result0.uq[0] = " << result0.uq[0] << " (expected " << 0x3456789abcdef000ULL << ")\n"; + std::cout << " result0.uq[1] = " << result0.uq[1] << " (expected " << 0x3456789abcdef000ULL << ")\n"; + } + } + else + { + std::cout << "psllq_4 ... failed\n"; + } + + return; +} + +int main() +{ + signal(SIGILL, handle_sigill); + psllq_4(); +} diff --git a/none/tests/amd64/bug487439.stderr.exp b/none/tests/amd64/bug487439.stderr.exp new file mode 100644 index 0000000000..e69de29bb2 diff --git a/none/tests/amd64/bug487439.stdout.exp b/none/tests/amd64/bug487439.stdout.exp new file mode 100644 index 0000000000..065b518a27 --- /dev/null +++ b/none/tests/amd64/bug487439.stdout.exp @@ -0,0 +1 @@ +psllq_4 ... ok diff --git a/none/tests/amd64/bug487439.vgtest b/none/tests/amd64/bug487439.vgtest new file mode 100644 index 0000000000..3faa1ed6b0 --- /dev/null +++ b/none/tests/amd64/bug487439.vgtest @@ -0,0 +1,2 @@ +prog: bug487439 +vgopts: -q |
From: Mark W. <ma...@so...> - 2024-06-23 19:42:22
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=9c552924b96547c0bfe4bdd02c642049f7b6198a commit 9c552924b96547c0bfe4bdd02c642049f7b6198a Author: Mark Wielaard <ma...@kl...> Date: Sun Jun 23 21:40:11 2024 +0200 Add bug 479661 to NEWS This was fixed in commit 1263471efdf8 "Close both internal pipe fds after VG_(fork) in parent and child". Diff: --- NEWS | 1 + 1 file changed, 1 insertion(+) diff --git a/NEWS b/NEWS index 9c828068fb..e60f274f41 100644 --- a/NEWS +++ b/NEWS @@ -38,6 +38,7 @@ are not entered into bugzilla tend to get forgotten about or ignored. 412377 SIGILL on cache flushes on arm64 447989 Support Armv8.2 SHA-512 instructions 453044 gbserver_tests failures in aarch64 +479661 Valgrind leaks file descriptors 486180 [Valgrind][MIPS] 'VexGuestArchState' has no member named 'guest_IP_AT_SYSCALL' 486293 memccpy false positives |
From: Mark W. <ma...@kl...> - 2024-06-23 15:44:03
|
Hi all, On Thu, Nov 16, 2023 at 08:22:33PM +0100, Mark Wielaard wrote: > Valgrind is more than 20 years old and we have been collecting > bugs slightly faster than we have been able to close them. Which means > we now have around a thousand bugs open. This is a slightly > intimidating number. I am happy to say that we have been closing bugs faster than they are being filed in the last 6 months. There have been 85 new bugs filed and 110 bugs closed. There are now "only" 975 bugs open. Great progress, but still slightly intimidating. So if people could take a look and confirm or close issues that would be appreciated. > But some of the bugs are more than 10 years old (the oldest bugs are > from 2004). So some of them are likely not really relevant anymore. > > If people could do some quick spot checks of some of these bugs that > would be really appreciated. > > The bugs can be found here: > https://bugs.kde.org/buglist.cgi?product=valgrind&resolution=--- > Or per component here: > https://bugs.kde.org/describecomponents.cgi?product=valgrind > > If you filed a bug yourself please look if the issue is still > relevant. Please add a comment saying so if it is, or close it if it > isn't. Same if it has a simple reproducer. If it has a patch attached > please check if it still applies. > > Please don't go out of your way to close bugs, even old bugs can still > be relevant. But it would be good to know if they really still are and > we need to take another look at them. > > Thanks, > > Mark |
From: Mark W. <ma...@so...> - 2024-06-20 15:50:15
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=4b83e3d47daaf5eff2ca96867a8c790e13830eb5 commit 4b83e3d47daaf5eff2ca96867a8c790e13830eb5 Author: Alexandra Hájková <aha...@re...> Date: Thu Jun 20 07:45:56 2024 -0400 Don't allow programs calling fnctl on valgrind's own file descriptors Add a call to ML_(fd_allowed) in the PRE handler of fcntl and fcntl64 and block syscalls with EBADF when the file descriptor isn't allowed to be used by the program. https://bugs.kde.org/show_bug.cgi?id=337388 Diff: --- NEWS | 1 + coregrind/m_syswrap/syswrap-linux.c | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/NEWS b/NEWS index 49d055bee0..9c828068fb 100644 --- a/NEWS +++ b/NEWS @@ -31,6 +31,7 @@ are not entered into bugzilla tend to get forgotten about or ignored. valgrind: vex x86->IR: unhandled instruction bytes: 0x66 0xF 0x3A 0x2 311655 --log-file=FILE leads to apparent fd leak +337388 fcntl works on Valgrind's own file descriptors 377966 arm64 unhandled instruction dc zva392146 aarch64: unhandled instruction 0xD5380001 (MRS rT, midr_el1) 392146 aarch64: unhandled instruction 0xD5380001 (MRS rT, midr_el1) diff --git a/coregrind/m_syswrap/syswrap-linux.c b/coregrind/m_syswrap/syswrap-linux.c index 45413fdd9e..9f3c51c179 100644 --- a/coregrind/m_syswrap/syswrap-linux.c +++ b/coregrind/m_syswrap/syswrap-linux.c @@ -6978,6 +6978,10 @@ PRE(sys_fcntl) if (ARG2 == VKI_F_SETLKW) # endif *flags |= SfMayBlock; + + if (!ML_(fd_allowed)(ARG1, "fcntl", tid, False)) { + SET_STATUS_Failure (VKI_EBADF); + } } POST(sys_fcntl) @@ -7088,6 +7092,10 @@ PRE(sys_fcntl64) if (ARG2 == VKI_F_SETLKW) # endif *flags |= SfMayBlock; + + if (!ML_(fd_allowed)(ARG1, "fcntl64", tid, False)) { + SET_STATUS_Failure (VKI_EBADF); + } } POST(sys_fcntl64) |
From: Paul F. <pa...@so...> - 2024-06-17 19:34:06
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=9fe4a99265e2765fde87ad5ace7d0854fb02c54b commit 9fe4a99265e2765fde87ad5ace7d0854fb02c54b Author: Paul Floyd <pj...@wa...> Date: Mon Jun 17 21:32:44 2024 +0200 FreeBSD configure: missed splitting freebsd_14 to freebsd_14_0 Affects building a few regression tests. Diff: --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index b11d1f26d4..7d3078ea6e 100755 --- a/configure.ac +++ b/configure.ac @@ -416,7 +416,7 @@ case "${host_os}" in AC_DEFINE([FREEBSD_13_3], 1330, [FREEBSD_VERS value for FreeBSD 13.3]) freebsd_13_3=1330 AC_DEFINE([FREEBSD_14_0], 1400, [FREEBSD_VERS value for FreeBSD 14.0]) - freebsd_14=1400 + freebsd_14_0=1400 AC_DEFINE([FREEBSD_14_1], 1410, [FREEBSD_VERS value for FreeBSD 14.1]) freebsd_14_1=1410 AC_DEFINE([FREEBSD_15], 1500, [FREEBSD_VERS value for FreeBSD 15.x]) |
From: Mark W. <ma...@so...> - 2024-06-17 16:10:42
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=1263471efdf8405cb0f1a767c6af73bf2eaf7160 commit 1263471efdf8405cb0f1a767c6af73bf2eaf7160 Author: Mark Wielaard <ma...@kl...> Date: Mon Jun 17 00:27:12 2024 +0200 Close both internal pipe fds after VG_(fork) in parent and child An VG_fork() creates a pipe between parent and child to syncronize the two processes. The parent wants to register the child pid before the child can run. This is done in register_sigchld_ignore. Make sure both the parent and the child close both the read and write file descriptors so none leak. https://bugs.kde.org/show_bug.cgi?id=479661 Diff: --- coregrind/m_libcproc.c | 7 +++++++ none/tests/Makefile.am | 3 +++ none/tests/track-fds-exec-children.c | 13 +++++++++++++ none/tests/track-fds-exec-children.stderr.exp | 0 none/tests/track-fds-exec-children.vgtest | 3 +++ 5 files changed, 26 insertions(+) diff --git a/coregrind/m_libcproc.c b/coregrind/m_libcproc.c index 11dabe768f..8422e9d118 100644 --- a/coregrind/m_libcproc.c +++ b/coregrind/m_libcproc.c @@ -905,6 +905,8 @@ static void register_sigchld_ignore ( Int pid, Int fds[2]) return; if (pid == 0) { + /* We are the child, close writing fd that we don't use. */ + VG_(close)(fds[1]); /* Before proceeding, ensure parent has recorded child PID in map of SIGCHLD to ignore */ while (child_wait == 1) @@ -916,6 +918,7 @@ static void register_sigchld_ignore ( Int pid, Int fds[2]) } } + /* Now close reading fd. */ VG_(close)(fds[0]); return; } @@ -926,11 +929,15 @@ static void register_sigchld_ignore ( Int pid, Int fds[2]) ht_sigchld_ignore = VG_(HT_construct)("ht.sigchld.ignore"); VG_(HT_add_node)(ht_sigchld_ignore, n); + /* We are the parent process, close read fd that we don't use. */ + VG_(close)(fds[0]); + child_wait = 0; if (VG_(write)(fds[1], &child_wait, sizeof(Int)) <= 0) VG_(message)(Vg_DebugMsg, "warning: Unable to record PID of internal process (write)\n"); + /* Now close writing fd. */ VG_(close)(fds[1]); } diff --git a/none/tests/Makefile.am b/none/tests/Makefile.am index 553a9c8655..8c1bc014bc 100644 --- a/none/tests/Makefile.am +++ b/none/tests/Makefile.am @@ -240,6 +240,7 @@ EXTRA_DIST = \ threadederrno.vgtest \ timestamp.stderr.exp timestamp.vgtest \ tls.vgtest tls.stderr.exp tls.stdout.exp \ + track-fds-exec-children.vgtest track-fds-exec-children.stderr.exp \ unit_debuglog.stderr.exp unit_debuglog.vgtest \ vgprintf.stderr.exp vgprintf.vgtest \ vgprintf_nvalgrind.stderr.exp vgprintf_nvalgrind.vgtest \ @@ -297,6 +298,7 @@ check_PROGRAMS = \ tls \ tls.so \ tls2.so \ + track-fds-exec-children \ unit_debuglog \ valgrind_cpp_test \ vgprintf \ @@ -435,6 +437,7 @@ if VGCONF_OS_IS_DARWIN else tls2_so_LDFLAGS = -shared endif +track_fds_exec_children_SOURCES = track-fds-exec-children.c vgprintf_nvalgrind_SOURCES = vgprintf.c vgprintf_nvalgrind_CFLAGS = ${AM_CFLAGS} -DNVALGRIND diff --git a/none/tests/track-fds-exec-children.c b/none/tests/track-fds-exec-children.c new file mode 100644 index 0000000000..7209ee73d5 --- /dev/null +++ b/none/tests/track-fds-exec-children.c @@ -0,0 +1,13 @@ +#include <unistd.h> +#include <sys/wait.h> + +int main() +{ + pid_t pid = fork (); + if (pid == 0) + execlp("true", "true", NULL); + + // Wait till true succeeds + wait (NULL); + return 0; +} diff --git a/none/tests/track-fds-exec-children.stderr.exp b/none/tests/track-fds-exec-children.stderr.exp new file mode 100644 index 0000000000..e69de29bb2 diff --git a/none/tests/track-fds-exec-children.vgtest b/none/tests/track-fds-exec-children.vgtest new file mode 100644 index 0000000000..aa926a6290 --- /dev/null +++ b/none/tests/track-fds-exec-children.vgtest @@ -0,0 +1,3 @@ +env: DEBUGINFOD_URLS=file:/dev/null +prog: track-fds-exec-children +vgopts: -q --track-fds=yes --trace-children=yes |
From: Mark W. <ma...@so...> - 2024-06-17 15:58:23
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=fbd7596f8342f0b0fbbe088d960da839a8bdb839 commit fbd7596f8342f0b0fbbe088d960da839a8bdb839 Author: Mark Wielaard <ma...@kl...> Date: Sun Jun 16 21:23:08 2024 +0200 Don't leave fds created with --log-file, --xml-file or --log-socket open prepare_sink_fd and prepare_sink_socket will create a new file descriptor for the output sink. finalize_sink_fd then copies the fd to the safe range, so it doesn't conflict with any application fds. If we created the original fd ourselves, it was a VgLogTo_File or VgLogTo_Socket, not VgLogTo_Fd, finalize_sink_fd should close it. Also close socket when connecting fails in VG_(connect_via_socket). Add a testcase for --log-file and --xml-file which prints output to /dev/stderr https://bugs.kde.org/show_bug.cgi?id=202770 https://bugs.kde.org/show_bug.cgi?id=311655 https://bugs.kde.org/show_bug.cgi?id=488379 Co-authored-by: Alexandra Hájková <aha...@re... Diff: --- NEWS | 3 +++ coregrind/m_libcfile.c | 1 + coregrind/m_libcprint.c | 6 +++++ none/tests/Makefile.am | 4 +++- none/tests/log-track-fds.stderr.exp | 0 none/tests/log-track-fds.vgtest | 4 ++++ none/tests/xml-track-fds.stderr.exp | 47 +++++++++++++++++++++++++++++++++++++ none/tests/xml-track-fds.vgtest | 5 ++++ 8 files changed, 69 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 7a8505cb50..49d055bee0 100644 --- a/NEWS +++ b/NEWS @@ -26,9 +26,11 @@ bugzilla (https://bugs.kde.org/enter_bug.cgi?product=valgrind) rather than mailing the developers (or mailing lists) directly -- bugs that are not entered into bugzilla tend to get forgotten about or ignored. +202770 open fd at exit --log-socket=127.0.0.1:1500 with --track-fds=yes 276780 An instruction in fftw (Fast Fourier Transform) is unhandled by valgrind: vex x86->IR: unhandled instruction bytes: 0x66 0xF 0x3A 0x2 +311655 --log-file=FILE leads to apparent fd leak 377966 arm64 unhandled instruction dc zva392146 aarch64: unhandled instruction 0xD5380001 (MRS rT, midr_el1) 392146 aarch64: unhandled instruction 0xD5380001 (MRS rT, midr_el1) @@ -42,6 +44,7 @@ are not entered into bugzilla tend to get forgotten about or ignored. 487439 SIGILL in JDK11, JDK17 487993 Alignment error when using Eigen with Valgrind and -m32 488026 Use of `sizeof` instead of `strlen +488379 --track-fds=yes errors that cannot be suppressed with --xml-file= 488441 Add tests for --track-fds=yes --xml=yes and fd suppression tests To see details of a given bug, visit diff --git a/coregrind/m_libcfile.c b/coregrind/m_libcfile.c index 6098bc5813..9635b80a68 100644 --- a/coregrind/m_libcfile.c +++ b/coregrind/m_libcfile.c @@ -1333,6 +1333,7 @@ Int VG_(connect_via_socket)( const HChar* str ) res = my_connect(sd, &servAddr, sizeof(servAddr)); if (res < 0) { /* connection failed */ + VG_(close)(sd); return -2; } diff --git a/coregrind/m_libcprint.c b/coregrind/m_libcprint.c index c802f81403..593889da9d 100644 --- a/coregrind/m_libcprint.c +++ b/coregrind/m_libcprint.c @@ -425,6 +425,12 @@ static void finalize_sink_fd(OutputSink *sink, Int new_fd, Bool is_xml) } else { VG_(fcntl)(safe_fd, VKI_F_SETFD, VKI_FD_CLOEXEC); sink->fd = safe_fd; + /* If we created the new_fd (VgLogTo_File or VgLogTo_Socket), then we + don't need the original file descriptor open anymore. We only need + to keep it open if it was an existing fd given by the user (or + stderr). */ + if (sink->type != VgLogTo_Fd) + VG_(close)(new_fd); } } diff --git a/none/tests/Makefile.am b/none/tests/Makefile.am index 7caa8ca322..553a9c8655 100644 --- a/none/tests/Makefile.am +++ b/none/tests/Makefile.am @@ -251,7 +251,9 @@ EXTRA_DIST = \ file_dclose_xml.stderr.exp file_dclose_xml.vgtest \ file_dclose_xml.stderr.exp-nomain \ file_dclose.supp file_dclose_sup.stderr.exp file_dclose_sup.vgtest \ - double_close_range.stderr.exp double_close_range.vgtest + double_close_range.stderr.exp double_close_range.vgtest \ + log-track-fds.stderr.exp log-track-fds.vgtest \ + xml-track-fds.stderr.exp xml-track-fds.vgtest check_PROGRAMS = \ diff --git a/none/tests/log-track-fds.stderr.exp b/none/tests/log-track-fds.stderr.exp new file mode 100644 index 0000000000..e69de29bb2 diff --git a/none/tests/log-track-fds.vgtest b/none/tests/log-track-fds.vgtest new file mode 100644 index 0000000000..dfebb5bf3e --- /dev/null +++ b/none/tests/log-track-fds.vgtest @@ -0,0 +1,4 @@ +# Simple test to make sure track-fds doesn't error on (internal) log-file +# See https://bugs.kde.org/show_bug.cgi?id=311655 +prog: ../../tests/true +vgopts: -q --track-fds=yes --log-file=/dev/stderr diff --git a/none/tests/xml-track-fds.stderr.exp b/none/tests/xml-track-fds.stderr.exp new file mode 100644 index 0000000000..b06da9d722 --- /dev/null +++ b/none/tests/xml-track-fds.stderr.exp @@ -0,0 +1,47 @@ +<?xml version="1.0"?> + +<valgrindoutput> + +<protocolversion>5</protocolversion> +<protocoltool>none</protocoltool> + +<preamble> + <line>Nulgrind, the minimal Valgrind tool</line> + <line>Copyright...</line> + <line>Using Valgrind...</line> + <line>Command: ./../../tests/true</line> +</preamble> + +<pid>...</pid> +<ppid>...</ppid> +<tool>none</tool> + +<args> + <vargv> + <exe>...</exe> + <arg>--command-line-only=yes</arg> + <arg>--memcheck:leak-check=no</arg> + <arg>--tool=none</arg> + <arg>--track-fds=yes</arg> + <arg>--xml=yes</arg> + <arg>--xml-file=/dev/stderr</arg> + </vargv> + <argv> + <exe>...</exe> + </argv> +</args> + +<status> + <state>RUNNING</state> + <time>...</time> +</status> + + +<status> + <state>FINISHED</state> + <time>...</time> +</status> + + +</valgrindoutput> + diff --git a/none/tests/xml-track-fds.vgtest b/none/tests/xml-track-fds.vgtest new file mode 100644 index 0000000000..50f1a55a82 --- /dev/null +++ b/none/tests/xml-track-fds.vgtest @@ -0,0 +1,5 @@ +# Simple test to make sure track-fds doesn't error on (internal) xml-file +# See https://bugs.kde.org/show_bug.cgi?id=488379 +prog: ../../tests/true +vgopts: --track-fds=yes --xml=yes --xml-file=/dev/stderr +stderr_filter: filter_xml |
From: Paul F. <pa...@so...> - 2024-06-16 19:13:39
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=022fc29d5ffb4e9cca0db6b197c48b0b02ac9005 commit 022fc29d5ffb4e9cca0db6b197c48b0b02ac9005 Author: Paul Floyd <pj...@wa...> Date: Sun Jun 16 21:11:33 2024 +0200 doc FAQ: add items for common code causes of 'Mismatched' errors (when there is no fault in the code). Diff: --- docs/xml/FAQ.xml | 55 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 54 insertions(+), 1 deletion(-) diff --git a/docs/xml/FAQ.xml b/docs/xml/FAQ.xml index 414ac1364b..4179a62ac1 100644 --- a/docs/xml/FAQ.xml +++ b/docs/xml/FAQ.xml @@ -486,9 +486,62 @@ int main(void) </answer> </qandaentry> -</qandadiv> +<qandaentry id="faq.mismatches"> + <question id="q-mismatches"> + <para>Why does Memcheck report many + "Mismatched free() / delete / delete []" errors when + my code is correct?</para> + </question> + <answer id="a-mismatches"> + <para>There are two possible causes of this.</para> + + <para>First, check if you are using an optimized build of Google + tcmalloc (part of Google perftools). This library uses a single + alias for free/scalar delete/array delete as an unmeasurable + micro-optimization. There is simply no way for Memcheck to tell + which of these was originally used. There are a few possible + workarounds. + <itemizedlist> + <listitem> + <para>Build tcmalloc with "CPPFLAGS=-DTCMALLOC_NO_ALIASES" + (best).</para> + </listitem> + <listitem> + <para>Use a debug build of tcmalloc (debug builds turn off the alias + micro-optimization).</para> + </listitem> + <listitem> + <para>Do not link with tcmalloc for the builds that you use for + Memecheck testing.</para> + </listitem> + </itemizedlist> + </para> + <para>Second, if you are replacing operator new or operator delete + make sure that the compiler does not perform optimizations such as + inlining on calls to these functions. Such optimizations can + prevent Memcheck from correctly identifying the allocator or + deallocator that is being used.</para> + + <para>The following two code snippets show how you can do this with + GCC and LLVM (clang).</para> + +<programlisting> + // GCC + void operator delete(void*) noexcept __attribute__((__externally_visible__)); +</programlisting> +<programlisting> + // LLVM (clang) + __attribute__((__visibility__("default"))) void operator delete(void*) noexcept; +</programlisting> + + <para>If all else fails, you might have to use "--show-mismatched-frees=no" + </para> + </answer> +</qandaentry> + +</qandadiv> <!-- Miscellaneous --> <qandadiv id="faq.misc" xreflabel="Miscellaneous"> |
From: Paul F. <pa...@so...> - 2024-06-16 07:27:03
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=c19d19d34a6dadaf4a9d590f516f813e9cbacdd0 commit c19d19d34a6dadaf4a9d590f516f813e9cbacdd0 Author: Paul Floyd <pj...@wa...> Date: Sun Jun 16 09:25:51 2024 +0200 Bug 487439 - SIGILL in JDK11, JDK17 Diff: --- .gitignore | 1 + NEWS | 1 + VEX/priv/guest_amd64_toIR.c | 2 +- none/tests/amd64/Makefile.am | 3 ++ none/tests/amd64/bug487439.cpp | 83 +++++++++++++++++++++++++++++++++++ none/tests/amd64/bug487439.stderr.exp | 0 none/tests/amd64/bug487439.stdout.exp | 1 + none/tests/amd64/bug487439.vgtest | 2 + 8 files changed, 92 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index e80b1dda89..1473e9a739 100644 --- a/.gitignore +++ b/.gitignore @@ -1672,6 +1672,7 @@ /none/tests/amd64/bug137714-amd64 /none/tests/amd64/bug156404-amd64 /none/tests/amd64/bug485148 +/none/tests/amd64/bug487439 /none/tests/amd64/cet_nops /none/tests/amd64/clc /none/tests/amd64/cmpxchg diff --git a/NEWS b/NEWS index 990e2238a8..7a8505cb50 100644 --- a/NEWS +++ b/NEWS @@ -39,6 +39,7 @@ are not entered into bugzilla tend to get forgotten about or ignored. 'guest_IP_AT_SYSCALL' 486293 memccpy false positives 486569 linux inotify_init syscall wrapper missing POST entry in syscall_table +487439 SIGILL in JDK11, JDK17 487993 Alignment error when using Eigen with Valgrind and -m32 488026 Use of `sizeof` instead of `strlen 488441 Add tests for --track-fds=yes --xml=yes and fd suppression tests diff --git a/VEX/priv/guest_amd64_toIR.c b/VEX/priv/guest_amd64_toIR.c index f0b1c55162..28c37f0922 100644 --- a/VEX/priv/guest_amd64_toIR.c +++ b/VEX/priv/guest_amd64_toIR.c @@ -14138,7 +14138,7 @@ Long dis_ESC_0F__SSE2 ( Bool* decode_OK, goto decode_success; } /* 66 0F 73 /6 ib = PSLLQ by immediate */ - if (have66noF2noF3(pfx) && sz == 2 + if (have66noF2noF3(pfx) && (sz == 2 || /* ignore redundant REX.W */ sz == 8) && epartIsReg(getUChar(delta)) && gregLO3ofRM(getUChar(delta)) == 6) { delta = dis_SSE_shiftE_imm( pfx, delta, "psllq", Iop_ShlN64x2 ); diff --git a/none/tests/amd64/Makefile.am b/none/tests/amd64/Makefile.am index dc04980182..83029c1559 100644 --- a/none/tests/amd64/Makefile.am +++ b/none/tests/amd64/Makefile.am @@ -44,6 +44,7 @@ EXTRA_DIST = \ bug156404-amd64.vgtest bug156404-amd64.stdout.exp \ bug156404-amd64.stderr.exp \ bug485148.vgtest bug485148.stdout.exp bug485148.stderr.exp \ + bug487439.vgtest bug487439.stdout.exp bug487439.stderr.exp \ cet_nops.vgtest cet_nops.stdout.exp cet_nops.stderr.exp \ clc.vgtest clc.stdout.exp clc.stderr.exp \ crc32.vgtest crc32.stdout.exp crc32.stderr.exp \ @@ -107,6 +108,7 @@ check_PROGRAMS = \ amd64locked \ bt_flags \ bug127521-64 bug132813-amd64 bug132918 bug137714-amd64 \ + bug487439 \ cet_nops \ clc \ cmpxchg \ @@ -204,6 +206,7 @@ amd64locked_CFLAGS = $(AM_CFLAGS) -O bug132918_LDADD = -lm bug485148_CXXFLAGS = ${AM_CXXFLAGS} -mfma bug485148_SOURCES = bug485148.cpp +bug487439_SOURCES = bug487439.cpp cmpxchg_CFLAGS = $(AM_CFLAGS) @FLAG_NO_PIE@ fb_test_amd64_CFLAGS = $(AM_CFLAGS) -O -fno-strict-aliasing fb_test_amd64_LDADD = -lm diff --git a/none/tests/amd64/bug487439.cpp b/none/tests/amd64/bug487439.cpp new file mode 100644 index 0000000000..f86bb65ce9 --- /dev/null +++ b/none/tests/amd64/bug487439.cpp @@ -0,0 +1,83 @@ +// This is more or less a copy/paste from the generated insn_sse2.c +// I didn't want to mess with the perl generator because +// GCC and clang don't agree on the asm syntax +// Using the rex prefix looks like a bug or misfeature in OpenJDK +// so I'm assuming that this is a one-off and not a general issue + +#include <iostream> +#include <csetjmp> +#include <csignal> + +union reg128_t { + char sb[16]; + unsigned char ub[16]; + short sw[8]; + unsigned short uw[8]; + int sd[4]; + unsigned int ud[4]; + long long int sq[2]; + unsigned long long int uq[2]; + float ps[4]; + double pd[2]; +} __attribute__ ((aligned (16))); + +static sigjmp_buf catchpoint; + +static void handle_sigill(int signum) +{ + siglongjmp(catchpoint, 1); +} + +/* with redundant rex.W */ +static void psllq_4(void) +{ + reg128_t arg1 = { .uq = { 0x0123456789abcdefULL, 0x0123456789abcdefULL } }; + reg128_t result0; + char state[108]; + + if (sigsetjmp(catchpoint, 1) == 0) + { + asm( + "ffree %%st(7)\n" + "ffree %%st(6)\n" + "ffree %%st(5)\n" + "ffree %%st(4)\n" + "movlps %2, %%xmm1\n" + "movhps %3, %%xmm1\n" + // only GCC + //".rex.W psllq $12, %%xmm1\n" + // only clang + //"data16 rex64 psllq $12, %mm1\n" + ".byte 0x66,0x48,0x0f,0x73,0xf1,0x0c\n" + "movlps %%xmm1, %0\n" + "movhps %%xmm1, %1\n" + "cld\n" + : "=m" (result0.uq[0]), "=m" (result0.uq[1]) + : "m" (arg1.uq[0]), "m" (arg1.uq[1]), "m" (state[0]) + : "xmm1" + ); + + if (result0.uq[0] == 0x3456789abcdef000ULL && result0.uq[1] == 0x3456789abcdef000ULL ) + { + std::cout << "psllq_4 ... ok\n"; + } + else + { + std::cout << "psllq_4 ... not ok\n"; + std::cout << " result0.uq[0] = " << result0.uq[0] << " (expected " << 0x3456789abcdef000ULL << ")\n"; + std::cout << " result0.uq[1] = " << result0.uq[1] << " (expected " << 0x3456789abcdef000ULL << ")\n"; + } + } + else + { + std::cout << "psllq_4 ... failed\n"; + } + + return; +} + +int main() +{ + signal(SIGILL, handle_sigill); + psllq_4(); +} diff --git a/none/tests/amd64/bug487439.stderr.exp b/none/tests/amd64/bug487439.stderr.exp new file mode 100644 index 0000000000..e69de29bb2 diff --git a/none/tests/amd64/bug487439.stdout.exp b/none/tests/amd64/bug487439.stdout.exp new file mode 100644 index 0000000000..065b518a27 --- /dev/null +++ b/none/tests/amd64/bug487439.stdout.exp @@ -0,0 +1 @@ +psllq_4 ... ok diff --git a/none/tests/amd64/bug487439.vgtest b/none/tests/amd64/bug487439.vgtest new file mode 100644 index 0000000000..3faa1ed6b0 --- /dev/null +++ b/none/tests/amd64/bug487439.vgtest @@ -0,0 +1,2 @@ +prog: bug487439 +vgopts: -q |
From: Paul F. <pa...@so...> - 2024-06-15 15:25:47
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=33eb3718a1b695da4fd453da21c1fe5fa17f01f3 commit 33eb3718a1b695da4fd453da21c1fe5fa17f01f3 Author: Paul Floyd <pj...@wa...> Date: Sat Jun 15 17:09:05 2024 +0200 FreeBSD: mostly filters and suppressions for fdleak tests Also make close_range behave like linux when highfd is UINT_MAX. We should probably move close_range to generic. Diff: --- coregrind/m_syswrap/syswrap-freebsd.c | 18 ++++++++++++------ none/tests/fdleak_cmsg_supp.supp | 17 ++++++----------- none/tests/filter_xml | 6 ++++++ 3 files changed, 24 insertions(+), 17 deletions(-) diff --git a/coregrind/m_syswrap/syswrap-freebsd.c b/coregrind/m_syswrap/syswrap-freebsd.c index 426fa60154..b9532542a1 100644 --- a/coregrind/m_syswrap/syswrap-freebsd.c +++ b/coregrind/m_syswrap/syswrap-freebsd.c @@ -6862,7 +6862,7 @@ POST(sys___realpathat) #if (FREEBSD_VERS >= FREEBSD_12_2) // SYS_sys_close_range 575 -// int close_range(close_range(u_int lowfd, u_int highfd, int flags); +// int close_range(u_int lowfd, u_int highfd, int flags); PRE(sys_close_range) { SysRes res = VG_(mk_SysRes_Success)(0); @@ -6923,11 +6923,17 @@ POST(sys_close_range) if (last >= VG_(fd_hard_limit)) last = VG_(fd_hard_limit) - 1; - for (fd = ARG1; fd <= last; fd++) - if ((fd != 2/*stderr*/ || VG_(debugLog_getLevel)() == 0) - && fd != VG_(log_output_sink).fd - && fd != VG_(xml_output_sink).fd) - ML_(record_fd_close)(tid, fd); + /* If the close_range range is too wide, we don't want to loop + through the whole range. */ + if (ARG2 == ~0U) + ML_(record_fd_close_range)(tid, ARG1); + else { + for (fd = ARG1; fd <= last; fd++) + if ((fd != 2/*stderr*/ || VG_(debugLog_getLevel)() == 0) + && fd != VG_(log_output_sink).fd + && fd != VG_(xml_output_sink).fd) + ML_(record_fd_close)(tid, fd); + } } #endif diff --git a/none/tests/fdleak_cmsg_supp.supp b/none/tests/fdleak_cmsg_supp.supp index 5644147a98..92fbacabdb 100644 --- a/none/tests/fdleak_cmsg_supp.supp +++ b/none/tests/fdleak_cmsg_supp.supp @@ -1,7 +1,7 @@ { sup1 CoreError:FdNotClosed - fun:accept + fun:*accept fun:server fun:main } @@ -15,33 +15,28 @@ { sup3 CoreError:FdNotClosed - fun:*open* - fun:server - fun:main -} -{ - sup4 - CoreError:FdNotClosed + ... fun:*open* fun:server #fun:main } { - sup5 + sup4 CoreError:FdNotClosed fun:recvmsg fun:client fun:main } { - sup6 + sup5 CoreError:FdNotClosed + ... fun:recvmsg fun:client fun:main } { - sup7 + sup6 CoreError:FdNotClosed fun:socket fun:client diff --git a/none/tests/filter_xml b/none/tests/filter_xml index 70fdb65791..d1ef570a05 100755 --- a/none/tests/filter_xml +++ b/none/tests/filter_xml @@ -2,6 +2,12 @@ dir=`dirname $0` +# FreeBSD adds this one extra line +# but after filter_xml_frames it will just be <path>...<\/path> +# which matches other lines, so get rid of it while we can +# uniquely match it +sed "/<path>internet<\/path>/d" | + $dir/../../tests/filter_xml_frames | perl -p -e "s/<time>.*<\/time>/<time>...<\/time>/s" | perl -p -e "s/<what>.*<\/what>/<what>...<\/what>/s" | |
From: Mark W. <ma...@so...> - 2024-06-15 13:05:45
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=f774365a715edfa759770620454e4a669169d9ea commit f774365a715edfa759770620454e4a669169d9ea Author: Mark Wielaard <ma...@kl...> Date: Sat Jun 15 15:05:29 2024 +0200 none/tests/Makefile.am: EXTRA_DIST add exp-nomain files Diff: --- none/tests/Makefile.am | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/none/tests/Makefile.am b/none/tests/Makefile.am index c8e152023c..7caa8ca322 100644 --- a/none/tests/Makefile.am +++ b/none/tests/Makefile.am @@ -149,7 +149,7 @@ EXTRA_DIST = \ fdleak_fcntl_xml.stderr.exp fdleak_fcntl_xml.vgtest \ fdleak_ipv4.stderr.exp fdleak_ipv4.stdout.exp fdleak_ipv4.vgtest \ fdleak_ipv4_xml.stderr.exp fdleak_ipv4_xml.stdout.exp \ - fdleak_ipv4_xml.vgtest \ + fdleak_ipv4_xml.vgtest fdleak_ipv4_xml.stderr.exp-nomain \ fdleak_open.stderr.exp fdleak_open.vgtest \ fdleak_open_xml.stderr.exp fdleak_open_xml.vgtest \ fdleak_pipe.stderr.exp fdleak_pipe.vgtest \ @@ -249,6 +249,7 @@ EXTRA_DIST = \ socket_close_xml.stderr.exp socket_close_xml.vgtest \ file_dclose.stderr.exp file_dclose.vgtest \ file_dclose_xml.stderr.exp file_dclose_xml.vgtest \ + file_dclose_xml.stderr.exp-nomain \ file_dclose.supp file_dclose_sup.stderr.exp file_dclose_sup.vgtest \ double_close_range.stderr.exp double_close_range.vgtest |
From: Mark W. <ma...@so...> - 2024-06-14 23:46:39
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=8864c92efb8f65d8a56153f3bc8f7d2ac907b6cb commit 8864c92efb8f65d8a56153f3bc8f7d2ac907b6cb Author: Alexandra Hájková <aha...@re...> Date: Thu May 23 04:39:54 2024 -0400 Add file descriptor suppression tests - none/tests/double_close_range_sup.vgtest - none/tests/fdleak_cmsg_supp.vgtest - none/tests/fdleak_creat_sup.vgtest - none/tests/file_dclose_sup.vgtest https://bugs.kde.org/show_bug.cgi?id=488441 Diff: --- NEWS | 1 + none/tests/Makefile.am | 6 ++++ none/tests/double_close_range_sup.stderr.exp | 34 +++++++++++++++++++ none/tests/double_close_range_sup.vgtest | 4 +++ none/tests/fdleak_cmsg_supp.stderr.exp | 25 ++++++++++++++ none/tests/fdleak_cmsg_supp.supp | 49 ++++++++++++++++++++++++++++ none/tests/fdleak_cmsg_supp.vgtest | 4 +++ none/tests/fdleak_creat_sup.stderr.exp | 13 ++++++++ none/tests/fdleak_creat_sup.supp | 18 ++++++++++ none/tests/fdleak_creat_sup.vgtest | 4 +++ none/tests/file_dclose.supp | 7 ++++ none/tests/file_dclose_sup.stderr.exp | 2 ++ none/tests/file_dclose_sup.vgtest | 3 ++ 13 files changed, 170 insertions(+) diff --git a/NEWS b/NEWS index 4d7a97c9d7..990e2238a8 100644 --- a/NEWS +++ b/NEWS @@ -41,6 +41,7 @@ are not entered into bugzilla tend to get forgotten about or ignored. 486569 linux inotify_init syscall wrapper missing POST entry in syscall_table 487993 Alignment error when using Eigen with Valgrind and -m32 488026 Use of `sizeof` instead of `strlen +488441 Add tests for --track-fds=yes --xml=yes and fd suppression tests To see details of a given bug, visit https://bugs.kde.org/show_bug.cgi?id=XXXXXX diff --git a/none/tests/Makefile.am b/none/tests/Makefile.am index 717baee332..c8e152023c 100644 --- a/none/tests/Makefile.am +++ b/none/tests/Makefile.am @@ -125,6 +125,7 @@ EXTRA_DIST = \ discard.vgtest \ double_close_range_xml.stderr.exp \ double_close_range_xml.vgtest \ + double_close_range_sup.stderr.exp double_close_range_sup.vgtest \ empty-exe.vgtest empty-exe.stderr.exp \ exec-sigmask.vgtest exec-sigmask.stdout.exp \ exec-sigmask.stdout.exp2 exec-sigmask.stdout.exp3 \ @@ -134,8 +135,12 @@ EXTRA_DIST = \ fcntl_setown.vgtest fcntl_setown.stdout.exp fcntl_setown.stderr.exp \ fdleak_cmsg.stderr.exp fdleak_cmsg.vgtest \ fdleak_cmsg_xml.stderr.exp fdleak_cmsg_xml.vgtest \ + fdleak_cmsg_supp.stderr.exp fdleak_cmsg_supp.supp \ + fdleak_cmsg_supp.vgtest \ fdleak_creat.stderr.exp fdleak_creat.vgtest \ fdleak_creat_xml.stderr.exp fdleak_creat_xml.vgtest \ + fdleak_creat_sup.stderr.exp fdleak_creat_sup.supp \ + fdleak_creat_sup.vgtest \ fdleak_dup.stderr.exp fdleak_dup.vgtest \ fdleak_dup_xml.stderr.exp fdleak_dup_xml.vgtest \ fdleak_dup2.stderr.exp fdleak_dup2.vgtest \ @@ -244,6 +249,7 @@ EXTRA_DIST = \ socket_close_xml.stderr.exp socket_close_xml.vgtest \ file_dclose.stderr.exp file_dclose.vgtest \ file_dclose_xml.stderr.exp file_dclose_xml.vgtest \ + file_dclose.supp file_dclose_sup.stderr.exp file_dclose_sup.vgtest \ double_close_range.stderr.exp double_close_range.vgtest diff --git a/none/tests/double_close_range_sup.stderr.exp b/none/tests/double_close_range_sup.stderr.exp new file mode 100644 index 0000000000..815a02f42d --- /dev/null +++ b/none/tests/double_close_range_sup.stderr.exp @@ -0,0 +1,34 @@ +close fd 3 +Closing range (3, -1). +Closing range (5, 7). +Double closing range (5, 7). +File descriptor ...: ... is already closed + at 0x........: close_range (in /...libc...) + by 0x........: main + Previously closed + at 0x........: close_range (in /...libc...) + by 0x........: main + Originally opened + at 0x........: dup2 (in /...libc...) + by 0x........: main +{ + <insert_a_suppression_name_here> + CoreError:FdBadClose + fun:close_range + fun:main +} +File descriptor ...: ... is already closed + at 0x........: close_range (in /...libc...) + by 0x........: main + Previously closed + at 0x........: close_range (in /...libc...) + by 0x........: main + Originally opened + at 0x........: dup2 (in /...libc...) + by 0x........: main +{ + <insert_a_suppression_name_here> + CoreError:FdBadClose + fun:close_range + fun:main +} diff --git a/none/tests/double_close_range_sup.vgtest b/none/tests/double_close_range_sup.vgtest new file mode 100644 index 0000000000..321b7c73de --- /dev/null +++ b/none/tests/double_close_range_sup.vgtest @@ -0,0 +1,4 @@ +prog: double_close_range +prereq: test -x double_close_range +stderr_filter: filter_fdleak +vgopts: -q --track-fds=yes --gen-suppressions=all diff --git a/none/tests/fdleak_cmsg_supp.stderr.exp b/none/tests/fdleak_cmsg_supp.stderr.exp new file mode 100644 index 0000000000..a7d8cc42e2 --- /dev/null +++ b/none/tests/fdleak_cmsg_supp.stderr.exp @@ -0,0 +1,25 @@ + + +FILE DESCRIPTORS: 7 open (3 std) at exit. +Open file descriptor ...: ... + <inherited from parent> + +Open file descriptor ...: ... + <inherited from parent> + +Open file descriptor ...: /dev/null + <inherited from parent> + + + +FILE DESCRIPTORS: 6 open (3 std) at exit. +Open file descriptor ...: ... + <inherited from parent> + +Open file descriptor ...: ... + <inherited from parent> + +Open file descriptor ...: /dev/null + <inherited from parent> + + diff --git a/none/tests/fdleak_cmsg_supp.supp b/none/tests/fdleak_cmsg_supp.supp new file mode 100644 index 0000000000..5644147a98 --- /dev/null +++ b/none/tests/fdleak_cmsg_supp.supp @@ -0,0 +1,49 @@ +{ + sup1 + CoreError:FdNotClosed + fun:accept + fun:server + fun:main +} +{ + sup2 + CoreError:FdNotClosed + fun:socket + fun:server + fun:main +} +{ + sup3 + CoreError:FdNotClosed + fun:*open* + fun:server + fun:main +} +{ + sup4 + CoreError:FdNotClosed + fun:*open* + fun:server + #fun:main +} +{ + sup5 + CoreError:FdNotClosed + fun:recvmsg + fun:client + fun:main +} +{ + sup6 + CoreError:FdNotClosed + fun:recvmsg + fun:client + fun:main +} +{ + sup7 + CoreError:FdNotClosed + fun:socket + fun:client + fun:main +} diff --git a/none/tests/fdleak_cmsg_supp.vgtest b/none/tests/fdleak_cmsg_supp.vgtest new file mode 100644 index 0000000000..bc8fab5ee1 --- /dev/null +++ b/none/tests/fdleak_cmsg_supp.vgtest @@ -0,0 +1,4 @@ +prog: fdleak_cmsg +vgopts: --track-fds=all --suppressions=fdleak_cmsg_supp.supp +stderr_filter: filter_fdleak +args: < /dev/null diff --git a/none/tests/fdleak_creat_sup.stderr.exp b/none/tests/fdleak_creat_sup.stderr.exp new file mode 100644 index 0000000000..c02a807356 --- /dev/null +++ b/none/tests/fdleak_creat_sup.stderr.exp @@ -0,0 +1,13 @@ + + +FILE DESCRIPTORS: 4 open (3 std) at exit. +Open file descriptor ...: ... + <inherited from parent> + +Open file descriptor ...: ... + <inherited from parent> + +Open file descriptor ...: /dev/null + <inherited from parent> + + diff --git a/none/tests/fdleak_creat_sup.supp b/none/tests/fdleak_creat_sup.supp new file mode 100644 index 0000000000..f0c4034224 --- /dev/null +++ b/none/tests/fdleak_creat_sup.supp @@ -0,0 +1,18 @@ +{ + sup + CoreError:FdNotClosed + obj:*libc.so* + fun:main +} +{ + sup2 + CoreError:FdNotClosed + fun:*creat* + fun:main +} +{ + sup3 + CoreError:FdNotClosed + fun:*open* + fun:main +} diff --git a/none/tests/fdleak_creat_sup.vgtest b/none/tests/fdleak_creat_sup.vgtest new file mode 100644 index 0000000000..f601ae00e4 --- /dev/null +++ b/none/tests/fdleak_creat_sup.vgtest @@ -0,0 +1,4 @@ +prog: fdleak_creat +vgopts: --track-fds=all --suppressions=fdleak_creat_sup.supp +stderr_filter: filter_fdleak +args: < /dev/null diff --git a/none/tests/file_dclose.supp b/none/tests/file_dclose.supp new file mode 100644 index 0000000000..d812adeada --- /dev/null +++ b/none/tests/file_dclose.supp @@ -0,0 +1,7 @@ +{ + badclose + CoreError:FdBadClose + fun:*close* + fun:closefile + #fun:main +} diff --git a/none/tests/file_dclose_sup.stderr.exp b/none/tests/file_dclose_sup.stderr.exp new file mode 100644 index 0000000000..d530aa429b --- /dev/null +++ b/none/tests/file_dclose_sup.stderr.exp @@ -0,0 +1,2 @@ +close 3 +time passes and we close 3 again diff --git a/none/tests/file_dclose_sup.vgtest b/none/tests/file_dclose_sup.vgtest new file mode 100644 index 0000000000..ac33cceefe --- /dev/null +++ b/none/tests/file_dclose_sup.vgtest @@ -0,0 +1,3 @@ +prog: file_dclose +prereq: test -x file_dclose +vgopts: -q --track-fds=yes --suppressions=file_dclose.supp |
From: Mark W. <ma...@so...> - 2024-06-14 23:46:39
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=6369c67d37c40c312f5403a08a23e5da878688db commit 6369c67d37c40c312f5403a08a23e5da878688db Author: Alexandra Hájková <aha...@re...> Date: Tue Apr 23 09:17:03 2024 -0400 Add the tests for --track-fds=yes --xml=yes - none/tests/double_close_range_xml.vgtest - none/tests/fdleak_cmsg_xml.vgtest - none/tests/fdleak_creat_xml.vgtest - none/tests/fdleak_dup_xml.vgtest - none/tests/fdleak_dup2_xml.vgtest - none/tests/fdleak_fcntl_xml.vgtest - none/tests/fdleak_ipv4_xml.vgtest - none/tests/fdleak_open_xml.vgtest - none/tests/fdleak_pipe_xml.vgtest - none/tests/fdleak_socketpair_xml.vgtest - none/tests/file_dclose_xml.vgtest - none/tests/socket_close_xml.vgtest Add a new filter_xml. Note the use of --child-silent-after-fork=yes usage in two vgtests. Maybe this should be the default for --xml=yes? Otherwise xml output will be "corrupted" by output from a fork. https://bugs.kde.org/show_bug.cgi?id=488441 Diff: --- none/tests/Makefile.am | 15 +++ none/tests/double_close_range_xml.stderr.exp | 145 +++++++++++++++++++++++++ none/tests/double_close_range_xml.vgtest | 4 + none/tests/fdleak_cmsg_xml.stderr.exp | 155 +++++++++++++++++++++++++++ none/tests/fdleak_cmsg_xml.vgtest | 6 ++ none/tests/fdleak_creat_xml.stderr.exp | 93 ++++++++++++++++ none/tests/fdleak_creat_xml.vgtest | 4 + none/tests/fdleak_dup2_xml.stderr.exp | 131 ++++++++++++++++++++++ none/tests/fdleak_dup2_xml.vgtest | 4 + none/tests/fdleak_dup_xml.stderr.exp | 112 +++++++++++++++++++ none/tests/fdleak_dup_xml.vgtest | 4 + none/tests/fdleak_fcntl_xml.stderr.exp | 112 +++++++++++++++++++ none/tests/fdleak_fcntl_xml.vgtest | 4 + none/tests/fdleak_ipv4_xml.stderr.exp | 147 +++++++++++++++++++++++++ none/tests/fdleak_ipv4_xml.stderr.exp-nomain | 123 +++++++++++++++++++++ none/tests/fdleak_ipv4_xml.stdout.exp | 1 + none/tests/fdleak_ipv4_xml.vgtest | 6 ++ none/tests/fdleak_open_xml.stderr.exp | 66 ++++++++++++ none/tests/fdleak_open_xml.vgtest | 4 + none/tests/fdleak_pipe_xml.stderr.exp | 83 ++++++++++++++ none/tests/fdleak_pipe_xml.vgtest | 4 + none/tests/fdleak_socketpair_xml.stderr.exp | 83 ++++++++++++++ none/tests/fdleak_socketpair_xml.vgtest | 4 + none/tests/file_dclose_xml.stderr.exp | 114 ++++++++++++++++++++ none/tests/file_dclose_xml.stderr.exp-nomain | 98 +++++++++++++++++ none/tests/file_dclose_xml.vgtest | 4 + none/tests/filter_xml | 19 ++++ none/tests/socket_close_xml.stderr.exp | 106 ++++++++++++++++++ none/tests/socket_close_xml.vgtest | 4 + 29 files changed, 1655 insertions(+) diff --git a/none/tests/Makefile.am b/none/tests/Makefile.am index 185993f204..717baee332 100644 --- a/none/tests/Makefile.am +++ b/none/tests/Makefile.am @@ -86,6 +86,7 @@ dist_noinst_SCRIPTS = \ filter_none_discards \ filter_stderr \ filter_timestamp \ + filter_xml \ allexec_prepare_prereq noinst_HEADERS = fdleak.h @@ -122,6 +123,8 @@ EXTRA_DIST = \ coolo_strlen.stderr.exp coolo_strlen.vgtest \ discard.stderr.exp discard.stdout.exp \ discard.vgtest \ + double_close_range_xml.stderr.exp \ + double_close_range_xml.vgtest \ empty-exe.vgtest empty-exe.stderr.exp \ exec-sigmask.vgtest exec-sigmask.stdout.exp \ exec-sigmask.stdout.exp2 exec-sigmask.stdout.exp3 \ @@ -130,14 +133,24 @@ EXTRA_DIST = \ faultstatus.vgtest faultstatus.stderr.exp faultstatus.stderr.exp-s390x \ fcntl_setown.vgtest fcntl_setown.stdout.exp fcntl_setown.stderr.exp \ fdleak_cmsg.stderr.exp fdleak_cmsg.vgtest \ + fdleak_cmsg_xml.stderr.exp fdleak_cmsg_xml.vgtest \ fdleak_creat.stderr.exp fdleak_creat.vgtest \ + fdleak_creat_xml.stderr.exp fdleak_creat_xml.vgtest \ fdleak_dup.stderr.exp fdleak_dup.vgtest \ + fdleak_dup_xml.stderr.exp fdleak_dup_xml.vgtest \ fdleak_dup2.stderr.exp fdleak_dup2.vgtest \ + fdleak_dup2_xml.stderr.exp fdleak_dup2_xml.vgtest \ fdleak_fcntl.stderr.exp fdleak_fcntl.vgtest \ + fdleak_fcntl_xml.stderr.exp fdleak_fcntl_xml.vgtest \ fdleak_ipv4.stderr.exp fdleak_ipv4.stdout.exp fdleak_ipv4.vgtest \ + fdleak_ipv4_xml.stderr.exp fdleak_ipv4_xml.stdout.exp \ + fdleak_ipv4_xml.vgtest \ fdleak_open.stderr.exp fdleak_open.vgtest \ + fdleak_open_xml.stderr.exp fdleak_open_xml.vgtest \ fdleak_pipe.stderr.exp fdleak_pipe.vgtest \ + fdleak_pipe_xml.stderr.exp fdleak_pipe_xml.vgtest \ fdleak_socketpair.stderr.exp fdleak_socketpair.vgtest \ + fdleak_socketpair_xml.stderr.exp fdleak_socketpair_xml.vgtest \ floored.stderr.exp floored.stdout.exp floored.vgtest \ fork.stderr.exp fork.stdout.exp fork.vgtest \ fucomip.stderr.exp fucomip.vgtest \ @@ -228,7 +241,9 @@ EXTRA_DIST = \ process_vm_readv_writev.stderr.exp process_vm_readv_writev.vgtest \ sigprocmask.stderr.exp sigprocmask.vgtest \ socket_close.stderr.exp socket_close.vgtest \ + socket_close_xml.stderr.exp socket_close_xml.vgtest \ file_dclose.stderr.exp file_dclose.vgtest \ + file_dclose_xml.stderr.exp file_dclose_xml.vgtest \ double_close_range.stderr.exp double_close_range.vgtest diff --git a/none/tests/double_close_range_xml.stderr.exp b/none/tests/double_close_range_xml.stderr.exp new file mode 100644 index 0000000000..c21a2bcdd0 --- /dev/null +++ b/none/tests/double_close_range_xml.stderr.exp @@ -0,0 +1,145 @@ +<?xml version="1.0"?> + +<valgrindoutput> + +<protocolversion>5</protocolversion> +<protocoltool>none</protocoltool> + +<preamble> + <line>Nulgrind, the minimal Valgrind tool</line> + <line>Copyright...</line> + <line>Using Valgrind...</line> + <line>Command: ./double_close_range</line> +</preamble> + +<pid>...</pid> +<ppid>...</ppid> +<tool>none</tool> + +<args> + <vargv> + <exe>...</exe> + <arg>--command-line-only=yes</arg> + <arg>--memcheck:leak-check=no</arg> + <arg>--tool=none</arg> + <arg>-q</arg> + <arg>--track-fds=yes</arg> + <arg>--xml=yes</arg> + <arg>--xml-fd=2</arg> + </vargv> + <argv> + <exe>...</exe> + </argv> +</args> + +<status> + <state>RUNNING</state> + <time>...</time> +</status> + +close fd 3 +Closing range (3, -1). +Closing range (5, 7). +Double closing range (5, 7). +<error> + <unique>0x........</unique> + <tid>...</tid> + <kind>FdBadClose</kind> + <fd>5</fd> + <path>...</path> + <what>...</what> + <stack> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>main</fn> + <dir>...</dir> + <file>double_close_range.c</file> + <line>33</line> + </frame> + </stack> + <auxwhat>Previously closed</auxwhat> + <stack> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>main</fn> + <dir>...</dir> + <file>double_close_range.c</file> + <line>29</line> + </frame> + </stack> + <auxwhat>Originally opened</auxwhat> + <stack> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>main</fn> + <dir>...</dir> + <file>double_close_range.c</file> + <line>26</line> + </frame> + </stack> +</error> + +<error> + <unique>0x........</unique> + <tid>...</tid> + <kind>FdBadClose</kind> + <fd>7</fd> + <path>...</path> + <what>...</what> + <stack> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>main</fn> + <dir>...</dir> + <file>double_close_range.c</file> + <line>33</line> + </frame> + </stack> + <auxwhat>Previously closed</auxwhat> + <stack> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>main</fn> + <dir>...</dir> + <file>double_close_range.c</file> + <line>29</line> + </frame> + </stack> + <auxwhat>Originally opened</auxwhat> + <stack> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>main</fn> + <dir>...</dir> + <file>double_close_range.c</file> + <line>27</line> + </frame> + </stack> +</error> + + +<status> + <state>FINISHED</state> + <time>...</time> +</status> + +<errorcounts> + <pair> + <count>1</count> + <unique>0x........</unique> + </pair> + <pair> + <count>1</count> + <unique>0x........</unique> + </pair> +</errorcounts> + + +</valgrindoutput> + diff --git a/none/tests/double_close_range_xml.vgtest b/none/tests/double_close_range_xml.vgtest new file mode 100644 index 0000000000..fc899af35f --- /dev/null +++ b/none/tests/double_close_range_xml.vgtest @@ -0,0 +1,4 @@ +prog: double_close_range +prereq: test -x double_close_range +vgopts: -q --track-fds=yes --xml=yes --xml-fd=2 +stderr_filter: filter_xml diff --git a/none/tests/fdleak_cmsg_xml.stderr.exp b/none/tests/fdleak_cmsg_xml.stderr.exp new file mode 100644 index 0000000000..39b739be70 --- /dev/null +++ b/none/tests/fdleak_cmsg_xml.stderr.exp @@ -0,0 +1,155 @@ +<?xml version="1.0"?> + +<valgrindoutput> + +<protocolversion>5</protocolversion> +<protocoltool>none</protocoltool> + +<preamble> + <line>Nulgrind, the minimal Valgrind tool</line> + <line>Copyright...</line> + <line>Using Valgrind...</line> + <line>Command: ./fdleak_cmsg</line> +</preamble> + +<pid>...</pid> +<ppid>...</ppid> +<tool>none</tool> + +<args> + <vargv> + <exe>...</exe> + <arg>--command-line-only=yes</arg> + <arg>--memcheck:leak-check=no</arg> + <arg>--tool=none</arg> + <arg>--track-fds=all</arg> + <arg>--xml=yes</arg> + <arg>--xml-fd=2</arg> + <arg>--child-silent-after-fork=yes</arg> + </vargv> + <argv> + <exe>...</exe> + </argv> +</args> + +<status> + <state>RUNNING</state> + <time>...</time> +</status> + + +<status> + <state>FINISHED</state> + <time>...</time> +</status> + +<error> + <unique>0x........</unique> + <tid>...</tid> + <kind>FdNotClosed</kind> + <fd>5</fd> + <path>...</path> + <what>...</what> + <stack> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>client</fn> + <dir>...</dir> + <file>fdleak_cmsg.c</file> + <line>133</line> + </frame> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>main</fn> + <dir>...</dir> + <file>fdleak_cmsg.c</file> + <line>174</line> + </frame> + </stack> +</error> + +<error> + <unique>0x........</unique> + <tid>...</tid> + <kind>FdNotClosed</kind> + <fd>4</fd> + <path>...</path> + <what>...</what> + <stack> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>client</fn> + <dir>...</dir> + <file>fdleak_cmsg.c</file> + <line>133</line> + </frame> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>main</fn> + <dir>...</dir> + <file>fdleak_cmsg.c</file> + <line>174</line> + </frame> + </stack> +</error> + +<error> + <unique>0x........</unique> + <tid>...</tid> + <kind>FdNotClosed</kind> + <fd>3</fd> + <what>...</what> + <stack> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>client</fn> + <dir>...</dir> + <file>fdleak_cmsg.c</file> + <line>112</line> + </frame> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>main</fn> + <dir>...</dir> + <file>fdleak_cmsg.c</file> + <line>174</line> + </frame> + </stack> +</error> + +<error> + <unique>0x........</unique> + <tid>...</tid> + <kind>FdNotClosed</kind> + <fd>2</fd> + <path>...</path> + <what>...</what> +</error> + +<error> + <unique>0x........</unique> + <tid>...</tid> + <kind>FdNotClosed</kind> + <fd>1</fd> + <path>...</path> + <what>...</what> +</error> + +<error> + <unique>0x........</unique> + <tid>...</tid> + <kind>FdNotClosed</kind> + <fd>0</fd> + <path>...</path> + <what>...</what> +</error> + + +</valgrindoutput> + diff --git a/none/tests/fdleak_cmsg_xml.vgtest b/none/tests/fdleak_cmsg_xml.vgtest new file mode 100644 index 0000000000..a012522c70 --- /dev/null +++ b/none/tests/fdleak_cmsg_xml.vgtest @@ -0,0 +1,6 @@ +prog: fdleak_cmsg +# Program forks, so don't output anything after fork/child. +# Should maybe be default for xml output? +vgopts: --track-fds=all --xml=yes --xml-fd=2 --child-silent-after-fork=yes +args: < /dev/null +stderr_filter: filter_xml diff --git a/none/tests/fdleak_creat_xml.stderr.exp b/none/tests/fdleak_creat_xml.stderr.exp new file mode 100644 index 0000000000..fbdc261d61 --- /dev/null +++ b/none/tests/fdleak_creat_xml.stderr.exp @@ -0,0 +1,93 @@ +<?xml version="1.0"?> + +<valgrindoutput> + +<protocolversion>5</protocolversion> +<protocoltool>none</protocoltool> + +<preamble> + <line>Nulgrind, the minimal Valgrind tool</line> + <line>Copyright...</line> + <line>Using Valgrind...</line> + <line>Command: ./fdleak_creat</line> +</preamble> + +<pid>...</pid> +<ppid>...</ppid> +<tool>none</tool> + +<args> + <vargv> + <exe>...</exe> + <arg>--command-line-only=yes</arg> + <arg>--memcheck:leak-check=no</arg> + <arg>--tool=none</arg> + <arg>--track-fds=all</arg> + <arg>--xml=yes</arg> + <arg>--xml-fd=2</arg> + </vargv> + <argv> + <exe>...</exe> + </argv> +</args> + +<status> + <state>RUNNING</state> + <time>...</time> +</status> + + +<status> + <state>FINISHED</state> + <time>...</time> +</status> + +<error> + <unique>0x........</unique> + <tid>...</tid> + <kind>FdNotClosed</kind> + <fd>3</fd> + <path>...</path> + <what>...</what> + <stack> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>main</fn> + <dir>...</dir> + <file>fdleak_creat.c</file> + <line>13</line> + </frame> + </stack> +</error> + +<error> + <unique>0x........</unique> + <tid>...</tid> + <kind>FdNotClosed</kind> + <fd>2</fd> + <path>...</path> + <what>...</what> +</error> + +<error> + <unique>0x........</unique> + <tid>...</tid> + <kind>FdNotClosed</kind> + <fd>1</fd> + <path>...</path> + <what>...</what> +</error> + +<error> + <unique>0x........</unique> + <tid>...</tid> + <kind>FdNotClosed</kind> + <fd>0</fd> + <path>...</path> + <what>...</what> +</error> + + +</valgrindoutput> + diff --git a/none/tests/fdleak_creat_xml.vgtest b/none/tests/fdleak_creat_xml.vgtest new file mode 100644 index 0000000000..97fc5fedfb --- /dev/null +++ b/none/tests/fdleak_creat_xml.vgtest @@ -0,0 +1,4 @@ +prog: fdleak_creat +vgopts: --track-fds=all --xml=yes --xml-fd=2 +args: < /dev/null +stderr_filter: filter_xml diff --git a/none/tests/fdleak_dup2_xml.stderr.exp b/none/tests/fdleak_dup2_xml.stderr.exp new file mode 100644 index 0000000000..318093bd39 --- /dev/null +++ b/none/tests/fdleak_dup2_xml.stderr.exp @@ -0,0 +1,131 @@ +<?xml version="1.0"?> + +<valgrindoutput> + +<protocolversion>5</protocolversion> +<protocoltool>none</protocoltool> + +<preamble> + <line>Nulgrind, the minimal Valgrind tool</line> + <line>Copyright...</line> + <line>Using Valgrind...</line> + <line>Command: ./fdleak_dup2</line> +</preamble> + +<pid>...</pid> +<ppid>...</ppid> +<tool>none</tool> + +<args> + <vargv> + <exe>...</exe> + <arg>--command-line-only=yes</arg> + <arg>--memcheck:leak-check=no</arg> + <arg>--tool=none</arg> + <arg>--track-fds=all</arg> + <arg>--xml=yes</arg> + <arg>--xml-fd=2</arg> + </vargv> + <argv> + <exe>...</exe> + </argv> +</args> + +<status> + <state>RUNNING</state> + <time>...</time> +</status> + + +<status> + <state>FINISHED</state> + <time>...</time> +</status> + +<error> + <unique>0x........</unique> + <tid>...</tid> + <kind>FdNotClosed</kind> + <fd>20</fd> + <path>...</path> + <what>...</what> + <stack> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>main</fn> + <dir>...</dir> + <file>fdleak_dup2.c</file> + <line>15</line> + </frame> + </stack> +</error> + +<error> + <unique>0x........</unique> + <tid>...</tid> + <kind>FdNotClosed</kind> + <fd>4</fd> + <path>...</path> + <what>...</what> + <stack> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>main</fn> + <dir>...</dir> + <file>fdleak_dup2.c</file> + <line>16</line> + </frame> + </stack> +</error> + +<error> + <unique>0x........</unique> + <tid>...</tid> + <kind>FdNotClosed</kind> + <fd>3</fd> + <path>...</path> + <what>...</what> + <stack> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>main</fn> + <dir>...</dir> + <file>fdleak_dup2.c</file> + <line>12</line> + </frame> + </stack> +</error> + +<error> + <unique>0x........</unique> + <tid>...</tid> + <kind>FdNotClosed</kind> + <fd>2</fd> + <path>...</path> + <what>...</what> +</error> + +<error> + <unique>0x........</unique> + <tid>...</tid> + <kind>FdNotClosed</kind> + <fd>1</fd> + <path>...</path> + <what>...</what> +</error> + +<error> + <unique>0x........</unique> + <tid>...</tid> + <kind>FdNotClosed</kind> + <fd>0</fd> + <path>...</path> + <what>...</what> +</error> + + +</valgrindoutput> + diff --git a/none/tests/fdleak_dup2_xml.vgtest b/none/tests/fdleak_dup2_xml.vgtest new file mode 100644 index 0000000000..41fcb36674 --- /dev/null +++ b/none/tests/fdleak_dup2_xml.vgtest @@ -0,0 +1,4 @@ +prog: fdleak_dup2 +vgopts: --track-fds=all --xml=yes --xml-fd=2 +args: < /dev/null +stderr_filter: filter_xml diff --git a/none/tests/fdleak_dup_xml.stderr.exp b/none/tests/fdleak_dup_xml.stderr.exp new file mode 100644 index 0000000000..3fc08d342e --- /dev/null +++ b/none/tests/fdleak_dup_xml.stderr.exp @@ -0,0 +1,112 @@ +<?xml version="1.0"?> + +<valgrindoutput> + +<protocolversion>5</protocolversion> +<protocoltool>none</protocoltool> + +<preamble> + <line>Nulgrind, the minimal Valgrind tool</line> + <line>Copyright...</line> + <line>Using Valgrind...</line> + <line>Command: ./fdleak_dup</line> +</preamble> + +<pid>...</pid> +<ppid>...</ppid> +<tool>none</tool> + +<args> + <vargv> + <exe>...</exe> + <arg>--command-line-only=yes</arg> + <arg>--memcheck:leak-check=no</arg> + <arg>--tool=none</arg> + <arg>--track-fds=all</arg> + <arg>--xml=yes</arg> + <arg>--xml-fd=2</arg> + </vargv> + <argv> + <exe>...</exe> + </argv> +</args> + +<status> + <state>RUNNING</state> + <time>...</time> +</status> + + +<status> + <state>FINISHED</state> + <time>...</time> +</status> + +<error> + <unique>0x........</unique> + <tid>...</tid> + <kind>FdNotClosed</kind> + <fd>4</fd> + <path>...</path> + <what>...</what> + <stack> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>main</fn> + <dir>...</dir> + <file>fdleak_dup.c</file> + <line>12</line> + </frame> + </stack> +</error> + +<error> + <unique>0x........</unique> + <tid>...</tid> + <kind>FdNotClosed</kind> + <fd>3</fd> + <path>...</path> + <what>...</what> + <stack> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>main</fn> + <dir>...</dir> + <file>fdleak_dup.c</file> + <line>11</line> + </frame> + </stack> +</error> + +<error> + <unique>0x........</unique> + <tid>...</tid> + <kind>FdNotClosed</kind> + <fd>2</fd> + <path>...</path> + <what>...</what> +</error> + +<error> + <unique>0x........</unique> + <tid>...</tid> + <kind>FdNotClosed</kind> + <fd>1</fd> + <path>...</path> + <what>...</what> +</error> + +<error> + <unique>0x........</unique> + <tid>...</tid> + <kind>FdNotClosed</kind> + <fd>0</fd> + <path>...</path> + <what>...</what> +</error> + + +</valgrindoutput> + diff --git a/none/tests/fdleak_dup_xml.vgtest b/none/tests/fdleak_dup_xml.vgtest new file mode 100644 index 0000000000..9b895491ee --- /dev/null +++ b/none/tests/fdleak_dup_xml.vgtest @@ -0,0 +1,4 @@ +prog: fdleak_dup +vgopts: --track-fds=all --xml=yes --xml-fd=2 +args: < /dev/null +stderr_filter: filter_xml diff --git a/none/tests/fdleak_fcntl_xml.stderr.exp b/none/tests/fdleak_fcntl_xml.stderr.exp new file mode 100644 index 0000000000..4f33dc9e36 --- /dev/null +++ b/none/tests/fdleak_fcntl_xml.stderr.exp @@ -0,0 +1,112 @@ +<?xml version="1.0"?> + +<valgrindoutput> + +<protocolversion>5</protocolversion> +<protocoltool>none</protocoltool> + +<preamble> + <line>Nulgrind, the minimal Valgrind tool</line> + <line>Copyright...</line> + <line>Using Valgrind...</line> + <line>Command: ./fdleak_fcntl</line> +</preamble> + +<pid>...</pid> +<ppid>...</ppid> +<tool>none</tool> + +<args> + <vargv> + <exe>...</exe> + <arg>--command-line-only=yes</arg> + <arg>--memcheck:leak-check=no</arg> + <arg>--tool=none</arg> + <arg>--track-fds=all</arg> + <arg>--xml=yes</arg> + <arg>--xml-fd=2</arg> + </vargv> + <argv> + <exe>...</exe> + </argv> +</args> + +<status> + <state>RUNNING</state> + <time>...</time> +</status> + + +<status> + <state>FINISHED</state> + <time>...</time> +</status> + +<error> + <unique>0x........</unique> + <tid>...</tid> + <kind>FdNotClosed</kind> + <fd>4</fd> + <path>...</path> + <what>...</what> + <stack> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>main</fn> + <dir>...</dir> + <file>fdleak_fcntl.c</file> + <line>13</line> + </frame> + </stack> +</error> + +<error> + <unique>0x........</unique> + <tid>...</tid> + <kind>FdNotClosed</kind> + <fd>3</fd> + <path>...</path> + <what>...</what> + <stack> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>main</fn> + <dir>...</dir> + <file>fdleak_fcntl.c</file> + <line>12</line> + </frame> + </stack> +</error> + +<error> + <unique>0x........</unique> + <tid>...</tid> + <kind>FdNotClosed</kind> + <fd>2</fd> + <path>...</path> + <what>...</what> +</error> + +<error> + <unique>0x........</unique> + <tid>...</tid> + <kind>FdNotClosed</kind> + <fd>1</fd> + <path>...</path> + <what>...</what> +</error> + +<error> + <unique>0x........</unique> + <tid>...</tid> + <kind>FdNotClosed</kind> + <fd>0</fd> + <path>...</path> + <what>...</what> +</error> + + +</valgrindoutput> + diff --git a/none/tests/fdleak_fcntl_xml.vgtest b/none/tests/fdleak_fcntl_xml.vgtest new file mode 100644 index 0000000000..5d629b5b59 --- /dev/null +++ b/none/tests/fdleak_fcntl_xml.vgtest @@ -0,0 +1,4 @@ +prog: fdleak_fcntl +vgopts: --track-fds=all --xml=yes --xml-fd=2 +args: < /dev/null +stderr_filter: filter_xml diff --git a/none/tests/fdleak_ipv4_xml.stderr.exp b/none/tests/fdleak_ipv4_xml.stderr.exp new file mode 100644 index 0000000000..38797041a1 --- /dev/null +++ b/none/tests/fdleak_ipv4_xml.stderr.exp @@ -0,0 +1,147 @@ +<?xml version="1.0"?> + +<valgrindoutput> + +<protocolversion>5</protocolversion> +<protocoltool>none</protocoltool> + +<preamble> + <line>Nulgrind, the minimal Valgrind tool</line> + <line>Copyright...</line> + <line>Using Valgrind...</line> + <line>Command: ./fdleak_ipv4</line> +</preamble> + +<pid>...</pid> +<ppid>...</ppid> +<tool>none</tool> + +<args> + <vargv> + <exe>...</exe> + <arg>--command-line-only=yes</arg> + <arg>--memcheck:leak-check=no</arg> + <arg>--tool=none</arg> + <arg>--track-fds=yes</arg> + <arg>--xml=yes</arg> + <arg>--xml-fd=2</arg> + <arg>--child-silent-after-fork=yes</arg> + </vargv> + <argv> + <exe>...</exe> + </argv> +</args> + +<status> + <state>RUNNING</state> + <time>...</time> +</status> + +<error> + <unique>0x........</unique> + <tid>...</tid> + <kind>FdBadClose</kind> + <fd>4</fd> + <what>...</what> + <stack> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>client</fn> + <dir>...</dir> + <file>fdleak_ipv4.c</file> + <line>70</line> + </frame> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>main</fn> + <dir>...</dir> + <file>fdleak_ipv4.c</file> + <line>90</line> + </frame> + </stack> + <auxwhat>Previously closed</auxwhat> + <stack> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>client</fn> + <dir>...</dir> + <file>fdleak_ipv4.c</file> + <line>69</line> + </frame> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>main</fn> + <dir>...</dir> + <file>fdleak_ipv4.c</file> + <line>90</line> + </frame> + </stack> + <auxwhat>Originally opened</auxwhat> + <stack> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>client</fn> + <dir>...</dir> + <file>fdleak_ipv4.c</file> + <line>68</line> + </frame> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>main</fn> + <dir>...</dir> + <file>fdleak_ipv4.c</file> + <line>90</line> + </frame> + </stack> +</error> + + +<status> + <state>FINISHED</state> + <time>...</time> +</status> + +<error> + <unique>0x........</unique> + <tid>...</tid> + <kind>FdNotClosed</kind> + <fd>3</fd> + <what>...</what> + <stack> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>client</fn> + <dir>...</dir> + <file>fdleak_ipv4.c</file> + <line>51</line> + </frame> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>main</fn> + <dir>...</dir> + <file>fdleak_ipv4.c</file> + <line>90</line> + </frame> + </stack> +</error> + +<errorcounts> + <pair> + <count>1</count> + <unique>0x........</unique> + </pair> +</errorcounts> + +<suppcounts> +</suppcounts> + +</valgrindoutput> + diff --git a/none/tests/fdleak_ipv4_xml.stderr.exp-nomain b/none/tests/fdleak_ipv4_xml.stderr.exp-nomain new file mode 100644 index 0000000000..8eaa4f20fa --- /dev/null +++ b/none/tests/fdleak_ipv4_xml.stderr.exp-nomain @@ -0,0 +1,123 @@ +<?xml version="1.0"?> + +<valgrindoutput> + +<protocolversion>5</protocolversion> +<protocoltool>none</protocoltool> + +<preamble> + <line>Nulgrind, the minimal Valgrind tool</line> + <line>Copyright...</line> + <line>Using Valgrind...</line> + <line>Command: ./fdleak_ipv4</line> +</preamble> + +<pid>...</pid> +<ppid>...</ppid> +<tool>none</tool> + +<args> + <vargv> + <exe>...</exe> + <arg>--command-line-only=yes</arg> + <arg>--memcheck:leak-check=no</arg> + <arg>--tool=none</arg> + <arg>--track-fds=yes</arg> + <arg>--xml=yes</arg> + <arg>--xml-fd=2</arg> + <arg>--child-silent-after-fork=yes</arg> + </vargv> + <argv> + <exe>...</exe> + </argv> +</args> + +<status> + <state>RUNNING</state> + <time>...</time> +</status> + +<error> + <unique>0x........</unique> + <tid>...</tid> + <kind>FdBadClose</kind> + <fd>4</fd> + <what>...</what> + <stack> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>client</fn> + <dir>...</dir> + <file>fdleak_ipv4.c</file> + <line>70</line> + </frame> + </stack> + <auxwhat>Previously closed</auxwhat> + <stack> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>client</fn> + <dir>...</dir> + <file>fdleak_ipv4.c</file> + <line>69</line> + </frame> + </stack> + <auxwhat>Originally opened</auxwhat> + <stack> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>client</fn> + <dir>...</dir> + <file>fdleak_ipv4.c</file> + <line>68</line> + </frame> + </stack> +</error> + + +<status> + <state>FINISHED</state> + <time>...</time> +</status> + +<error> + <unique>0x........</unique> + <tid>...</tid> + <kind>FdNotClosed</kind> + <fd>3</fd> + <what>...</what> + <stack> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>client</fn> + <dir>...</dir> + <file>fdleak_ipv4.c</file> + <line>51</line> + </frame> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>main</fn> + <dir>...</dir> + <file>fdleak_ipv4.c</file> + <line>90</line> + </frame> + </stack> +</error> + +<errorcounts> + <pair> + <count>1</count> + <unique>0x........</unique> + </pair> +</errorcounts> + +<suppcounts> +</suppcounts> + +</valgrindoutput> + diff --git a/none/tests/fdleak_ipv4_xml.stdout.exp b/none/tests/fdleak_ipv4_xml.stdout.exp new file mode 100644 index 0000000000..ce01362503 --- /dev/null +++ b/none/tests/fdleak_ipv4_xml.stdout.exp @@ -0,0 +1 @@ +hello diff --git a/none/tests/fdleak_ipv4_xml.vgtest b/none/tests/fdleak_ipv4_xml.vgtest new file mode 100644 index 0000000000..3dd65f6144 --- /dev/null +++ b/none/tests/fdleak_ipv4_xml.vgtest @@ -0,0 +1,6 @@ +prog: fdleak_ipv4 +# Program forks, so don't output anything after fork/child. +# Should maybe be default for xml output? +vgopts: --track-fds=yes --xml=yes --xml-fd=2 --child-silent-after-fork=yes +args: < /dev/null +stderr_filter: filter_xml diff --git a/none/tests/fdleak_open_xml.stderr.exp b/none/tests/fdleak_open_xml.stderr.exp new file mode 100644 index 0000000000..2cde2d1904 --- /dev/null +++ b/none/tests/fdleak_open_xml.stderr.exp @@ -0,0 +1,66 @@ +<?xml version="1.0"?> + +<valgrindoutput> + +<protocolversion>5</protocolversion> +<protocoltool>none</protocoltool> + +<preamble> + <line>Nulgrind, the minimal Valgrind tool</line> + <line>Copyright...</line> + <line>Using Valgrind...</line> + <line>Command: ./fdleak_open</line> +</preamble> + +<pid>...</pid> +<ppid>...</ppid> +<tool>none</tool> + +<args> + <vargv> + <exe>...</exe> + <arg>--command-line-only=yes</arg> + <arg>--memcheck:leak-check=no</arg> + <arg>--tool=none</arg> + <arg>--track-fds=yes</arg> + <arg>--xml=yes</arg> + <arg>--xml-fd=2</arg> + </vargv> + <argv> + <exe>...</exe> + </argv> +</args> + +<status> + <state>RUNNING</state> + <time>...</time> +</status> + + +<status> + <state>FINISHED</state> + <time>...</time> +</status> + +<error> + <unique>0x........</unique> + <tid>...</tid> + <kind>FdNotClosed</kind> + <fd>3</fd> + <path>...</path> + <what>...</what> + <stack> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>main</fn> + <dir>...</dir> + <file>fdleak_open.c</file> + <line>9</line> + </frame> + </stack> +</error> + + +</valgrindoutput> + diff --git a/none/tests/fdleak_open_xml.vgtest b/none/tests/fdleak_open_xml.vgtest new file mode 100644 index 0000000000..84a09291c6 --- /dev/null +++ b/none/tests/fdleak_open_xml.vgtest @@ -0,0 +1,4 @@ +prog: fdleak_open +vgopts: --track-fds=yes --xml=yes --xml-fd=2 +args: < /dev/null +stderr_filter: filter_xml diff --git a/none/tests/fdleak_pipe_xml.stderr.exp b/none/tests/fdleak_pipe_xml.stderr.exp new file mode 100644 index 0000000000..2abb5a2660 --- /dev/null +++ b/none/tests/fdleak_pipe_xml.stderr.exp @@ -0,0 +1,83 @@ +<?xml version="1.0"?> + +<valgrindoutput> + +<protocolversion>5</protocolversion> +<protocoltool>none</protocoltool> + +<preamble> + <line>Nulgrind, the minimal Valgrind tool</line> + <line>Copyright...</line> + <line>Using Valgrind...</line> + <line>Command: ./fdleak_pipe</line> +</preamble> + +<pid>...</pid> +<ppid>...</ppid> +<tool>none</tool> + +<args> + <vargv> + <exe>...</exe> + <arg>--command-line-only=yes</arg> + <arg>--memcheck:leak-check=no</arg> + <arg>--tool=none</arg> + <arg>--track-fds=yes</arg> + <arg>--xml=yes</arg> + <arg>--xml-fd=2</arg> + </vargv> + <argv> + <exe>...</exe> + </argv> +</args> + +<status> + <state>RUNNING</state> + <time>...</time> +</status> + + +<status> + <state>FINISHED</state> + <time>...</time> +</status> + +<error> + <unique>0x........</unique> + <tid>...</tid> + <kind>FdNotClosed</kind> + <fd>4</fd> + <what>...</what> + <stack> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>main</fn> + <dir>...</dir> + <file>fdleak_pipe.c</file> + <line>10</line> + </frame> + </stack> +</error> + +<error> + <unique>0x........</unique> + <tid>...</tid> + <kind>FdNotClosed</kind> + <fd>3</fd> + <what>...</what> + <stack> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>main</fn> + <dir>...</dir> + <file>fdleak_pipe.c</file> + <line>10</line> + </frame> + </stack> +</error> + + +</valgrindoutput> + diff --git a/none/tests/fdleak_pipe_xml.vgtest b/none/tests/fdleak_pipe_xml.vgtest new file mode 100644 index 0000000000..34ee765f60 --- /dev/null +++ b/none/tests/fdleak_pipe_xml.vgtest @@ -0,0 +1,4 @@ +prog: fdleak_pipe +vgopts: --track-fds=yes --xml=yes --xml-fd=2 +args: < /dev/null +stderr_filter: filter_xml diff --git a/none/tests/fdleak_socketpair_xml.stderr.exp b/none/tests/fdleak_socketpair_xml.stderr.exp new file mode 100644 index 0000000000..bdd31860d8 --- /dev/null +++ b/none/tests/fdleak_socketpair_xml.stderr.exp @@ -0,0 +1,83 @@ +<?xml version="1.0"?> + +<valgrindoutput> + +<protocolversion>5</protocolversion> +<protocoltool>none</protocoltool> + +<preamble> + <line>Nulgrind, the minimal Valgrind tool</line> + <line>Copyright...</line> + <line>Using Valgrind...</line> + <line>Command: ./fdleak_socketpair</line> +</preamble> + +<pid>...</pid> +<ppid>...</ppid> +<tool>none</tool> + +<args> + <vargv> + <exe>...</exe> + <arg>--command-line-only=yes</arg> + <arg>--memcheck:leak-check=no</arg> + <arg>--tool=none</arg> + <arg>--track-fds=yes</arg> + <arg>--xml=yes</arg> + <arg>--xml-fd=2</arg> + </vargv> + <argv> + <exe>...</exe> + </argv> +</args> + +<status> + <state>RUNNING</state> + <time>...</time> +</status> + + +<status> + <state>FINISHED</state> + <time>...</time> +</status> + +<error> + <unique>0x........</unique> + <tid>...</tid> + <kind>FdNotClosed</kind> + <fd>4</fd> + <what>...</what> + <stack> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>main</fn> + <dir>...</dir> + <file>fdleak_socketpair.c</file> + <line>13</line> + </frame> + </stack> +</error> + +<error> + <unique>0x........</unique> + <tid>...</tid> + <kind>FdNotClosed</kind> + <fd>3</fd> + <what>...</what> + <stack> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>main</fn> + <dir>...</dir> + <file>fdleak_socketpair.c</file> + <line>13</line> + </frame> + </stack> +</error> + + +</valgrindoutput> + diff --git a/none/tests/fdleak_socketpair_xml.vgtest b/none/tests/fdleak_socketpair_xml.vgtest new file mode 100644 index 0000000000..791c22ec28 --- /dev/null +++ b/none/tests/fdleak_socketpair_xml.vgtest @@ -0,0 +1,4 @@ +prog: fdleak_socketpair +vgopts: --track-fds=yes --xml=yes --xml-fd=2 +args: < /dev/null +stderr_filter: filter_xml diff --git a/none/tests/file_dclose_xml.stderr.exp b/none/tests/file_dclose_xml.stderr.exp new file mode 100644 index 0000000000..4e4bd773cb --- /dev/null +++ b/none/tests/file_dclose_xml.stderr.exp @@ -0,0 +1,114 @@ +<?xml version="1.0"?> + +<valgrindoutput> + +<protocolversion>5</protocolversion> +<protocoltool>none</protocoltool> + +<preamble> + <line>Nulgrind, the minimal Valgrind tool</line> + <line>Copyright...</line> + <line>Using Valgrind...</line> + <line>Command: ./file_dclose</line> +</preamble> + +<pid>...</pid> +<ppid>...</ppid> +<tool>none</tool> + +<args> + <vargv> + <exe>...</exe> + <arg>--command-line-only=yes</arg> + <arg>--memcheck:leak-check=no</arg> + <arg>--tool=none</arg> + <arg>-q</arg> + <arg>--track-fds=yes</arg> + <arg>--xml=yes</arg> + <arg>--xml-fd=2</arg> + </vargv> + <argv> + <exe>...</exe> + </argv> +</args> + +<status> + <state>RUNNING</state> + <time>...</time> +</status> + +close 3 +time passes and we close 3 again +<error> + <unique>0x........</unique> + <tid>...</tid> + <kind>FdBadClose</kind> + <fd>3</fd> + <path>...</path> + <what>...</what> + <stack> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>closefile</fn> + <dir>...</dir> + <file>file_dclose.c</file> + <line>17</line> + </frame> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>main</fn> + <dir>...</dir> + <file>file_dclose.c</file> + <line>35</line> + </frame> + </stack> + <auxwhat>Previously closed</auxwhat> + <stack> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>main</fn> + <dir>...</dir> + <file>file_dclose.c</file> + <line>31</line> + </frame> + </stack> + <auxwhat>Originally opened</auxwhat> + <stack> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>openfile</fn> + <dir>...</dir> + <file>file_dclose.c</file> + <line>11</line> + </frame> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>main</fn> + <dir>...</dir> + <file>file_dclose.c</file> + <line>28</line> + </frame> + </stack> +</error> + + +<status> + <state>FINISHED</state> + <time>...</time> +</status> + +<errorcounts> + <pair> + <count>1</count> + <unique>0x........</unique> + </pair> +</errorcounts> + + +</valgrindoutput> + diff --git a/none/tests/file_dclose_xml.stderr.exp-nomain b/none/tests/file_dclose_xml.stderr.exp-nomain new file mode 100644 index 0000000000..b0cfc10c5f --- /dev/null +++ b/none/tests/file_dclose_xml.stderr.exp-nomain @@ -0,0 +1,98 @@ +<?xml version="1.0"?> + +<valgrindoutput> + +<protocolversion>5</protocolversion> +<protocoltool>none</protocoltool> + +<preamble> + <line>Nulgrind, the minimal Valgrind tool</line> + <line>Copyright...</line> + <line>Using Valgrind...</line> + <line>Command: ./file_dclose</line> +</preamble> + +<pid>...</pid> +<ppid>...</ppid> +<tool>none</tool> + +<args> + <vargv> + <exe>...</exe> + <arg>--command-line-only=yes</arg> + <arg>--memcheck:leak-check=no</arg> + <arg>--tool=none</arg> + <arg>-q</arg> + <arg>--track-fds=yes</arg> + <arg>--xml=yes</arg> + <arg>--xml-fd=2</arg> + </vargv> + <argv> + <exe>...</exe> + </argv> +</args> + +<status> + <state>RUNNING</state> + <time>...</time> +</status> + +close 3 +time passes and we close 3 again +<error> + <unique>0x........</unique> + <tid>...</tid> + <kind>FdBadClose</kind> + <fd>3</fd> + <path>...</path> + <what>...</what> + <stack> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>closefile</fn> + <dir>...</dir> + <file>file_dclose.c</file> + <line>17</line> + </frame> + </stack> + <auxwhat>Previously closed</auxwhat> + <stack> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>main</fn> + <dir>...</dir> + <file>file_dclose.c</file> + <line>31</line> + </frame> + </stack> + <auxwhat>Originally opened</auxwhat> + <stack> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>openfile</fn> + <dir>...</dir> + <file>file_dclose.c</file> + <line>11</line> + </frame> + </stack> +</error> + + +<status> + <state>FINISHED</state> + <time>...</time> +</status> + +<errorcounts> + <pair> + <count>1</count> + <unique>0x........</unique> + </pair> +</errorcounts> + + +</valgrindoutput> + diff --git a/none/tests/file_dclose_xml.vgtest b/none/tests/file_dclose_xml.vgtest new file mode 100644 index 0000000000..ceddc12d12 --- /dev/null +++ b/none/tests/file_dclose_xml.vgtest @@ -0,0 +1,4 @@ +prog: file_dclose +prereq: test -x file_dclose +vgopts: -q --track-fds=yes --xml=yes --xml-fd=2 +stderr_filter: filter_xml diff --git a/none/tests/filter_xml b/none/tests/filter_xml new file mode 100755 index 0000000000..70fdb65791 --- /dev/null +++ b/none/tests/filter_xml @@ -0,0 +1,19 @@ +#! /bin/sh + +dir=`dirname $0` + +$dir/../../tests/filter_xml_frames | +perl -p -e "s/<time>.*<\/time>/<time>...<\/time>/s" | +perl -p -e "s/<what>.*<\/what>/<what>...<\/what>/s" | +perl -p -e "s/<path>.*<\/path>/<path>...<\/path>/s" | +perl -p -e "s/<line>Copyright.*<\/line>/<line>Copyright...<\/line>/s" | +perl -p -e "s/<line>Using Valgrind.*<\/line>/<line>Using Valgrind...<\/line>/s" | +sed "s/<ppid>[0-9]*<\/ppid>/<ppid>...<\/ppid>/" | +sed "s/<tid>[0-9]*<\/tid>/<tid>...<\/tid>/" | +sed "s/<pid>[0-9]*<\/pid>/<pid>...<\/pid>/" | +sed "s/<obj>.*<\/obj>/<obj>...<\/obj>/" | +sed "s/<exe>.*<\/exe>/<exe>...<\/exe>/" | +sed "s/<dir>.*<\/dir>/<dir>...<\/dir>/" | +sed "s/<ppid>[0-9]*<\/ppid>/<ppid>...<\/ppid>/" | +sed "s/<unique>0x[0-9a-fA-F]*<\/unique>/<unique>0x........<\/unique>/" | +sed "s/<ip>0x[0-9a-fA-F]*<\/ip>/<ip>0x........<\/ip>/" diff --git a/none/tests/socket_close_xml.stderr.exp b/none/tests/socket_close_xml.stderr.exp new file mode 100644 index 0000000000..69a2c514ec --- /dev/null +++ b/none/tests/socket_close_xml.stderr.exp @@ -0,0 +1,106 @@ +<?xml version="1.0"?> + +<valgrindoutput> + +<protocolversion>5</protocolversion> +<protocoltool>none</protocoltool> + +<preamble> + <line>Nulgrind, the minimal Valgrind tool</line> + <line>Copyright...</line> + <line>Using Valgrind...</line> + <line>Command: ./socket_close</line> +</preamble> + +<pid>...</pid> +<ppid>...</ppid> +<tool>none</tool> + +<args> + <vargv> + <exe>...</exe> + <arg>--command-line-only=yes</arg> + <arg>--memcheck:leak-check=no</arg> + <arg>--tool=none</arg> + <arg>-q</arg> + <arg>--track-fds=yes</arg> + <arg>--xml=yes</arg> + <arg>--xml-fd=2</arg> + </vargv> + <argv> + <exe>...</exe> + </argv> +</args> + +<status> + <state>RUNNING</state> + <time>...</time> +</status> + +Open socket 3 +close socket_fd 3 +and close the socket again 3 +<error> + <unique>0x........</unique> + <tid>...</tid> + <kind>FdBadClose</kind> + <fd>3</fd> + <what>...</what> + <stack> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>main</fn> + <dir>...</dir> + <file>socket_close.c</file> + <line>40</line> + </frame> + </stack> + <auxwhat>Previously closed</auxwhat> + <stack> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>main</fn> + <dir>...</dir> + <file>socket_close.c</file> + <line>36</line> + </frame> + </stack> + <auxwhat>Originally opened</auxwhat> + <stack> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>open_socket</fn> + <dir>...</dir> + <file>socket_close.c</file> + <line>17</line> + </frame> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>main</fn> + <dir>...</dir> + <file>socket_close.c</file> + <line>31</line> + </frame> + </stack> +</error> + + +<status> + <state>FINISHED</state> + <time>...</time> +</status> + +<errorcounts> + <pair> + <count>1</count> + <unique>0x........</unique> + </pair> +</errorcounts> + + +</valgrindoutput> + diff --git a/none/tests/socket_close_xml.vgtest b/none/tests/socket_close_xml.vgtest new file mode 100644 index 0000000000..82c791a28b --- /dev/null +++ b/none/tests/socket_close_xml.vgtest @@ -0,0 +1,4 @@ +prog: socket_close +prereq: test -x socket_close +vgopts: -q --track-fds=yes --xml=yes --xml-fd=2 +stderr_filter: filter_xml |
From: Mark W. <ma...@so...> - 2024-06-14 23:46:24
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=8b374fd2bce60a58809b4f95a93d7e2f01929a08 commit 8b374fd2bce60a58809b4f95a93d7e2f01929a08 Author: Alexandra Hájková <aha...@re...> Date: Thu May 23 04:46:26 2024 -0400 Improve none/tests/double_close_range test and filter_fdleak Adjust none/tests/file_dclose, none/tests/fdleak_ipv4 and socket_close to fit the changes in filter_fdleak. https://bugs.kde.org/show_bug.cgi?id=488441 Diff: --- none/tests/double_close_range.c | 15 ++++++++++++--- none/tests/double_close_range.stderr.exp | 21 ++++++++++++++++++++- none/tests/double_close_range.vgtest | 1 + none/tests/fdleak_ipv4.stderr.exp | 2 +- none/tests/file_dclose.stderr.exp | 2 +- none/tests/filter_fdleak | 7 +++++-- none/tests/socket_close.stderr.exp | 2 +- 7 files changed, 41 insertions(+), 9 deletions(-) diff --git a/none/tests/double_close_range.c b/none/tests/double_close_range.c index 6239593301..5c593fd112 100644 --- a/none/tests/double_close_range.c +++ b/none/tests/double_close_range.c @@ -9,6 +9,8 @@ int main () { + // Create a new file descriptor that we immediately close. + // This is of course fine. int fd = dup (2); if (fd != -1){ fprintf(stderr, "close fd %d\n", fd); @@ -16,11 +18,18 @@ int main () } // Shouldn't warn, we are closing everything + // This is a special case for close_range if the last + // argument is ~0U (infinity). fprintf(stderr, "Closing range (%d, %d).\n", fd, ~0U); - close_range(6, ~0U, 0); + close_range(fd, ~0U, 0); - // Should warn, we close a small range (but only for fd itself - fprintf(stderr, "Closing range (%d, %d).\n", fd, 7); + int fd5 = dup2(1, 5); + int fd7 = dup2(2, 7); + fprintf(stderr, "Closing range (%d, %d).\n", fd5, fd7); + close_range(5, 7, 0); + + // Should warn, we close a small range + fprintf(stderr, "Double closing range (%d, %d).\n", fd5, fd7); close_range(5, 7, 0); return 0; diff --git a/none/tests/double_close_range.stderr.exp b/none/tests/double_close_range.stderr.exp index f1b78ea1dd..eeb599bf24 100644 --- a/none/tests/double_close_range.stderr.exp +++ b/none/tests/double_close_range.stderr.exp @@ -1,3 +1,22 @@ close fd 3 Closing range (3, -1). -Closing range (3, 7). +Closing range (5, 7). +Double closing range (5, 7). +File descriptor ...: ... is already closed + at 0x........: close_range (in /...libc...) + by 0x........: main + Previously closed + at 0x........: close_range (in /...libc...) + by 0x........: main + Originally opened + at 0x........: dup2 (in /...libc...) + by 0x........: main +File descriptor ...: ... is already closed + at 0x........: close_range (in /...libc...) + by 0x........: main + Previously closed + at 0x........: close_range (in /...libc...) + by 0x........: main + Originally opened + at 0x........: dup2 (in /...libc...) + by 0x........: main diff --git a/none/tests/double_close_range.vgtest b/none/tests/double_close_range.vgtest index 8320d03f9a..e47ee50d15 100644 --- a/none/tests/double_close_range.vgtest +++ b/none/tests/double_close_range.vgtest @@ -1,3 +1,4 @@ prog: double_close_range prereq: test -x double_close_range +stderr_filter: filter_fdleak vgopts: -q --track-fds=yes diff --git a/none/tests/fdleak_ipv4.stderr.exp b/none/tests/fdleak_ipv4.stderr.exp index 9612ef72ac..801b0279f8 100644 --- a/none/tests/fdleak_ipv4.stderr.exp +++ b/none/tests/fdleak_ipv4.stderr.exp @@ -1,5 +1,5 @@ -File descriptor 4: AF_INET socket 4: 127.0.0.1:... <-> 127.0.0.1:... is already closed +File descriptor ...: ... is already closed at 0x........: close (in /...libc...) by 0x........: client (fdleak_ipv4.c:70) by 0x........: main diff --git a/none/tests/file_dclose.stderr.exp b/none/tests/file_dclose.stderr.exp index 26721e6f56..c2c8c80ed2 100644 --- a/none/tests/file_dclose.stderr.exp +++ b/none/tests/file_dclose.stderr.exp @@ -1,6 +1,6 @@ close 3 time passes and we close 3 again -File descriptor 3: file_dclose.tmp is already closed +File descriptor ...: ... is already closed at 0x........: close (in /...libc...) by 0x........: closefile (file_dclose.c:17) by 0x........: main diff --git a/none/tests/filter_fdleak b/none/tests/filter_fdleak index f7cb026ed5..d26937bccd 100755 --- a/none/tests/filter_fdleak +++ b/none/tests/filter_fdleak @@ -13,6 +13,7 @@ perl -p -e 's/^Open (AF_UNIX socket|file descriptor) [0-9]*: \/devices\/pseudo\/ perl -p -e 's/^Open (AF_UNIX socket|file descriptor) [0-9]*: (\/private)?\/tmp\/(sock|data1|data2|file)\.[0-9]*/Open $1 ...: \/tmp\/$3/' | perl -p -e 's/^Open file descriptor [0-9]*: .*/Open file descriptor ...: .../' | perl -p -e 's/^Open file descriptor [0-9]*:$/Open file descriptor ...:/' | +perl -p -e 's/File descriptor [0-9]*: .* is already closed/File descriptor ...: ... is already closed/' | perl -p -e 's/127.0.0.1:[0-9]*/127.0.0.1:.../g' | perl -p -e 's/socket\.c:[1-9][0-9]*/in \/...libc.../' | # arm systems substitute open for creat @@ -42,7 +43,9 @@ perl -p -0 -e 's/(Open[^\n]*\n)( (at|by)[^\n]*\n)+/$1 ...\n/gs' | sed "s/by 0x........: (below main)/by 0x........: main/" | sed "s/by 0x........: main (.*)/by 0x........: main/" | -# With glibc debuginfo installed we might see syscall-template.S, close.c or creat64.c +# With glibc debuginfo installed we might see syscall-template.S, +# dup2.c close.c or creat64.c perl -p -e "s/\(syscall-template.S:[0-9]*\)/(in \/...libc...)/" | perl -p -e "s/\(close.c:[0-9]*\)/(in \/...libc...)/" | -perl -p -e "s/\(creat(?:64)?.c:[0-9]*\)/(in \/...libc...)/" +perl -p -e "s/\(creat(?:64)?.c:[0-9]*\)/(in \/...libc...)/" | +perl -p -e "s/\(dup2.c:[0-9]*\)/(in \/...libc...)/" diff --git a/none/tests/socket_close.stderr.exp b/none/tests/socket_close.stderr.exp index 5352390dd9..e7435e8aa6 100644 --- a/none/tests/socket_close.stderr.exp +++ b/none/tests/socket_close.stderr.exp @@ -1,7 +1,7 @@ Open socket 3 close socket_fd 3 and close the socket again 3 -File descriptor 3: AF_UNIX socket 3: /tmp/vgtest-foofrob is already closed +File descriptor ...: ... is already closed at 0x........: close (in /...libc...) by 0x........: main Previously closed |
From: Mark W. <ma...@kl...> - 2024-06-10 15:04:14
|
Hi developers and packagers, I updated the VALGRIND_3_23_BRANCH with some patches to unbreak mips, fix memccpy false positives, inotify_init syscall handling, add aarch64 frinta and frinta vector instructions and clean up the s390x extension mechanism and some testcases. I don't intent to do a full 3.23.1 release, but I hope distros will pick up these fixes. I have also added them to the Fedora package. Please let me know if you find other fixes on trunk you believe really should be backported to 3.23.0. Thanks, Mark commit 1c2cdfd790b3e26f47e709770bdefd456d83a7cb Author: Paul Floyd <pj...@wa...> Date: Tue Jun 4 12:49:33 2024 +0200 Linux regtest: reallocarray needs malloc.h Seen on Rocky 8.9 (cherry picked from commit a015ad2e0db40076b4841220c7ab6d6853798936) commit 70d765faa162f2f12e7771db51877649637f2c12 Author: Jesus Checa <jc...@re...> Date: Sat May 25 12:40:30 2024 +0200 Bug 453044 - gbserver_tests failures in aarch64 (cherry picked from commit 790abdf7d3f3df0c968605b68ca765310689b7ce) commit ebe5fd9c0aae97767a4418d2f26f3281065b3e6a Author: Andreas Arnez <ar...@li...> Date: Wed May 15 14:32:42 2024 +0200 s390x: Minor fixes in extension-s390x.c Some tracker names for registers are not consistent with the naming scheme. Also, there is a dead assignment to orig_addr2 and orig_len2. Fix both. (cherry picked from commit 76f2218924f85547f670969b1a0b59e5200e22ec) commit 40b68ae8d6c869f098493e3a31d66f09170592e3 Author: Andreas Arnez <ar...@li...> Date: Wed May 15 14:32:42 2024 +0200 Avoid use of guest_IP_AT_SYSCALL in handle_extension() The guest state field guest_IP_AT_SYSCALL is referenced in handle_extension(), even though it may not be defined by all architectures. Avoid its use altogether. (cherry picked from commit 16249b21456d681b5d98400287b8dbd926050c75) commit 468933f9765449c1e353c38e88555a2f1603b9ce Author: Andreas Arnez <ar...@li...> Date: Wed May 15 14:32:42 2024 +0200 Fix uninitialized `err' in handle_extension() In handle_extension(), in the case of a second return from SCHEDSETJMP the variable `err' would be used uninitialized. Fix this by avoiding any access to `err' in this case. (cherry picked from commit 94c2e5c6be23c6323f24deacdad5f98fb9f0b1c2) commit 726f930355ca74b4aa4c656979224c9b7a706244 Author: Aleksandar Rikalo <ar...@gm...> Date: Fri May 10 17:59:28 2024 +0200 mips: skip using shared syscall numbers for mips32 mips does not use shared syscall numbers, so we can not use vki-scnums-shared-linux.h. This partially fixes KDE #444781. Signed-off-by: Hauke Mehrtens <ha...@ha...> Signed-off-by: Aleksandar Rikalo <ar...@gm...> (cherry picked from commit 54d6ad3348fb50f5b972fe9c05d0d8757bfe73ba) commit f5d1c336e9276dd5947ef94c9831d9d53673b75b Author: Paul Floyd <pj...@wa...> Date: Thu May 9 21:01:52 2024 +0200 aarch64 frinta and frinta vector instructions The initial fix for Bug 484426 only corrected frinta and frintn scalar instructions. This adds support for the vector variants. (cherry picked from commit 7b66a5b58219ac1a4865da8e371edbdb8d765f32) commit 3795a011eeb9730cda9f0beadce70aab8aa71e68 Author: Paul Floyd <pj...@wa...> Date: Sat May 4 15:03:11 2024 +0200 Bug 486569 - linux inotify_init syscall wrapper missing POST entry in syscall_table (cherry picked from commit b38115cc6087f30f872c533f93c7c31a6d73eb24) commit 14141bb4a6ea528b4c0b9295aa64348f7a675735 Author: Paul Floyd <pj...@wa...> Date: Wed May 1 09:24:14 2024 +0200 Bug 486293 - memccpy false positives (cherry picked from commit 805c020c6e5161966e6eb0099ebe937a510cea9e) commit 2e26af756d69c53026bf2d6d61589f754796340d Author: Paul Floyd <pj...@wa...> Date: Sat Apr 27 13:07:07 2024 +0200 486180 [MIPS] 'VexGuestArchState' has no member named 'guest_IP_AT_SYSCALL' (cherry picked from commit 7214886886bce9029f325214156c02dcfff760d5) |
From: Mark W. <ma...@so...> - 2024-06-10 12:28:10
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=1c2cdfd790b3e26f47e709770bdefd456d83a7cb commit 1c2cdfd790b3e26f47e709770bdefd456d83a7cb Author: Paul Floyd <pj...@wa...> Date: Tue Jun 4 12:49:33 2024 +0200 Linux regtest: reallocarray needs malloc.h Seen on Rocky 8.9 (cherry picked from commit a015ad2e0db40076b4841220c7ab6d6853798936) Diff: --- memcheck/tests/amd64-linux/reallocarray.c | 1 + memcheck/tests/amd64-linux/reallocarray.stderr.exp | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/memcheck/tests/amd64-linux/reallocarray.c b/memcheck/tests/amd64-linux/reallocarray.c index 8765ca4997..ce63b80100 100644 --- a/memcheck/tests/amd64-linux/reallocarray.c +++ b/memcheck/tests/amd64-linux/reallocarray.c @@ -2,6 +2,7 @@ #include <assert.h> #include <errno.h> #include <stdint.h> +#include <malloc.h> #include "../../memcheck.h" int main(void) diff --git a/memcheck/tests/amd64-linux/reallocarray.stderr.exp b/memcheck/tests/amd64-linux/reallocarray.stderr.exp index a1c8439cc9..20a1c4e8b4 100644 --- a/memcheck/tests/amd64-linux/reallocarray.stderr.exp +++ b/memcheck/tests/amd64-linux/reallocarray.stderr.exp @@ -12,19 +12,19 @@ To see them, rerun with: --leak-check=full --show-leak-kinds=all realloc() with size 0 at 0x........: reallocarray (vg_replace_malloc.c:...) - by 0x........: main (reallocarray.c:13) + by 0x........: main (reallocarray.c:14) Address 0x........ is 0 bytes inside a block of size 40 alloc'd at 0x........: reallocarray (vg_replace_malloc.c:...) - by 0x........: main (reallocarray.c:11) + by 0x........: main (reallocarray.c:12) All heap blocks were freed -- no leaks are possible realloc() with size 0 at 0x........: reallocarray (vg_replace_malloc.c:...) - by 0x........: main (reallocarray.c:16) + by 0x........: main (reallocarray.c:17) Address 0x........ is 0 bytes inside a block of size 10 alloc'd at 0x........: malloc (vg_replace_malloc.c:...) - by 0x........: main (reallocarray.c:15) + by 0x........: main (reallocarray.c:16) All heap blocks were freed -- no leaks are possible |
From: Mark W. <ma...@so...> - 2024-06-10 12:28:05
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=70d765faa162f2f12e7771db51877649637f2c12 commit 70d765faa162f2f12e7771db51877649637f2c12 Author: Jesus Checa <jc...@re...> Date: Sat May 25 12:40:30 2024 +0200 Bug 453044 - gbserver_tests failures in aarch64 (cherry picked from commit 790abdf7d3f3df0c968605b68ca765310689b7ce) Diff: --- NEWS | 1 + gdbserver_tests/filter_gdb.in | 1 + 2 files changed, 2 insertions(+) diff --git a/NEWS b/NEWS index adb52169dd..c2ad6a207d 100644 --- a/NEWS +++ b/NEWS @@ -5,6 +5,7 @@ Branch 3.23 The following bugs have been fixed or resolved on this branch. +453044 gbserver_tests failures in aarch64 486180 [MIPS] 'VexGuestArchState' has no member named 'guest_IP_AT_SYSCALL' 486293 memccpy false positives 486569 linux inotify_init syscall wrapper missing POST entry in syscall_table diff --git a/gdbserver_tests/filter_gdb.in b/gdbserver_tests/filter_gdb.in index 4118063f6b..497171732b 100755 --- a/gdbserver_tests/filter_gdb.in +++ b/gdbserver_tests/filter_gdb.in @@ -152,6 +152,7 @@ s/in _select ()/in syscall .../ /sysv\/linux\/generic\/select.c/d /return SYSCALL_CANCEL /d /r = SYSCALL_CANCEL /d +/result = SYSCALL_CANCEL /d # a more specialised system call select stack trace part # (on 32 bits, we have an int_80, on 64 bits, directly select) |
From: Mark W. <ma...@so...> - 2024-06-10 12:27:55
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=40b68ae8d6c869f098493e3a31d66f09170592e3 commit 40b68ae8d6c869f098493e3a31d66f09170592e3 Author: Andreas Arnez <ar...@li...> Date: Wed May 15 14:32:42 2024 +0200 Avoid use of guest_IP_AT_SYSCALL in handle_extension() The guest state field guest_IP_AT_SYSCALL is referenced in handle_extension(), even though it may not be defined by all architectures. Avoid its use altogether. (cherry picked from commit 16249b21456d681b5d98400287b8dbd926050c75) Diff: --- coregrind/m_scheduler/scheduler.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/coregrind/m_scheduler/scheduler.c b/coregrind/m_scheduler/scheduler.c index 29751bb282..cc8d070b79 100644 --- a/coregrind/m_scheduler/scheduler.c +++ b/coregrind/m_scheduler/scheduler.c @@ -1237,8 +1237,7 @@ static void handle_extension(ThreadId tid) block_signals(); VG_(poll_signals)(tid); } else if (err != ExtErr_OK) { - ThreadState* tst = VG_(get_ThreadState)(tid); - Addr addr = tst->arch.vex.guest_IP_AT_SYSCALL; + Addr addr = VG_(get_IP)(tid); switch (err) { case ExtErr_Illop: VG_(synth_sigill)(tid, addr); |
From: Mark W. <ma...@so...> - 2024-06-10 12:27:55
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=ebe5fd9c0aae97767a4418d2f26f3281065b3e6a commit ebe5fd9c0aae97767a4418d2f26f3281065b3e6a Author: Andreas Arnez <ar...@li...> Date: Wed May 15 14:32:42 2024 +0200 s390x: Minor fixes in extension-s390x.c Some tracker names for registers are not consistent with the naming scheme. Also, there is a dead assignment to orig_addr2 and orig_len2. Fix both. (cherry picked from commit 76f2218924f85547f670969b1a0b59e5200e22ec) Diff: --- coregrind/m_extension/extension-s390x.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/coregrind/m_extension/extension-s390x.c b/coregrind/m_extension/extension-s390x.c index fd45c7ee94..735406e6e4 100644 --- a/coregrind/m_extension/extension-s390x.c +++ b/coregrind/m_extension/extension-s390x.c @@ -37,9 +37,9 @@ #undef SYSNO -#define READ_FUNCTION_CODE(tst) \ +#define READ_FUNCTION_CODE(tst, extname) \ ({ \ - PRE_REG_READ(tst, "func_code", r0, 7, sizeof(UChar)); \ + PRE_REG_READ(tst, extname "(func_code)", r0, 7, sizeof(UChar)); \ tst->arch.vex.guest_r0 & 0xff; \ }) @@ -141,10 +141,10 @@ static enum ExtensionError do_extension_PRNO(ThreadState* tst, ULong variant) { UChar r1 = variant & 0xf; UChar r2 = (variant >> 4) & 0xf; - UChar func = READ_FUNCTION_CODE(tst); + UChar func = READ_FUNCTION_CODE(tst, "PRNO"); UChar fc = func & 0x7f; UChar mflag = func & 128; - ULong parms = READ_GPR(tst, "r1", 1); + ULong parms = READ_GPR(tst, "PRNO(r1)", 1); ULong parms_len; Int cc = 0; ULong orig_addr1 = 0, orig_len1 = 0, orig_addr2 = 0, orig_len2 = 0; @@ -175,8 +175,8 @@ static enum ExtensionError do_extension_PRNO(ThreadState* tst, ULong variant) PRE_MEM_WRITE(tst, "PRNO(op1)", addr1, len1); } else { // Seed operation - addr2 = orig_addr2 = READ_GPR(tst, "PRNO(op2_addr)", r2); - len2 = orig_len2 = READ_GPR(tst, "PRNO(op2_len)", r2 + 1); + addr2 = READ_GPR(tst, "PRNO(op2_addr)", r2); + len2 = READ_GPR(tst, "PRNO(op2_len)", r2 + 1); PRE_MEM_READ(tst, "PRNO(op2)", addr2, len2); } PRE_MEM_WRITE(tst, "PRNO(parms)", parms, parms_len); @@ -474,7 +474,7 @@ static enum ExtensionError do_extension_NNPA(ThreadState* tst, ULong variant) { ULong gpr0 = READ_GPR(tst, "NNPA(r0)", 0); UChar fc = gpr0 & 0x7f; - ULong parms_addr = READ_GPR(tst, "r1", 1); + ULong parms_addr = READ_GPR(tst, "NNPA(r1)", 1); Int cc = 0; ULong parms_len; |
From: Mark W. <ma...@so...> - 2024-06-10 12:27:50
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=468933f9765449c1e353c38e88555a2f1603b9ce commit 468933f9765449c1e353c38e88555a2f1603b9ce Author: Andreas Arnez <ar...@li...> Date: Wed May 15 14:32:42 2024 +0200 Fix uninitialized `err' in handle_extension() In handle_extension(), in the case of a second return from SCHEDSETJMP the variable `err' would be used uninitialized. Fix this by avoiding any access to `err' in this case. (cherry picked from commit 94c2e5c6be23c6323f24deacdad5f98fb9f0b1c2) Diff: --- coregrind/m_scheduler/scheduler.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/coregrind/m_scheduler/scheduler.c b/coregrind/m_scheduler/scheduler.c index fc8cf7c9cb..29751bb282 100644 --- a/coregrind/m_scheduler/scheduler.c +++ b/coregrind/m_scheduler/scheduler.c @@ -1233,7 +1233,10 @@ static void handle_extension(ThreadId tid) SCHEDSETJMP(tid, jumped, err = VG_(client_extension)(tid)); vg_assert(VG_(is_running_thread)(tid)); - if (err != ExtErr_OK) { + if (jumped != (UWord)0) { + block_signals(); + VG_(poll_signals)(tid); + } else if (err != ExtErr_OK) { ThreadState* tst = VG_(get_ThreadState)(tid); Addr addr = tst->arch.vex.guest_IP_AT_SYSCALL; switch (err) { @@ -1244,11 +1247,6 @@ static void handle_extension(ThreadId tid) VG_(core_panic)("scheduler: bad return code from extension"); } } - - if (jumped != (UWord)0) { - block_signals(); - VG_(poll_signals)(tid); - } } /* tid just requested a jump to the noredir version of its current |
From: Mark W. <ma...@so...> - 2024-06-10 12:27:45
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=726f930355ca74b4aa4c656979224c9b7a706244 commit 726f930355ca74b4aa4c656979224c9b7a706244 Author: Aleksandar Rikalo <ar...@gm...> Date: Fri May 10 17:59:28 2024 +0200 mips: skip using shared syscall numbers for mips32 mips does not use shared syscall numbers, so we can not use vki-scnums-shared-linux.h. This partially fixes KDE #444781. Signed-off-by: Hauke Mehrtens <ha...@ha...> Signed-off-by: Aleksandar Rikalo <ar...@gm...> (cherry picked from commit 54d6ad3348fb50f5b972fe9c05d0d8757bfe73ba) Diff: --- coregrind/m_syswrap/syswrap-mips32-linux.c | 1 + include/pub_tool_vkiscnums_asm.h | 2 - include/vki/vki-scnums-mips32-linux.h | 105 ++++++++++++++++++++++------- 3 files changed, 83 insertions(+), 25 deletions(-) diff --git a/coregrind/m_syswrap/syswrap-mips32-linux.c b/coregrind/m_syswrap/syswrap-mips32-linux.c index e2f499eb80..e3498cd96f 100644 --- a/coregrind/m_syswrap/syswrap-mips32-linux.c +++ b/coregrind/m_syswrap/syswrap-mips32-linux.c @@ -1110,6 +1110,7 @@ static SyscallTableEntry syscall_main_table[] = { LINX_ (__NR_pwritev2, sys_pwritev2), // 362 //.. LINXY(__NR_statx, sys_statx), // 366 + GENX_(__NR_rseq, sys_ni_syscall), // 367 LINXY(__NR_clock_gettime64, sys_clock_gettime64), // 403 LINX_(__NR_clock_settime64, sys_clock_settime64), // 404 diff --git a/include/pub_tool_vkiscnums_asm.h b/include/pub_tool_vkiscnums_asm.h index 8a26f834a9..d3d7dc19be 100644 --- a/include/pub_tool_vkiscnums_asm.h +++ b/include/pub_tool_vkiscnums_asm.h @@ -63,8 +63,6 @@ # include "vki/vki-scnums-arm64-linux.h" #elif defined(VGP_mips32_linux) -# include "vki/vki-scnums-shared-linux.h" -# include "vki/vki-scnums-32bit-linux.h" # include "vki/vki-scnums-mips32-linux.h" #elif defined(VGP_nanomips_linux) diff --git a/include/vki/vki-scnums-mips32-linux.h b/include/vki/vki-scnums-mips32-linux.h index e452a2e6c8..d4f8de15aa 100644 --- a/include/vki/vki-scnums-mips32-linux.h +++ b/include/vki/vki-scnums-mips32-linux.h @@ -380,35 +380,94 @@ #define __NR_setns (__NR_Linux + 343) #define __NR_process_vm_readv (__NR_Linux + 345) #define __NR_process_vm_writev (__NR_Linux + 346) -#define __NR_kcmp (__NR_Linux + 347) -#define __NR_finit_module (__NR_Linux + 348) -#define __NR_sched_setattr (__NR_Linux + 349) -#define __NR_sched_getattr (__NR_Linux + 350) -#define __NR_renameat2 (__NR_Linux + 351) -#define __NR_seccomp (__NR_Linux + 352) -#define __NR_getrandom (__NR_Linux + 353) -#define __NR_memfd_create (__NR_Linux + 354) -#define __NR_bpf (__NR_Linux + 355) -#define __NR_execveat (__NR_Linux + 356) -#define __NR_userfaultfd (__NR_Linux + 357) -#define __NR_membarrier (__NR_Linux + 358) -#define __NR_mlock2 (__NR_Linux + 359) -#define __NR_copy_file_range (__NR_Linux + 360) -#define __NR_preadv2 (__NR_Linux + 361) -#define __NR_pwritev2 (__NR_Linux + 362) -#define __NR_pkey_mprotect (__NR_Linux + 363) -#define __NR_pkey_alloc (__NR_Linux + 364) -#define __NR_pkey_free (__NR_Linux + 365) -#define __NR_statx (__NR_Linux + 366) - +#define __NR_kcmp (__NR_Linux + 347) +#define __NR_finit_module (__NR_Linux + 348) +#define __NR_sched_setattr (__NR_Linux + 349) +#define __NR_sched_getattr (__NR_Linux + 350) +#define __NR_renameat2 (__NR_Linux + 351) +#define __NR_seccomp (__NR_Linux + 352) +#define __NR_getrandom (__NR_Linux + 353) +#define __NR_memfd_create (__NR_Linux + 354) +#define __NR_bpf (__NR_Linux + 355) +#define __NR_execveat (__NR_Linux + 356) +#define __NR_userfaultfd (__NR_Linux + 357) +#define __NR_membarrier (__NR_Linux + 358) +#define __NR_mlock2 (__NR_Linux + 359) +#define __NR_copy_file_range (__NR_Linux + 360) +#define __NR_preadv2 (__NR_Linux + 361) +#define __NR_pwritev2 (__NR_Linux + 362) +#define __NR_pkey_mprotect (__NR_Linux + 363) +#define __NR_pkey_alloc (__NR_Linux + 364) +#define __NR_pkey_free (__NR_Linux + 365) +#define __NR_statx (__NR_Linux + 366) +#define __NR_rseq (__NR_Linux + 367) +#define __NR_io_pgetevents (__NR_Linux + 368) +#define __NR_semget (__NR_Linux + 393) +#define __NR_semctl (__NR_Linux + 394) +#define __NR_shmget (__NR_Linux + 395) +#define __NR_shmctl (__NR_Linux + 396) +#define __NR_shmat (__NR_Linux + 397) +#define __NR_shmdt (__NR_Linux + 398) +#define __NR_msgget (__NR_Linux + 399) +#define __NR_msgsnd (__NR_Linux + 400) +#define __NR_msgrcv (__NR_Linux + 401) +#define __NR_msgctl (__NR_Linux + 402) +#define __NR_clock_gettime64 (__NR_Linux + 403) +#define __NR_clock_settime64 (__NR_Linux + 404) +#define __NR_clock_adjtime64 (__NR_Linux + 405) +#define __NR_clock_getres_time64 (__NR_Linux + 406) +#define __NR_clock_nanosleep_time64 (__NR_Linux + 407) +#define __NR_timer_gettime64 (__NR_Linux + 408) +#define __NR_timer_settime64 (__NR_Linux + 409) +#define __NR_timerfd_gettime64 (__NR_Linux + 410) +#define __NR_timerfd_settime64 (__NR_Linux + 411) +#define __NR_utimensat_time64 (__NR_Linux + 412) +#define __NR_pselect6_time64 (__NR_Linux + 413) +#define __NR_ppoll_time64 (__NR_Linux + 414) +#define __NR_io_pgetevents_time64 (__NR_Linux + 416) +#define __NR_recvmmsg_time64 (__NR_Linux + 417) +#define __NR_mq_timedsend_time64 (__NR_Linux + 418) +#define __NR_mq_timedreceive_time64 (__NR_Linux + 419) +#define __NR_semtimedop_time64 (__NR_Linux + 420) +#define __NR_rt_sigtimedwait_time64 (__NR_Linux + 421) +#define __NR_futex_time64 (__NR_Linux + 422) +#define __NR_sched_rr_get_interval_time64 (__NR_Linux + 423) +#define __NR_pidfd_send_signal (__NR_Linux + 424) +#define __NR_io_uring_setup (__NR_Linux + 425) +#define __NR_io_uring_enter (__NR_Linux + 426) +#define __NR_io_uring_register (__NR_Linux + 427) +#define __NR_open_tree (__NR_Linux + 428) +#define __NR_move_mount (__NR_Linux + 429) +#define __NR_fsopen (__NR_Linux + 430) +#define __NR_fsconfig (__NR_Linux + 431) +#define __NR_fsmount (__NR_Linux + 432) +#define __NR_fspick (__NR_Linux + 433) +#define __NR_pidfd_open (__NR_Linux + 434) +#define __NR_clone3 (__NR_Linux + 435) +#define __NR_close_range (__NR_Linux + 436) +#define __NR_openat2 (__NR_Linux + 437) +#define __NR_pidfd_getfd (__NR_Linux + 438) +#define __NR_faccessat2 (__NR_Linux + 439) +#define __NR_process_madvise (__NR_Linux + 440) +#define __NR_epoll_pwait2 (__NR_Linux + 441) +#define __NR_mount_setattr (__NR_Linux + 442) +#define __NR_quotactl_fd (__NR_Linux + 443) +#define __NR_landlock_create_ruleset (__NR_Linux + 444) +#define __NR_landlock_add_rule (__NR_Linux + 445) +#define __NR_landlock_restrict_self (__NR_Linux + 446) +#define __NR_process_mrelease (__NR_Linux + 448) +#define __NR_futex_waitv (__NR_Linux + 449) +#define __NR_set_mempolicy_home_node (__NR_Linux + 450) +#define __NR_cachestat (__NR_Linux + 451) +#define __NR_fchmodat2 (__NR_Linux + 452) /* * Offset of the last Linux o32 flavoured syscall */ -#define __NR_Linux_syscalls 366 +#define __NR_Linux_syscalls 366 #define __NR_O32_Linux 4000 -#define __NR_O32_Linux_syscalls 366 +#define __NR_O32_Linux_syscalls 366 #endif /* __VKI_SCNUMS_MIPS32_LINUX_H */ |
From: Mark W. <ma...@so...> - 2024-06-10 12:27:35
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=3795a011eeb9730cda9f0beadce70aab8aa71e68 commit 3795a011eeb9730cda9f0beadce70aab8aa71e68 Author: Paul Floyd <pj...@wa...> Date: Sat May 4 15:03:11 2024 +0200 Bug 486569 - linux inotify_init syscall wrapper missing POST entry in syscall_table (cherry picked from commit b38115cc6087f30f872c533f93c7c31a6d73eb24) Diff: --- NEWS | 1 + coregrind/m_syswrap/syswrap-amd64-linux.c | 2 +- coregrind/m_syswrap/syswrap-arm-linux.c | 2 +- coregrind/m_syswrap/syswrap-mips32-linux.c | 2 +- coregrind/m_syswrap/syswrap-mips64-linux.c | 2 +- coregrind/m_syswrap/syswrap-ppc32-linux.c | 2 +- coregrind/m_syswrap/syswrap-ppc64-linux.c | 2 +- coregrind/m_syswrap/syswrap-s390x-linux.c | 2 +- coregrind/m_syswrap/syswrap-x86-linux.c | 2 +- 9 files changed, 9 insertions(+), 8 deletions(-) diff --git a/NEWS b/NEWS index f674191a28..b65f920667 100644 --- a/NEWS +++ b/NEWS @@ -7,6 +7,7 @@ The following bugs have been fixed or resolved on this branch. 486180 [MIPS] 'VexGuestArchState' has no member named 'guest_IP_AT_SYSCALL' 486293 memccpy false positives +486569 linux inotify_init syscall wrapper missing POST entry in syscall_table 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-linux.c b/coregrind/m_syswrap/syswrap-amd64-linux.c index a59e01826c..86a47d9c28 100644 --- a/coregrind/m_syswrap/syswrap-amd64-linux.c +++ b/coregrind/m_syswrap/syswrap-amd64-linux.c @@ -773,7 +773,7 @@ static SyscallTableEntry syscall_table[] = { LINXY(__NR_keyctl, sys_keyctl), // 250 LINX_(__NR_ioprio_set, sys_ioprio_set), // 251 LINX_(__NR_ioprio_get, sys_ioprio_get), // 252 - LINX_(__NR_inotify_init, sys_inotify_init), // 253 + LINXY(__NR_inotify_init, sys_inotify_init), // 253 LINX_(__NR_inotify_add_watch, sys_inotify_add_watch), // 254 LINX_(__NR_inotify_rm_watch, sys_inotify_rm_watch), // 255 diff --git a/coregrind/m_syswrap/syswrap-arm-linux.c b/coregrind/m_syswrap/syswrap-arm-linux.c index 217b1c49dc..7b536e52cb 100644 --- a/coregrind/m_syswrap/syswrap-arm-linux.c +++ b/coregrind/m_syswrap/syswrap-arm-linux.c @@ -922,7 +922,7 @@ static SyscallTableEntry syscall_main_table[] = { // LINX_(__NR_ioprio_set, sys_ioprio_set), // 289 // LINX_(__NR_ioprio_get, sys_ioprio_get), // 290 - LINX_(__NR_inotify_init, sys_inotify_init), // 291 + LINXY(__NR_inotify_init, sys_inotify_init), // 291 LINX_(__NR_inotify_add_watch, sys_inotify_add_watch), // 292 LINX_(__NR_inotify_rm_watch, sys_inotify_rm_watch), // 293 // LINX_(__NR_migrate_pages, sys_migrate_pages), // 294 diff --git a/coregrind/m_syswrap/syswrap-mips32-linux.c b/coregrind/m_syswrap/syswrap-mips32-linux.c index 3f991da0a1..e2f499eb80 100644 --- a/coregrind/m_syswrap/syswrap-mips32-linux.c +++ b/coregrind/m_syswrap/syswrap-mips32-linux.c @@ -1037,7 +1037,7 @@ static SyscallTableEntry syscall_main_table[] = { LINXY (__NR_mq_timedreceive, sys_mq_timedreceive), // 274 LINX_ (__NR_mq_notify, sys_mq_notify), // 275 LINXY (__NR_mq_getsetattr, sys_mq_getsetattr), // 276 - LINX_ (__NR_inotify_init, sys_inotify_init), // 275 + LINXY (__NR_inotify_init, sys_inotify_init), // 275 LINX_ (__NR_inotify_add_watch, sys_inotify_add_watch), // 276 LINX_ (__NR_inotify_rm_watch, sys_inotify_rm_watch), // 277 LINXY (__NR_waitid, sys_waitid), // 278 diff --git a/coregrind/m_syswrap/syswrap-mips64-linux.c b/coregrind/m_syswrap/syswrap-mips64-linux.c index 9899a21cfa..24f2bcc939 100644 --- a/coregrind/m_syswrap/syswrap-mips64-linux.c +++ b/coregrind/m_syswrap/syswrap-mips64-linux.c @@ -759,7 +759,7 @@ static SyscallTableEntry syscall_main_table[] = { LINX_ (__NR_request_key, sys_request_key), LINXY (__NR_keyctl, sys_keyctl), PLAX_ (__NR_set_thread_area, sys_set_thread_area), - LINX_ (__NR_inotify_init, sys_inotify_init), + LINXY (__NR_inotify_init, sys_inotify_init), LINX_ (__NR_inotify_add_watch, sys_inotify_add_watch), LINX_ (__NR_inotify_rm_watch, sys_inotify_rm_watch), LINXY (__NR_openat, sys_openat), diff --git a/coregrind/m_syswrap/syswrap-ppc32-linux.c b/coregrind/m_syswrap/syswrap-ppc32-linux.c index 0aabfbb179..74ba68564c 100644 --- a/coregrind/m_syswrap/syswrap-ppc32-linux.c +++ b/coregrind/m_syswrap/syswrap-ppc32-linux.c @@ -944,7 +944,7 @@ static SyscallTableEntry syscall_table[] = { LINX_(__NR_ioprio_set, sys_ioprio_set), // 273 LINX_(__NR_ioprio_get, sys_ioprio_get), // 274 - LINX_(__NR_inotify_init, sys_inotify_init), // 275 + LINXY(__NR_inotify_init, sys_inotify_init), // 275 LINX_(__NR_inotify_add_watch, sys_inotify_add_watch), // 276 LINX_(__NR_inotify_rm_watch, sys_inotify_rm_watch), // 277 PLAXY(__NR_spu_run, sys_spu_run), // 278 diff --git a/coregrind/m_syswrap/syswrap-ppc64-linux.c b/coregrind/m_syswrap/syswrap-ppc64-linux.c index 35e3f8ec4e..4609e10df3 100644 --- a/coregrind/m_syswrap/syswrap-ppc64-linux.c +++ b/coregrind/m_syswrap/syswrap-ppc64-linux.c @@ -928,7 +928,7 @@ static SyscallTableEntry syscall_table[] = { LINX_(__NR_ioprio_set, sys_ioprio_set), // 273 LINX_(__NR_ioprio_get, sys_ioprio_get), // 274 - LINX_(__NR_inotify_init, sys_inotify_init), // 275 + LINXY(__NR_inotify_init, sys_inotify_init), // 275 LINX_(__NR_inotify_add_watch, sys_inotify_add_watch), // 276 LINX_(__NR_inotify_rm_watch, sys_inotify_rm_watch), // 277 diff --git a/coregrind/m_syswrap/syswrap-s390x-linux.c b/coregrind/m_syswrap/syswrap-s390x-linux.c index f941bdd190..9ed2fa4688 100644 --- a/coregrind/m_syswrap/syswrap-s390x-linux.c +++ b/coregrind/m_syswrap/syswrap-s390x-linux.c @@ -751,7 +751,7 @@ static SyscallTableEntry syscall_table[] = { LINXY(__NR_waitid, sys_waitid), // 281 LINX_(__NR_ioprio_set, sys_ioprio_set), // 282 LINX_(__NR_ioprio_get, sys_ioprio_get), // 283 - LINX_(__NR_inotify_init, sys_inotify_init), // 284 + LINXY(__NR_inotify_init, sys_inotify_init), // 284 LINX_(__NR_inotify_add_watch, sys_inotify_add_watch), // 285 LINX_(__NR_inotify_rm_watch, sys_inotify_rm_watch), // 286 diff --git a/coregrind/m_syswrap/syswrap-x86-linux.c b/coregrind/m_syswrap/syswrap-x86-linux.c index c6cf682e79..ea930bafe3 100644 --- a/coregrind/m_syswrap/syswrap-x86-linux.c +++ b/coregrind/m_syswrap/syswrap-x86-linux.c @@ -1508,7 +1508,7 @@ static SyscallTableEntry syscall_table[] = { LINX_(__NR_ioprio_set, sys_ioprio_set), // 289 LINX_(__NR_ioprio_get, sys_ioprio_get), // 290 - LINX_(__NR_inotify_init, sys_inotify_init), // 291 + LINXY(__NR_inotify_init, sys_inotify_init), // 291 LINX_(__NR_inotify_add_watch, sys_inotify_add_watch), // 292 LINX_(__NR_inotify_rm_watch, sys_inotify_rm_watch), // 293 // LINX_(__NR_migrate_pages, sys_migrate_pages), // 294 |