]> git.ipfire.org Git - thirdparty/valgrind.git/log
thirdparty/valgrind.git
12 months agoClose both internal pipe fds after VG_(fork) in parent and child
Mark Wielaard [Sun, 16 Jun 2024 22:27:12 +0000 (00:27 +0200)] 
Close both internal pipe fds after VG_(fork) in parent and child

An VG_fork() creates a pipe between parent and child to syncronize the
two processes. The parent wants to register the child pid before the
child can run. This is done in register_sigchld_ignore.

Make sure both the parent and the child close both the read and write
file descriptors so none leak.

https://bugs.kde.org/show_bug.cgi?id=479661

12 months agoDon't leave fds created with --log-file, --xml-file or --log-socket open
Mark Wielaard [Sun, 16 Jun 2024 19:23:08 +0000 (21:23 +0200)] 
Don't leave fds created with --log-file, --xml-file or --log-socket open

prepare_sink_fd and prepare_sink_socket will create a new file
descriptor for the output sink. finalize_sink_fd then copies the fd
to the safe range, so it doesn't conflict with any application fds.

If we created the original fd ourselves, it was a VgLogTo_File or
VgLogTo_Socket, not VgLogTo_Fd, finalize_sink_fd should close it.

Also close socket when connecting fails in VG_(connect_via_socket).

Add a testcase for --log-file and --xml-file which prints output to
/dev/stderr

https://bugs.kde.org/show_bug.cgi?id=202770
https://bugs.kde.org/show_bug.cgi?id=311655
https://bugs.kde.org/show_bug.cgi?id=488379

Co-authored-by: Alexandra Hájková <ahajkova@redhat.com
12 months agodoc FAQ: add items for common code causes of 'Mismatched' errors
Paul Floyd [Sun, 16 Jun 2024 19:11:33 +0000 (21:11 +0200)] 
doc FAQ: add items for common code causes of 'Mismatched' errors

(when there is no fault in the code).

12 months agoBug 487439 - SIGILL in JDK11, JDK17
Paul Floyd [Sun, 16 Jun 2024 07:25:51 +0000 (09:25 +0200)] 
Bug 487439 - SIGILL in JDK11, JDK17

12 months agoFreeBSD: mostly filters and suppressions for fdleak tests
Paul Floyd [Sat, 15 Jun 2024 15:09:05 +0000 (17:09 +0200)] 
FreeBSD: mostly filters and suppressions for fdleak tests

Also make close_range behave like linux when highfd is UINT_MAX.
We should probably move close_range to generic.

12 months agonone/tests/Makefile.am: EXTRA_DIST add exp-nomain files
Mark Wielaard [Sat, 15 Jun 2024 13:05:29 +0000 (15:05 +0200)] 
none/tests/Makefile.am: EXTRA_DIST add exp-nomain files

12 months agoAdd file descriptor suppression tests
Alexandra Hájková [Thu, 23 May 2024 08:39:54 +0000 (04:39 -0400)] 
Add file descriptor suppression tests

- none/tests/double_close_range_sup.vgtest
- none/tests/fdleak_cmsg_supp.vgtest
- none/tests/fdleak_creat_sup.vgtest
- none/tests/file_dclose_sup.vgtest

https://bugs.kde.org/show_bug.cgi?id=488441

12 months agoAdd the tests for --track-fds=yes --xml=yes
Alexandra Hájková [Tue, 23 Apr 2024 13:17:03 +0000 (09:17 -0400)] 
Add the tests for --track-fds=yes --xml=yes

- none/tests/double_close_range_xml.vgtest
- none/tests/fdleak_cmsg_xml.vgtest
- none/tests/fdleak_creat_xml.vgtest
- none/tests/fdleak_dup_xml.vgtest
- none/tests/fdleak_dup2_xml.vgtest
- none/tests/fdleak_fcntl_xml.vgtest
- none/tests/fdleak_ipv4_xml.vgtest
- none/tests/fdleak_open_xml.vgtest
- none/tests/fdleak_pipe_xml.vgtest
- none/tests/fdleak_socketpair_xml.vgtest
- none/tests/file_dclose_xml.vgtest
- none/tests/socket_close_xml.vgtest

Add a new filter_xml. Note the use of --child-silent-after-fork=yes
usage in two vgtests. Maybe this should be the default for --xml=yes?
Otherwise xml output will be "corrupted" by output from a fork.

https://bugs.kde.org/show_bug.cgi?id=488441

12 months agoImprove none/tests/double_close_range test and filter_fdleak
Alexandra Hájková [Thu, 23 May 2024 08:46:26 +0000 (04:46 -0400)] 
Improve none/tests/double_close_range test and filter_fdleak

Adjust none/tests/file_dclose, none/tests/fdleak_ipv4
and socket_close to fit the changes in filter_fdleak.

https://bugs.kde.org/show_bug.cgi?id=488441

