]> git.ipfire.org Git - thirdparty/valgrind.git/log
thirdparty/valgrind.git
9 days agoBug 511329 - Darwin and FreeBSD: Move setting of carry flag out of ML_(do_syscall_for...
Paul Floyd [Wed, 29 Oct 2025 18:50:05 +0000 (19:50 +0100)] 
Bug 511329 - Darwin and FreeBSD: Move setting of carry flag out of ML_(do_syscall_for_client_WRK) part 1

This changeset includes the changes to ML_(do_syscall_for_client_WRK)
for the 3 supported FreeBSD platforms.

To come: Darwin x86/amd64 and removing the SETC flag from the guest state
(and its OFFSET).

9 days agoFreeBSD regtest: rationalise memcheck test-plo-no expecteds
Paul Floyd [Wed, 29 Oct 2025 19:40:44 +0000 (20:40 +0100)] 
FreeBSD regtest: rationalise memcheck test-plo-no expecteds

Now just one 32bit expected.

9 days agoFreeBSD comment: fix amd64 do_syscall_WRK arg comments
Paul Floyd [Wed, 29 Oct 2025 15:08:28 +0000 (16:08 +0100)] 
FreeBSD comment: fix amd64 do_syscall_WRK arg comments

I recently changed the amd64 syscall to lower the max number
of args handled but didn't update the corresponding comment.

9 days agoFreeBSD regtest: clobber R11 for memcheck/tests/leak_cpp_interior
Paul Floyd [Wed, 29 Oct 2025 14:54:59 +0000 (15:54 +0100)] 
FreeBSD regtest: clobber R11 for memcheck/tests/leak_cpp_interior

9 days agoDarwin regtest: simplify memcheck filter_supp
Paul Floyd [Wed, 29 Oct 2025 13:25:04 +0000 (14:25 +0100)] 
Darwin regtest: simplify memcheck filter_supp

The filter removes used suppression lines and duplicate lines.
Old Darwin sed doesn't understand 'M{}', so use "cat -s" to remove
duplicate blank lines instead.

9 days agoDarwin: gettaddrinfo suppressions and wildcard memmove redir
Paul Floyd [Wed, 29 Oct 2025 10:20:22 +0000 (11:20 +0100)] 
Darwin: gettaddrinfo suppressions and wildcard memmove redir

9 days agowarnings: one more -Wno-deprecated-declarations flag
Paul Floyd [Wed, 29 Oct 2025 07:06:28 +0000 (08:06 +0100)] 
warnings: one more -Wno-deprecated-declarations flag

11 days agos390x: Testcase workaround
Florian Krohm [Mon, 27 Oct 2025 13:09:04 +0000 (13:09 +0000)] 
s390x: Testcase workaround

GCC 14.2.0 does not recognize convert to fixed/logical opcodes:

bfp-convert.c: Assembler messages:
bfp-convert.c:205: Error: Unrecognized opcode: `cfebra'
bfp-convert.c:210: Error: Unrecognized opcode: `cgebra'
...
bfp-convert.c:314: Error: Unrecognized opcode: `clfebr'
bfp-convert.c:314: Error: Unrecognized opcode: `clgebr'
...

11 days agoRemove a FIXME.
Florian Krohm [Sun, 26 Oct 2025 22:08:48 +0000 (22:08 +0000)] 
Remove a FIXME.

538 to go.

11 days agos390x: Enable "convert to logical" BFP test
Florian Krohm [Sun, 26 Oct 2025 21:45:32 +0000 (21:45 +0000)] 
s390x: Enable "convert to logical" BFP test

This was disabled because I had thought that a negative
operand value should result in a condition code of 1. Not so.
Additionally the operand value must be 0 after rounding.

12 days agoregtest: update none/tests/linux/bug506910.cpp to add errno value
Paul Floyd [Sun, 26 Oct 2025 19:41:38 +0000 (20:41 +0100)] 
regtest: update none/tests/linux/bug506910.cpp to add errno value

This test recently had a couple of failures. Don't know why, but know
that errno wasn't the expected ELOOP. This change adds the value of
errno.

12 days agoregtest: correct a typo
Paul Floyd [Sun, 26 Oct 2025 17:44:18 +0000 (18:44 +0100)] 
regtest: correct a typo

nothow instead of nothrow

12 days agoconfigure.ac: fix build lzcnt test to work on both i386 and amd64
Mark Wielaard [Sun, 26 Oct 2025 14:23:23 +0000 (15:23 +0100)] 
configure.ac: fix build lzcnt test to work on both i386 and amd64

The BUILD_LZCNT_TESTS conditional is used in both
none/tests/x86/Makefile.am and none/tests/amd64/Makefile.am to check
whether to build the lzcnt32 and lzcnt64 test program. However the
configure test uses %rax which is only available on amd64. Use %eax
instead to make sure the configure test succeeds on both i386 and
amd64.

12 days agoregtest: use FLAG_NO_PIE
Paul Floyd [Sun, 26 Oct 2025 08:47:20 +0000 (09:47 +0100)] 
regtest: use FLAG_NO_PIE

Now sure that the compiler won't complain.

12 days agoregtest: fix typo in previous commmit that was supposed to fix deprecated declaration...
Paul Floyd [Sun, 26 Oct 2025 08:33:32 +0000 (09:33 +0100)] 
regtest: fix typo in previous commmit that was supposed to fix deprecated declaration warnings

I even managed to copy the line 3 more times without noticing.

12 days agoDarwin: deprecated warning cleanup
Paul Floyd [Sat, 25 Oct 2025 21:04:37 +0000 (23:04 +0200)] 
Darwin: deprecated warning cleanup

Mainly sem* and syscall().

12 days agoAvoid linker warnings in various x86/amd64 testcases.
Florian Krohm [Sat, 25 Oct 2025 20:50:22 +0000 (20:50 +0000)] 
Avoid linker warnings in various x86/amd64 testcases.

Like so:
/usr/bin/ld: int3-x86.o: warning: relocation in read-only section `.text'
/usr/bin/ld: warning: creating DT_TEXTREL in a PIE

Link with -no-pie.

13 days agoBug 487055 - memcheck/tests/x86-linux/scalar fails running in Docker
Paul Floyd [Sat, 25 Oct 2025 15:56:50 +0000 (17:56 +0200)] 
Bug 487055 - memcheck/tests/x86-linux/scalar fails running in Docker

Also move to 3.27.0.GIT.

Will this fix some of the failures in the nightly tests?

2 weeks ago-> 3.26.0 final VALGRIND_3_26_0
Mark Wielaard [Fri, 24 Oct 2025 18:24:02 +0000 (20:24 +0200)] 
-> 3.26.0 final

2 weeks agoDon't warn about fcntl F_GETFD with --track-fds
Mark Wielaard [Fri, 24 Oct 2025 16:31:31 +0000 (18:31 +0200)] 
Don't warn about fcntl F_GETFD with --track-fds

fcntl F_GETFD is used to check if a file descriptor is valid, so only
make sure it isn't a valgrind fd, otherwise we might warn, with
--track-fds=bad for any bad fd.

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

2 weeks agoSilence false positive failure of LTP munmap01
Martin Cermak [Mon, 13 Oct 2025 07:53:56 +0000 (09:53 +0200)] 
Silence false positive failure of LTP munmap01

After upgrading LTP testsuite version to 20250930 (tracked in bug
510169) munmap01 syscall test started failing.  It however turns out
that this testcase was substantially rewritten and the failure is
expected.  This update will silence mentioned false positive.

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

2 weeks agoNEWS: Add bug 510694 Handle qExecAndArgs remote protocol packet
Mark Wielaard [Fri, 24 Oct 2025 14:48:09 +0000 (16:48 +0200)] 
NEWS: Add bug 510694 Handle qExecAndArgs remote protocol packet

Fixed in f80358f109d1 server.c: handle qExecAndArgs remote protocol packet

2 weeks agoserver.c: handle qExecAndArgs remote protocol packet
Alexandra Hájková [Wed, 15 Oct 2025 10:27:25 +0000 (06:27 -0400)] 
server.c: handle qExecAndArgs remote protocol packet

New qExecAndArgs packet has been added recently to GDB's remote
protocol.

The new qExecAndArgs packet is sent from GDB, and gdbserver replies
with a packet that includes the executable filename and the arguments
string that were used for starting the initial inferior.

On the GDB side this information can be used to update GDB's state,
the 'show remote exec-file' will reflect how gdbserver was started,
and 'show args' will reflect the arguments used for starting the
inferior.

When running valgrind together with GDB like this:

./vg-in-place --tool=memcheck --vgdb-error=0 /bin/ls -lh

~/build/gdb/gdb/gdb
target remote | coregrind/vgdb
We can now ask GDB to show the executable's arguments:

(gdb) show args

Argument list to give program being debugged when it is started is "-lh".

or the executable's name:

(gdb) show remote exec-file
The remote exec-file is "/bin/ls".

2 weeks agogdbserver_tests: Avoid l10n problems with gdb tests
Matthias Schwarzott [Fri, 24 Oct 2025 04:26:51 +0000 (06:26 +0200)] 
gdbserver_tests: Avoid l10n problems with gdb tests

GNU gdb (Ubuntu 12.1-0ubuntu1) 12.1
with LANG=de_DE.UTF-8

Fixes these issues:
== 26 tests, 0 stderr failures, 0 stdout failures, 14 stderrB failures, 10 stdoutB failures, 0 post failures ==
gdbserver_tests/hginfo                   (stdoutB)
gdbserver_tests/hginfo                   (stderrB)
gdbserver_tests/hgtls                    (stdoutB)
gdbserver_tests/mcblocklistsearch        (stderrB)
gdbserver_tests/mcbreak                  (stdoutB)
gdbserver_tests/mcbreak                  (stderrB)
gdbserver_tests/mcclean_after_fork       (stdoutB)
gdbserver_tests/mcclean_after_fork       (stderrB)
gdbserver_tests/mcinfcallWSRU            (stderrB)
gdbserver_tests/mcleak                   (stdoutB)
gdbserver_tests/mcleak                   (stderrB)
gdbserver_tests/mcmain_pic               (stdoutB)
gdbserver_tests/mcmain_pic               (stderrB)
gdbserver_tests/mcvabits                 (stdoutB)
gdbserver_tests/mcvabits                 (stderrB)
gdbserver_tests/mcwatchpoints            (stdoutB)
gdbserver_tests/mssnapshot               (stdoutB)
gdbserver_tests/mssnapshot               (stderrB)
gdbserver_tests/nlgone_abrt              (stderrB)
gdbserver_tests/nlgone_return            (stderrB)
gdbserver_tests/nlpasssigalrm            (stdoutB)
gdbserver_tests/nlpasssigalrm            (stderrB)
gdbserver_tests/nlself_invalidate        (stderrB)
gdbserver_tests/nlsigvgdb                (stderrB)

All issues are similar to this:
  --- mcblocklistsearch.stderrB.exp
  +++ mcblocklistsearch.stderrB.out
  @@ -1,7 +1,8 @@
   vgdb-error value changed from 0 to 999999
  -Breakpoint 1 at 0x........: file leak-tree.c, line 42.
  -Breakpoint 2 at 0x........: file leak-tree.c, line 68.
  +Haltepunkt 1 at 0x........: file leak-tree.c, line 42.
  +Haltepunkt 2 at 0x........: file leak-tree.c, line 68.
   Continuing.
  +Warnung: Missing auto-load script at offset 0 in section .debug_gdb_scripts
   Breakpoint 1, f () at leak-tree.c:42
   42        t->l    = mk();   // B
   Continuing.
  @@ -63,4 +64,4 @@
     0x........[16] indirect loss record 4
     0x........[16] indirect loss record 5
   monitor command request to kill this process
  -Remote connection closed
  +Remote Verbindung wurde beendet

2 weeks agoconfigure.ac: Use primary arch flags for openssl and libaio checks
Mark Wielaard [Thu, 23 Oct 2025 23:12:19 +0000 (01:12 +0200)] 
configure.ac: Use primary arch flags for openssl and libaio checks

Make sure that the configure check for openssl/crypto and libaio use
the primary arch flags. These are used in testcases for the primary
arch and should compile and link with the primary arch flags (which
are empty on most arches, but are set explicitly on e.g. mips).

Move the libaio check after the compiler check flags.

2 weeks agonone/tests/s390x/bfp-emit testcase: Assorted fixes.
Florian Krohm [Thu, 23 Oct 2025 22:35:27 +0000 (22:35 +0000)] 
none/tests/s390x/bfp-emit testcase: Assorted fixes.

Make function check_valgrind_output actually check something..
Remove --check-prereq logic. It is not needed. I think I was doing some
experiment of using objdump to make sure the insns written out by
valgrind match those produced by objdump. And then there was different
behaviour of objdump in different versions.

2 weeks agos390x testcases: Fix valgrind invocation
Florian Krohm [Thu, 23 Oct 2025 21:10:57 +0000 (21:10 +0000)] 
s390x testcases: Fix valgrind invocation

coregrind/valgrind works iff valgrind was installed beforehand.
But we don't know that. Use vg-in-place instead.

2 weeks agos390-runone: Add command line option --cc=... to choose a compiler.
Florian Krohm [Thu, 23 Oct 2025 21:06:41 +0000 (21:06 +0000)] 
s390-runone: Add command line option --cc=... to choose a compiler.

gcc is still default, --cc=whatever overrides.

2 weeks agoHook up ioprio_{get,set}, [vm]splice, tee and bpf syscalls on arm-linux
Mark Wielaard [Wed, 22 Oct 2025 23:23:48 +0000 (01:23 +0200)] 
Hook up ioprio_{get,set}, [vm]splice, tee and bpf syscalls on arm-linux

2 weeks agoFix a compiler warning about an unused variable on some platforms.
Florian Krohm [Tue, 21 Oct 2025 17:45:52 +0000 (17:45 +0000)] 
Fix a compiler warning about an unused variable on some platforms.

2 weeks agoUpdate NEWS with more items
Mark Wielaard [Mon, 20 Oct 2025 17:11:41 +0000 (19:11 +0200)] 
Update NEWS with more items

- Make BUILD_DOCS controls building documentation.
- LTP integration has been updated to v20250930.
- New Linux syscall wrappers (cachestat, futex_waitv, listmount,
  mount_setattr, mseal, quotactl_fd, remap_file_pages, setdomainname,
  statmount, swapoff, swapon, sysfs and ustat).
- New --modify-fds=yes is like --modify-fds=high except for fds 0,1,2.
- New --track-fds=bad only produces errors for bad file descriptor usage.
- With --xml=yes log now always uses output protocol 6.
- vgdb now handles the qExecAndArgs packet.
- DWARF inlined subroutine handling has been rewritten to work cross CUs.

2 weeks agoDocument FdBadUse in xml-output-protocol5.txt
Mark Wielaard [Mon, 20 Oct 2025 17:04:25 +0000 (19:04 +0200)] 
Document FdBadUse in xml-output-protocol5.txt

The core error FdBadUse was added in commit 22971a15d62d
"Report track-fd errors for fd used which was not opened or already closed"
But not documented. Add it to the protocol documentation now.

2 weeks agovgdb.c: Update --vargs documentation
Alexandra Hájková [Wed, 15 Oct 2025 11:32:06 +0000 (07:32 -0400)] 
vgdb.c: Update --vargs documentation

2 weeks agoSet version to 3.26.0-RC1
Mark Wielaard [Sat, 18 Oct 2025 01:35:12 +0000 (03:35 +0200)] 
Set version to 3.26.0-RC1

2 weeks agoUpdate libiberty demangler
Mark Wielaard [Sat, 18 Oct 2025 00:36:25 +0000 (02:36 +0200)] 
Update libiberty demangler

Update the libiberty demangler using the auxprogs/update-demangler
script to gcc git commit 7921bb4afcb7a3be8e10e63b10acfc2bfa477cae.

This update includes:

- Support for unnamed unscoped enums.
- Fix whaever -> whatever, comment typo.
- Update copyright years.

2 weeks agocoregrind/m_debuginfo/readpdb.c (DEBUG_SnarfLinetab): Remove this_seg
Mark Wielaard [Fri, 17 Oct 2025 23:27:57 +0000 (01:27 +0200)] 
coregrind/m_debuginfo/readpdb.c (DEBUG_SnarfLinetab): Remove this_seg

GCC notices that this_seg is set, but never really used in this
function

m_debuginfo/readpdb.c: In function 'DEBUG_SnarfLinetab':
m_debuginfo/readpdb.c:1542:23: warning: variable 'this_seg' set but not used [-Wunused-but-set-variable=]
 1542 |    Int                this_seg;
      |                       ^~~~~~~~

Fix this by just removing this_seg.

2 weeks agoUpgrade to GNU General Public License version 3
Mark Wielaard [Sun, 12 Oct 2025 21:57:43 +0000 (23:57 +0200)] 
Upgrade to GNU General Public License version 3

- Update COPYING and VEX/LICENSE.GPL to version 3.
- Update README, NEWS, docs/manual license and contributing text.
- Update file headers to say either version 3 of the License,
  or (at your option) any later version.
- Leave tests and perf file headers as is, unless the code is derived
  from Valgrind/VEX.
- Leave valgrind.h, cachegrind.h, callgrind.h, drd.h, helgrind.h,
  memcheck.h and dhat.h Hybrid-BSD licensed.

2 weeks agoUpdate where to get a copy of the GNU General Public License
Mark Wielaard [Sun, 12 Oct 2025 19:21:31 +0000 (21:21 +0200)] 
Update where to get a copy of the GNU General Public License

Several files still said to write to the Free Software Foundation at a
particular address. Add a reference to <http://www.gnu.org/licenses/>
instead.

Some files that were imported into valgrind from other places still
mention the old address. They should be updated when new versions
get imported.

3 weeks agosyswrap, i386-linux: add missing ipc syscalls
Maxim Zhukov [Mon, 23 May 2022 14:30:22 +0000 (17:30 +0300)] 
syswrap, i386-linux: add missing ipc syscalls

Kernel 5.1 introduced separate IPC syscalls:
* semget
* semctl
* shmget
* shmctl
* shmat
* shmdt
* msgget
* msgsnd
* msgrcv
* msgctl

instead of ipc()

Note the new shm wrappers were already added as
afea9317a1c9 ("Bug 501846 - Add x86 Linux shm wrappers")

Signed-off-by: Maxim Zhukov <mussitantesmortem@gmail.com>
https://bugs.kde.org/show_bug.cgi?id=454276

3 weeks agoHook up bpf syscall wrapper on x86-linux
Mark Wielaard [Fri, 17 Oct 2025 17:26:09 +0000 (19:26 +0200)] 
Hook up bpf syscall wrapper on x86-linux

3 weeks agoKeep at least one frame while peeling syscall frames
Mark Wielaard [Fri, 17 Oct 2025 16:23:58 +0000 (18:23 +0200)] 
Keep at least one frame while peeling syscall frames

VG_(get_StackTrace_with_deltas) might peel extra glibc syscall
(cancel) frames. But if the backtrace failed, or only contains such
syscall frames then we should keep at least one (the initial frame will
always be there). Various routines expect n_ips of a Stacktrace to be
at least 1.

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

3 weeks agoSupport AArch64 ARMv8.3 LDAPR/LDAPRH/LDAPRB instructions
Mark Wielaard [Fri, 17 Oct 2025 13:38:43 +0000 (15:38 +0200)] 
Support AArch64 ARMv8.3 LDAPR/LDAPRH/LDAPRB instructions

Implement them just like LDAR/LDARH/LDARB.

Patch by: Arne Juul <arnej@vespa.ai>
https://bugs.kde.org/show_bug.cgi?id=476465

3 weeks agoRevert 644d68e9501dd5679194dd5c8e0d3ce24764a1d8
Florian Krohm [Thu, 16 Oct 2025 14:23:01 +0000 (14:23 +0000)] 
Revert 644d68e9501dd5679194dd5c8e0d3ce24764a1d8

That change broke none/tests/ppc64/test_isa_3_1_VRT. Not good.
Add a comment as to why a vector type is needed.

3 weeks agovgdb.c: Handle qExecAndArgs packet
Alexandra Hájková [Wed, 15 Oct 2025 10:02:03 +0000 (06:02 -0400)] 
vgdb.c: Handle qExecAndArgs packet

New qExecAndArgs packet has been added recently to GDB's remote
protocol.

The new qExecAndArgs packet is sent from GDB, and gdbserver replies
with a packet that includes the executable filename and the arguments
string that were used for starting the initial inferior.

On the GDB side this information can be used to update GDB's state,
the 'show remote exec-file' will reflect how gdbserver was started,
and 'show args' will reflect the arguments used for starting the
inferior.

When running Valgrind from inside GDB, we can see that GDB actually
sends the packet to vgdb and vgdb is able to respond to it.

gdb -ex 'set debug remote on' \
  -ex 'set remote exec-file /bin/ls' \
  -ex 'set sysroot /' \
  -ex 'target extended-remote | ~/valgrind/coregrind/vgdb --multi --vargs -q' \
  /bin/ls

[remote] Sending packet: $qExecAndArgs#96
[remote] Packet received: U
[remote] packet_ok: Packet qExecAndArgs (fetch-exec-and-args) is supported

To be able to run Valgrind from inside GDB we currently have to set
remote exec-file and our goal is to avoid that to make running Valgrind
from GDB easier for the users. There's work on GDB side which should allow
us to avoid this soon.

When vgdb replies with 'U', it indicates that no executable has been set.
GDB sees that the executable that it has loaded is inside the sysroot
(which we set with 'set sysroot /'), then GDB knows that the remote and
GDB can see the same file.  GDB will then automatically use the current
executable path as the remote exec-file value.

3 weeks agoMassif warnings: use -Wno-attributes for overloaded-new.cpp test
Paul Floyd [Wed, 15 Oct 2025 06:11:50 +0000 (08:11 +0200)] 
Massif warnings: use -Wno-attributes for overloaded-new.cpp test

The was showing up with gcc (Debian 8.3.0-6) 8.3.0

3 weeks agoFix exe name warnings
Paul Floyd [Tue, 14 Oct 2025 06:27:16 +0000 (08:27 +0200)] 
Fix exe name warnings

Most of the exe name functions can take a const char* for the name.
Indeed, on Linux this is a requirement since we also lookup
debuginfod-find using a const char string literal.

The  exception to this rule is for scripts. In this case the script
shebang can refer to another script with another shebang. And so on
until eventually an ELF or macho file is encountered. In that case
VG_(args_the_exename) will get freed if necessary and reassigned
to a new string. So VG_(load_script) needs to be able to take a
non-const char* name, unlike VG_(load_ELF) and VG_(load_macho).

VG_(args_the_exename) is now non-const (which fixes a warning
when freeing it), VG_(load_script) takes a non-const name
and there is an ugly cast for the function pointer.

3 weeks agoregtest: move memcheck realloc3 CFLAGS
Paul Floyd [Tue, 14 Oct 2025 05:25:25 +0000 (07:25 +0200)] 
regtest: move memcheck realloc3 CFLAGS

It was inside a block for C++ 17 features. Old systems
not supporting that lost the default AM_CFLAGS with -g.

3 weeks agoFreeBSD regtest: fix filter_arg_check on arm64 and x86
Paul Floyd [Mon, 13 Oct 2025 19:33:39 +0000 (21:33 +0200)] 
FreeBSD regtest: fix filter_arg_check on arm64 and x86

3 weeks agoconfigure: correct the value for -Wno-alloc-size-larger-than
Paul Floyd [Mon, 13 Oct 2025 18:50:10 +0000 (20:50 +0200)] 
configure: correct the value for -Wno-alloc-size-larger-than

3 weeks agoFreeBSD warnings: clear up most warnings with clang19
Paul Floyd [Mon, 13 Oct 2025 11:26:50 +0000 (13:26 +0200)] 
FreeBSD warnings: clear up most warnings with clang19

Still a few more (from MIPS and exe name handling which I added)

3 weeks agoconfigure: hard code -Wno-alloc-size-larger-than=2147483647
Paul Floyd [Mon, 13 Oct 2025 11:02:52 +0000 (13:02 +0200)] 
configure: hard code -Wno-alloc-size-larger-than=2147483647

Should be OK for both 32bit and 64bit.
Remove AC_GCC_WARNING_SUBST_NO_VAL - always need to set a value.

3 weeks agoBug 286849 - [PATCH] Interceptors for new/delete on Darwin were erroneously commented...
Paul Floyd [Mon, 13 Oct 2025 10:37:35 +0000 (12:37 +0200)] 
Bug 286849 - [PATCH] Interceptors for new/delete on Darwin were erroneously commented out in r12043

3 weeks agoFreeBSD syscall wrapper: fix warning
Paul Floyd [Mon, 13 Oct 2025 07:18:18 +0000 (09:18 +0200)] 
FreeBSD syscall wrapper: fix warning

Was giving
m_syswrap/syswrap-main.c:370:28: warning: variable 'saved' is uninitialized when passed as a const pointer argument here [-Wuninitialized-const-pointer]
  370 |             syscall_mask, &saved, sizeof(vki_sigset_t)
      |                            ^~~~~

Initialising it is probably the safest thing to do, but I suspect that the
argument ought not to be const. Will check on that.

While I'm at it, looking at how Solaris handles the carry flag it's much
better than the global variable used by FreeBSD and Darwin. Will check on
that as well.

3 weeks agoconfigure and make: add configure checks for C++ exception warnings
Paul Floyd [Mon, 13 Oct 2025 06:38:09 +0000 (08:38 +0200)] 
configure and make: add configure checks for C++ exception warnings

Add checks for -Wno-implicit-exception-spec-mismatch
   (FLAG_W_NO_IMPLICIT_EXCEPTION_SPEC_MISMATCH)
and -Wno-missing-exception-spec
   (FLAG_W_NO_MISSING_EXCEPTION_SPEC)

Also we should clean up C++ flag checking a bit. If all checks get
grouped together than just one AC_LANG(C++)/AC_LANG(C) would be
needed.

3 weeks agoFreeBSD regtest: rename 45032 to bug45032
Paul Floyd [Mon, 13 Oct 2025 06:11:43 +0000 (08:11 +0200)] 
FreeBSD regtest: rename 45032 to bug45032

4 weeks agoBug 509406 - FreeBSD 15 issues
Paul Floyd [Sat, 4 Oct 2025 18:46:58 +0000 (18:46 +0000)] 
Bug 509406 - FreeBSD 15 issues

This is the last of a series of fixes and bodges.

I now get the following results.

On arm64
== 793 tests, 1 stderr failure, 0 stdout failures, 0 stderrB failures, 0 stdoutB failures, 0 post failures ==
memcheck/tests/thread_alloca             (stderr)

(which is not a new failure) and

== 947 tests, 1 stderr failure, 0 stdout failures, 0 stderrB failures, 1 stdoutB failure, 0 post failures ==
gdbserver_tests/nlvgdbsigqueue           (stderr)
gdbserver_tests/nlvgdbsigqueue           (stdoutB)

(again a test that fails regularly)

3 weeks agoFreeBSD regtest: add a prereq for bug452274
Paul Floyd [Sun, 12 Oct 2025 11:29:45 +0000 (13:29 +0200)] 
FreeBSD regtest: add a prereq for bug452274

This test tends to hang when running in a VM. The problem is that
the test spams both syscalls (write) and signals (SIGVTALRM from
setitimer). The test halts after 100 signals have been handled.
Under VirtualBox the timer signals get starved by the syscalls
and the limit of 100 doesn't get reached (at least not in any
reasonable amount of time).

3 weeks agoFreeBSD cleanup: remove an orphaned comment
Paul Floyd [Sat, 11 Oct 2025 13:11:10 +0000 (15:11 +0200)] 
FreeBSD cleanup: remove an orphaned comment

Removed the function, forgot to remove the reminder comment.

3 weeks agoNEWS: Add FreeBSD platform section
Paul Floyd [Sat, 11 Oct 2025 13:09:46 +0000 (15:09 +0200)] 
NEWS: Add FreeBSD platform section

3 weeks agogdbserver doc: add some comments about the invoker implementations.
Paul Floyd [Sat, 11 Oct 2025 11:01:03 +0000 (13:01 +0200)] 
gdbserver doc: add some comments about the invoker implementations.

3 weeks agoFreeBSD regtest: improve filter_arg_check
Paul Floyd [Fri, 10 Oct 2025 22:32:23 +0000 (00:32 +0200)] 
FreeBSD regtest: improve filter_arg_check

This was looking for PIDs with 5 digits so the test failed
when the PIDs being used have fewer digits.

4 weeks agoFreeBSD regtest: tweak setcred test
Paul Floyd [Fri, 10 Oct 2025 18:57:26 +0000 (20:57 +0200)] 
FreeBSD regtest: tweak setcred test

Should now work on both arm64 and amd64
(and with a diff on the size of struct setcred for x86).

Still don't see what caused the Conditional jump error.

4 weeks agoDefine __NR_swapon and __NR_swapoff on riscv64
Martin Cermak [Fri, 10 Oct 2025 16:12:02 +0000 (18:12 +0200)] 
Define __NR_swapon and __NR_swapoff on riscv64

Update commit c3f8f3ceb4ba6942993762f82911a670fa128789 adding
a missing define.

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

4 weeks agoWrap swapon and swapoff syscalls on non-mips arches.
Martin Cermak [Wed, 8 Oct 2025 08:07:30 +0000 (10:07 +0200)] 
Wrap swapon and swapoff syscalls on non-mips arches.

Drop the mips-specific syswraps for swapon and swapoff syscalls.
Instead, wrap these syscalls on all the arches.

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

4 weeks agoUpdate the LTP version in valgrind testsuite to v20250930
Martin Cermak [Thu, 2 Oct 2025 15:11:50 +0000 (17:11 +0200)] 
Update the LTP version in valgrind testsuite to v20250930

Update the LTP version in valgrind testsuite to v20250930.
All patches from auxprogs/ltp-patches were accepted by LTP
upstream and included in the release, so these can now be
dropped locally.

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

4 weeks agos390x: Make IBM z17 known to Valgrind
Andreas Arnez [Thu, 9 Oct 2025 11:42:39 +0000 (13:42 +0200)] 
s390x: Make IBM z17 known to Valgrind

Make the IBM z17 machine model 9175 known to Valgrind.  Also add the
expected output of the s390x-specific "ecag" test case on an IBM z17, so
the test case succeeds on that system.

4 weeks agoDocument that --vex-guest-chase=not ought to be used when doing IR injection.
Florian Krohm [Tue, 7 Oct 2025 12:39:38 +0000 (12:39 +0000)] 
Document that --vex-guest-chase=not ought to be used when doing IR injection.

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

5 weeks agoFreeBSD regtest: update setcred expected from arm64
Paul Floyd [Sun, 28 Sep 2025 03:39:45 +0000 (03:39 +0000)] 
FreeBSD regtest: update setcred expected from arm64

Still have an unexpected extra error on amd64

4 weeks agoFreeBSD setcred syscall: use arg3 for size
Paul Floyd [Mon, 6 Oct 2025 08:55:34 +0000 (10:55 +0200)] 
FreeBSD setcred syscall: use arg3 for size

Not really our job to check that thwe size is right.
Also revamp the secred testcase.

5 weeks agoFreeBSD vgdb: ensure stack is 16byte aligned for invoker
Paul Floyd [Sun, 28 Sep 2025 02:11:58 +0000 (02:11 +0000)] 
FreeBSD vgdb: ensure stack is 16byte aligned for invoker

I haven't seen any issues but there's no harm in being certain.

5 weeks agogetdents* syswrap: only check proc fd/fdinfo on Linux and Solaris
Paul Floyd [Fri, 3 Oct 2025 18:54:15 +0000 (20:54 +0200)] 
getdents* syswrap: only check proc fd/fdinfo on Linux and Solaris

Keep check for __NR_getdents and use a check for __NR_getdents64

5 weeks agoAdd BZ 495483 to NEWS.
Florian Krohm [Fri, 3 Oct 2025 16:31:59 +0000 (16:31 +0000)] 
Add BZ 495483 to NEWS.

Darn I keep forgetting this....

5 weeks agoControl building documentation (BZ 495483)
Florian Krohm [Fri, 3 Oct 2025 16:26:55 +0000 (16:26 +0000)] 
Control building documentation   (BZ 495483)

Introduce Makefile variable BUILD_DOCS with these possible values:
none - does not build any documentation
all  - builds all documentation
html - builds HTML docs but skips building PDFs

BUILD_ALL_DOCS is still recognised for backward compatibility and
is mapped to BUILD_DOCS like so:
If not specified   --> BUILD_DOCS=all
BUILD_ALL_DOCS=yes --> BUILD_DOCS=all
BUILD_ALL_DOCS=no  --> BUILD_DOCS=html

README_DEVELOPERS adjusted.

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

5 weeks agogetdents_filter.vgtest: Add filter_sort
Alexandra Hájková [Tue, 30 Sep 2025 13:54:58 +0000 (09:54 -0400)] 
getdents_filter.vgtest: Add filter_sort

On some file systems the testfiles 1000 and 1001 come out in different
order. Add filter_sort to sort the output lines to always appear at the
same order.

5 weeks agoFreeBSD: fix build, FreeBSD has no dirent64 or getdent64
Paul Floyd [Thu, 2 Oct 2025 05:46:59 +0000 (07:46 +0200)] 
FreeBSD: fix build, FreeBSD has no dirent64 or getdent64

Need to check Darwin as well.

5 weeks agonone/tests/Makefile.am: Add s390x/disasm-test to DIST_SUBDIRS
Mark Wielaard [Wed, 1 Oct 2025 14:42:17 +0000 (16:42 +0200)] 
none/tests/Makefile.am: Add s390x/disasm-test to DIST_SUBDIRS

Fixes: 6abf08f96a97 ("disasm-test: Makefile tweaks")
5 weeks agoAdd BZ 506211 to NEWS
Florian Krohm [Wed, 1 Oct 2025 14:42:23 +0000 (14:42 +0000)] 
Add BZ 506211 to NEWS

5 weeks agodisasm-test: Makefile tweaks
Florian Krohm [Wed, 1 Oct 2025 12:48:12 +0000 (12:48 +0000)] 
disasm-test: Makefile tweaks

disasm-test/Makefile.am: Include Makefile.tool-tests.am not Makefile.all.am

Also: do not build disasm-test on platforms other than s390x. There is no
point doing so as you won't be able to run it in a meaningful way.

5 weeks agoVEX: Remove algebraic simplification for shift IROps.
Florian Krohm [Wed, 1 Oct 2025 12:19:13 +0000 (12:19 +0000)] 
VEX: Remove algebraic simplification for shift IROps.

Shl/Shr/Sar(0,x) ==> 0

Don't. Because doing so removes the undefined behaviour in case the shift
amount is out of range.  This is also consistent with what constant folding
does in this case, namely, passing the undefined behaviour down the VEX
pipeline.

5 weeks agoAdd BZ 509157 to NEWS.
Florian Krohm [Tue, 30 Sep 2025 20:27:43 +0000 (20:27 +0000)] 
Add BZ 509157 to NEWS.

5 weeks agoriscv64: Fix IR generation for shift operations (BZ 509157)
Florian Krohm [Tue, 30 Sep 2025 20:14:24 +0000 (20:14 +0000)] 
riscv64: Fix IR generation for shift operations  (BZ 509157)

For SLL, SRL, and SRA the shift amount is 6 bits wide - not 8 bits.
For SLLW, SRLW, and SRAW the shift amount is 5 bits wide - not 8 bits.

Patch for IR generation by Christoph Jung (christoph.j27@googlemail.com).

Also clarify semantics of bitwise shift operators in libvex_ir.h

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

5 weeks agos390: Cleanup none/tests/s390x/Makefile.am
Florian Krohm [Mon, 29 Sep 2025 22:35:10 +0000 (22:35 +0000)] 
s390: Cleanup none/tests/s390x/Makefile.am

5 weeks agos390: Add testcases for unhandled IEEE exceptions. Fixes BZ 306098
Florian Krohm [Mon, 29 Sep 2025 21:34:56 +0000 (21:34 +0000)] 
s390: Add testcases for unhandled IEEE exceptions. Fixes BZ 306098

New emulation warnings: EmWarn_S390X_XxC_not_zero and EmWarn_S390X_XiC_not_zero
New testcases bfp-XxC, dfp-XxC, and dfp-XiC.
New testcase driver emwarn-gen.pl to get around valgrind's restriction
on the number of emulation warnings.

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

5 weeks agos390x: Fix inline assembly for STFLE
Andreas Arnez [Mon, 29 Sep 2025 14:11:04 +0000 (16:11 +0200)] 
s390x: Fix inline assembly for STFLE

The inline assembly for emitting the STFLE instruction changes GPR 0, but
fails to mention it in the clobber list.  Depending on the compiler's
mood, this may result in wrong code.

A simple fix would be to just add "0" to the clobber list, but for
readability it also helps to move the inline assembly to a separate
function.  So do that.  In that function, use an "asm" variable for GPR 0
instead of moving the value back and forth between registers.

5 weeks agoAdd BZ 309100
Florian Krohm [Sun, 28 Sep 2025 13:17:28 +0000 (13:17 +0000)] 
Add BZ 309100

5 weeks agoFix file permissions.
Florian Krohm [Fri, 26 Sep 2025 22:01:46 +0000 (22:01 +0000)] 
Fix file permissions.

The following files do not need to be executable:
- configure.ac
- Makefile*am
- *.in

The following files lack execute permission:
- tests/platform_test
- tests/vg_regtest
- perf/vg_perf

So from now on you can just run  tests/vg_regtest and perf/vg_perf
without the perl prefix.
Docs changed accordingly.

5 weeks agos390: Assorted BFP testsuite tweaks
Florian Krohm [Fri, 26 Sep 2025 21:50:39 +0000 (21:50 +0000)] 
s390: Assorted BFP testsuite tweaks

Rename rounding-1 to bfp-306054 because that was the corresponding BZ.
Rename bfp-3 to bfp-muldiv as it is more expressive.
Only compile testcases for 128-bit BFP if the compiler supports -mlong-double-128.
Add -mlong-double-128 to the compile flags for the files that need it.

This concludes fixing https://bugs.kde.org/show_bug.cgi?id=509572

6 weeks agoDeal with linux arches that don't have getdents, only getdents64
Mark Wielaard [Wed, 24 Sep 2025 21:16:29 +0000 (23:16 +0200)] 
Deal with linux arches that don't have getdents, only getdents64

Not all linux arches have getdents, some newer arches (arm64 and
riscv64) only implement getdents64. So only use the function
filter_valgrind_fds_from_getdents_with_refill on linux with
__NR_getdents.

Also move the getdents_filter testcase under none/tests/linux and only
use getdents64.

Fixes: e8e4066c3a01 ("Filter Valgrind FDs from getdents syscalls")
https://bugs.kde.org/show_bug.cgi?id=331311

6 weeks agos390: Remove rounding-6 BFP testcase (convert to int)
Florian Krohm [Wed, 24 Sep 2025 20:54:22 +0000 (20:54 +0000)] 
s390: Remove rounding-6 BFP testcase (convert to int)

Should have been part of 18c5454874d.

Part of fixing https://bugs.kde.org/show_bug.cgi?id=509572

6 weeks agos390: Reorg and extend BFP "convert to/from fixed/logical" testcases
Florian Krohm [Wed, 24 Sep 2025 20:27:30 +0000 (20:27 +0000)] 
s390: Reorg and extend BFP "convert to/from fixed/logical" testcases

Testing these insns was spread over 3 testcases: rounding-3, fpconv,
and fpext.

rounding-3 was testing "convert to fixed" with rounding per FPC.
fpext was testing "convert to/from logical" with rounding per M3 field.
fpconv was testing "convert to/from fixed" with rounding per M3 field.

The new testcase bfp-convert replaces these 3.  It removes the
"convert from fixed/logical" testing because that is done in bfp-emit.pl.
It consolidates end extends "convert to fixed/logical" testing from
those files.

Testing "convert to logical" has been commented out until the condition
code weirdness for negative input values has been sorted.

Part of fixing https://bugs.kde.org/show_bug.cgi?id=509572

6 weeks agoFilter Valgrind FDs from getdents syscalls
Alexandra Hájková [Tue, 12 Aug 2025 16:17:54 +0000 (12:17 -0400)] 
Filter Valgrind FDs from getdents syscalls

This change prevents client programs from seeing Valgrind's internal file
descriptors when scanning /proc/self/fd or /proc/<pid>/fd.

This patch modifies the getdents and getdents64 syscall wrappers to
selectively filter out Valgrind's internal file descriptors only when
listing /proc/*/fd directories for the current process.

Add none/tests/getdents_filter.vgtest test that tests that the
Valgrind's file descriptors are hidden from the client program
and verifies both /proc/self/fd filtering and that regular
directory listings remain unfiltered.

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

6 weeks agos390: Add missing BFP rounding mode conversions
Florian Krohm [Tue, 23 Sep 2025 20:29:19 +0000 (20:29 +0000)] 
s390: Add missing BFP rounding mode conversions

Function decode_bfp_rounding_mode:
- Irrm_NEAREST_TIE_AWAY_0 --> S390_BFP_ROUND_NEAREST_AWAY
- Irrm_PREPARE_SHORTER    --> S390_BFP_ROUND_PREPARE_SHORT

Macros S390_CC_FOR_BFP_CONVERT, S390_CC_FOR_BFP_UCONVERT
- add S390_BFP_ROUND_NEAREST_AWAY
- add S390_BFP_ROUND_PREPARE_SHORT

Macros S390_CC_FOR_BFP128_CONVERT, S390_CC_FOR_BFP128_UCONVERT
- add S390_BFP_ROUND_NEAREST_AWAY
- add S390_BFP_ROUND_PREPARE_SHORT

Fix more out-of-date comments related to rounding.

6 weeks agoFix an out-of-date comment.
Florian Krohm [Tue, 23 Sep 2025 13:19:58 +0000 (13:19 +0000)] 
Fix an out-of-date comment.

6 weeks agos390: BFP testsuite: condolidate FPC insns in bfp-insn.c
Florian Krohm [Tue, 23 Sep 2025 13:18:25 +0000 (13:18 +0000)] 
s390: BFP testsuite: condolidate FPC insns in bfp-insn.c

Remove srnm, srnmb, and rounding-2 testcases.
Also test EFPC and LFPC.

Part of fixing https://bugs.kde.org/show_bug.cgi?id=509572

6 weeks agos390: BFP testsuite: load positive/negative/complement, load and test
Florian Krohm [Mon, 22 Sep 2025 22:20:57 +0000 (22:20 +0000)] 
s390: BFP testsuite: load positive/negative/complement, load and test

Remove bfp-2. Add bfp-load
Observe condition code!
Also add correct bfp-compare.stdout.exp (c.f. 6190acedb1d)

Part of fixing https://bugs.kde.org/show_bug.cgi?id=509572

6 weeks agos390: Add forgotten file bfp-compare.stdout.exp
Florian Krohm [Mon, 22 Sep 2025 20:43:23 +0000 (20:43 +0000)] 
s390: Add forgotten file bfp-compare.stdout.exp

6 weeks agos390: BFP testsuite: comparison ops
Florian Krohm [Mon, 22 Sep 2025 20:36:45 +0000 (20:36 +0000)] 
s390: BFP testsuite: comparison ops

Rename bfp-4.c -->  bfp-compare.c.
Add more testcases including NANs.

Part of fixing https://bugs.kde.org/show_bug.cgi?id=509572

6 weeks agos390: BFP testsuite tweaks
Florian Krohm [Mon, 22 Sep 2025 19:31:50 +0000 (19:31 +0000)] 
s390: BFP testsuite  tweaks

Remove square root tests as they are covered by bfp-emit.pl
Likewise for multiplication.
Add tests for division.
New file bfp-arith.c: Check condition code of arithmetic ops.
Remove bfp-1.c

Part of https://bugs.kde.org/show_bug.cgi?id=509572

6 weeks agoFreeBSD regtest: add an x86 version of scalar_arg_check
Paul Floyd [Mon, 22 Sep 2025 18:21:57 +0000 (20:21 +0200)] 
FreeBSD regtest: add an x86 version of scalar_arg_check

6 weeks agoDRD suppression: broaden drd-glibc-io-xsputn-mempcpy
Paul Floyd [Mon, 22 Sep 2025 17:49:52 +0000 (19:49 +0200)] 
DRD suppression: broaden drd-glibc-io-xsputn-mempcpy

Add wildcards to cover variations of mem[p]cpy. This is now the
same as Helgrind.