]> git.ipfire.org Git - thirdparty/valgrind.git/log
thirdparty/valgrind.git
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.

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

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

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

6 weeks agos390: Remove a few BFP testcases
Florian Krohm [Mon, 22 Sep 2025 15:55:23 +0000 (15:55 +0000)] 
s390: Remove a few BFP testcases

Namely: fgx, fixbr, rounding-4, and rounding-5

Those insn tests are covered by bfp-emit.pl
Part of fixing https://bugs.kde.org/show_bug.cgi?id=509572

6 weeks agos390: Remove none/tests/s390x/tcxb, add none/tests/s390x/bfp-tdc
Florian Krohm [Mon, 22 Sep 2025 15:31:12 +0000 (15:31 +0000)] 
s390: Remove none/tests/s390x/tcxb, add none/tests/s390x/bfp-tdc

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

6 weeks agogdbserver regtest: add return value to sleepers select error message
Paul Floyd [Mon, 22 Sep 2025 12:59:17 +0000 (14:59 +0200)] 
gdbserver regtest: add return value to sleepers select error message

This is failing on FreeBSD 15 (looks like an OS or libc regression).
Improve the error message to make the problem clearer. errno is 0
but select is returning 93 (from a set of 0 fds!).

6 weeks agos390: New testcase none/tests/s390x/hfp
Florian Krohm [Sun, 21 Sep 2025 21:03:55 +0000 (21:03 +0000)] 
s390: New testcase none/tests/s390x/hfp

Containing the very few needed hexadecimal floating point insns.
Carved out of none/tests/s390x/bfp-2

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

6 weeks agodocs/xml/FAQ.xml: listitems contain paras, not raw CDATA
Mark Wielaard [Sun, 21 Sep 2025 19:38:15 +0000 (21:38 +0200)] 
docs/xml/FAQ.xml: listitems contain paras, not raw CDATA

Fixes: b5c89ee9839a ("Doc: add item on tcmalloc >= 2.16 hangs to FAQ")
6 weeks agodoc: missed closing itemizedlist
Paul Floyd [Sun, 21 Sep 2025 18:57:04 +0000 (20:57 +0200)] 
doc: missed closing itemizedlist

6 weeks agoDoc: add item on tcmalloc >= 2.16 hangs to FAQ
Paul Floyd [Sun, 21 Sep 2025 18:53:33 +0000 (20:53 +0200)] 
Doc: add item on tcmalloc >= 2.16 hangs to FAQ

6 weeks agoRefactor: make try_get_interp extern and multi-plaftorm
Paul Floyd [Sun, 21 Sep 2025 15:08:35 +0000 (17:08 +0200)] 
Refactor: make try_get_interp extern and multi-plaftorm

Previously it was static and defined for Darwin, FreeBSD and Linux.
Now it is global VG_(args_the_exename)  and has a length check.

Also fixed a nasty bug related to VG_(args_the_exename).

Initially this is set to point to the name of the client command
in Valgrinds own arguments. Later when checking for scripts or binaries
VG_(load_script) may get called recursively. If it gets called more than
once it sets VG_(args_the_exename) to point to the new name.
But that is on the stack. Later, if the stack grows too much the
name will get overwritten. I was seeing that with my first versions
of this code in the recursive tests in none/tests/scripts.

Now I'm allocating VG_(args_the_exename) on the heap.

6 weeks agoregtest: add arm64-freebsd to tests/platform_test
Paul Floyd [Sun, 21 Sep 2025 06:07:11 +0000 (08:07 +0200)] 
regtest: add arm64-freebsd to tests/platform_test

Not explicitly listing the platform was causing the one test
to run on other platforms

6 weeks agomemcheck/tests/Makefile.am: Add arm64-freebsd to DIST_SUBDIRS
Mark Wielaard [Sat, 20 Sep 2025 20:31:48 +0000 (22:31 +0200)] 
memcheck/tests/Makefile.am: Add arm64-freebsd to DIST_SUBDIRS

Fixes: 0a9e19a5947a ("FreeBSD regtest: add scalar_arg_check for arm64")
6 weeks agoFreeBSD arm64: arm64 syscalls also only ever need max 7 args
Paul Floyd [Sat, 20 Sep 2025 20:06:08 +0000 (22:06 +0200)] 
FreeBSD arm64: arm64 syscalls also only ever need max 7 args

6 weeks agoFreeBSD regtest: add scalar_arg_check for arm64
Paul Floyd [Sat, 20 Sep 2025 19:01:22 +0000 (21:01 +0200)] 
FreeBSD regtest: add scalar_arg_check for arm64

Much the same as arm64. x86 otoh is the only FreeBSD platform to use
PRE_REG_READ8 (again for sendfile).

6 weeks agoFreeBSD amd64: amd64 syscalls only ever need max 7 args
Paul Floyd [Sat, 20 Sep 2025 17:20:50 +0000 (19:20 +0200)] 
FreeBSD amd64: amd64 syscalls only ever need max 7 args

The only possible exception would be a syscall0 of SYS_sendfile
done by the host. Since we're never going to do that reduce the number
of arguments to 7.