12 months agoFreeBSD: fixes for version 14.1
Paul Floyd [Mon, 10 Jun 2024 05:14:40 +0000 (07:14 +0200)] 
FreeBSD: fixes for version 14.1

There were several leftovers from when I split FREEBSD_14
into 14_0 and 14_1 versions.
sys_break doesn't exist on arm64
There's a really annoying conditional jump error in a static copy
of strlen in ld-elf.so.1. We can't redirect the strlen, so I've
added a suppression. But it messes up test cases that use -s
to count errors.
Finally, FreeBSD 14.1 has removed a few old FreeBSD 7 syscalls.

12 months agoFreeBSD syscall: mostly cosmetic update to the unused sbrk syscall
Paul Floyd [Mon, 10 Jun 2024 05:24:47 +0000 (07:24 +0200)] 
FreeBSD syscall: mostly cosmetic update to the unused sbrk syscall

12 months agoFreeBSD regtest: add filter for FreeBSD 14.1 conditional error
Paul Floyd [Sun, 9 Jun 2024 15:13:42 +0000 (17:13 +0200)] 
FreeBSD regtest: add filter for FreeBSD 14.1 conditional error

12 months agoBug 487993 - Alignment error when using Eigen with Valgrind and -m32
Paul Floyd [Wed, 5 Jun 2024 19:01:22 +0000 (21:01 +0200)] 
Bug 487993 - Alignment error when using Eigen with Valgrind and -m32

Not tested on Solaris, but I think that x86 is more or less unused
on that platform these days.

12 months agoFreeBSD and Darwin: apply same fix as Bug 488026
Paul Floyd [Wed, 5 Jun 2024 06:54:16 +0000 (08:54 +0200)] 
FreeBSD and Darwin: apply same fix as Bug 488026

12 months agocoregrind: fix allocation length
Ethiraric [Tue, 4 Jun 2024 16:37:48 +0000 (18:37 +0200)] 
coregrind: fix allocation length

The `sizeof(preload_core)` here evaluates the size of a pointer rather
than the string behind it (unlike for `VG_PLATFORM` which is a
macro).

12 months agoLinux regtest: reallocarray needs malloc.h
Paul Floyd [Tue, 4 Jun 2024 10:49:33 +0000 (12:49 +0200)] 
Linux regtest: reallocarray needs malloc.h

Seen on Rocky 8.9

12 months agoREADME_DEVELOPERS: fix a couple of typos
Paul Floyd [Sun, 2 Jun 2024 10:06:18 +0000 (12:06 +0200)] 
README_DEVELOPERS: fix a couple of typos

13 months agoarm64 regtest: improve dc_cvax test
Paul Floyd [Sun, 26 May 2024 05:46:33 +0000 (07:46 +0200)] 
arm64 regtest: improve dc_cvax test

Make sure that the buffer used for dc zva is the right size.
Turn on the dc cvap and dc cvadp tests, resorting to .byte arrays.

13 months agoBug 453044 - gbserver_tests failures in aarch64
Jesus Checa [Sat, 25 May 2024 10:40:30 +0000 (12:40 +0200)] 
Bug 453044 - gbserver_tests failures in aarch64

13 months agoarm64 cleanup, part 1
Paul Floyd [Wed, 22 May 2024 06:16:19 +0000 (08:16 +0200)] 
arm64 cleanup, part 1

Mainly typos but also fix a potential assert in get_cache_info.

13 months agoarm64 regtest: add a configure check that the compiler accepts sha3.
Paul Floyd [Wed, 22 May 2024 06:01:40 +0000 (08:01 +0200)] 
arm64 regtest: add a configure check that the compiler accepts sha3.

13 months agoFreeBSD: synthesize AT_HWCAP on arm64
Paul Floyd [Wed, 22 May 2024 05:34:34 +0000 (07:34 +0200)] 
FreeBSD: synthesize AT_HWCAP on arm64

Not used on amd64. Less hardware variation?

13 months agoFreeBSD regtest: add filters for syscall macro wrappers
Paul Floyd [Mon, 20 May 2024 19:58:21 +0000 (19:58 +0000)] 
FreeBSD regtest: add filters for syscall macro wrappers

Seen on FreeBSD 15.

13 months agoAdd Bug 447989 to NEWS
Paul Floyd [Mon, 20 May 2024 19:19:57 +0000 (21:19 +0200)] 
Add Bug 447989 to NEWS

13 months agoAdd support for Armv8.2 SHA-512 instructions
David Benjamin [Wed, 5 Jan 2022 05:22:30 +0000 (00:22 -0500)] 
Add support for Armv8.2 SHA-512 instructions

Fixes https://bugs.kde.org/show_bug.cgi?id=447989

13 months agoExtract common arm64 SIMD helpers into a single header
David Benjamin [Thu, 16 May 2024 14:12:59 +0000 (10:12 -0400)] 
Extract common arm64 SIMD helpers into a single header

