]> git.ipfire.org Git - thirdparty/valgrind.git/log
thirdparty/valgrind.git
10 months agoComments: update comments added for Bug 492663
Paul Floyd [Mon, 16 Sep 2024 06:07:15 +0000 (08:07 +0200)] 
Comments: update comments added for Bug 492663

10 months agoBug 492210 - False positive on x86/amd64 with ZF taken directly from addition
Paul Floyd [Sun, 15 Sep 2024 07:52:56 +0000 (09:52 +0200)] 
Bug 492210 - False positive on x86/amd64 with ZF taken directly from addition

Also adds similar checks for short and char equivalents to the
original int reproducer.

Initial fix provided by
   Alexander Monakov <amonakov@gmail.com>

Two versions of the testcase, one with default options and one with
-expensive-definedness-checks=yes because the byte operations
subb and addb need the flag turned on explicitly.

10 months agoFreeBSD: add file descriptor tracking for _umtx_op
Paul Floyd [Sat, 14 Sep 2024 18:56:54 +0000 (20:56 +0200)] 
FreeBSD: add file descriptor tracking for _umtx_op

UMTX_OP_SHM with a sub request of UMTX_SHM_CREAT creates
an anonymous shared memory object and returns a file
descriptor. This fd is now tracked when required.

10 months agoFreeBSD 13.4: change conditional compilation for recent syscalls
Paul Floyd [Fri, 13 Sep 2024 07:34:26 +0000 (09:34 +0200)] 
FreeBSD 13.4: change conditional compilation for recent syscalls

10 months agoFreeBSD: initial support for version 13.4
Paul Floyd [Fri, 13 Sep 2024 06:47:23 +0000 (08:47 +0200)] 
FreeBSD: initial support for version 13.4

10 months agos390x: Add MSA support
Andreas Arnez [Tue, 10 Sep 2024 16:38:49 +0000 (18:38 +0200)] 
s390x: Add MSA support

Handle instructions that were added to z/Architecture with the
message-security assist (MSA) facility or with one of its extensions up to
MSA extension 9:

   km -- ``cipher message''
   kmc -- ``cipher message with chaining''
   kimd -- ``compute intermediate message digest''
   klmd -- ``compute last message digest''
   kmac -- ``compute message authentication code''
   kmf -- ``cipher message with cipher feedback''
   kmctr -- ``cipher message with counter''
   kmo -- ``cipher message with output feedback''
   pcc -- ``perform cryptographic computation''
   kma -- ``cipher message with authentication''
   kdsa -- ``compute digital signature authentication''

Each of these instructions has multiple functions.  Support all functions
described by MSA levels up to extension 9.  Handle the instructions as
"extensions" and essentially forward them to the instructions themselves,
as long as they are available on the host.

Note that the MSA-3 instruction

   pkcmo -- ``perform cryptographic key management operation''

will not be handled by this change, since it is privileged and should not
occur in user-space programs.

The MSA facilities are typically used by cryptographic libraries like
OpenSSL or openCryptoki.  So far Valgrind suppresses the facility bits
indicating any MSA support, which causes such libraries to revert to a
software implementation.

This change enables running cryptographic applications under Valgrind
without reverting to an alternate code path.

10 months agoFreeBSD nightly: increase parallel build to 4 jobs
Paul Floyd [Mon, 9 Sep 2024 05:51:51 +0000 (07:51 +0200)] 
FreeBSD nightly: increase parallel build to 4 jobs

16 months agoAdd 492663 to NEWS
Paul Floyd [Sat, 16 Mar 2024 03:51:37 +0000 (04:51 +0100)] 
Add 492663 to NEWS

10 months agoFreeBSD suppression: reachables from libc scanf and srand
Paul Floyd [Sat, 7 Sep 2024 10:02:50 +0000 (12:02 +0200)] 
FreeBSD suppression: reachables from libc scanf and srand

Still no libc freeres on FreeBSD.

10 months agoBug 492663 - Valgrind ignores debug info for some binaries
Paul Floyd [Sat, 7 Sep 2024 07:06:03 +0000 (09:06 +0200)] 
Bug 492663 - Valgrind ignores debug info for some binaries