6 weeks agoFreeBSD regtest: forgot the makefile changes for amd64 scalar_arg_check
Paul Floyd [Sat, 20 Sep 2025 17:19:46 +0000 (19:19 +0200)] 
FreeBSD regtest: forgot the makefile changes for amd64 scalar_arg_check

6 weeks agoFreeBSD regtest: add an amd64 test that max nb args to a syscall get passed correctly
Paul Floyd [Sat, 20 Sep 2025 17:16:38 +0000 (19:16 +0200)] 
FreeBSD regtest: add an amd64 test that max nb args to a syscall get passed correctly

6 weeks agos390: Add bfp-emit.pl (BZ 509572)
Florian Krohm [Fri, 19 Sep 2025 22:06:27 +0000 (22:06 +0000)] 
s390: Add bfp-emit.pl  (BZ 509572)

For a BFP insn X in the guest code the same insn will be emitted in
the jitted code. This does not hold universally but for most BFP
insns it does.
bfp-emit.pl contains a complete list of all BFP insns as of Principles
of Operations SA22-7832-14. It tests all insns for which the above
observation is true and ensures the emitted insn matches the insn in
the guest code.

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

6 weeks agoWrap the mount_setattr syscall 442
Martin Cermak [Fri, 19 Sep 2025 15:25:30 +0000 (17:25 +0200)] 
Wrap the mount_setattr syscall 442

int syscall(SYS_mount_setattr, int dirfd, const char *pathname,
           unsigned int flags, struct mount_attr *attr, size_t size);

The mount_setattr() system call changes the mount properties of a
mount or an entire mount tree.  If pathname is a relative pathname,
then it is interpreted relative to the directory referred to by the
file descriptor dirfd.  If dirfd is the special value AT_FDCWD, then
pathname is interpreted relative to the current working directory of
the calling process.  If pathname is the empty string and
AT_EMPTY_PATH is specified in flags, then the mount properties of the
mount identified by dirfd are changed

Declare a mount_setattr wrapper in priv_syswrap-linux.h and hook it
for {amd64,arm,arm64,mips64,ppc32,ppc64,riscv64,s390x,x86}-linux
using LINX_ with PRE handler in syswrap-linux.c

Part of this update also is a fix of the sys_move_mount wrapper.
Specifically there was a typo mount_moce vs. move_mount, and also
there was a problem in handling VKI_AT_FDCWD special fd value in the
check for to_fd and to_pathname.

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

6 weeks agoFreeBSD regtest: add syscall 9999 to scalar
Paul Floyd [Fri, 19 Sep 2025 17:57:07 +0000 (19:57 +0200)] 
FreeBSD regtest: add syscall 9999 to scalar

This provokes an unhandled syscall message, as is done on other
platforms. Update filter since scalar runs on all FreeBSD
platforms.

7 weeks agoWrap the setdomainname syscall
Martin Cermak [Fri, 19 Sep 2025 07:31:39 +0000 (09:31 +0200)] 
Wrap the setdomainname syscall

The setdomainname() call sets the domain name to the value given in the
character array name.  The len argument specifies the number of bytes in
name.  (Thus, name does not require a terminating null byte.)

Declare a setdomainname wrapper in priv_syswrap-linux.h and hook it for
{amd64,arm,arm64,mips64,ppc32,ppc64,riscv64,s390x,x86}-linux using
LINX_ with PRE handler in syswrap-linux.c

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

7 weeks agoFix none/tests/s390x/disasm-test/Makefile.am
Florian Krohm [Fri, 19 Sep 2025 16:06:39 +0000 (16:06 +0000)] 
Fix none/tests/s390x/disasm-test/Makefile.am

Remove disasm-test.stdout.exp from Makefile.am.
This was fogotten in 3d224b85ac.

7 weeks agos390: Tweak disasm-test
Florian Krohm [Fri, 19 Sep 2025 15:25:00 +0000 (15:25 +0000)] 
s390: Tweak disasm-test

Remove stdout.exp file as it is not needed.
The mandatory .stderr.exp file was not empty even though disasm-test
does not write anything to stderr. Annoying!
../filter_stderr was doing it. Adjust filter_stderr accordingly and
let .stderr.exp reflect the actual output.

7 weeks agoAdd missing ppc64-linux and s390x-linux syswraps existing on other arches
Martin Cermak [Fri, 19 Sep 2025 09:47:14 +0000 (11:47 +0200)] 
Add missing ppc64-linux and s390x-linux syswraps existing on other arches

This update adds following ppc64le and s390x syswraps:
 - sys_msgctl
 - sys_semctl
 - sys_semtimedop
 - sys_sethostname
 - sys_shmctl
 - sys_sigpending
 - sys_stime

This update adds following ppc64le syswraps:
 - sys_setns

This update adds following s390x syswraps:
 - sys_bpf

Blacklist the shmctl05, as it is a long running one.  It does
pass on all architectures afaics, but needs a relatively high
LTP_TIMEOUT_MUL setting. So, let's skip that one.

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