This was copy-pasted between two files and, with the number of
extensions in aarch64, will likely need to be in many more. As the
header file defines a bunch of static, mutable state, some functions
needed to be moved to a separate .c file, to avoid weird behaviors from
C's textual inclusion model.

This also required refreshing fp_and_simd's expected output. The
fp_and_simd and fp_and_simd_v82 copies of randV128 produced slightly
different output because fp_and_simd_v82 also checked for valid f16s.
Deduplicating the code means we now apply that across the board.

NB: The fp_and_simd expected output was synthesized from what valgrind
thought the correct output was, *not* running the executable directly.
Valgrind does not seem to actually match a real Arm machine. This
divergence already existed before this commit. The divergence is in the
fmla, fcvtxn, and fcvtxn2 instructions. Looking at the corresponding
code in guest_arm64_toIR.c, I see various comments discussion how they
don't quite round correctly, so I'm guessing this is a known bug. For
now, as before this commit, I've generated the test expectations based
on the bug.

13 months agoREADME_DEVELOPERS: better to generate stdout expecteds directly from test exes
Paul Floyd [Sat, 18 May 2024 13:39:34 +0000 (15:39 +0200)] 
README_DEVELOPERS: better to generate stdout expecteds directly from test exes

13 months agoREADME_DEVELOPERS: describe how to write regression tests.
Paul Floyd [Wed, 15 May 2024 19:40:48 +0000 (21:40 +0200)] 
README_DEVELOPERS: describe how to write regression tests.

13 months agos390x: Support the deflate-conversion facility (DFLTCC)
Andreas Arnez [Wed, 15 May 2024 12:32:42 +0000 (14:32 +0200)] 
s390x: Support the deflate-conversion facility (DFLTCC)

So far the DFLTCC (deflate conversion call) instruction is not supported
by Valgrind.  Similar to PRNO and NNPA, it is a "complex" instruction
whose memory effects cannot be adequately expressed with a dirty helper.

Add support for the DFLTCC instruction using the new "extension" mechanism
and reflect this accordingly in the supported facilities and HWCAPs.

13 months agos390x: Minor fixes in extension-s390x.c
Andreas Arnez [Wed, 15 May 2024 12:32:42 +0000 (14:32 +0200)] 
s390x: Minor fixes in extension-s390x.c

Some tracker names for registers are not consistent with the naming
scheme.  Also, there is a dead assignment to orig_addr2 and orig_len2.
Fix both.

13 months agoAvoid use of guest_IP_AT_SYSCALL in handle_extension()
Andreas Arnez [Wed, 15 May 2024 12:32:42 +0000 (14:32 +0200)] 
Avoid use of guest_IP_AT_SYSCALL in handle_extension()

The guest state field guest_IP_AT_SYSCALL is referenced in
handle_extension(), even though it may not be defined by all
architectures.  Avoid its use altogether.

13 months agoFix uninitialized `err' in handle_extension()
Andreas Arnez [Wed, 15 May 2024 12:32:42 +0000 (14:32 +0200)] 
Fix uninitialized `err' in handle_extension()

In handle_extension(), in the case of a second return from SCHEDSETJMP the
variable `err' would be used uninitialized.  Fix this by avoiding any
access to `err' in this case.

13 months agoBug 276780 - An instruction in fftw (Fast Fourier Transform) is unhandled by valgrind...
Tom Hughes [Mon, 13 May 2024 18:40:19 +0000 (20:40 +0200)] 
Bug 276780 - An instruction in fftw (Fast Fourier Transform) is unhandled by valgrind: vex x86->IR: unhandled instruction bytes: 0x66 0xF 0x3A 0x22

13 months agoaarch64: small fix for mrs id_aa64pfr0_el1
Paul Floyd [Mon, 13 May 2024 18:49:38 +0000 (20:49 +0200)] 
aarch64: small fix for mrs id_aa64pfr0_el1

The flag for half-precision is 0x1 not 0x11. Probably harmless and gets caught
by the default. Add a comment for the bottom 6 nibbles.

13 months agoREADME_DEVELOPERS: Replace b vgPlain_do_exec with b vgPlain_do_exec_inner
Mark Wielaard [Mon, 13 May 2024 10:30:13 +0000 (12:30 +0200)] 
README_DEVELOPERS: Replace b vgPlain_do_exec with b vgPlain_do_exec_inner

When building with --enable-lto vgPlain_do_exec is optimized out.
So replace the breakpoint example with vgPlain_do_exec_inner and
add a note that this is just an example and internal symbol names
might change or get optimized out.

13 months agoaarch64 regtest: add test for dc cva? op codes
Paul Floyd [Sun, 12 May 2024 06:47:58 +0000 (08:47 +0200)] 
aarch64 regtest: add test for dc cva? op codes

And also system registers for feature tests.