ML_(check_elf_and_get_rw_loads) now always checks for
merged PT_LOADs when called from valgrind_main when
iterating over nsegments.

Updated comments and changed variable names and the
debug message when the number of expected RW PT_LOADs
hasn't been reached.

10 months agoLinux regtest: add gdbserver filter for debuginfod messages
Paul Floyd [Fri, 6 Sep 2024 19:47:38 +0000 (21:47 +0200)] 
Linux regtest: add gdbserver filter for debuginfod messages

11 months agovalgrind testing: fix vg_regtest individual-test mode
Frank Ch. Eigler [Tue, 3 Sep 2024 17:30:13 +0000 (13:30 -0400)] 
valgrind testing: fix vg_regtest individual-test mode

One of the new log files was created in a way that was
oblivious to the chdir()'s in effect in the perl script.

Signed-off-by: Frank Ch. Eigler <fche@redhat.com>
11 months agoNEWS: Add 492214 sys_statx: support for statx(fd, NULL, AT_EMPTY_PATH)
Mark Wielaard [Mon, 2 Sep 2024 17:17:05 +0000 (19:17 +0200)] 
NEWS: Add 492214 sys_statx: support for statx(fd, NULL, AT_EMPTY_PATH)

This was resolved in commit de408f75bf28d76a0016325b75f14be45631472a

11 months agoFreeBSD regtest: add an expected for FreeBSD 14.1 amd64
Paul Floyd [Sun, 1 Sep 2024 19:45:24 +0000 (21:45 +0200)] 
FreeBSD regtest: add an expected for FreeBSD 14.1 amd64

Some old FreeBSD 7 syscalls have been removed.

11 months agosys_statx: support for statx(fd, NULL, AT_EMPTY_PATH)
Miao Wang [Mon, 26 Aug 2024 14:08:43 +0000 (22:08 +0800)] 
sys_statx: support for statx(fd, NULL, AT_EMPTY_PATH)

statx(fd, NULL, AT_EMPTY_PATH) is supported since Linux 6.11 and this
patch adds the support to valgrind, so that it won't complain when
NULL is used as |filename| and |flags| includes AT_EMPTY_PATH.

Ref: commit 0ef625bba6fb ("vfs: support statx(..., NULL, AT_EMPTY_PATH, ...)")

Signed-off-by: Miao Wang <shankerwangmiao@gmail.com>
11 months agoLinux: updates to stat scructs
Paul Floyd [Tue, 27 Aug 2024 05:39:48 +0000 (07:39 +0200)] 
Linux: updates to stat scructs

I added these as part of the work on bug 317127.

11 months agovalgrind testing: extend vg_regtest to emit automake-style .trs/.log files
Frank Ch. Eigler [Fri, 19 Jul 2024 15:55:03 +0000 (11:55 -0400)] 
valgrind testing: extend vg_regtest to emit automake-style .trs/.log files

Extend vg_regtest to produce automake-style log files for each vgtest
case, so that developers and testsuite archiving/analysis tools such
as bunsen can examine passing as well as non-passing test outputs in
detail.  The build-tree test-suite-overall.log file holds all the key
information about tests, especially failures.

Signed-Off-By: Frank Ch. Eigler <fche@redhat.com>
11 months agoBug 491394i - (vgModuleLocal_addDiCfSI): Assertion 'di->fsm.have_rx_map && di->fsm...
Paul Floyd [Tue, 20 Aug 2024 19:44:00 +0000 (21:44 +0200)] 
Bug 491394i - (vgModuleLocal_addDiCfSI): Assertion 'di->fsm.have_rx_map && di->fsm.rw_map_count' failed.

11 months agos390x: Fix PC calculations with EX/EXRL
Andreas Arnez [Mon, 19 Aug 2024 13:22:40 +0000 (15:22 +0200)] 
s390x: Fix PC calculations with EX/EXRL

When executing under EX or EXRL, some instructions yield wrong results
under Valgrind.  This affects

* PC-relative instructions such as LARL or BRC

* instructions that set a link register, such as BASR

The issue is caused by confusions about the various instruction addresses
involved.  When executing an instruction under EX or EXRL, the following
addresses are relevant:

