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
(48) |
Sep
|
Oct
|
Nov
|
Dec
|
From: Mark W. <ma...@so...> - 2024-10-31 22:38:49
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=22971a15d62df6351ab97ea064eebd9bdcb4cf37 commit 22971a15d62df6351ab97ea064eebd9bdcb4cf37 Author: Alexandra Hájková <aha...@re...> Date: Wed Oct 16 13:38:48 2024 -0400 Report track-fd errors for fd used which was not opened or already closed Add (optional) pathname, description, where_closed and where_opened fields to struct FdBadUse. Print those fields when set in fd_pp_Error. Add a new function ML_(find_OpenFd) that provides a recorded OpenFd given an fd (or NULL when the fd was never recorded). In ML_(fd_allowed) when using a file descriptor use ML_(find_OpenFd) to see if the fd was ever created, if not create an "was never created" FdBadUse error. If it was created, but already closed create an "was closed already", filling in as much details as we can. Add none/tests/use_after_close.vgtest to test, already closed, never created, invalid, double (double) close and invalid close issues. Adjust error message in none/tests/fdbaduse.stderr.exp. https://bugs.kde.org/show_bug.cgi?id=493418 Diff: --- NEWS | 1 + coregrind/m_syswrap/syswrap-generic.c | 73 ++++++++++++++++++++++++++++++++--- none/tests/Makefile.am | 6 ++- none/tests/fdbaduse.stderr.exp | 2 +- none/tests/use_after_close.c | 33 ++++++++++++++++ none/tests/use_after_close.stderr.exp | 28 ++++++++++++++ none/tests/use_after_close.vgtest | 4 ++ 7 files changed, 139 insertions(+), 8 deletions(-) diff --git a/NEWS b/NEWS index 2857a387d1..54229dc57c 100644 --- a/NEWS +++ b/NEWS @@ -76,6 +76,7 @@ are not entered into bugzilla tend to get forgotten about or ignored. 492214 statx(fd, NULL, AT_EMPTY_PATH) is supported since Linux 6.11 but not supported in valgrind 492663 Valgrind ignores debug info for some binaries +493418 Add bad fd usage errors for --track-fds in ML_(fd_allowed) 493454 Missing FUSE_COMPATIBLE_MAY_BLOCK markers 493507 direct readlink syscall from PRE handler is incompatible with FUSE_COMPATIBLE_MAY_BLOCK diff --git a/coregrind/m_syswrap/syswrap-generic.c b/coregrind/m_syswrap/syswrap-generic.c index 26e14d4943..920c87a8ae 100644 --- a/coregrind/m_syswrap/syswrap-generic.c +++ b/coregrind/m_syswrap/syswrap-generic.c @@ -593,6 +593,11 @@ struct BadCloseExtra { struct FdBadUse { Int fd; /* The file descriptor */ + HChar *pathname; /* NULL if not a regular file or unknown */ + HChar *description; /* Description of the file descriptor + might include the pathname */ + ExeContext *where_closed; /* record the last close of fd */ + ExeContext *where_opened; /* recordwhere the fd was opened */ }; struct NotClosedExtra { @@ -1166,8 +1171,25 @@ void fd_pp_Error (const Error *err) if (xml) VG_(emit)(" <kind>FdBadUse</kind>\n"); struct FdBadUse *nce = (struct FdBadUse *) VG_(get_error_extra)(err); - if (xml) VG_(emit)(" <fd>%d</fd>\n", nce->fd); - VG_(emit)("%sInvalid file descriptor %d%s\n", whatpre, nce->fd, whatpost); + const char *error_string = VG_(get_error_string)(err); + if (xml) { + VG_(emit)(" <fd>%d</fd>\n", nce->fd); + if (nce->pathname) + VG_(emit)(" <path>%s</path>\n", nce->pathname); + } + VG_(emit)("%sFile descriptor %d %s%s\n", whatpre, nce->fd, + error_string, whatpost); + /* If the file descriptor was never created we won't have + where_closed and where_opened. Only print them in a + use after close case. */ + if (nce->where_closed) { + VG_(emit)("%sPreviously closed%s\n", auxpre, auxpost); + VG_(pp_ExeContext)(nce->where_closed); + } + if (nce->where_opened) { + VG_(emit)("%sOriginally opened%s\n", auxpre, auxpost); + VG_(pp_ExeContext)(nce->where_opened); + } VG_(pp_ExeContext)(where); } else { vg_assert2 (False, "Unknown error kind: %d", @@ -1577,6 +1599,19 @@ static Addr do_brk ( Addr newbrk, ThreadId tid ) return VG_(brk_limit); } +const OpenFd *ML_(find_OpenFd)(Int fd) +{ + OpenFd *i = allocated_fds; + + while (i) { + if (i->fd == fd) + return i; + i = i->next; + } + + return NULL; +} + /* --------------------------------------------------------------------- Vet file descriptors for sanity @@ -1640,14 +1675,42 @@ Bool ML_(fd_allowed)(Int fd, const HChar *syscallname, ThreadId tid, client is exactly what we don't want. */ /* croak? */ + if (VG_(clo_track_fds) && allowed + && !isNewFd && (VG_(strcmp)("close", syscallname) != 0)) { + const OpenFd *openbadfd = ML_(find_OpenFd)(fd); + if (!openbadfd) { + /* File descriptor which was never created (or inherited). */ + struct FdBadUse badfd; + badfd.fd = fd; + badfd.pathname = NULL; + badfd.description = NULL; + badfd.where_opened = NULL; + badfd.where_closed = NULL; + VG_(maybe_record_error)(tid, FdBadUse, 0, + "was never created", &badfd); + + } else if (openbadfd->fd_closed) { + /* Already closed file descriptor is being used. */ + struct FdBadUse badfd; + badfd.fd = fd; + badfd.pathname = openbadfd->pathname; + badfd.description = openbadfd->description; + badfd.where_opened = openbadfd->where; + badfd.where_closed = openbadfd->where_closed; + VG_(maybe_record_error)(tid, FdBadUse, 0, + "was closed already", &badfd); + } + } if ((!allowed) && !isNewFd) { - // XXX FdBadUse might want to add more info if we are going to include - // already closed file descriptors, then we do have a bit more info if (VG_(clo_track_fds)) { struct FdBadUse badfd; badfd.fd = fd; + badfd.pathname = NULL; + badfd.description = NULL; + badfd.where_opened = NULL; + badfd.where_closed = NULL; VG_(maybe_record_error)(tid, FdBadUse, 0, - "invalid file descriptor", &badfd); + "Invalid file descriptor", &badfd); } else if (VG_(showing_core_warnings) ()) { // XXX legacy warnings, will be removed eventually VG_(message)(Vg_UserMsg, diff --git a/none/tests/Makefile.am b/none/tests/Makefile.am index 4ec2943175..59be79e579 100644 --- a/none/tests/Makefile.am +++ b/none/tests/Makefile.am @@ -256,7 +256,8 @@ EXTRA_DIST = \ 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 \ - fdbaduse.stderr.exp fdbaduse.vgtest + fdbaduse.stderr.exp fdbaduse.vgtest \ + use_after_close.stderr.exp use_after_close.vgtest check_PROGRAMS = \ @@ -311,7 +312,8 @@ check_PROGRAMS = \ sigprocmask \ socket_close \ file_dclose \ - fdbaduse + fdbaduse \ + use_after_close if HAVE_STATIC_LIBC if ! VGCONF_OS_IS_LINUX diff --git a/none/tests/fdbaduse.stderr.exp b/none/tests/fdbaduse.stderr.exp index 15d71f99aa..a4772dbd99 100644 --- a/none/tests/fdbaduse.stderr.exp +++ b/none/tests/fdbaduse.stderr.exp @@ -1,3 +1,3 @@ -Invalid file descriptor -1 +File descriptor -1 Invalid file descriptor at 0x........: close (in /...libc...) by 0x........: main diff --git a/none/tests/use_after_close.c b/none/tests/use_after_close.c new file mode 100644 index 0000000000..deb4e68881 --- /dev/null +++ b/none/tests/use_after_close.c @@ -0,0 +1,33 @@ +#include<stdio.h> +#include <stdlib.h> +#include <unistd.h> +#include <fcntl.h> + +int main(void) +{ + char *string = "bad\n"; + int fd = dup(2); + + /* OK. */ + write(fd, string, 4); + close(fd); + + /* Already closed. */ + write(fd, string, 4); + + /* Never created. */ + write(7, string, 4); + + /* Invalid. */ + write(-7, string, 4); + + /* Double double close. */ + close(fd); + + /* Invalid close. */ + close (-7); + + return 0; +} + + diff --git a/none/tests/use_after_close.stderr.exp b/none/tests/use_after_close.stderr.exp new file mode 100644 index 0000000000..1ef31c6551 --- /dev/null +++ b/none/tests/use_after_close.stderr.exp @@ -0,0 +1,28 @@ +bad +File descriptor 3 was closed already + Previously closed + at 0x........: close (in /...libc...) + by 0x........: main + Originally opened + at 0x........: dup (in /...libc...) + by 0x........: main + at 0x........: write (in /...libc...) + by 0x........: main +File descriptor 7 was never created + at 0x........: write (in /...libc...) + by 0x........: main +File descriptor -7 Invalid file descriptor + at 0x........: write (in /...libc...) + by 0x........: main +File descriptor ...: ... is already closed + at 0x........: close (in /...libc...) + by 0x........: main + Previously closed + at 0x........: close (in /...libc...) + by 0x........: main + Originally opened + at 0x........: dup (in /...libc...) + by 0x........: main +File descriptor -7 Invalid file descriptor + at 0x........: close (in /...libc...) + by 0x........: main diff --git a/none/tests/use_after_close.vgtest b/none/tests/use_after_close.vgtest new file mode 100644 index 0000000000..eec5b93088 --- /dev/null +++ b/none/tests/use_after_close.vgtest @@ -0,0 +1,4 @@ +prog: use_after_close +prereq: test -x use_after_close +vgopts: -q --track-fds=yes +stderr_filter: filter_fdleak |
From: Paul F. <pj...@wa...> - 2024-10-29 21:14:22
|
On 28-10-24 19:54, Paul Floyd via Valgrind-developers wrote: > > > On 28-10-24 00:58, Mark Wielaard wrote: >> There are still some pending patches, but lets do an RC1 for some >> wider testing. > > Hi Mark > > I tested FreeBSD 14.1 arm64 and amd64 this morning, both OK. > > I'll try to do more testing tomorrow and Wednesday. Now for the poor relatives. macOS 10.13 == 771 tests, 198 stderr failures, 13 stdout failures, 0 stderrB failures, 0 stdoutB failures, 4 post failures == (327 fails back with 3.22) Not too bad, and I've seen that Louis Brunner's macOS port has recently made big progress on arm64. Illumos OpenIndiana Hipster 2024.10 == 897 tests, 80 stderr failures, 14 stdout failures, 15 stderrB failures, 6 stdoutB failures, 6 post failures == (78 fails back with 3.22) A broad reflection on the rate of change in Illumos. Alpine / musl libc. I've given up doing anything for musl. I got fed up with the main musl developer Rich Felker telling me on IRC #musl how Valgrind should work. A+ Paul |
From: Paul F. <pa...@so...> - 2024-10-29 20:03:48
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=688f35dfdb5cc628a5c202069835a9a1390923a2 commit 688f35dfdb5cc628a5c202069835a9a1390923a2 Author: Paul Floyd <pj...@wa...> Date: Tue Oct 29 21:02:38 2024 +0100 Illumos: fix wartnings Macro redefinition, calculating the size of an array and printf format specifiers. Diff: --- callgrind/dump.c | 2 ++ coregrind/m_syswrap/syswrap-amd64-solaris.c | 4 ++-- coregrind/m_syswrap/syswrap-solaris.c | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/callgrind/dump.c b/callgrind/dump.c index 7f9f59f92a..130b73bd0b 100644 --- a/callgrind/dump.c +++ b/callgrind/dump.c @@ -895,7 +895,9 @@ void swap(BBCC** a, BBCC** b) t = *a; *a = *b; *b = t; } +#if !defined(min) #define min(x, y) ((x)<=(y) ? (x) : (y)) +#endif static BBCC** med3(BBCC **a, BBCC **b, BBCC **c, int (*cmp)(BBCC**,BBCC**)) diff --git a/coregrind/m_syswrap/syswrap-amd64-solaris.c b/coregrind/m_syswrap/syswrap-amd64-solaris.c index 8a0b3c08df..404cba5a0a 100644 --- a/coregrind/m_syswrap/syswrap-amd64-solaris.c +++ b/coregrind/m_syswrap/syswrap-amd64-solaris.c @@ -233,7 +233,7 @@ void ML_(save_machine_context)(ThreadId tid, vki_ucontext_t *uc, buf[2] = VKI_UC_GUEST_CC_DEP1(uc); buf[3] = VKI_UC_GUEST_CC_DEP2(uc); buf[4] = uc->uc_mcontext.gregs[VKI_REG_RFL]; - checksum = ML_(fletcher64)((UInt*)&buf, sizeof(buf) / sizeof(UInt)); + checksum = ML_(fletcher64)((UInt*)&buf, 2 * sizeof(buf) / sizeof(buf[0])); VKI_UC_GUEST_RFLAGS_CHECKSUM(uc) = checksum; } @@ -439,7 +439,7 @@ void ML_(restore_machine_context)(ThreadId tid, vki_ucontext_t *uc, buf[3] = VKI_UC_GUEST_CC_DEP2(uc); buf[4] = rflags; checksum = ML_(fletcher64)((UInt*)&buf, - sizeof(buf) / sizeof(UInt)); + 2 * sizeof(buf) / sizeof(buf[0])); if (checksum == VKI_UC_GUEST_RFLAGS_CHECKSUM(uc)) { /* Check ok, the full restoration is possible. */ VG_(debugLog)(1, "syswrap-solaris", diff --git a/coregrind/m_syswrap/syswrap-solaris.c b/coregrind/m_syswrap/syswrap-solaris.c index dad70ef857..f43c2f30a9 100644 --- a/coregrind/m_syswrap/syswrap-solaris.c +++ b/coregrind/m_syswrap/syswrap-solaris.c @@ -3930,7 +3930,7 @@ PRE(sys_execve) #if defined(SOLARIS_EXECVE_SYSCALL_TAKES_FLAGS) if (ARG1_is_fd) VG_(message)(Vg_UserMsg, "execve(%ld, %#lx, %#lx, %lu) failed, " - "errno %ld\n", SARG1, ARG2, ARG3, ARG4, ERR); + "errno %lu\n", SARG1, ARG2, ARG3, ARG4, ERR); else VG_(message)(Vg_UserMsg, "execve(%#lx(%s), %#lx, %#lx, %ld) failed, errno" " %lu\n", ARG1, (HChar *) ARG1, ARG2, ARG3, SARG4, ERR); |
From: Paul F. <pa...@so...> - 2024-10-29 19:31:57
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=a488029d6955797283eede8744652b0d25b2c5c1 commit a488029d6955797283eede8744652b0d25b2c5c1 Author: Paul Floyd <pj...@wa...> Date: Tue Oct 29 20:31:06 2024 +0100 macOS: compiler warnings Debug traces in vgdb. Diff: --- coregrind/vgdb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/coregrind/vgdb.c b/coregrind/vgdb.c index f05a766e8c..786ead160d 100644 --- a/coregrind/vgdb.c +++ b/coregrind/vgdb.c @@ -441,8 +441,8 @@ Bool write_buf(int fd, const char* buf, size_t size, const char* desc, { size_t nrwritten; ssize_t nrw; - DEBUG(2, "writing %s len %d %.*s notify: %d\n", desc, size, - size, buf, notify); + DEBUG(2, "writing %s len %zu %.*s notify: %d\n", desc, size, + (int)size, buf, notify); nrwritten = 0; while (nrwritten < size) { nrw = write(fd, buf+nrwritten, size - nrwritten); |
From: Andreas A. <ar...@so...> - 2024-10-29 17:24:36
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=54c0a49bca6570a09a0764ccd6cf60f9a08ad493 commit 54c0a49bca6570a09a0764ccd6cf60f9a08ad493 Author: Andreas Arnez <ar...@li...> Date: Tue Oct 29 17:43:15 2024 +0100 Bug 495470 - s390x: Add s390-opcodes.csv to distribution Include s390-opcodes.csv in the distribution, since it is referenced in README.s390. Diff: --- NEWS | 1 + docs/Makefile.am | 1 + 2 files changed, 2 insertions(+) diff --git a/NEWS b/NEWS index 329bcdb654..2857a387d1 100644 --- a/NEWS +++ b/NEWS @@ -86,6 +86,7 @@ are not entered into bugzilla tend to get forgotten about or ignored. ISA 3.0 and earlier, just ignore the value 495469 aligned_alloc and posix_memalign missing MALLOC_TRACE with returned pointer +495470 s390x: 3.24.0.RC1 missing file and regtest failure n-i-bz Improve messages for sigaltstack errors, use specific stack_t member names diff --git a/docs/Makefile.am b/docs/Makefile.am index f9ba4e3958..6859ee8a34 100644 --- a/docs/Makefile.am +++ b/docs/Makefile.am @@ -64,6 +64,7 @@ EXTRA_DIST = \ internals/qemu-aarch64-linux-HOWTO.txt \ internals/qemu-mips64-linux-HOWTO.txt \ internals/register-uses.txt \ + internals/s390-opcodes.csv \ internals/release-HOWTO.txt \ internals/segments-seginfos.txt \ internals/t-chaining-notes.txt \ |
From: Andreas A. <ar...@so...> - 2024-10-29 15:48:06
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=74d85edfbdcac7c5c9cbbb2460005d5c4dac4447 commit 74d85edfbdcac7c5c9cbbb2460005d5c4dac4447 Author: Florian Krohm <fl...@ei...> Date: Tue Oct 29 16:24:31 2024 +0100 Bug 493959 - s390x: Fix regtest failure for op00 with /bin/dash On different machines /bin/sh may be impersonated by different shells, and those behave differently as to whether they write "Illegal instruction ..." to stderr. While newer versions of bash do not, dash does. For the op00 test case this means that an additional line may be written to `op00.stderr.out', depending on which shell is being used. Hence adding "Illegal instruction ..." as an expected line to `op00.stderr.exp' wouldn't work on all systems. Instead, fix this issue by adding the case of "illegal instruction" to the general filtering logic in filter_stderr_basic.in, where various other messages of this kind are already filtered out. Reviewed-by: Andreas Arnez <ar...@li...> Diff: --- NEWS | 1 + tests/filter_stderr_basic.in | 9 ++++----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/NEWS b/NEWS index 8fb685ffaa..329bcdb654 100644 --- a/NEWS +++ b/NEWS @@ -79,6 +79,7 @@ are not entered into bugzilla tend to get forgotten about or ignored. 493454 Missing FUSE_COMPATIBLE_MAY_BLOCK markers 493507 direct readlink syscall from PRE handler is incompatible with FUSE_COMPATIBLE_MAY_BLOCK +493959 s390x: Fix regtest failure for none/tests/s390x/op00 493970 s390x: Store/restore FPC upon helper call causes slowdown 494252 s390x: incorrect disassembly for LOCHI and friends 495278 PowerPC instruction dcbf should allow the L field values of 4, 6 on diff --git a/tests/filter_stderr_basic.in b/tests/filter_stderr_basic.in index 6f7dec1d3d..f32266c0b7 100755 --- a/tests/filter_stderr_basic.in +++ b/tests/filter_stderr_basic.in @@ -49,11 +49,10 @@ $SED "/warning: line info addresses out of order/d" | $SED "/main Warning: due to transparent memory mappings with MAP_STACK/d" | $SED "/main --sanity-level=3 and above may give spurious errors./d" | -# Older bash versions print abnormal termination messages on the stderr -# of the bash process. Newer bash versions redirect such messages properly. -# Suppress any redirected abnormal termination messages. You can find the -# complete list of messages in the bash source file siglist.c. -perl -n -e 'print if !/^(Segmentation fault|Alarm clock|Aborted|Bus error|Killed)( \(core dumped\))?$/' | +# Filter out abnormal termination messages. Depending on which shell is +# pointed to by /bin/sh those messages will be written to stderr or not. +# E.g. dash writes them to stderr, whereas bash does not. +perl -n -e 'print if !/^(Illegal instruction|Segmentation fault|Alarm clock|Aborted|Bus error|Killed)( \(core dumped\))?$/' | # Similar as above, but for ksh on Solaris/illumos. perl -n -e 'print if !/^(Memory fault|Killed) $/' | |
From: Carl L. <ce...@li...> - 2024-10-29 15:08:06
|
Paul: On 10/29/24 12:38 AM, Paul Floyd via Valgrind-developers wrote: > > > On 28-10-24 19:52, Carl Love via Valgrind-developers wrote: >> Mark: >> >> PowerPC testing on Power 8, I am seeing 4 additional stderr failures >> versus Valgrind 3.23.0.RC2 > >> none/tests/fdleak_cmsg_supp (stderr) New for >> Valgrind-3.24.0.RC1 >> none/tests/fdleak_cmsg_xml (stderr) New for >> Valgrind-3.24.0.RC1 >> none/tests/fdleak_ipv4_xml (stderr) New for >> Valgrind-3.24.0.RC1 >> none/tests/socket_close_xml (stderr) New for >> Valgrind-3.24.0.RC1 > > Hi Carl > > It's probably not too serious. The fdleak feature tends to output > messages that are highly system dependent and need plenty of filtering > in order to have stable regtest results. Thanks for the feedback. The tests were run on various lab machines at IBM. I will note that the nightly regression runs on the GCC pool machines gcc110 and gcc112 do not have the same failures. I don't think these failures are an issue for delaying the next release. I agree they do appear to be fairly minor. I will try and get to investigating them soon. Thanks. Carl |
From: Paul F. <pj...@wa...> - 2024-10-29 07:39:05
|
On 28-10-24 19:52, Carl Love via Valgrind-developers wrote: > Mark: > > PowerPC testing on Power 8, I am seeing 4 additional stderr failures > versus Valgrind 3.23.0.RC2 > none/tests/fdleak_cmsg_supp (stderr) New for > Valgrind-3.24.0.RC1 > none/tests/fdleak_cmsg_xml (stderr) New for > Valgrind-3.24.0.RC1 > none/tests/fdleak_ipv4_xml (stderr) New for > Valgrind-3.24.0.RC1 > none/tests/socket_close_xml (stderr) New for > Valgrind-3.24.0.RC1 Hi Carl It's probably not too serious. The fdleak feature tends to output messages that are highly system dependent and need plenty of filtering in order to have stable regtest results. A+ Paul |
From: Paul F. <pa...@so...> - 2024-10-28 21:11:12
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=7450eb6d295db3f060a6dbc950634ce0d194219d commit 7450eb6d295db3f060a6dbc950634ce0d194219d Author: Paul Floyd <pj...@wa...> Date: Mon Oct 28 22:10:30 2024 +0100 macOS Helgrind: fix wrong wrapper for sem_trywait. Diff: --- helgrind/hg_intercepts.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helgrind/hg_intercepts.c b/helgrind/hg_intercepts.c index 0068ea7a6f..0c27b0a662 100644 --- a/helgrind/hg_intercepts.c +++ b/helgrind/hg_intercepts.c @@ -3241,7 +3241,7 @@ PTH_FUNC(int, semZutrywaitZAZa, sem_t* sem) { /* sem_trywait@* */ } #elif defined(VGO_darwin) PTH_FUNC(int, semZutrywait, sem_t* sem) { /* sem_trywait */ - return sem_wait_WRK(sem); + return sem_trywait_WRK(sem); } #elif defined(VGO_freebsd) LIBC_FUNC(int, semZutrywait, sem_t* sem) { /* sem_trywait */ |
From: Carl L. <ce...@li...> - 2024-10-28 19:59:47
|
Mark: PowerPC testing on Power 8, I am seeing 4 additional stderr failures versus Valgrind 3.23.0.RC2 == 749 tests, 7 stderr failures, 0 stdout failures, 13 stderrB failures, 0 stdoutB failures, 0 post failures == gdbserver_tests/hginfo (stderrB) gdbserver_tests/mcblocklistsearch (stderrB) gdbserver_tests/mcbreak (stderrB) gdbserver_tests/mcclean_after_fork (stderrB) gdbserver_tests/mcinfcallWSRU (stderrB) gdbserver_tests/mcleak (stderrB) gdbserver_tests/mcmain_pic (stderrB) gdbserver_tests/mcvabits (stderrB) gdbserver_tests/mssnapshot (stderrB) gdbserver_tests/nlgone_abrt (stderrB) gdbserver_tests/nlgone_exit (stderrB) gdbserver_tests/nlgone_return (stderrB) gdbserver_tests/nlpasssigalrm (stderrB) memcheck/tests/leak_cpp_interior (stderr) memcheck/tests/linux/rfcomm (stderr) memcheck/tests/linux/sys-execveat (stderr) none/tests/fdleak_cmsg_supp (stderr) New for Valgrind-3.24.0.RC1 none/tests/fdleak_cmsg_xml (stderr) New for Valgrind-3.24.0.RC1 none/tests/fdleak_ipv4_xml (stderr) New for Valgrind-3.24.0.RC1 none/tests/socket_close_xml (stderr) New for Valgrind-3.24.0.RC1 PowerPC testing on Power 9, I am seeing 4 additional stderr failures versus Valgrind 3.23.0.RC2 == 767 tests, 7 stderr failures, 0 stdout failures, 13 stderrB failures, 0 stdoutB failures, 0 post failures == gdbserver_tests/hginfo (stderrB) gdbserver_tests/mcblocklistsearch (stderrB) gdbserver_tests/mcbreak (stderrB) gdbserver_tests/mcclean_after_fork (stderrB) gdbserver_tests/mcinfcallWSRU (stderrB) gdbserver_tests/mcleak (stderr) gdbserver_tests/mcleak (stderrB) gdbserver_tests/mcmain_pic (stderrB) gdbserver_tests/mcvabits (stderrB) gdbserver_tests/mssnapshot (stderrB) gdbserver_tests/nlgone_abrt (stderrB) gdbserver_tests/nlgone_exit (stderrB) gdbserver_tests/nlgone_return (stderrB) gdbserver_tests/nlpasssigalrm (stderrB) memcheck/tests/leak-delta (stderr) memcheck/tests/linux/rfcomm (stderr) none/tests/fdleak_cmsg_supp (stderr) New for Valgrind-3.24.0.RC1 none/tests/fdleak_cmsg_xml (stderr) New for Valgrind-3.24.0.RC1 none/tests/fdleak_ipv4_xml (stderr) New for Valgrind-3.24.0.RC1 none/tests/socket_close_xml (stderr) New for Valgrind-3.24.0.RC1 PowerPC testing on Power 10, I am seeing 4 additional stderr failures versus Valgrind 3.23.0.RC2 == 753 tests, 5 stderr failures, 0 stdout failures, 0 stderrB failures, 0 stdoutB failures, 0 post failures == memcheck/tests/linux/rfcomm (stderr) none/tests/fdleak_cmsg_supp (stderr) New for Valgrind-3.24.0.RC1 none/tests/fdleak_cmsg_xml (stderr) New for Valgrind-3.24.0.RC1 none/tests/fdleak_ipv4_xml (stderr) New for Valgrind-3.24.0.RC1 none/tests/socket_close_xml (stderr) New for Valgrind-3.24.0.RC1 I am not sure what is going on with these tests. I have not yet been able to dig into them. Carl On 10/27/24 4:58 PM, Mark Wielaard wrote: > There are still some pending patches, but lets do an RC1 for some > wider testing. > > An RC1 tarball for 3.24.0 is now available at > https://sourceware.org/pub/valgrind/valgrind-3.24.0.RC1.tar.bz2 > (md5sum = a11f33c94dcb0f545a27464934b6fef8) > (sha1sum = b87105b23d3b6d0e212d5729235d0d8225ff8851) > https://sourceware.org/pub/valgrind/valgrind-3.24.0.RC1.tar.bz2.asc > > Please give it a try in configurations that are important for you and > report any problems you have, either on this mailing list, or > (preferably) via our bug tracker at > https://bugs.kde.org/enter_bug.cgi?product=valgrind > > If nothing critical emerges a final release will happen on Thursday 31 > October. > > > _______________________________________________ > Valgrind-users mailing list > Val...@li... > https://lists.sourceforge.net/lists/listinfo/valgrind-users |
From: Paul F. <pa...@so...> - 2024-10-28 19:37:09
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=f29bc61a22097c4e5ca966ad874647ef596f0327 commit f29bc61a22097c4e5ca966ad874647ef596f0327 Author: Paul Floyd <pj...@wa...> Date: Mon Oct 28 20:36:17 2024 +0100 Bug 495469 - aligned_alloc and posix_memalign missing MALLOC_TRACE with returned pointer Diff: --- NEWS | 2 ++ coregrind/m_replacemalloc/vg_replace_malloc.c | 15 +++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/NEWS b/NEWS index 74679b34ca..8fb685ffaa 100644 --- a/NEWS +++ b/NEWS @@ -83,6 +83,8 @@ are not entered into bugzilla tend to get forgotten about or ignored. 494252 s390x: incorrect disassembly for LOCHI and friends 495278 PowerPC instruction dcbf should allow the L field values of 4, 6 on ISA 3.0 and earlier, just ignore the value +495469 aligned_alloc and posix_memalign missing MALLOC_TRACE with returned + pointer n-i-bz Improve messages for sigaltstack errors, use specific stack_t member names diff --git a/coregrind/m_replacemalloc/vg_replace_malloc.c b/coregrind/m_replacemalloc/vg_replace_malloc.c index c8f93bc42d..4125479b82 100644 --- a/coregrind/m_replacemalloc/vg_replace_malloc.c +++ b/coregrind/m_replacemalloc/vg_replace_malloc.c @@ -1781,6 +1781,7 @@ extern int * __error(void) __attribute__((weak)); MALLOC_TRACE("reallocarray(%p,%llu,%llu)", ptrV, (ULong)nmemb, (ULong)size ); \ if (nmemb > 0 && (SizeT)-1 / nmemb < size) { \ SET_ERRNO_ENOMEM; \ + MALLOC_TRACE(" = 0\n"); \ return NULL; \ } \ v = (void*)VALGRIND_NON_SIMD_CALL2( info.tl_realloc, ptrV, nmemb*size ); \ @@ -1987,6 +1988,7 @@ extern int * __error(void) __attribute__((weak)); (alignment & (alignment - 1)) != 0) || \ (VG_MEMALIGN_ALIGN_FACTOR_FOUR && (alignment % 4 != 0))) { \ SET_ERRNO_EINVAL; \ + MALLOC_TRACE(" = 0\n"); \ return 0; \ } \ /* Round up to minimum alignment if necessary. */ \ @@ -2006,6 +2008,8 @@ extern int * __error(void) __attribute__((weak)); if (!mem) \ SET_ERRNO_ENOMEM; \ \ + MALLOC_TRACE(" = %p\n", mem); \ + \ return mem; \ } @@ -2049,6 +2053,8 @@ extern int * __error(void) __attribute__((weak)); \ if (!mem) SET_ERRNO_ENOMEM; \ \ + MALLOC_TRACE(" = %p\n", mem); \ + \ return mem; \ } @@ -2188,12 +2194,14 @@ extern int * __error(void) __attribute__((weak)); if (alignment == 0 \ || alignment % sizeof (void *) != 0 \ || (alignment & (alignment - 1)) != 0) { \ + MALLOC_TRACE(" = 0\n"); \ return VKI_EINVAL; \ } \ if (VG_POSIX_MEMALIGN_SIZE_0_RETURN_NULL && \ size == 0U) { \ /* no allocation for zero size on Solaris/Illumos */ \ *memptr = NULL; \ + MALLOC_TRACE(" = 0\n"); \ return 0; \ } \ /* Round up to minimum alignment if necessary. */ \ @@ -2203,6 +2211,8 @@ extern int * __error(void) __attribute__((weak)); mem = (void*)VALGRIND_NON_SIMD_CALL3( info.tl_memalign, \ alignment, orig_alignment, size ); \ \ + MALLOC_TRACE(" = %p\n", mem); \ + \ if (mem != NULL) { \ *memptr = mem; \ return 0; \ @@ -2328,6 +2338,8 @@ extern int * __error(void) __attribute__((weak)); mem = (void*)VALGRIND_NON_SIMD_CALL3( info.tl_memalign, \ alignment, orig_alignment, size ); \ \ + MALLOC_TRACE(" = %p\n", mem); \ + \ return mem; \ } @@ -2353,6 +2365,7 @@ extern int * __error(void) __attribute__((weak)); || (VG_ALIGNED_ALLOC_ALIGN_POWER_TWO && (alignment & (alignment - 1)) != 0) \ || (VG_ALIGNED_ALLOC_ALIGN_FACTOR_FOUR && (alignment % 4 != 0))) { \ SET_ERRNO_EINVAL; \ + MALLOC_TRACE(" = 0\n"); \ return 0; \ } \ \ @@ -2367,6 +2380,8 @@ extern int * __error(void) __attribute__((weak)); \ if (!mem) SET_ERRNO_ENOMEM; \ \ + MALLOC_TRACE(" = %p\n", mem); \ + \ return mem; \ } #endif |
From: Paul F. <pa...@so...> - 2024-10-28 18:59:13
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=a162f24d2ad9e0a2d4f88d937c4e34a7ae4e8336 commit a162f24d2ad9e0a2d4f88d937c4e34a7ae4e8336 Author: Paul Floyd <pj...@wa...> Date: Mon Oct 28 19:56:37 2024 +0100 Linux regtest: update arm64 expected with sigaltstack extra details. Diff: --- memcheck/tests/arm64-linux/scalar.stderr.exp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/memcheck/tests/arm64-linux/scalar.stderr.exp b/memcheck/tests/arm64-linux/scalar.stderr.exp index 4c81819b64..43a9bfff9b 100644 --- a/memcheck/tests/arm64-linux/scalar.stderr.exp +++ b/memcheck/tests/arm64-linux/scalar.stderr.exp @@ -1555,7 +1555,19 @@ Syscall param sigaltstack(oss) contains uninitialised byte(s) ... by 0x........: main (scalar.c:834) -Syscall param sigaltstack(ss) points to unaddressable byte(s) +Syscall param sigaltstack(ss->ss_sp) points to unaddressable byte(s) + ... + by 0x........: main (scalar.c:834) + Address 0x........ is on thread 1's stack + in frame #1, created by main (scalar.c:28) + +Syscall param sigaltstack(ss->ss_size) points to unaddressable byte(s) + ... + by 0x........: main (scalar.c:834) + Address 0x........ is on thread 1's stack + in frame #1, created by main (scalar.c:28) + +Syscall param sigaltstack(ss->ss_flags) points to unaddressable byte(s) ... by 0x........: main (scalar.c:834) Address 0x........ is on thread 1's stack |
From: Paul F. <pj...@wa...> - 2024-10-28 18:55:04
|
On 28-10-24 00:58, Mark Wielaard wrote: > There are still some pending patches, but lets do an RC1 for some > wider testing. Hi Mark I tested FreeBSD 14.1 arm64 and amd64 this morning, both OK. I'll try to do more testing tomorrow and Wednesday. There are a couple of bits that I'd like to push. This morning I noticed an arm64 regtest fail due to one of my changes. I'll see if I can get a change for https://bugs.kde.org/show_bug.cgi?id=495469 in. I think that I'm out of time for https://bugs.kde.org/show_bug.cgi?id=495488, I'll work on that after the release. A+ Paul |
From: Mark W. <ma...@kl...> - 2024-10-27 23:59:07
|
There are still some pending patches, but lets do an RC1 for some wider testing. An RC1 tarball for 3.24.0 is now available at https://sourceware.org/pub/valgrind/valgrind-3.24.0.RC1.tar.bz2 (md5sum = a11f33c94dcb0f545a27464934b6fef8) (sha1sum = b87105b23d3b6d0e212d5729235d0d8225ff8851) https://sourceware.org/pub/valgrind/valgrind-3.24.0.RC1.tar.bz2.asc Please give it a try in configurations that are important for you and report any problems you have, either on this mailing list, or (preferably) via our bug tracker at https://bugs.kde.org/enter_bug.cgi?product=valgrind If nothing critical emerges a final release will happen on Thursday 31 October. |
From: Mark W. <ma...@so...> - 2024-10-27 23:36:32
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=1ad4fbf86a8771358bd6f413e5b04af07d45cbcb commit 1ad4fbf86a8771358bd6f413e5b04af07d45cbcb Author: Mark Wielaard <ma...@kl...> Date: Mon Oct 28 00:13:19 2024 +0100 Set version to 3.24.0-RC1 Also update vg-lifespan which is used for documentation copyright years. Diff: --- NEWS | 4 ++-- configure.ac | 4 ++-- docs/xml/vg-entities.xml.in | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/NEWS b/NEWS index acefe24188..74679b34ca 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,4 @@ -Release 3.24.0 (?? Oct 2024) +Release 3.24.0.RC1 (27 Oct 2024) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This release supports X86/Linux, AMD64/Linux, ARM32/Linux, ARM64/Linux, @@ -90,7 +90,7 @@ To see details of a given bug, visit https://bugs.kde.org/show_bug.cgi?id=XXXXXX where XXXXXX is the bug number as listed above. -(3.24.0.RC1: ?? Oct 2024) +(3.24.0.RC1: 27 Oct 2024) Release 3.23.0 (26 Apr 2024) diff --git a/configure.ac b/configure.ac index 23e4901060..9670d02b88 100755 --- a/configure.ac +++ b/configure.ac @@ -17,8 +17,8 @@ m4_define([v_major_ver], [3]) m4_define([v_minor_ver], [24]) m4_define([v_micro_ver], [0]) -m4_define([v_suffix_ver], [GIT]) -m4_define([v_rel_date], ["?? Oct 2024"]) +m4_define([v_suffix_ver], [RC1]) +m4_define([v_rel_date], ["27 Oct 2024"]) m4_define([v_version], m4_if(v_suffix_ver, [], [v_major_ver.v_minor_ver.v_micro_ver], diff --git a/docs/xml/vg-entities.xml.in b/docs/xml/vg-entities.xml.in index 0d2a4313c3..2feaeec2f2 100644 --- a/docs/xml/vg-entities.xml.in +++ b/docs/xml/vg-entities.xml.in @@ -2,7 +2,7 @@ <!ENTITY vg-jemail "ju...@va..."> <!ENTITY vg-vemail "val...@va..."> <!ENTITY cl-email "Jos...@gm..."> -<!ENTITY vg-lifespan "2000-2022"> +<!ENTITY vg-lifespan "2000-2024"> <!-- valgrind release + version stuff --> <!ENTITY rel-type "Release"> |
From: Paul F. <pa...@so...> - 2024-10-27 20:59:15
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=5bc26782d6c917e4ee411ce4b8b2d530e780a25c commit 5bc26782d6c917e4ee411ce4b8b2d530e780a25c Author: Paul Floyd <pj...@wa...> Date: Sun Oct 27 22:58:32 2024 +0100 FreeBSD regtest: final part of scalar rationalisation, x86 expected Diff: --- memcheck/tests/freebsd/scalar.stderr.exp-x86 | 186 +++++++++++++++++++++++++++ 1 file changed, 186 insertions(+) diff --git a/memcheck/tests/freebsd/scalar.stderr.exp-x86 b/memcheck/tests/freebsd/scalar.stderr.exp-x86 index 290cc163b1..cce726e1d6 100644 --- a/memcheck/tests/freebsd/scalar.stderr.exp-x86 +++ b/memcheck/tests/freebsd/scalar.stderr.exp-x86 @@ -610,6 +610,7 @@ Syscall param mprotect(len) contains uninitialised byte(s) Syscall param mprotect(prot) contains uninitialised byte(s) ... +Warning: client syscall mprotect tried to modify addresses 0x........-0x........ --------------------------------------------------------- 75: SYS_madvise 3s 0m --------------------------------------------------------- @@ -5596,6 +5597,191 @@ Syscall param __sysctlbyname(newp) points to unaddressable byte(s) ... Address 0x........ is not stack'd, malloc'd or (recently) free'd +--------------------------------------------------------- +571: SYS_shm_open2 5s 2m +--------------------------------------------------------- +Syscall param shm_open2(path) contains uninitialised byte(s) + ... + +Syscall param shm_open2(flags) contains uninitialised byte(s) + ... + +Syscall param shm_open2(mode) contains uninitialised byte(s) + ... + +Syscall param shm_open2(shmflags) contains uninitialised byte(s) + ... + +Syscall param shm_open2(name) contains uninitialised byte(s) + ... + +Syscall param shm_open2(path) points to unaddressable byte(s) + ... + Address 0x........ is not stack'd, malloc'd or (recently) free'd + +Syscall param shm_open2(name) points to unaddressable byte(s) + ... + Address 0x........ is not stack'd, malloc'd or (recently) free'd + +--------------------------------------------------------- +571: SYS_shm_open2 5s 1m +--------------------------------------------------------- +Syscall param shm_open2(path) contains uninitialised byte(s) + ... + +Syscall param shm_open2(flags) contains uninitialised byte(s) + ... + +Syscall param shm_open2(mode) contains uninitialised byte(s) + ... + +Syscall param shm_open2(shmflags) contains uninitialised byte(s) + ... + +Syscall param shm_open2(name) contains uninitialised byte(s) + ... + +Syscall param shm_open2(name) points to unaddressable byte(s) + ... + Address 0x........ is not stack'd, malloc'd or (recently) free'd + +--------------------------------------------------------- +574: SYS___realpathat 5s 2m +--------------------------------------------------------- +Syscall param __realpathat(fd) contains uninitialised byte(s) + ... + +Syscall param __realpathat(path) contains uninitialised byte(s) + ... + +Syscall param __realpathat(buf) contains uninitialised byte(s) + ... + +Syscall param __realpathat(size) contains uninitialised byte(s) + ... + +Syscall param __realpathat(flags) contains uninitialised byte(s) + ... + +Syscall param __realpathat(path) points to unaddressable byte(s) + ... + Address 0x........ is not stack'd, malloc'd or (recently) free'd + +Syscall param __realpathat(buf) points to unaddressable byte(s) + ... + Address 0x........ is not stack'd, malloc'd or (recently) free'd + +--------------------------------------------------------- +575: SYS_close_range 3s 0m +--------------------------------------------------------- +Syscall param close_range(lowfd) contains uninitialised byte(s) + ... + +Syscall param close_range(highfd) contains uninitialised byte(s) + ... + +Syscall param close_range(flags) contains uninitialised byte(s) + ... + +--------------------------------------------------------- +577: SYS___specialfd 3s 1m +--------------------------------------------------------- +Syscall param __specialfd(type) contains uninitialised byte(s) + ... + +Syscall param __specialfd(req) contains uninitialised byte(s) + ... + +Syscall param __specialfd(len) contains uninitialised byte(s) + ... + +Syscall param __specialfd(req) points to unaddressable byte(s) + ... + Address 0x........ is not stack'd, malloc'd or (recently) free'd + +--------------------------------------------------------- +578: SYS_aio_writev 1s 1m +--------------------------------------------------------- +Syscall param aio_writev(iocb) contains uninitialised byte(s) + ... + +Syscall param aio_writev(iocb) points to unaddressable byte(s) + ... + Address 0x........ is not stack'd, malloc'd or (recently) free'd + +--------------------------------------------------------- +579: SYS_aio_readv 1s 1m +--------------------------------------------------------- +Syscall param aio_readv(iocb) contains uninitialised byte(s) + ... + +Syscall param aio_readv(iocb) points to unaddressable byte(s) + ... + Address 0x........ is not stack'd, malloc'd or (recently) free'd + +--------------------------------------------------------- +583: SYS_kqueuex 1s 0m +--------------------------------------------------------- +Syscall param kqueuex(flags) contains uninitialised byte(s) + ... + +--------------------------------------------------------- +584: SYS_membarrier 3s 0m +--------------------------------------------------------- +Syscall param membarrier(cmd) contains uninitialised byte(s) + ... + +Syscall param membarrier(flags) contains uninitialised byte(s) + ... + +Syscall param membarrier(cpu_id) contains uninitialised byte(s) + ... + +--------------------------------------------------------- +585: SYS_timerfd_create 2s 0m +--------------------------------------------------------- +Syscall param timerfd_create(clockid) contains uninitialised byte(s) + ... + +Syscall param timerfd_create(flags) contains uninitialised byte(s) + ... + +--------------------------------------------------------- +586: SYS_timerfd_gettime 2s 1m +--------------------------------------------------------- +Syscall param timerfd_gettime(fd) contains uninitialised byte(s) + ... + +Syscall param timerfd_gettime(curr_value) contains uninitialised byte(s) + ... + +Syscall param timerfd_gettime(curr_value) points to unaddressable byte(s) + ... + Address 0x........ is not stack'd, malloc'd or (recently) free'd + +--------------------------------------------------------- +587: SYS_timerfd_settime 4s 2m +--------------------------------------------------------- +Syscall param timerfd_settime(fd) contains uninitialised byte(s) + ... + +Syscall param timerfd_settime(flags) contains uninitialised byte(s) + ... + +Syscall param timerfd_settime(new_value) contains uninitialised byte(s) + ... + +Syscall param timerfd_settime(old_value) contains uninitialised byte(s) + ... + +Syscall param timerfd_settime(new_value) points to unaddressable byte(s) + ... + Address 0x........ is not stack'd, malloc'd or (recently) free'd + +Syscall param timerfd_settime(old_value) points to unaddressable byte(s) + ... + Address 0x........ is not stack'd, malloc'd or (recently) free'd + --------------------------------------------------------- 1: SYS_exit 1s 0m --------------------------------------------------------- |
From: Paul F. <pa...@so...> - 2024-10-27 20:56:34
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=57a1c75bb2f2bd29582aa8fcac3eaa12c20e4e74 commit 57a1c75bb2f2bd29582aa8fcac3eaa12c20e4e74 Author: Paul Floyd <pj...@wa...> Date: Sun Oct 27 21:54:55 2024 +0100 FreeBSD regtest: add fakes for older versions in scalar Syscalls added for FreeBSD 15 or thereabouts. Diff: --- memcheck/tests/freebsd/scalar.c | 53 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/memcheck/tests/freebsd/scalar.c b/memcheck/tests/freebsd/scalar.c index 8ddf408c07..5aecfebacf 100644 --- a/memcheck/tests/freebsd/scalar.c +++ b/memcheck/tests/freebsd/scalar.c @@ -2325,6 +2325,10 @@ int main(void) GO(SYS_kqueuex, " 1s 0m"); SY(SYS_kqueuex, x0+123); FAIL; #else + FAKE_GO("583: SYS_kqueuex 1s 0m"); + FAKE_SY("Syscall param kqueuex(flags) contains uninitialised byte(s)\n"); + FAKE_SY(" ...\n"); + FAKE_SY("\n"); #endif /* SYS_membarrier 584 */ @@ -2332,6 +2336,16 @@ int main(void) GO(SYS_membarrier, " 3s 0m"); SY(SYS_membarrier, x0+123, x0+456, x0+789); FAIL; #else + FAKE_GO("584: SYS_membarrier 3s 0m"); + FAKE_SY("Syscall param membarrier(cmd) contains uninitialised byte(s)\n"); + FAKE_SY(" ...\n"); + FAKE_SY("\n"); + FAKE_SY("Syscall param membarrier(flags) contains uninitialised byte(s)\n"); + FAKE_SY(" ...\n"); + FAKE_SY("\n"); + FAKE_SY("Syscall param membarrier(cpu_id) contains uninitialised byte(s)\n"); + FAKE_SY(" ...\n"); + FAKE_SY("\n"); #endif /* SYS_timerfd_create 585 */ @@ -2339,6 +2353,13 @@ int main(void) GO(SYS_timerfd_create, " 2s 0m"); SY(SYS_timerfd_create, x0+123, x0+23456); FAIL; #else + FAKE_GO("585: SYS_timerfd_create 2s 0m"); + FAKE_SY("Syscall param timerfd_create(clockid) contains uninitialised byte(s)\n"); + FAKE_SY(" ...\n"); + FAKE_SY("\n"); + FAKE_SY("Syscall param timerfd_create(flags) contains uninitialised byte(s)\n"); + FAKE_SY(" ...\n"); + FAKE_SY("\n"); #endif /* SYS_timerfd_gettime 586 */ @@ -2346,6 +2367,17 @@ int main(void) GO(SYS_timerfd_gettime, " 2s 1m"); SY(SYS_timerfd_gettime, x0+100, x0); FAIL; #else + FAKE_GO("586: SYS_timerfd_gettime 2s 1m"); + FAKE_SY("Syscall param timerfd_gettime(fd) contains uninitialised byte(s)\n"); + FAKE_SY(" ...\n"); + FAKE_SY("\n"); + FAKE_SY("Syscall param timerfd_gettime(curr_value) contains uninitialised byte(s)\n"); + FAKE_SY(" ...\n"); + FAKE_SY("\n"); + FAKE_SY("Syscall param timerfd_gettime(curr_value) points to unaddressable byte(s)\n"); + FAKE_SY(" ...\n"); + FAKE_SY(" Address 0x........ is not stack'd, malloc'd or (recently) free'd\n"); + FAKE_SY("\n"); #endif /* SYS_timerfd_settime 587 */ @@ -2353,6 +2385,27 @@ int main(void) GO(SYS_timerfd_settime, "4s 2m"); SY(SYS_timerfd_settime, x0+321, x0, x0+10, x0+5); FAIL; #else + FAKE_GO("587: SYS_timerfd_settime 4s 2m"); + FAKE_SY("Syscall param timerfd_settime(fd) contains uninitialised byte(s)\n"); + FAKE_SY(" ...\n"); + FAKE_SY("\n"); + FAKE_SY("Syscall param timerfd_settime(flags) contains uninitialised byte(s)\n"); + FAKE_SY(" ...\n"); + FAKE_SY("\n"); + FAKE_SY("Syscall param timerfd_settime(new_value) contains uninitialised byte(s)\n"); + FAKE_SY(" ...\n"); + FAKE_SY("\n"); + FAKE_SY("Syscall param timerfd_settime(old_value) contains uninitialised byte(s)\n"); + FAKE_SY(" ...\n"); + FAKE_SY("\n"); + FAKE_SY("Syscall param timerfd_settime(new_value) points to unaddressable byte(s)\n"); + FAKE_SY(" ...\n"); + FAKE_SY(" Address 0x........ is not stack'd, malloc'd or (recently) free'd\n"); + FAKE_SY("\n"); + FAKE_SY("Syscall param timerfd_settime(old_value) points to unaddressable byte(s)\n"); + FAKE_SY(" ...\n"); + FAKE_SY(" Address 0x........ is not stack'd, malloc'd or (recently) free'd\n"); + FAKE_SY("\n"); #endif /* SYS_exit 1 */ |
From: Paul F. <pa...@so...> - 2024-10-27 20:22:43
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=94bca9b9fc14e1c7a1c3a2848cbbacdee3a649ed commit 94bca9b9fc14e1c7a1c3a2848cbbacdee3a649ed Author: Paul Floyd <pj...@wa...> Date: Sun Oct 27 21:21:51 2024 +0100 FreeBSD regtest: remove scalar for version 15+ Now also merged into scalar.c Diff: --- .gitignore | 1 - configure.ac | 17 ------- memcheck/tests/freebsd/Makefile.am | 7 --- memcheck/tests/freebsd/scalar.c | 36 ++++++++++++++ memcheck/tests/freebsd/scalar.stderr.exp | 63 ++++++++++++++++++++++++ memcheck/tests/freebsd/scalar_15_plus.c | 31 ------------ memcheck/tests/freebsd/scalar_15_plus.stderr.exp | 63 ------------------------ memcheck/tests/freebsd/scalar_15_plus.vgtest | 12 ----- 8 files changed, 99 insertions(+), 131 deletions(-) diff --git a/.gitignore b/.gitignore index 9757543e68..1b6e2d002b 100644 --- a/.gitignore +++ b/.gitignore @@ -1433,7 +1433,6 @@ /memcheck/tests/freebsd/realpathat /memcheck/tests/freebsd/revoke /memcheck/tests/freebsd/scalar -/memcheck/tests/freebsd/scalar_15_plus /memcheck/tests/freebsd/scalar_abort2 /memcheck/tests/freebsd/scalar_fork /memcheck/tests/freebsd/scalar_pdfork diff --git a/configure.ac b/configure.ac index 39885a63c3..23e4901060 100755 --- a/configure.ac +++ b/configure.ac @@ -4815,29 +4815,12 @@ AC_MSG_RESULT([no]) ]) AM_CONDITIONAL(FREEBSD_TIMERFD_SYSCALL, test x$freebsd_timerfd_syscall = xyes) -AC_MSG_CHECKING([for syscalls only in FreeBSD 15 and later]) -AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ -#include <sys/syscall.h> -]], [[ - return !SYS_getrlimitusage; -]])], [ -freebsd_syscall15=yes -AC_MSG_RESULT([yes]) -AC_DEFINE([FREEBSD_SYSCALL15], 1, - [Define to 1 if you are using FreeBSD 15 or later.]) -], [ -freebsd_syscall15=no -AC_MSG_RESULT([no]) -]) -AM_CONDITIONAL(FREEBSD_SYSCALL15, test x$freebsd_syscall15 = xyes) - else AM_CONDITIONAL(FREEBSD_EVENTFD, false) AM_CONDITIONAL(FREEBSD_REALPATHAT_SYSCALL, false) AM_CONDITIONAL(FREEBSD_KQUEUEX_SYSCALL, false) AM_CONDITIONAL(FREEBSD_TIMERFD_SYSCALL, false) -AM_CONDITIONAL(FREEBSD_SYSCALL15, false) fi # test "$VGCONF_OS" = "freebsd" diff --git a/memcheck/tests/freebsd/Makefile.am b/memcheck/tests/freebsd/Makefile.am index 4f7e35b393..b2e84fc03e 100644 --- a/memcheck/tests/freebsd/Makefile.am +++ b/memcheck/tests/freebsd/Makefile.am @@ -93,8 +93,6 @@ EXTRA_DIST = \ scalar.stderr.exp-x86 \ scalar.supp \ scalar_abort2.vgtest \ - scalar_15_plus.vgtest \ - scalar_15_plus.stderr.exp \ scalar_abort2.stderr.exp \ scalar_fork.vgtest \ scalar_fork.stderr.exp \ @@ -202,11 +200,6 @@ check_PROGRAMS += timerfd timerfd_LDFLAGS = -lm endif -if FREEBSD_SYSCALL15 -check_PROGRAMS += scalar_15_plus timerfd -scalar_15_plus_CFLAGS = ${AM_CFLAGS} -g -endif - aligned_alloc_CFLAGS = ${AM_CFLAGS} @FLAG_W_NO_NON_POWER_OF_TWO_ALIGNMENT@ delete_sized_mismatch_CXXFLAGS = ${AM_CXXFLAGS} --std=c++14 diff --git a/memcheck/tests/freebsd/scalar.c b/memcheck/tests/freebsd/scalar.c index bd34487b08..8ddf408c07 100644 --- a/memcheck/tests/freebsd/scalar.c +++ b/memcheck/tests/freebsd/scalar.c @@ -2319,6 +2319,42 @@ int main(void) FAKE_SY("\n"); #endif + // FreeBSD 15 (and any backports) + /* SYS_kqueuex 583 */ +#if defined(SYS_kqueuex) + GO(SYS_kqueuex, " 1s 0m"); + SY(SYS_kqueuex, x0+123); FAIL; +#else +#endif + + /* SYS_membarrier 584 */ +#if defined(SYS_membarrier) + GO(SYS_membarrier, " 3s 0m"); + SY(SYS_membarrier, x0+123, x0+456, x0+789); FAIL; +#else +#endif + + /* SYS_timerfd_create 585 */ +#if defined(SYS_timerfd_create) + GO(SYS_timerfd_create, " 2s 0m"); + SY(SYS_timerfd_create, x0+123, x0+23456); FAIL; +#else +#endif + + /* SYS_timerfd_gettime 586 */ +#if defined(SYS_timerfd_gettime) + GO(SYS_timerfd_gettime, " 2s 1m"); + SY(SYS_timerfd_gettime, x0+100, x0); FAIL; +#else +#endif + + /* SYS_timerfd_settime 587 */ +#if defined(SYS_timerfd_settime) + GO(SYS_timerfd_settime, "4s 2m"); + SY(SYS_timerfd_settime, x0+321, x0, x0+10, x0+5); FAIL; +#else +#endif + /* SYS_exit 1 */ GO(SYS_exit, "1s 0m"); SY(SYS_exit, x0); FAIL; diff --git a/memcheck/tests/freebsd/scalar.stderr.exp b/memcheck/tests/freebsd/scalar.stderr.exp index cdda0a7e0d..ed5f0a9b15 100644 --- a/memcheck/tests/freebsd/scalar.stderr.exp +++ b/memcheck/tests/freebsd/scalar.stderr.exp @@ -5647,6 +5647,69 @@ Syscall param aio_readv(iocb) points to unaddressable byte(s) ... Address 0x........ is not stack'd, malloc'd or (recently) free'd +--------------------------------------------------------- +583: SYS_kqueuex 1s 0m +--------------------------------------------------------- +Syscall param kqueuex(flags) contains uninitialised byte(s) + ... + +--------------------------------------------------------- +584: SYS_membarrier 3s 0m +--------------------------------------------------------- +Syscall param membarrier(cmd) contains uninitialised byte(s) + ... + +Syscall param membarrier(flags) contains uninitialised byte(s) + ... + +Syscall param membarrier(cpu_id) contains uninitialised byte(s) + ... + +--------------------------------------------------------- +585: SYS_timerfd_create 2s 0m +--------------------------------------------------------- +Syscall param timerfd_create(clockid) contains uninitialised byte(s) + ... + +Syscall param timerfd_create(flags) contains uninitialised byte(s) + ... + +--------------------------------------------------------- +586: SYS_timerfd_gettime 2s 1m +--------------------------------------------------------- +Syscall param timerfd_gettime(fd) contains uninitialised byte(s) + ... + +Syscall param timerfd_gettime(curr_value) contains uninitialised byte(s) + ... + +Syscall param timerfd_gettime(curr_value) points to unaddressable byte(s) + ... + Address 0x........ is not stack'd, malloc'd or (recently) free'd + +--------------------------------------------------------- +587: SYS_timerfd_settime 4s 2m +--------------------------------------------------------- +Syscall param timerfd_settime(fd) contains uninitialised byte(s) + ... + +Syscall param timerfd_settime(flags) contains uninitialised byte(s) + ... + +Syscall param timerfd_settime(new_value) contains uninitialised byte(s) + ... + +Syscall param timerfd_settime(old_value) contains uninitialised byte(s) + ... + +Syscall param timerfd_settime(new_value) points to unaddressable byte(s) + ... + Address 0x........ is not stack'd, malloc'd or (recently) free'd + +Syscall param timerfd_settime(old_value) points to unaddressable byte(s) + ... + Address 0x........ is not stack'd, malloc'd or (recently) free'd + --------------------------------------------------------- 1: SYS_exit 1s 0m --------------------------------------------------------- diff --git a/memcheck/tests/freebsd/scalar_15_plus.c b/memcheck/tests/freebsd/scalar_15_plus.c deleted file mode 100644 index b417c14373..0000000000 --- a/memcheck/tests/freebsd/scalar_15_plus.c +++ /dev/null @@ -1,31 +0,0 @@ -#include "scalar.h" -#include <sys/mman.h> - -int main(void) -{ - long *px = malloc(2*sizeof(long)); - x0 = px[0]; - - /* SYS_kqueuex 583 */ - GO(SYS_kqueuex, " 1s 0m"); - SY(SYS_kqueuex, x0+123); FAIL; - - /* SYS_membarrier 584 */ - GO(SYS_membarrier, " 3s 0m"); - SY(SYS_membarrier, x0+123, x0+456, x0+789); FAIL; - - /* SYS_timerfd_create 585 */ - GO(SYS_timerfd_create, " 2s 0m"); - SY(SYS_timerfd_create, x0+123, x0+23456); FAIL; - - /* SYS_timerfd_gettime 586 */ - GO(SYS_timerfd_gettime, " 2s 1m"); - SY(SYS_timerfd_gettime, x0+100, x0); FAIL; - - /* SYS_timerfd_settime 587 */ - GO(SYS_timerfd_settime, "4s 2m"); - SY(SYS_timerfd_settime, x0+321, x0, x0+10, x0+5); FAIL; - - return(0); -} - diff --git a/memcheck/tests/freebsd/scalar_15_plus.stderr.exp b/memcheck/tests/freebsd/scalar_15_plus.stderr.exp deleted file mode 100644 index b95f3ab12e..0000000000 --- a/memcheck/tests/freebsd/scalar_15_plus.stderr.exp +++ /dev/null @@ -1,63 +0,0 @@ ---------------------------------------------------------- -583: SYS_kqueuex 1s 0m ---------------------------------------------------------- -Syscall param kqueuex(flags) contains uninitialised byte(s) - ... - ---------------------------------------------------------- -584: SYS_membarrier 3s 0m ---------------------------------------------------------- -Syscall param membarrier(cmd) contains uninitialised byte(s) - ... - -Syscall param membarrier(flags) contains uninitialised byte(s) - ... - -Syscall param membarrier(cpu_id) contains uninitialised byte(s) - ... - ---------------------------------------------------------- -585: SYS_timerfd_create 2s 0m ---------------------------------------------------------- -Syscall param timerfd_create(clockid) contains uninitialised byte(s) - ... - -Syscall param timerfd_create(flags) contains uninitialised byte(s) - ... - ---------------------------------------------------------- -586: SYS_timerfd_gettime 2s 1m ---------------------------------------------------------- -Syscall param timerfd_gettime(fd) contains uninitialised byte(s) - ... - -Syscall param timerfd_gettime(curr_value) contains uninitialised byte(s) - ... - -Syscall param timerfd_gettime(curr_value) points to unaddressable byte(s) - ... - Address 0x........ is not stack'd, malloc'd or (recently) free'd - ---------------------------------------------------------- -587: SYS_timerfd_settime 4s 2m ---------------------------------------------------------- -Syscall param timerfd_settime(fd) contains uninitialised byte(s) - ... - -Syscall param timerfd_settime(flags) contains uninitialised byte(s) - ... - -Syscall param timerfd_settime(new_value) contains uninitialised byte(s) - ... - -Syscall param timerfd_settime(old_value) contains uninitialised byte(s) - ... - -Syscall param timerfd_settime(new_value) points to unaddressable byte(s) - ... - Address 0x........ is not stack'd, malloc'd or (recently) free'd - -Syscall param timerfd_settime(old_value) points to unaddressable byte(s) - ... - Address 0x........ is not stack'd, malloc'd or (recently) free'd - diff --git a/memcheck/tests/freebsd/scalar_15_plus.vgtest b/memcheck/tests/freebsd/scalar_15_plus.vgtest deleted file mode 100644 index fe40176591..0000000000 --- a/memcheck/tests/freebsd/scalar_15_plus.vgtest +++ /dev/null @@ -1,12 +0,0 @@ -prereq: test -e ./scalar_15_plus -prog: scalar_15_plus -vgopts: -q --error-limit=no -stderr_filter: filter_scalar -# Remove all frames from the stack trace except the first one. -# This is important because syscall() function on x86 isn't ABI conformant -# which confuses the Valgrind stack unwinder. -# Therefore x86 and amd64 stack traces are unified so that they contain only -# 'syscall (in libc)' stack frame and this is then filtered out completely. -stderr_filter_args: libc -args: < scalar_13_plus.c - |
From: Paul F. <pa...@so...> - 2024-10-27 19:17:58
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=fbec9641c6f09b2c41a1a37b16b52d0398dc0eb8 commit fbec9641c6f09b2c41a1a37b16b52d0398dc0eb8 Author: Paul Floyd <pj...@wa...> Date: Sun Oct 27 20:17:03 2024 +0100 FreeBSD regtest: remove test for version 13+ syscalls Now merged into main scalar.c Diff: --- .gitignore | 1 - configure.ac | 17 ---- memcheck/tests/freebsd/Makefile.am | 7 -- memcheck/tests/freebsd/scalar_13_plus.c | 38 ------- memcheck/tests/freebsd/scalar_13_plus.stderr.exp | 122 ----------------------- memcheck/tests/freebsd/scalar_13_plus.vgtest | 12 --- 6 files changed, 197 deletions(-) diff --git a/.gitignore b/.gitignore index 8275e9f901..9757543e68 100644 --- a/.gitignore +++ b/.gitignore @@ -1433,7 +1433,6 @@ /memcheck/tests/freebsd/realpathat /memcheck/tests/freebsd/revoke /memcheck/tests/freebsd/scalar -/memcheck/tests/freebsd/scalar_13_plus /memcheck/tests/freebsd/scalar_15_plus /memcheck/tests/freebsd/scalar_abort2 /memcheck/tests/freebsd/scalar_fork diff --git a/configure.ac b/configure.ac index 7a740a2da5..39885a63c3 100755 --- a/configure.ac +++ b/configure.ac @@ -4783,22 +4783,6 @@ AC_MSG_RESULT([no]) ]) AM_CONDITIONAL(FREEBSD_REALPATHAT_SYSCALL, test x$freebsd_realpathat_syscall = xyes) -AC_MSG_CHECKING([for syscalls only in FreeBSD 13 and later]) -AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ -#include <sys/syscall.h> -]], [[ - return !SYS_aio_readv; -]])], [ -freebsd_syscall13=yes -AC_MSG_RESULT([yes]) -AC_DEFINE([FREEBSD_SYSCALL13], 1, - [Define to 1 if you are using FreeBSD 13 or later.]) -], [ -freebsd_syscall13=no -AC_MSG_RESULT([no]) -]) -AM_CONDITIONAL(FREEBSD_SYSCALL13, test x$freebsd_syscall13 = xyes) - AC_MSG_CHECKING([for the SYS_kqueuex syscall (FreeBSD-specific)]) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/syscall.h> @@ -4851,7 +4835,6 @@ else AM_CONDITIONAL(FREEBSD_EVENTFD, false) AM_CONDITIONAL(FREEBSD_REALPATHAT_SYSCALL, false) -AM_CONDITIONAL(FREEBSD_SYSCALL13, false) AM_CONDITIONAL(FREEBSD_KQUEUEX_SYSCALL, false) AM_CONDITIONAL(FREEBSD_TIMERFD_SYSCALL, false) AM_CONDITIONAL(FREEBSD_SYSCALL15, false) diff --git a/memcheck/tests/freebsd/Makefile.am b/memcheck/tests/freebsd/Makefile.am index 0a144cd3d2..4f7e35b393 100644 --- a/memcheck/tests/freebsd/Makefile.am +++ b/memcheck/tests/freebsd/Makefile.am @@ -93,8 +93,6 @@ EXTRA_DIST = \ scalar.stderr.exp-x86 \ scalar.supp \ scalar_abort2.vgtest \ - scalar_13_plus.vgtest \ - scalar_13_plus.stderr.exp \ scalar_15_plus.vgtest \ scalar_15_plus.stderr.exp \ scalar_abort2.stderr.exp \ @@ -187,11 +185,6 @@ inlinfo_nested_so_LDFLAGS = -Wl,-rpath,$(top_builddir)/memcheck/tests/freebsd -s bug464476_SOURCES = bug464476.cpp bug470713_SOURCES = bug470713.cpp -if FREEBSD_SYSCALL13 -check_PROGRAMS += scalar_13_plus -scalar_13_plus_CFLAGS = ${AM_CFLAGS} -g -endif - if FREEBSD_EVENTFD check_PROGRAMS += eventfd1 eventfd2 endif diff --git a/memcheck/tests/freebsd/scalar_13_plus.c b/memcheck/tests/freebsd/scalar_13_plus.c deleted file mode 100644 index 799dcfc8b7..0000000000 --- a/memcheck/tests/freebsd/scalar_13_plus.c +++ /dev/null @@ -1,38 +0,0 @@ -#include "scalar.h" -#include <sys/mman.h> - -int main(void) -{ - long *px = malloc(2*sizeof(long)); - x0 = px[0]; - - /* SYS_shm_open2 571 */ - GO(SYS_shm_open2, " 5s 2m"); - SY(SYS_shm_open2, x0+0xf00c, x0+1, x0+2, x0+3, x0+4); FAIL; - - GO(SYS_shm_open2, " 5s 1m"); - SY(SYS_shm_open2, x0+SHM_ANON, x0+1, x0+2, x0+3, x0+4); FAIL; - - /* SYS___realpathat 574 */ - GO(SYS___realpathat, " 5s 2m"); - SY(SYS___realpathat, x0+0xffff, x0, x0, x0+100, x0+2); FAIL; - - /* SYS_close_range 575 */ - GO(SYS_close_range, "3s 0m"); - SY(SYS_close_range, x0+5, x0+10, x0); SUCC; - - /* SYS___specialfd 577 */ - GO(SYS___specialfd, "3s 1m"); - SY(SYS___specialfd, x0+0xf000, x0+1, x0+10); FAIL; - - /* SYS_aio_writev 578 */ - GO(SYS_aio_writev, "1s 1m"); - SY(SYS_aio_writev, x0+1); FAIL; - - /* SYS_aio_readv 579 */ - GO(SYS_aio_readv, "1s 1m"); - SY(SYS_aio_readv, x0+1); FAIL; - - return(0); -} - diff --git a/memcheck/tests/freebsd/scalar_13_plus.stderr.exp b/memcheck/tests/freebsd/scalar_13_plus.stderr.exp deleted file mode 100644 index c7c2e4027b..0000000000 --- a/memcheck/tests/freebsd/scalar_13_plus.stderr.exp +++ /dev/null @@ -1,122 +0,0 @@ ---------------------------------------------------------- -571: SYS_shm_open2 5s 2m ---------------------------------------------------------- -Syscall param shm_open2(path) contains uninitialised byte(s) - ... - -Syscall param shm_open2(flags) contains uninitialised byte(s) - ... - -Syscall param shm_open2(mode) contains uninitialised byte(s) - ... - -Syscall param shm_open2(shmflags) contains uninitialised byte(s) - ... - -Syscall param shm_open2(name) contains uninitialised byte(s) - ... - -Syscall param shm_open2(path) points to unaddressable byte(s) - ... - Address 0x........ is not stack'd, malloc'd or (recently) free'd - -Syscall param shm_open2(name) points to unaddressable byte(s) - ... - Address 0x........ is not stack'd, malloc'd or (recently) free'd - ---------------------------------------------------------- -571: SYS_shm_open2 5s 1m ---------------------------------------------------------- -Syscall param shm_open2(path) contains uninitialised byte(s) - ... - -Syscall param shm_open2(flags) contains uninitialised byte(s) - ... - -Syscall param shm_open2(mode) contains uninitialised byte(s) - ... - -Syscall param shm_open2(shmflags) contains uninitialised byte(s) - ... - -Syscall param shm_open2(name) contains uninitialised byte(s) - ... - -Syscall param shm_open2(name) points to unaddressable byte(s) - ... - Address 0x........ is not stack'd, malloc'd or (recently) free'd - ---------------------------------------------------------- -574: SYS___realpathat 5s 2m ---------------------------------------------------------- -Syscall param __realpathat(fd) contains uninitialised byte(s) - ... - -Syscall param __realpathat(path) contains uninitialised byte(s) - ... - -Syscall param __realpathat(buf) contains uninitialised byte(s) - ... - -Syscall param __realpathat(size) contains uninitialised byte(s) - ... - -Syscall param __realpathat(flags) contains uninitialised byte(s) - ... - -Syscall param __realpathat(path) points to unaddressable byte(s) - ... - Address 0x........ is not stack'd, malloc'd or (recently) free'd - -Syscall param __realpathat(buf) points to unaddressable byte(s) - ... - Address 0x........ is not stack'd, malloc'd or (recently) free'd - ---------------------------------------------------------- -575: SYS_close_range 3s 0m ---------------------------------------------------------- -Syscall param close_range(lowfd) contains uninitialised byte(s) - ... - -Syscall param close_range(highfd) contains uninitialised byte(s) - ... - -Syscall param close_range(flags) contains uninitialised byte(s) - ... - ---------------------------------------------------------- -577: SYS___specialfd 3s 1m ---------------------------------------------------------- -Syscall param __specialfd(type) contains uninitialised byte(s) - ... - -Syscall param __specialfd(req) contains uninitialised byte(s) - ... - -Syscall param __specialfd(len) contains uninitialised byte(s) - ... - -Syscall param __specialfd(req) points to unaddressable byte(s) - ... - Address 0x........ is not stack'd, malloc'd or (recently) free'd - ---------------------------------------------------------- -578: SYS_aio_writev 1s 1m ---------------------------------------------------------- -Syscall param aio_writev(iocb) contains uninitialised byte(s) - ... - -Syscall param aio_writev(iocb) points to unaddressable byte(s) - ... - Address 0x........ is not stack'd, malloc'd or (recently) free'd - ---------------------------------------------------------- -579: SYS_aio_readv 1s 1m ---------------------------------------------------------- -Syscall param aio_readv(iocb) contains uninitialised byte(s) - ... - -Syscall param aio_readv(iocb) points to unaddressable byte(s) - ... - Address 0x........ is not stack'd, malloc'd or (recently) free'd - diff --git a/memcheck/tests/freebsd/scalar_13_plus.vgtest b/memcheck/tests/freebsd/scalar_13_plus.vgtest deleted file mode 100644 index 09dc90e90b..0000000000 --- a/memcheck/tests/freebsd/scalar_13_plus.vgtest +++ /dev/null @@ -1,12 +0,0 @@ -prereq: test -e ./scalar_13_plus -prog: scalar_13_plus -vgopts: -q --error-limit=no -stderr_filter: filter_scalar -# Remove all frames from the stack trace except the first one. -# This is important because syscall() function on x86 isn't ABI conformant -# which confuses the Valgrind stack unwinder. -# Therefore x86 and amd64 stack traces are unified so that they contain only -# 'syscall (in libc)' stack frame and this is then filtered out completely. -stderr_filter_args: libc -args: < scalar_13_plus.c - |
From: Paul F. <pa...@so...> - 2024-10-27 18:32:31
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=449c6a27fa246196fd8cccdb2445abdcec1c7f7a commit 449c6a27fa246196fd8cccdb2445abdcec1c7f7a Author: Paul Floyd <pj...@wa...> Date: Sun Oct 27 18:59:12 2024 +0100 FreeBSD regtest: add fakes for FreeBSD < 13 Also try again to make mprotect fail. It doesn't fail with a bogus 'prot' on FreeBSD 12.4. Diff: --- memcheck/tests/freebsd/scalar.c | 119 ++++++++++++++++++++++++++++++- memcheck/tests/freebsd/scalar.stderr.exp | 1 + memcheck/tests/freebsd/scalar.supp | 3 +- 3 files changed, 120 insertions(+), 3 deletions(-) diff --git a/memcheck/tests/freebsd/scalar.c b/memcheck/tests/freebsd/scalar.c index a1cfb06b14..bd34487b08 100644 --- a/memcheck/tests/freebsd/scalar.c +++ b/memcheck/tests/freebsd/scalar.c @@ -334,7 +334,7 @@ int main(void) /* SYS_mprotect 74 */ GO(SYS_mprotect, "3s 0m"); - SY(SYS_mprotect, x0+1, x0+1, x0+9999); FAIL; + SY(SYS_mprotect, x0+1, x0-10, x0+9999); FAIL; /* SYS_madvise 75 */ GO(SYS_madvise, "3s 0m"); @@ -2176,31 +2176,148 @@ int main(void) // FreeBSD 13 (and any backports) /* SYS_shm_open2 571 */ +#if defined(SYS_shm_open2) GO(SYS_shm_open2, " 5s 2m"); SY(SYS_shm_open2, x0+0xf00c, x0+1, x0+2, x0+3, x0+4); FAIL; GO(SYS_shm_open2, " 5s 1m"); SY(SYS_shm_open2, x0+SHM_ANON, x0+1, x0+2, x0+3, x0+4); FAIL; +#else + FAKE_GO("571: SYS_shm_open2 5s 2m"); + FAKE_SY("Syscall param shm_open2(path) contains uninitialised byte(s)\n"); + FAKE_SY(" ...\n"); + FAKE_SY("\n"); + FAKE_SY("Syscall param shm_open2(flags) contains uninitialised byte(s)\n"); + FAKE_SY(" ...\n"); + FAKE_SY("\n"); + FAKE_SY("Syscall param shm_open2(mode) contains uninitialised byte(s)\n"); + FAKE_SY(" ...\n"); + FAKE_SY("\n"); + FAKE_SY("Syscall param shm_open2(shmflags) contains uninitialised byte(s)\n"); + FAKE_SY(" ...\n"); + FAKE_SY("\n"); + FAKE_SY("Syscall param shm_open2(name) contains uninitialised byte(s)\n"); + FAKE_SY(" ...\n"); + FAKE_SY("\n"); + FAKE_SY("Syscall param shm_open2(path) points to unaddressable byte(s)\n"); + FAKE_SY(" ...\n"); + FAKE_SY(" Address 0x........ is not stack'd, malloc'd or (recently) free'd\n"); + FAKE_SY("\n"); + FAKE_SY("Syscall param shm_open2(name) points to unaddressable byte(s)\n"); + FAKE_SY(" ...\n"); + FAKE_SY(" Address 0x........ is not stack'd, malloc'd or (recently) free'd\n"); + FAKE_SY("\n"); + + FAKE_GO("571: SYS_shm_open2 5s 1m"); + FAKE_SY("Syscall param shm_open2(path) contains uninitialised byte(s)\n"); + FAKE_SY(" ...\n"); + FAKE_SY("\n"); + FAKE_SY("Syscall param shm_open2(flags) contains uninitialised byte(s)\n"); + FAKE_SY(" ...\n"); + FAKE_SY("\n"); + FAKE_SY("Syscall param shm_open2(mode) contains uninitialised byte(s)\n"); + FAKE_SY(" ...\n"); + FAKE_SY("\n"); + FAKE_SY("Syscall param shm_open2(shmflags) contains uninitialised byte(s)\n"); + FAKE_SY(" ...\n"); + FAKE_SY("\n"); + FAKE_SY("Syscall param shm_open2(name) contains uninitialised byte(s)\n"); + FAKE_SY(" ...\n"); + FAKE_SY("\n"); + FAKE_SY("Syscall param shm_open2(name) points to unaddressable byte(s)\n"); + FAKE_SY(" ...\n"); + FAKE_SY(" Address 0x........ is not stack'd, malloc'd or (recently) free'd\n"); + FAKE_SY("\n"); +#endif /* SYS___realpathat 574 */ +#if defined(SYS___realpathat) GO(SYS___realpathat, " 5s 2m"); SY(SYS___realpathat, x0+0xffff, x0, x0, x0+100, x0+2); FAIL; +#else + FAKE_GO("574: SYS___realpathat 5s 2m"); + FAKE_SY("Syscall param __realpathat(fd) contains uninitialised byte(s)\n"); + FAKE_SY(" ...\n"); + FAKE_SY("\n"); + FAKE_SY("Syscall param __realpathat(path) contains uninitialised byte(s)\n"); + FAKE_SY(" ...\n"); + FAKE_SY("\n"); + FAKE_SY("Syscall param __realpathat(buf) contains uninitialised byte(s)\n"); + FAKE_SY(" ...\n"); + FAKE_SY("\n"); + FAKE_SY("Syscall param __realpathat(size) contains uninitialised byte(s)\n"); + FAKE_SY(" ...\n"); + FAKE_SY("\n"); + FAKE_SY("Syscall param __realpathat(flags) contains uninitialised byte(s)\n"); + FAKE_SY(" ...\n"); + FAKE_SY("\n"); + FAKE_SY("Syscall param __realpathat(path) points to unaddressable byte(s)\n"); + FAKE_SY(" ...\n"); + FAKE_SY(" Address 0x........ is not stack'd, malloc'd or (recently) free'd\n"); + FAKE_SY("\n"); + FAKE_SY("Syscall param __realpathat(buf) points to unaddressable byte(s)\n"); + FAKE_SY(" ...\n"); + FAKE_SY(" Address 0x........ is not stack'd, malloc'd or (recently) free'd\n"); + FAKE_SY("\n"); +#endif /* SYS_close_range 575 */ +#if defined(SYS_close_range) GO(SYS_close_range, "3s 0m"); SY(SYS_close_range, x0+5, x0+10, x0+12345); FAIL; +#else +#endif /* SYS___specialfd 577 */ +#if defined(SYS___specialfd) GO(SYS___specialfd, "3s 1m"); SY(SYS___specialfd, x0+0xf000, x0+1, x0+10); FAIL; +#else + FAKE_GO("577: SYS___specialfd 3s 1m"); + FAKE_SY("Syscall param __specialfd(type) contains uninitialised byte(s)\n"); + FAKE_SY(" ...\n"); + FAKE_SY("\n"); + FAKE_SY("Syscall param __specialfd(req) contains uninitialised byte(s)\n"); + FAKE_SY(" ...\n"); + FAKE_SY("\n"); + FAKE_SY("Syscall param __specialfd(len) contains uninitialised byte(s)\n"); + FAKE_SY(" ...\n"); + FAKE_SY("\n"); + FAKE_SY("Syscall param __specialfd(req) points to unaddressable byte(s)\n"); + FAKE_SY(" ...\n"); + FAKE_SY(" Address 0x........ is not stack'd, malloc'd or (recently) free'd\n"); + FAKE_SY("\n"); +#endif /* SYS_aio_writev 578 */ +#if defined(SYS_aio_writev) GO(SYS_aio_writev, "1s 1m"); SY(SYS_aio_writev, x0+1); FAIL; +#else + FAKE_GO("578: SYS_aio_writev 1s 1m"); + FAKE_SY("Syscall param aio_writev(iocb) contains uninitialised byte(s)\n"); + FAKE_SY(" ...\n"); + FAKE_SY("\n"); + FAKE_SY("Syscall param aio_writev(iocb) points to unaddressable byte(s)\n"); + FAKE_SY(" ...\n"); + FAKE_SY(" Address 0x........ is not stack'd, malloc'd or (recently) free'd\n"); + FAKE_SY("\n"); +#endif /* SYS_aio_readv 579 */ +#if defined(SYS_aio_readv) GO(SYS_aio_readv, "1s 1m"); SY(SYS_aio_readv, x0+1); FAIL; +#else + FAKE_GO("579: SYS_aio_readv 1s 1m"); + FAKE_SY("Syscall param aio_readv(iocb) contains uninitialised byte(s)\n"); + FAKE_SY(" ...\n"); + FAKE_SY("\n"); + FAKE_SY("Syscall param aio_readv(iocb) points to unaddressable byte(s)\n"); + FAKE_SY(" ...\n"); + FAKE_SY(" Address 0x........ is not stack'd, malloc'd or (recently) free'd\n"); + FAKE_SY("\n"); +#endif /* SYS_exit 1 */ GO(SYS_exit, "1s 0m"); diff --git a/memcheck/tests/freebsd/scalar.stderr.exp b/memcheck/tests/freebsd/scalar.stderr.exp index db12726f55..cdda0a7e0d 100644 --- a/memcheck/tests/freebsd/scalar.stderr.exp +++ b/memcheck/tests/freebsd/scalar.stderr.exp @@ -610,6 +610,7 @@ Syscall param mprotect(len) contains uninitialised byte(s) Syscall param mprotect(prot) contains uninitialised byte(s) ... +Warning: client syscall mprotect tried to modify addresses 0x........-0x........ --------------------------------------------------------- 75: SYS_madvise 3s 0m --------------------------------------------------------- diff --git a/memcheck/tests/freebsd/scalar.supp b/memcheck/tests/freebsd/scalar.supp index f6b15a33ea..bf83845b59 100644 --- a/memcheck/tests/freebsd/scalar.supp +++ b/memcheck/tests/freebsd/scalar.supp @@ -1,4 +1,4 @@ -# not sure what causes this exactly# on x86 and amd64 (but not arm64) +# not sure what causes this exactly on x86 and amd64 (but not arm64) # there is an conditional uninit read # there are several if statements that use the two pointers to stack # structures that probably generate the error @@ -7,5 +7,4 @@ internal uninitilized read Memcheck:Cond fun:syscall - fun:main } |
From: Paul F. <pa...@so...> - 2024-10-27 17:15:07
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=9828f4808d8044190a9a585bbec1a80e0b2674d5 commit 9828f4808d8044190a9a585bbec1a80e0b2674d5 Author: Paul Floyd <pj...@wa...> Date: Sun Oct 27 18:14:20 2024 +0100 FreeBSD regtest: start removing versioned scalar variants Diff: --- memcheck/tests/freebsd/scalar.c | 6 +- memcheck/tests/freebsd/scalar.stderr.exp | 122 +++++++++++++++++++++++++++++++ 2 files changed, 124 insertions(+), 4 deletions(-) diff --git a/memcheck/tests/freebsd/scalar.c b/memcheck/tests/freebsd/scalar.c index 8862f3df3e..a1cfb06b14 100644 --- a/memcheck/tests/freebsd/scalar.c +++ b/memcheck/tests/freebsd/scalar.c @@ -334,7 +334,7 @@ int main(void) /* SYS_mprotect 74 */ GO(SYS_mprotect, "3s 0m"); - //SY(SYS_mprotect, x0+1, x0+1, x0+9999); FAIL; + SY(SYS_mprotect, x0+1, x0+1, x0+9999); FAIL; /* SYS_madvise 75 */ GO(SYS_madvise, "3s 0m"); @@ -372,7 +372,7 @@ int main(void) /* SYS_swapon 85 */ GO(SYS_swapon, "1s 1m"); - //SY(SYS_swapon, x0+1); SUCC; + SY(SYS_swapon, x0+1); FAIL; /* SYS_getitimer 86 */ GO(SYS_getitimer, "2s 1m"); @@ -2174,7 +2174,6 @@ int main(void) GO(SYS___sysctlbyname, "(putnew) 4s 2m"); SY(SYS___sysctlbyname, x0, x0+1, NULL, NULL, x0+1, x0+2); FAIL; -#if 0 // for later // FreeBSD 13 (and any backports) /* SYS_shm_open2 571 */ GO(SYS_shm_open2, " 5s 2m"); @@ -2202,7 +2201,6 @@ int main(void) /* SYS_aio_readv 579 */ GO(SYS_aio_readv, "1s 1m"); SY(SYS_aio_readv, x0+1); FAIL; -#endif /* SYS_exit 1 */ GO(SYS_exit, "1s 0m"); diff --git a/memcheck/tests/freebsd/scalar.stderr.exp b/memcheck/tests/freebsd/scalar.stderr.exp index 02f17f9d6c..db12726f55 100644 --- a/memcheck/tests/freebsd/scalar.stderr.exp +++ b/memcheck/tests/freebsd/scalar.stderr.exp @@ -5524,6 +5524,128 @@ Syscall param __sysctlbyname(newp) points to unaddressable byte(s) ... Address 0x........ is not stack'd, malloc'd or (recently) free'd +--------------------------------------------------------- +571: SYS_shm_open2 5s 2m +--------------------------------------------------------- +Syscall param shm_open2(path) contains uninitialised byte(s) + ... + +Syscall param shm_open2(flags) contains uninitialised byte(s) + ... + +Syscall param shm_open2(mode) contains uninitialised byte(s) + ... + +Syscall param shm_open2(shmflags) contains uninitialised byte(s) + ... + +Syscall param shm_open2(name) contains uninitialised byte(s) + ... + +Syscall param shm_open2(path) points to unaddressable byte(s) + ... + Address 0x........ is not stack'd, malloc'd or (recently) free'd + +Syscall param shm_open2(name) points to unaddressable byte(s) + ... + Address 0x........ is not stack'd, malloc'd or (recently) free'd + +--------------------------------------------------------- +571: SYS_shm_open2 5s 1m +--------------------------------------------------------- +Syscall param shm_open2(path) contains uninitialised byte(s) + ... + +Syscall param shm_open2(flags) contains uninitialised byte(s) + ... + +Syscall param shm_open2(mode) contains uninitialised byte(s) + ... + +Syscall param shm_open2(shmflags) contains uninitialised byte(s) + ... + +Syscall param shm_open2(name) contains uninitialised byte(s) + ... + +Syscall param shm_open2(name) points to unaddressable byte(s) + ... + Address 0x........ is not stack'd, malloc'd or (recently) free'd + +--------------------------------------------------------- +574: SYS___realpathat 5s 2m +--------------------------------------------------------- +Syscall param __realpathat(fd) contains uninitialised byte(s) + ... + +Syscall param __realpathat(path) contains uninitialised byte(s) + ... + +Syscall param __realpathat(buf) contains uninitialised byte(s) + ... + +Syscall param __realpathat(size) contains uninitialised byte(s) + ... + +Syscall param __realpathat(flags) contains uninitialised byte(s) + ... + +Syscall param __realpathat(path) points to unaddressable byte(s) + ... + Address 0x........ is not stack'd, malloc'd or (recently) free'd + +Syscall param __realpathat(buf) points to unaddressable byte(s) + ... + Address 0x........ is not stack'd, malloc'd or (recently) free'd + +--------------------------------------------------------- +575: SYS_close_range 3s 0m +--------------------------------------------------------- +Syscall param close_range(lowfd) contains uninitialised byte(s) + ... + +Syscall param close_range(highfd) contains uninitialised byte(s) + ... + +Syscall param close_range(flags) contains uninitialised byte(s) + ... + +--------------------------------------------------------- +577: SYS___specialfd 3s 1m +--------------------------------------------------------- +Syscall param __specialfd(type) contains uninitialised byte(s) + ... + +Syscall param __specialfd(req) contains uninitialised byte(s) + ... + +Syscall param __specialfd(len) contains uninitialised byte(s) + ... + +Syscall param __specialfd(req) points to unaddressable byte(s) + ... + Address 0x........ is not stack'd, malloc'd or (recently) free'd + +--------------------------------------------------------- +578: SYS_aio_writev 1s 1m +--------------------------------------------------------- +Syscall param aio_writev(iocb) contains uninitialised byte(s) + ... + +Syscall param aio_writev(iocb) points to unaddressable byte(s) + ... + Address 0x........ is not stack'd, malloc'd or (recently) free'd + +--------------------------------------------------------- +579: SYS_aio_readv 1s 1m +--------------------------------------------------------- +Syscall param aio_readv(iocb) contains uninitialised byte(s) + ... + +Syscall param aio_readv(iocb) points to unaddressable byte(s) + ... + Address 0x........ is not stack'd, malloc'd or (recently) free'd + --------------------------------------------------------- 1: SYS_exit 1s 0m --------------------------------------------------------- |
From: Paul F. <pa...@so...> - 2024-10-27 16:57:34
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=0d9ba0fc48edc3f183520185e25926dde1434219 commit 0d9ba0fc48edc3f183520185e25926dde1434219 Author: Paul Floyd <pj...@wa...> Date: Sun Oct 27 17:48:58 2024 +0100 FreeBSD: put back stacktrace hack for syscalls in older versions Diff: --- coregrind/m_stacktrace.c | 42 ++++++++++++++++++++++++++--------- memcheck/tests/freebsd/scalar.c | 4 ++-- memcheck/tests/freebsd/setproctitle.c | 2 +- 3 files changed, 34 insertions(+), 14 deletions(-) diff --git a/coregrind/m_stacktrace.c b/coregrind/m_stacktrace.c index 2cb0f3233e..630b5b8752 100644 --- a/coregrind/m_stacktrace.c +++ b/coregrind/m_stacktrace.c @@ -282,6 +282,26 @@ UInt VG_(get_StackTrace_wrk) ( ThreadId tid_if_known, i = 1; if (do_stats) stats.nr++; + // Does this apply to macOS 10.14 and earlier? +# if defined(VGO_freebsd) && (__FreeBSD_version < 1300000) + if (VG_(is_valid_tid)(tid_if_known) && + VG_(is_in_syscall)(tid_if_known) && + i < max_n_ips) { + /* On FreeBSD, all the system call stubs have no function + * prolog. So instead of top of the stack being a new + * frame comprising a saved BP and a return address, we + * just have the return address in the caller's frame. + * Adjust for this by recording the return address. + */ + if (debug) + VG_(printf)(" in syscall, use XSP-1\n"); + ips[i] = *(Addr *)uregs.xsp - 1; + if (sps) sps[i] = uregs.xsp; + if (fps) fps[i] = uregs.xbp; + i++; + } +# endif + while (True) { if (i >= max_n_ips) @@ -502,19 +522,19 @@ UInt VG_(get_StackTrace_wrk) ( ThreadId tid_if_known, || defined(VGP_amd64_solaris) || defined(VGP_amd64_freebsd) /* - * Concerning the comment in the function about syscalls, this also used to - * apply to FreeBSD. I'm not sure what changed or when. The situation with - * FreeBSD going at least as far back as version 12.1 (so Nov 2019) is that - * system calls are implemented with generated wrappers that call through - * an interposing table of function pointers. The restult when built with - * clang is that code for the frame pointer prolog is generated but then - * an optimized sibling call is made. That means the frame pointer is popped - * off the stack and a jmp is made to the function in the table rather than + * Concerning the comment in the function about syscalls, I'm not sure + * what changed or when with FreeBSD. The situation going at least + * as far back as FreeBSD 12.1 (so Nov 2019) is that system calls are + * implemented with generated wrappers that call through an interposing + * table of function pointers. The result when built with clang is that + * code for the frame pointer prolog is generated but then an optimized + * sibling call is made. That means the frame pointer is popped off + * the stack and a jmp is made to the function in the table rather than * a call. * * The end result is that, when we are in a syscall it is as though there were - * no prolog but a copy of the frame pointer is stored 64byte word below the - * stack pointer. If FreeBSD uses the hack for Darwin that sets + * no prolog but a copy of the frame pointer is stored one 64bit word below the + * stack pointer. If more recent FreeBSD uses the hack that sets * ips[i] = *(Addr *)uregs.xsp - 1; * then the caller of the syscall gets added twice. */ @@ -592,7 +612,7 @@ UInt VG_(get_StackTrace_wrk) ( ThreadId tid_if_known, VG_(printf)(" ipsS[%d]=%#08lx rbp %#08lx rsp %#08lx\n", i-1, ips[i-1], uregs.xbp, uregs.xsp); -# if defined(VGO_darwin) +# if defined(VGO_darwin) || (defined(VGO_freebsd) && __FreeBSD_version < 1300000) if (VG_(is_valid_tid)(tid_if_known) && VG_(is_in_syscall)(tid_if_known) && i < max_n_ips) { diff --git a/memcheck/tests/freebsd/scalar.c b/memcheck/tests/freebsd/scalar.c index e9d936e474..8862f3df3e 100644 --- a/memcheck/tests/freebsd/scalar.c +++ b/memcheck/tests/freebsd/scalar.c @@ -334,7 +334,7 @@ int main(void) /* SYS_mprotect 74 */ GO(SYS_mprotect, "3s 0m"); - SY(SYS_mprotect, x0+1, x0+1, x0+9999); FAIL; + //SY(SYS_mprotect, x0+1, x0+1, x0+9999); FAIL; /* SYS_madvise 75 */ GO(SYS_madvise, "3s 0m"); @@ -372,7 +372,7 @@ int main(void) /* SYS_swapon 85 */ GO(SYS_swapon, "1s 1m"); - SY(SYS_swapon, x0); FAIL; + //SY(SYS_swapon, x0+1); SUCC; /* SYS_getitimer 86 */ GO(SYS_getitimer, "2s 1m"); diff --git a/memcheck/tests/freebsd/setproctitle.c b/memcheck/tests/freebsd/setproctitle.c index cc0357f42f..44e7514a2e 100644 --- a/memcheck/tests/freebsd/setproctitle.c +++ b/memcheck/tests/freebsd/setproctitle.c @@ -10,7 +10,7 @@ int main(void) { -#if defined(KERN_PS_STRINGS) +#if defined(KERN_PS_STRINGS) && defined(AT_PS_STRINGS) unsigned long ul_ps_strings; struct ps_strings* v1; struct ps_strings* v2; |
From: Paul F. <pa...@so...> - 2024-10-27 13:28:09
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=dd23a6c30910020700b283e3deabbfc27606e4db commit dd23a6c30910020700b283e3deabbfc27606e4db Author: Paul Floyd <pj...@wa...> Date: Sun Oct 27 15:27:38 2024 +0100 FreeBSD regtest: x86 scalar expected Diff: --- memcheck/tests/freebsd/scalar.stderr.exp-x86 | 33 ++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/memcheck/tests/freebsd/scalar.stderr.exp-x86 b/memcheck/tests/freebsd/scalar.stderr.exp-x86 index e83b942838..290cc163b1 100644 --- a/memcheck/tests/freebsd/scalar.stderr.exp-x86 +++ b/memcheck/tests/freebsd/scalar.stderr.exp-x86 @@ -1154,6 +1154,23 @@ Syscall param adjtime(delta) points to unaddressable byte(s) ... Address 0x........ is not stack'd, malloc'd or (recently) free'd +--------------------------------------------------------- +140: SYS_adjtime 2s 2m +--------------------------------------------------------- +Syscall param adjtime(delta) contains uninitialised byte(s) + ... + +Syscall param adjtime(olddelta) contains uninitialised byte(s) + ... + +Syscall param adjtime(delta) points to unaddressable byte(s) + ... + Address 0x........ is not stack'd, malloc'd or (recently) free'd + +Syscall param adjtime(olddelta) points to unaddressable byte(s) + ... + Address 0x........ is not stack'd, malloc'd or (recently) free'd + --------------------------------------------------------- 147: SYS_setsid 0s 0m --------------------------------------------------------- @@ -3993,6 +4010,22 @@ Syscall param shm_open(flags) contains uninitialised byte(s) Syscall param shm_open(mode) contains uninitialised byte(s) ... +--------------------------------------------------------- +482: SYS_shm_open 3s 1m +--------------------------------------------------------- +Syscall param shm_open(path) contains uninitialised byte(s) + ... + +Syscall param shm_open(flags) contains uninitialised byte(s) + ... + +Syscall param shm_open(mode) contains uninitialised byte(s) + ... + +Syscall param shm_open(path) points to unaddressable byte(s) + ... + Address 0x........ is not stack'd, malloc'd or (recently) free'd + --------------------------------------------------------- 483: SYS_shm_unlink 1s 1m --------------------------------------------------------- |
From: Paul F. <pa...@so...> - 2024-10-27 13:25:11
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=bb706490243127ea6de47caaf5026536f787b8e1 commit bb706490243127ea6de47caaf5026536f787b8e1 Author: Paul Floyd <pj...@wa...> Date: Sun Oct 27 14:22:58 2024 +0100 FreeBSD regtest: cleanup scalar Make more tests fail. Add a few more tests. Add some asserts for tests that don't return -1 on failure. Diff: --- memcheck/tests/freebsd/scalar.c | 33 +++++++++++++++++++------------- memcheck/tests/freebsd/scalar.stderr.exp | 33 ++++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+), 13 deletions(-) diff --git a/memcheck/tests/freebsd/scalar.c b/memcheck/tests/freebsd/scalar.c index a7dd23947b..e9d936e474 100644 --- a/memcheck/tests/freebsd/scalar.c +++ b/memcheck/tests/freebsd/scalar.c @@ -334,8 +334,7 @@ int main(void) /* SYS_mprotect 74 */ GO(SYS_mprotect, "3s 0m"); - /* PJF why does this succeed? */ - SY(SYS_mprotect, x0+1, x0, x0); SUCC; + SY(SYS_mprotect, x0+1, x0+1, x0+9999); FAIL; /* SYS_madvise 75 */ GO(SYS_madvise, "3s 0m"); @@ -503,11 +502,11 @@ int main(void) /* SYS_setreuid 126 */ GO(SYS_setreuid, "2s 0m"); - SY(SYS_setreuid, x0-1, x0-1); SUCC; + SY(SYS_setreuid, x0+1, x0+1); FAIL; /* SYS_setregid 127 */ GO(SYS_setregid, "2s 0m"); - SY(SYS_setregid, x0-1, x0-1); SUCC; + SY(SYS_setregid, x0+1, x0+1); FAIL; /* SYS_rename 128 */ GO(SYS_rename, "2s 2m"); @@ -552,8 +551,10 @@ int main(void) /* SYS_adjtime 140 */ GO(SYS_adjtime, "2s 1m"); - /* succeeds? need non-null arg2 for 2m */ - SY(SYS_adjtime, x0, x0); SUCC; + SY(SYS_adjtime, x0+1, x0); FAIL; + + GO(SYS_adjtime, "2s 2m"); + SY(SYS_adjtime, x0+1, x0+1); FAIL; /* 4.3 getpeername 141 */ @@ -1004,6 +1005,7 @@ int main(void) /* SYS_clock_nanosleep 244 */ GO(SYS_clock_nanosleep, "4s 2m"); SY(SYS_clock_nanosleep, x0+5000, x0+3000, x0+3, x0+1); SUCC; + assert(res == EFAULT); #endif // SYS_clock_getcpuclockid2 247 @@ -1101,7 +1103,7 @@ int main(void) /* SYS_modnext 300 */ GO(SYS_modnext, "1s 0m"); - SY(SYS_modnext, x0+1); SUCC; + SY(SYS_modnext, x0+100000); FAIL; /* SYS_modstat 301 */ GO(SYS_modstat, "2s 1m"); @@ -1109,7 +1111,7 @@ int main(void) /* SYS_modfnext 302 */ GO(SYS_modfnext, "1s 0m"); - SY(SYS_modfnext, x0+1); SUCC; + SY(SYS_modfnext, x0+100000); FAIL; /* SYS_modfind 303 */ GO(SYS_modfind, "1s 1m"); @@ -1228,6 +1230,7 @@ int main(void) SY(SYS_sched_rr_get_interval, x0+999999, x0+1); FAIL; /* SYS_utrace 335*/ + /* only works if process is being traced */ GO(SYS_utrace, "2s 1m"); SY(SYS_utrace, x0+1, x0+16); SUCC; @@ -1758,14 +1761,16 @@ int main(void) #if defined(SYS_freebsd12_shm_open) GO(SYS_freebsd12_shm_open, "(SHM_ANON) 3s 0m"); SY(SYS_freebsd12_shm_open, x0+SHM_ANON, x0+2, x0+9); SUCC; + + GO(SYS_freebsd12_shm_open, "3s 1m"); + SY(SYS_freebsd12_shm_open, x0+2, x0+2, x0+9); FAIL; #else GO(SYS_shm_open, "(SHM_ANON) 3s 0m"); SY(SYS_shm_open, x0+SHM_ANON, x0+2, x0+9); SUCC; -#endif - // @todo this was causing a VG crash - // GO(SYS_shm_open, "3s 1m"); - //SY(SYS_shm_open, x0+2, x0+2, x0+9); SUCC; + GO(SYS_shm_open, "3s 1m"); + SY(SYS_shm_open, x0+2, x0+2, x0+9); FAIL; +#endif /* SYS_shm_unlink 483 */ GO(SYS_shm_unlink, "1s 1m"); @@ -1981,10 +1986,12 @@ int main(void) GO(SYS_posix_fallocate, "5s 0m"); SY(SYS_posix_fallocate, x0+99999, x0, x0+10, x0, x0+20); SUCC; #endif + assert(res == EBADF); /* SYS_posix_fadvise 531 */ GO(SYS_posix_fadvise, "4s 0m"); SY(SYS_posix_fadvise, x0+99999, x0+10, x0+20, x0); SUCC; + assert(res == EBADF); /* SYS_wait6 532 */ GO(SYS_wait6, "6s 3m"); @@ -2182,7 +2189,7 @@ int main(void) /* SYS_close_range 575 */ GO(SYS_close_range, "3s 0m"); - SY(SYS_close_range, x0+5, x0+10, x0); SUCC; + SY(SYS_close_range, x0+5, x0+10, x0+12345); FAIL; /* SYS___specialfd 577 */ GO(SYS___specialfd, "3s 1m"); diff --git a/memcheck/tests/freebsd/scalar.stderr.exp b/memcheck/tests/freebsd/scalar.stderr.exp index 5c61947a15..02f17f9d6c 100644 --- a/memcheck/tests/freebsd/scalar.stderr.exp +++ b/memcheck/tests/freebsd/scalar.stderr.exp @@ -1154,6 +1154,23 @@ Syscall param adjtime(delta) points to unaddressable byte(s) ... Address 0x........ is not stack'd, malloc'd or (recently) free'd +--------------------------------------------------------- +140: SYS_adjtime 2s 2m +--------------------------------------------------------- +Syscall param adjtime(delta) contains uninitialised byte(s) + ... + +Syscall param adjtime(olddelta) contains uninitialised byte(s) + ... + +Syscall param adjtime(delta) points to unaddressable byte(s) + ... + Address 0x........ is not stack'd, malloc'd or (recently) free'd + +Syscall param adjtime(olddelta) points to unaddressable byte(s) + ... + Address 0x........ is not stack'd, malloc'd or (recently) free'd + --------------------------------------------------------- 147: SYS_setsid 0s 0m --------------------------------------------------------- @@ -3966,6 +3983,22 @@ Syscall param shm_open(flags) contains uninitialised byte(s) Syscall param shm_open(mode) contains uninitialised byte(s) ... +--------------------------------------------------------- +482: SYS_shm_open 3s 1m +--------------------------------------------------------- +Syscall param shm_open(path) contains uninitialised byte(s) + ... + +Syscall param shm_open(flags) contains uninitialised byte(s) + ... + +Syscall param shm_open(mode) contains uninitialised byte(s) + ... + +Syscall param shm_open(path) points to unaddressable byte(s) + ... + Address 0x........ is not stack'd, malloc'd or (recently) free'd + --------------------------------------------------------- 483: SYS_shm_unlink 1s 1m --------------------------------------------------------- |
From: Paul F. <pa...@so...> - 2024-10-27 08:55:28
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=50b056811c58a7ee57b8a51d44a58f9c74eaba98 commit 50b056811c58a7ee57b8a51d44a58f9c74eaba98 Author: Paul Floyd <pj...@wa...> Date: Sun Oct 27 10:54:23 2024 +0100 FreeBSD x86 scalar: update expected after fix for sigwait Diff: --- memcheck/tests/freebsd/scalar.stderr.exp-x86 | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/memcheck/tests/freebsd/scalar.stderr.exp-x86 b/memcheck/tests/freebsd/scalar.stderr.exp-x86 index 6bff63d332..e83b942838 100644 --- a/memcheck/tests/freebsd/scalar.stderr.exp-x86 +++ b/memcheck/tests/freebsd/scalar.stderr.exp-x86 @@ -3614,6 +3614,10 @@ Syscall param mq_timedreceive(msg_prio) contains uninitialised byte(s) Syscall param mq_timedreceive(abs_timeout) contains uninitialised byte(s) ... +Syscall param mq_timedreceive(msg_ptr) points to unaddressable byte(s) + ... + Address 0x........ is not stack'd, malloc'd or (recently) free'd + Syscall param mq_timedreceive(msg_prio) points to unaddressable byte(s) ... Address 0x........ is not stack'd, malloc'd or (recently) free'd @@ -3640,6 +3644,10 @@ Syscall param mq_timedsend(msg_prio) contains uninitialised byte(s) Syscall param mq_timedsend(abs_timeout) contains uninitialised byte(s) ... +Syscall param mq_timedsend(msg_ptr) points to unaddressable byte(s) + ... + Address 0x........ is not stack'd, malloc'd or (recently) free'd + Syscall param mq_timedsend(abs_timeout) points to unaddressable byte(s) ... Address 0x........ is not stack'd, malloc'd or (recently) free'd @@ -3723,6 +3731,14 @@ Syscall param sctp_generic_sendmsg(sinfo) contains uninitialised byte(s) Syscall param sctp_generic_sendmsg(flags) contains uninitialised byte(s) ... +Syscall param sctp_generic_sendmsg(msg) points to unaddressable byte(s) + ... + Address 0x........ is not stack'd, malloc'd or (recently) free'd + +Syscall param sctp_generic_sendmsg(to) points to unaddressable byte(s) + ... + Address 0x........ is not stack'd, malloc'd or (recently) free'd + Syscall param sctp_generic_sendmsg(sinfo) points to unaddressable byte(s) ... Address 0x........ is not stack'd, malloc'd or (recently) free'd @@ -4055,6 +4071,10 @@ Syscall param cpuset_getaffinity(setsize) contains uninitialised byte(s) Syscall param cpuset_getaffinity(mask) contains uninitialised byte(s) ... +Syscall param cpuset_getaffinity points to unaddressable byte(s) + ... + Address 0x........ is not stack'd, malloc'd or (recently) free'd + --------------------------------------------------------- 488: SYS_cpuset_setaffinity 5s 1m --------------------------------------------------------- @@ -4076,6 +4096,10 @@ Syscall param cpuset_setaffinity(setsize) contains uninitialised byte(s) Syscall param cpuset_setaffinity(mask) contains uninitialised byte(s) ... +Syscall param cpuset_setaffinity points to unaddressable byte(s) + ... + Address 0x........ is not stack'd, malloc'd or (recently) free'd + --------------------------------------------------------- 489: SYS_faccessat 3s 1m --------------------------------------------------------- |