13 months agoaarch64: fix data cache opcode warning
Paul Floyd [Sun, 12 May 2024 05:12:41 +0000 (07:12 +0200)] 
aarch64: fix data cache opcode warning

Wrong logic used in patch.

13 months agoaarch64 dc zva: fix size calculation
Paul Floyd [Sat, 11 May 2024 18:51:46 +0000 (20:51 +0200)] 
aarch64 dc zva: fix size calculation

Cache block size is in words not bytes.

13 months agoFix build failure on arm/mips/ppc
Paul Floyd [Sat, 11 May 2024 16:39:23 +0000 (18:39 +0200)] 
Fix build failure on arm/mips/ppc

arm64_cache_block_size is, as the name implies, arm64 only.

13 months agoBug 377966 - arm64 unhandled instruction dc zva
Paul Floyd [Sat, 11 May 2024 16:10:03 +0000 (18:10 +0200)] 
Bug 377966 - arm64 unhandled instruction dc zva

With contributions from
Louis Brunner https://github.com/LouisBrunner/valgrind-macos

13 months agoBug 412377 - SIGILL on cache flushes on arm64
Paul Floyd [Sat, 11 May 2024 13:21:47 +0000 (15:21 +0200)] 
Bug 412377 - SIGILL on cache flushes on arm64

Patch contributed by
Adam Borowski <kilobyte@angband.pl>

13 months agoarm64 front end: add support for 'dc cvac', 'dc cvap', handling it the same as 'dc...
Kevin Zhao [Thu, 22 Jul 2021 08:00:21 +0000 (16:00 +0800)] 
arm64 front end: add support for 'dc cvac', 'dc cvap', handling it the same as 'dc cvau'.

patch modified to process DBP component of ID_AA64ISAR1_EL1

Signed-off-by: Kevin Zhao <kevin.zhao@linaro.org>
13 months agoBug 392146 - fix bad refactor in previous commit
Paul Floyd [Sat, 11 May 2024 12:33:32 +0000 (14:33 +0200)] 
Bug 392146 - fix bad refactor in previous commit

13 months agoBug 392146 - aarch64: unhandled instruction 0xD5380001 (MRS rT, midr_el1)
Paul Floyd [Sat, 11 May 2024 11:53:42 +0000 (13:53 +0200)] 
Bug 392146 - aarch64: unhandled instruction 0xD5380001 (MRS rT, midr_el1)

13 months agomips: skip using shared syscall numbers for mips32
Aleksandar Rikalo [Fri, 10 May 2024 15:59:28 +0000 (17:59 +0200)] 
mips: skip using shared syscall numbers for mips32

mips does not use shared syscall numbers, so we can not use
vki-scnums-shared-linux.h.

This partially fixes KDE #444781.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Aleksandar Rikalo <arikalo@gmail.com>
13 months agoaarch64 frinta and frinta vector instructions
Paul Floyd [Thu, 9 May 2024 19:01:52 +0000 (21:01 +0200)] 
aarch64 frinta and frinta vector instructions

The initial fix for Bug 484426 only corrected frinta and frintn
scalar instructions. This adds support for the vector variants.

13 months agoFreeBSD sanity check: enable dev/ino and offset checking.
Paul Floyd [Wed, 8 May 2024 16:25:12 +0000 (18:25 +0200)] 
FreeBSD sanity check: enable dev/ino and offset checking.

Works OK on ZFS, with the usual exeption of the RW segment of
the tool itself that has a funky mapping optimization.

13 months agoFreeBSD regtest: various fixes for x86 FreeBSD 14.1
Paul Floyd [Wed, 8 May 2024 14:40:36 +0000 (16:40 +0200)] 
FreeBSD regtest: various fixes for x86 FreeBSD 14.1

Most of them are related to the difference between x86 and amd64
syscall ABI.

13 months agoFreeBSD: correct error when adding support for FreeBSD 14.1
Paul Floyd [Wed, 8 May 2024 11:07:01 +0000 (13:07 +0200)] 
FreeBSD: correct error when adding support for FreeBSD 14.1

13 months agoFreeBSD: add support for FreeBSD 14.1
Paul Floyd [Wed, 8 May 2024 12:01:09 +0000 (14:01 +0200)] 
FreeBSD: add support for FreeBSD 14.1

Just one extra syscall that I can see.

13 months agoFreeBSD readme: updates for arm64 and ioctls
Paul Floyd [Mon, 6 May 2024 19:30:39 +0000 (21:30 +0200)] 
FreeBSD readme: updates for arm64 and ioctls

13 months agoBug 486569 - linux inotify_init syscall wrapper missing POST entry in syscall_table
Paul Floyd [Sat, 4 May 2024 13:03:11 +0000 (15:03 +0200)] 
Bug 486569 - linux inotify_init syscall wrapper missing POST entry in syscall_table