(1) The address of the execute instruction (guest_IA_curr_instr).  This is
needed when restarting the instruction or iterating over it.

(2) The address following the execute instruction (guest_IA_next_instr).
This is what a link register needs to be set to.

(3) The address of the target instruction.  This is the base for relative
addressing.

The latter isn't handled at all when translating for EX/EXRL.  And the
instructions that set a link register don't use guest_IA_next_instr, but
add their own instruction length to guest_IA_curr_instr.  This is wrong
whenever the target instruction and the EX/EXRL instruction have different
lengths.

Fix all this and enhance the test cases accordingly.  The updated test
cases fail before this patch and succeed afterwards.

11 months agos390x: Fix performance issue with EXRL
Andreas Arnez [Tue, 13 Aug 2024 11:52:07 +0000 (13:52 +0200)] 
s390x: Fix performance issue with EXRL

Valgrind can currently run into a situation where a code block containing
EXRL is re-translated over and over, potentially causing extreme
slow-down.  Such a slow-down has been observed when running the following
command under Valgrind:

  openssl kdf -digest sha512 -keylen 20 -kdfopt pass:12345678 \
    -kdfopt salt:abcdefgh -kdfopt iter:100000 PBKDF2

z/Architecture has the "execute" instructions EX and EXRL.  Valgrind
handles EX by translating it at least twice.  The first translation just
copies the target instruction to the variable `last_execute_target' and
triggers a "restart", invalidating the current BB and creating a new BB
that starts with EX.  The second translation contains the IR for the
instruction in `last_execute_target', but first checks if this still
matches the instruction to be executed.  If not, it initiates a "restart",
as above.  For EXRL there is a shortcut that sets `last_execute_target'
without going through the first translation.

Now the combination of two issues in the current implemenation typically
leads to an EXRL being translated every time:

(1) An EXRL can appear in the middle of a BB.  If so, a "restart" will
    discard everything in the BB up to this point.  And when getting back
    to the same instructions, everything will be re-translated again.

(2) After commit 7e9113cb7a249e0fae2a365462c6b016 (handling Bug 405403),
    the shortcut in s390_irgen_EXRL() only fills 6 instead of 8 bytes into
    `last_execute_target', while the check still compares this to 8 bytes
    from the target location.  Thus the check usually fails, triggering a
    "restart" of EXRL.

The first issue does not apply to EX, because there was already logic for
terminating a BB before an EX instruction.  Just extend that logic and
treat EXRL the same way.

The second issue is caused by the discrepancy of reading 6 versus 8 bytes
and comparing these two.  But in fact, reading 6 or 8 bytes are both
incorrect.  Only the bytes that belong to the instruction should be read
and compared.  The instruction length can be determined from the first
byte `b' at the target location (2 bytes if b < 0x40, 4 bytes if b < 0xc0,
and 6 bytes otherwise), so do this.

11 months agos390x: Fix disassembly of locfh/locfhr, update S390_MAX_MNEMONIC_LEN
Andreas Arnez [Thu, 8 Aug 2024 12:56:50 +0000 (14:56 +0200)] 
s390x: Fix disassembly of locfh/locfhr, update S390_MAX_MNEMONIC_LEN

The length of the "longest mnemonic" for the s390x disassembler is
currently defined in s390_defs.h to be 8 characters, where in fact it
should be 9.  Update the constant to reflect that.

Also fix the disassembly of the instructions locfh and locfhr, changing
them from their current wrong representations `locgh' and `locghr'.

12 months agoconfigure: drop -flto-partition=one
Sam James [Mon, 22 Jul 2024 11:26:39 +0000 (12:26 +0100)] 
configure: drop -flto-partition=one

For me, -flto-partition=one takes ~35m to build + test, while the default
(which is 'balanced') takes ~5m.

The reason that -flto-partition=one is slower is because it disables all
of gcc's LTO parallelisation. This can produce better code, at the cost
of (far) more expensive build times. If users want that, they can still
pass it in their *FLAGS, but I don't think it's a suitable default.

This was originally added in ab773096df7aaaf46e8883af5ed4690f4d4499af.

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

12 months agos390x: Re-implement STFLE as an extension
Andreas Arnez [Wed, 10 Jul 2024 16:47:07 +0000 (18:47 +0200)] 
s390x: Re-implement STFLE as an extension