13 months agoBug 486293 - memccpy false positives
Paul Floyd [Wed, 1 May 2024 07:24:14 +0000 (09:24 +0200)] 
Bug 486293 - memccpy false positives

13 months agoFreeBSD cleanup: mostly using VKI prefix in vki-freebsd.h
Paul Floyd [Wed, 1 May 2024 14:06:53 +0000 (16:06 +0200)] 
FreeBSD cleanup: mostly using VKI prefix in vki-freebsd.h

13 months agoFreeBSD ioctl: CAMIOCOMMAND with subcommmand XPT_DEV_MATCH
Paul Floyd [Wed, 1 May 2024 13:17:50 +0000 (15:17 +0200)] 
FreeBSD ioctl: CAMIOCOMMAND with subcommmand XPT_DEV_MATCH

CAM is the FreeBSD disk I/O subsystem (Common Access Method).

I had picked up an implementation of this from bitbucket done
by a FreeBSD dev. It was done a long time ago, around 2013 on
Valgrind 3.8. Mercurial bitbucket is now kickbucket. There
were 2 big problems.

1.  Bit rot. The CAM ioctl is versioned and the version that I
copies was 0x15 whilst the current version is 0x2a, 6 versions
later. That meant that the ioctl wrapper wasn't even getting
called. In addition, as the versioning implies, the data structures
were also out of date.

2. Might also be bit rot but the data structures were copied with
QUEUE_MACRO_DEBUG_TRACE enabled. For that to work the whole
FreeBSD system needs to be built with it turned on. With that
macro turned on in Valgrind the data structures were offset
compared to the kernel, and nothing worked correctly.

There are still a huge number of CAM ioctls unimplemented.
"camcontrol devlist" now works wihtout generating false positives.

13 months agoFreeBSD ioctl: add BIOCSETF
Paul Floyd [Wed, 1 May 2024 09:08:19 +0000 (11:08 +0200)] 
FreeBSD ioctl: add BIOCSETF

And a bit more header cleanup

13 months agoDRD regtest: try to make drd/tests/pth_mutex_signal less flaky
Paul Floyd [Tue, 30 Apr 2024 05:58:38 +0000 (07:58 +0200)] 
DRD regtest: try to make drd/tests/pth_mutex_signal less flaky

Use a loop of 1ms usleeps rather than a single 1s usleep.
This is usually more releable in ensuring that there's a context switch and that signals
get handled in the order that we want.

13 months agoDarwin regtest: don't visit dSYM directories with tests/vg_regtest
Paul Floyd [Mon, 29 Apr 2024 19:11:53 +0000 (21:11 +0200)] 
Darwin regtest: don't visit dSYM directories with tests/vg_regtest

Due to the extra directory depth of dSYM directories the following line
    my $dashes = "-" x (50 - length $full_dir);
generates a warning on Darwin because the length of $full_dir is more than 50
("Negative repeat count does nothing"). This change makes test_one_dir return
early if the directory contains "dSYM".

14 months agoFreeBSD ioctl: add SIOCGIFCONF
Paul Floyd [Sun, 28 Apr 2024 19:02:11 +0000 (21:02 +0200)] 
FreeBSD ioctl: add SIOCGIFCONF

Also remove a load of commented out Linux stuff from vki-freebsd.h

14 months agoFreeBSD ioctl: enable SIOCGIFMEDIA PCIOCGETCONF CAMIOCOMMAND ioctls and add SIOCGIFSTATUS
Paul Floyd [Sun, 28 Apr 2024 16:22:43 +0000 (18:22 +0200)] 
FreeBSD ioctl: enable SIOCGIFMEDIA PCIOCGETCONF CAMIOCOMMAND ioctls and add SIOCGIFSTATUS

14 months agofd leaks: add an assert for the error extra data
Paul Floyd [Sun, 28 Apr 2024 16:19:55 +0000 (18:19 +0200)] 
fd leaks: add an assert for the error extra data

Coverity claims that it could cause a NULL dereference. I don't
think it's possible. Adding an assert will at least make things
clearer if Coverity ever turns out to be right.

14 months agomc-manual.xml fix new/delete expresions -> expression
Mark Wielaard [Sat, 27 Apr 2024 20:19:54 +0000 (22:19 +0200)] 
mc-manual.xml fix new/delete expresions -> expression

Spotted by Philippe Waroquiers

14 months agoregtest warnings: use %z for printf size_t
Paul Floyd [Sat, 27 Apr 2024 15:41:19 +0000 (17:41 +0200)] 
regtest warnings: use %z for printf size_t

14 months agowarnings: arm64 unused function in test and missing return for FreeBSD getauxval
Paul Floyd [Sat, 27 Apr 2024 11:42:57 +0000 (13:42 +0200)] 
warnings: arm64 unused function in test and missing return for FreeBSD getauxval