The existing implementation of the STFLE instruction does not use the
correct operand size when tracking memory effects.  Instead of respecting
the user-provided maximum number of doublewords and the returned value
from the instruction, it assumes a hard coded value (S390_NUM_FACILITY_DW)
instead.

For example, if an application passes a buffer of 3 doublewords to STFLE
while Valgrind assumes a fixed size of 4 doublewords, Valgrind may falsely
complain about an invalid write for the last doubleword.

Fix this by re-implementing STFLE via the extension mechanism.

12 months agos390x: Fix PRNO for SHA-512-DRNG generate
Andreas Arnez [Wed, 10 Jul 2024 16:47:07 +0000 (18:47 +0200)] 
s390x: Fix PRNO for SHA-512-DRNG generate

In the implementation of PRNO, when handling the "SHA-512-DRNG generate"
operation, the updated length is written back to the wrong register.
Also, while the instruction fills the output buffer from right-to-left,
the memory tracking is done as if it were the other way around.  Fix both
of these issues.

12 months agomanual: fix broken link to info on gxx free store
Paul Floyd [Wed, 10 Jul 2024 06:49:55 +0000 (08:49 +0200)] 
manual: fix broken link to info on gxx free store

12 months agoFix typo in a configure.ac comment.
Philippe Waroquiers [Tue, 9 Jul 2024 19:14:36 +0000 (21:14 +0200)] 
Fix typo in a configure.ac comment.

LTO_RANLIG -> LTO_RANLIB

12 months agoregtest: fix regression in posix_memalign test
Paul Floyd [Sun, 7 Jul 2024 16:42:53 +0000 (18:42 +0200)] 
regtest: fix regression in posix_memalign test

12 months agoSolaris regtest: warning clearup
Paul Floyd [Sun, 7 Jul 2024 09:02:14 +0000 (11:02 +0200)] 
Solaris regtest: warning clearup

13 months agovgdb: Handle EINTR and EAGAIN more consistently
Mark Wielaard [Wed, 3 Jul 2024 13:51:06 +0000 (15:51 +0200)] 
vgdb: Handle EINTR and EAGAIN more consistently

Always handle EINTR or EAGAIN when calling read or write. Also be
consistent in the use of size_t and ssize_t for arguments and return
values.

This should make vgdb more robust against receiving signals or a
blocked pipe at the wrong time.

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

13 months agoAvoid dev/inode check on btrfs with --sanity-level=3
Mark Wielaard [Thu, 4 Jul 2024 13:21:39 +0000 (15:21 +0200)] 
Avoid dev/inode check on btrfs with --sanity-level=3

With --sanity-level=3 or higher the aspacemgr sanity checks the
device/inode numbers from /proc/self/maps to the file stat
results. These don't match on btrfs. So detect when a file is on a
btrfs volume and ignore the check in that case.

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

13 months agogdbserver_tests filters remove more verbose python rpm load warnings
Mark Wielaard [Thu, 4 Jul 2024 16:04:18 +0000 (18:04 +0200)] 
gdbserver_tests filters remove more verbose python rpm load warnings

The rpm python load warnings on Fedora became even more verbose.
Filter out all stderr messages related to them so tests don't fail.

13 months agoVEX/priv/host_arm_isel.c (doHelperCall): Fix nextArgReg guard
Mark Wielaard [Tue, 2 Jul 2024 14:47:19 +0000 (16:47 +0200)] 
VEX/priv/host_arm_isel.c (doHelperCall): Fix nextArgReg guard

We need two args, so change the guard to nextArgReg + 1 >= ARM_N_ARGREGS.

13 months agoarm64 regtest: bug489338 testcase needs to link with maths library on Linux
Paul Floyd [Mon, 1 Jul 2024 11:47:07 +0000 (13:47 +0200)] 
arm64 regtest: bug489338 testcase needs to link with maths library on Linux

13 months agoarm64 regtest: add 2 tests for bug489338
Paul Floyd [Mon, 1 Jul 2024 06:24:39 +0000 (08:24 +0200)] 
arm64 regtest: add 2 tests for bug489338