14 months agowarnings: remove two unused variables
Paul Floyd [Sat, 27 Apr 2024 11:30:35 +0000 (13:30 +0200)] 
warnings: remove two unused variables

14 months agoREADMEs: add details on dependencies needed to build and run tests.
Paul Floyd [Sat, 27 Apr 2024 11:23:21 +0000 (13:23 +0200)] 
READMEs: add details on dependencies needed to build and run tests.

14 months ago486180 - [Valgrind][MIPS] 'VexGuestArchState' has no member named 'guest_IP_AT_SYSCALL'
Paul Floyd [Sat, 27 Apr 2024 11:07:07 +0000 (13:07 +0200)] 
486180  - [Valgrind][MIPS] 'VexGuestArchState' has no member named 'guest_IP_AT_SYSCALL'

14 months agoUpdate memcheck description of C++ new and delete
Mark Wielaard [Fri, 26 Apr 2024 20:07:46 +0000 (22:07 +0200)] 
Update memcheck description of C++ new and delete

Lifted from valgrind-htdocs commit 73eaff0ad.

Left out the paragraph on C23 free_sized and free_sized_aligned not
being supported (they are now).

14 months agoAdd some website spelling fixes to xml files
Mark Wielaard [Fri, 26 Apr 2024 19:21:04 +0000 (21:21 +0200)] 
Add some website spelling fixes to xml files

Pick up some commits from valgrind-htdocs:

commit d97a1a24e

    Fix description of memory xtree.

    Was referring to function g2 which is not present in the screenshot.

    Suggested by Fabien Launay on valgrind-developers.

commit bc2801d98

Fix a few "the the" usages.

    One reported by Fabien Launay on valgrind-developers. The other
    two found with grep. There's a fourth one, but it's in a patch
    file so I've left it for now.

commit acc56391e

    Consistent spelling of visualize(r)

    Suggested by Fabien Launay on valgrind-developers

    I checked my Shorter Oxford English Dictionary, and there it is
    with a z. Good enough for me.

14 months ago-> 3.23.0 final VALGRIND_3_23_0
Mark Wielaard [Fri, 26 Apr 2024 16:44:47 +0000 (18:44 +0200)] 
-> 3.23.0 final

14 months agoNEWS: Add new instruction support for arm64, amd64, s390x and x86
Mark Wielaard [Fri, 26 Apr 2024 15:03:49 +0000 (17:03 +0200)] 
NEWS: Add new instruction support for arm64, amd64, s390x and x86

14 months agoAdd various none/tests/ppc64 test binaries to .gitignore
Mark Wielaard [Fri, 26 Apr 2024 12:52:46 +0000 (14:52 +0200)] 
Add various none/tests/ppc64 test binaries to .gitignore

14 months agoAdd valgrind-*tar.gz and bz2 to .gitignore
Mark Wielaard [Fri, 26 Apr 2024 12:48:33 +0000 (14:48 +0200)] 
Add valgrind-*tar.gz and bz2 to .gitignore

They are generated by make distcheck.

14 months agoUse 32 bit (with space) in sized_aligned_new_delete_misaligned test supp
Mark Wielaard [Thu, 25 Apr 2024 20:11:29 +0000 (22:11 +0200)] 
Use 32 bit (with space) in sized_aligned_new_delete_misaligned test supp

To be consistent with the space used in the exp-32 test file and all
other supp names.

14 months agos390x: Add support for the `NNPA' instruction
Andreas Arnez [Thu, 25 Apr 2024 12:38:45 +0000 (14:38 +0200)] 
s390x: Add support for the `NNPA' instruction

Finalize the NNPA facility support by handling the NNPA instruction
itself, using the new "extension" approach.  Also reflect NNPA facility
support in HWCAP and in the STFLE bits.

14 months agoSet version to 3.23.0-RC2
Mark Wielaard [Wed, 24 Apr 2024 22:45:49 +0000 (00:45 +0200)] 
Set version to 3.23.0-RC2

14 months agoglibc-2.X-helgrind.supp.in: Also recognize variants on gethostbyname2_r
Mark Wielaard [Wed, 24 Apr 2024 20:11:11 +0000 (22:11 +0200)] 
glibc-2.X-helgrind.supp.in: Also recognize variants on gethostbyname2_r

14 months agoFreeBSD syscall: add wrapper for kcmp
Paul Floyd [Wed, 24 Apr 2024 19:34:03 +0000 (21:34 +0200)] 
FreeBSD syscall: add wrapper for kcmp

For FreeBSD 15.0-CURRENT. Will need to add for 14.1 when it is out.
Mostly the same as the Linux kcmp syscall (small differences in the
supported types).

14 months agoAdd prereqs for tests using python 3.9+
Mark Wielaard [Wed, 24 Apr 2024 18:50:43 +0000 (20:50 +0200)] 
Add prereqs for tests using python 3.9+