13 months agoarm64: Fix fcvtas instruction.
Bernhard Übelacker [Thu, 27 Jun 2024 20:51:09 +0000 (22:51 +0200)] 
arm64: Fix fcvtas instruction.

13 months agoImplement VMOVQ xmm1, xmm2/m64
Mark Wielaard [Sun, 30 Jun 2024 18:17:32 +0000 (20:17 +0200)] 
Implement VMOVQ xmm1, xmm2/m64

We implemented the memory variant already, but not the reg variant.
Add a separate avx-vmovq testcase, because avx-1 is already really big.

https://bugs.kde.org/show_bug.cgi?id=391148
https://bugs.kde.org/show_bug.cgi?id=417572
https://bugs.kde.org/show_bug.cgi?id=489088

13 months agoBug 489040 massif trace change to show the location increasing the stack
Philippe Waroquiers [Sun, 30 Jun 2024 10:07:11 +0000 (12:07 +0200)] 
Bug 489040 massif trace change to show the location increasing the stack

Massif verbose output showing the code location that increases the stack.

13 months agoAdd track-fds-exec-children to .gitignore
Paul Floyd [Sun, 30 Jun 2024 05:29:24 +0000 (07:29 +0200)] 
Add track-fds-exec-children to .gitignore

13 months agogdbserver_tests filters remove python rpm module load warning
Mark Wielaard [Mon, 24 Jun 2024 12:56:37 +0000 (14:56 +0200)] 
gdbserver_tests filters remove python rpm module load warning

gdb on Fedora will warn not being able to load the rpm python module.
Unable to load 'rpm' module.  Please install the python3-rpm package.
Filter out that message so tests don't fail.

13 months agoupdate NEWS with fix for #444781
Petar Jovanovic [Mon, 24 Jun 2024 11:03:12 +0000 (11:03 +0000)] 
update NEWS with fix for #444781

The KDE issue #444781 has been fixed in

  commit efaa17e53a750d5f0f4c138b507b1b104729ed67
  mips: skip using shared syscall numbers for mips64

  commit 54d6ad3348fb50f5b972fe9c05d0d8757bfe73ba
  mips: skip using shared syscall numbers for mips32

13 months agomips: skip using shared syscall numbers for mips64
Petar Jovanovic [Mon, 24 Jun 2024 10:33:46 +0000 (10:33 +0000)] 
mips: skip using shared syscall numbers for mips64

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

This fixes KDE #444781.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Aleksandar Rikalo <arikalo@gmail.com>
13 months agoAdd bug 479661 to NEWS
Mark Wielaard [Sun, 23 Jun 2024 19:40:11 +0000 (21:40 +0200)] 
Add bug 479661 to NEWS

This was fixed in commit 1263471efdf8
"Close both internal pipe fds after VG_(fork) in parent and child".

13 months agoDon't allow programs calling fnctl on valgrind's own file descriptors
Alexandra Hájková [Thu, 20 Jun 2024 11:45:56 +0000 (07:45 -0400)] 
Don't allow programs calling fnctl on valgrind's own file descriptors

Add a call to ML_(fd_allowed) in the PRE handler of fcntl and fcntl64
and block syscalls with EBADF when the file descriptor isn't allowed
to be used by the program.

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

13 months agoFreeBSD configure: missed splitting freebsd_14 to freebsd_14_0
Paul Floyd [Mon, 17 Jun 2024 19:32:44 +0000 (21:32 +0200)] 
FreeBSD configure: missed splitting freebsd_14 to freebsd_14_0

Affects building a few regression tests.

13 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

13 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
13 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).

13 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

13 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.

13 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

13 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

13 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

13 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

13 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.

13 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

13 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

14 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.

14 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

14 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).

14 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

14 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

14 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.

14 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

14 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.

14 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.

14 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?

14 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.

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

14 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

14 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.

14 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

14 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.

14 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.

14 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.

14 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.

14 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.

14 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

14 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.

14 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.

14 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.

14 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.

14 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.

14 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.

14 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

14 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>

14 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>
14 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

14 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)

14 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>
14 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.

14 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.

14 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.

14 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

14 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.

14 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

15 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

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

15 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

15 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.

15 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