Adds a script tests/python_test.sh that checks whether there is a python3
binary and that it supports python version 3.9 or higher. Use this script
in the various cachegrind/tests annotate vgtests as prereq.

14 months agoFreeBSD syswrap: wrong length for __sysctlbyname(name)
Paul Floyd [Wed, 24 Apr 2024 18:14:40 +0000 (20:14 +0200)] 
FreeBSD syswrap: wrong length for __sysctlbyname(name)

Copied and pasted from syscall where name is a pointer to array of ints
so the size has a '*sizeof(int)'. -byname name is a char* so should not
have the *4 factor.

From
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=278566

14 months agoAdd new bar_bad exp files to drd/tests/Makefile.am (EXTRA_DIST).
Mark Wielaard [Wed, 24 Apr 2024 17:24:02 +0000 (19:24 +0200)] 
Add new bar_bad exp files to drd/tests/Makefile.am (EXTRA_DIST).

14 months agoAdd another drd/tests/bar_bad exp variant.
Mark Wielaard [Wed, 24 Apr 2024 16:42:42 +0000 (16:42 +0000)] 
Add another drd/tests/bar_bad exp variant.

An uninitialized barrier might not be recognized as a barrier at all.

14 months agos390x: Improve operand names in trackers for PRNO
Andreas Arnez [Tue, 23 Apr 2024 14:27:11 +0000 (16:27 +0200)] 
s390x: Improve operand names in trackers for PRNO

The operand names in the trackers called in the implementation of the PRNO
extension do not indicate the extension being handled.  Change this by
adding the name PRNO to all these names.

14 months agoAdd dl_new_hash suppression to drd/tests/std_thread2.supp
Mark Wielaard [Wed, 24 Apr 2024 14:00:44 +0000 (16:00 +0200)] 
Add dl_new_hash suppression to drd/tests/std_thread2.supp

_dl_lookup_symbol_x is already suppressed and normally _dl_new_hash
seems inlined, but on some systems it isn't.

14 months agoVG_(show_open_fds) Only emit empty line when not creating xml output
Mark Wielaard [Wed, 24 Apr 2024 11:20:34 +0000 (13:20 +0200)] 
VG_(show_open_fds) Only emit empty line when not creating xml output

The "empty" line containing '== pid == ' would corrupt the xml output
with --track-fds=yes.

14 months agoFilter away "main" differences in filter_fdleak
Mark Wielaard [Tue, 23 Apr 2024 12:14:33 +0000 (14:14 +0200)] 
Filter away "main" differences in filter_fdleak

Stack traces showing where fds were created show some differences in
the "main" function, different line numbers, or (in binary) or (below
main). Since the precise location of the original call in the main
function isn't the goal of these tests just filer them all out and
replace them with a simple "main".

14 months agofilter out in /absolute/path in drd/tests stderr filter
Mark Wielaard [Sat, 20 Apr 2024 20:56:05 +0000 (22:56 +0200)] 
filter out in /absolute/path in drd/tests stderr filter

This filters out a line like:
by 0x........: ??? (in /home/mjw/valgrind/helgrind/tests/tc04_free_lock)
and replaces it with
by 0x........: ???

14 months agoAdd new .exp-32 files to memcheck/tests/Makefile.am EXTRA_DIST
Mark Wielaard [Sat, 20 Apr 2024 19:58:09 +0000 (21:58 +0200)] 
Add new .exp-32 files to memcheck/tests/Makefile.am EXTRA_DIST

14 months ago32 bit new_delete_mismatch_size and sized_aligned_new_delete_misaligned .exp
Mark Wielaard [Sat, 20 Apr 2024 19:30:59 +0000 (21:30 +0200)] 
32 bit new_delete_mismatch_size and sized_aligned_new_delete_misaligned .exp

Add 32 bit variants of the memcheck/tests/new_delete_mismatch_size_supp,
memcheck/tests/sized_aligned_new_delete_misaligned{2,3}_supp .exp files.

14 months agoFreeBSD suppression: puts reachable
Paul Floyd [Sat, 20 Apr 2024 16:42:41 +0000 (18:42 +0200)] 
FreeBSD suppression: puts reachable

14 months agoFreeBSD suppressions: yet more reachables
Paul Floyd [Sat, 20 Apr 2024 06:29:51 +0000 (08:29 +0200)] 
FreeBSD suppressions: yet more reachables

14 months agoFreeBSD suppression: reachable for setlocale
Paul Floyd [Sat, 20 Apr 2024 05:54:05 +0000 (07:54 +0200)] 
FreeBSD suppression: reachable for setlocale

Normally I have LANG=en_GB.UTF-8 and LC_ALL=C but if I switch to
C.UTF-8 for everything (which is the default for a fresh install)
then setlocale comes into the picture with a reachable allocation
on exit.

14 months agoFreeBSD suppression: add a suppression for __swbuf seen on arm64
Paul Floyd [Sat, 20 Apr 2024 05:50:31 +0000 (07:50 +0200)] 
FreeBSD suppression: add a suppression for __swbuf seen on arm64

Still no libc freeres.

14 months agoSet version to 3.23.0-RC1
Mark Wielaard [Sat, 20 Apr 2024 01:40:29 +0000 (03:40 +0200)] 
Set version to 3.23.0-RC1

14 months agoUpdate emitted Copyright years to include 2024
Mark Wielaard [Sat, 20 Apr 2024 01:36:01 +0000 (03:36 +0200)] 
Update emitted Copyright years to include 2024

Also adjust test exp and filters.

14 months agocore errors suppression support
Mark Wielaard [Fri, 19 Apr 2024 20:46:11 +0000 (22:46 +0200)] 
core errors suppression support

Add two new functions core_get_extra_suppression_info and
core_get_error_name as alternatives for tool suppression callbacks.
These functions are used in gen_suppression.

Instead of a tool name, a core error component name is "CoreError".

Two new suppression kinds FdBadCloseSupp and FdNotClosedSupp
were added. Corresponding to the FdBadClose and FdNotClosed
error kinds.

core_error_matches_suppression matches these suppression kinds
with error kinds.

core_get_extra_suppression_info and core_print_extra_suppression_use
are noops for core errors.

is_suppressible_error, supp_matches_error, load_one_suppressions_file
and show_used_suppressions have been adjusted to work with core
error kinds.

A new function VG_(found_or_suppressed_errs) helps to not output
an empty error summary if only core errors are requested, but no
errors were detected.

VG_(clo_track_fds) has been moved from pub_core_options.h to
pub_tool_options.h. And VG_(needs_core_errors) now takes a Bool
that can be set to false in the tool post_clo_init handler. This
is used in the none tool to request core errors, but disable all
reporting if no option has been given that enables such errors.

This make sure only the none/tests/fdleak_ipv4.stderr.exp needs
adjustment. For all other tests the output is exactly as before.

https://bugs.kde.org/show_bug.cgi?id=485778

14 months agoFix const signedness issue in VG_(show_open_fds)
Mark Wielaard [Fri, 19 Apr 2024 14:59:25 +0000 (16:59 +0200)] 
Fix const signedness issue in VG_(show_open_fds)

The colon variable should be a const HChar.

14 months agoImprove file descriptor xml output, add fd and path elements
Alexandra Hájková [Thu, 18 Apr 2024 09:21:49 +0000 (05:21 -0400)] 
Improve file descriptor xml output, add fd and path elements

Add needs_xml_output to none tool so it can also output xml when
--track-fds enabled.

Use xml protocolversion 5 when clo_track_fds is enabled

Split OpenFD pathname and description. Add description when a file
descriptor is closed so it can be used in a future error. On error
print <fd> element and (if known) a <path> element.

Add docs/internals/xml-output-protocol5.txt.

https://bugs.kde.org/show_bug.cgi?id=328563

Co-Authored-By: Mark Wielaard <mark@klomp.org>
14 months agoAdd core errors and use them to implement file descriptor tracker
Mark Wielaard [Wed, 20 Mar 2024 05:44:23 +0000 (01:44 -0400)] 
Add core errors and use them to implement file descriptor tracker

All the tool error callbacks now have a core error equivalent.
core errors are negative (while tool errors are positive).
There are two new ones for tracking issues with file descriptors.
FdBadClose (-2) and FdNotClosed (-3).

Add following core error functions with delegates to file descriptor
specific functions (implemented in syswrap-generic):

- core_eq_Error (fd_eq_Error)
  Compares core errors to detect duplicates
- core_before_pp_Error (fd_before_pp_Error)
  Currently prints nothing for known core errors and
  exists with FATAL for unknown core errors
- core_pp_Error (fd_pp_Error)
  For FdBadClose prints the backtraces for the file descriptor was
  opened, where it was originally closed and where it was closed again.
  For FdNotClosed prints where the file descriptor was opened.
- core_update_extra (fd_update_extra)
  Returns the size of the BadCloseExtra or FdNotClosedExtra struct
  which data needs to be saved (the fd number, pathname/description
  and previous backtraces).

We now accept the error (ExeContext) where to be NULL.
This is necessary for reporting not closed file descriptors when
the descriptor is inherited from the parent (so wasn't actually
created and doesn't have a 'where' in the current process code).

All the testcases still pass since the (stderr) output is the
same. But now they count as "real" errors. And so --error-exitcode
does now also work for file descriptor errors or leaks.

https://bugs.kde.org/show_bug.cgi?id=362680

Co-authored-by: Alexandra Hájková <ahajkova@redhat.com>
14 months agoAdd FreeBSD arm64 to README list of platforms
Paul Floyd [Thu, 18 Apr 2024 18:53:58 +0000 (20:53 +0200)] 
Add FreeBSD arm64 to README list of platforms