]> git.ipfire.org Git - thirdparty/valgrind.git/log
thirdparty/valgrind.git
4 weeks agoSolaris 11: fix for VG_(lstat)
Paul Floyd [Sat, 6 Sep 2025 14:49:10 +0000 (16:49 +0200)] 
Solaris 11: fix for VG_(lstat)

This function was using SYS_lstat. It works OK with illumos
but not Solaris 11+ which has removed that syscall.

Instead do like Linux and FreeBSD, use SYS_fstatat with the flag
for no follow link.

4 weeks agoFreeBSD memalign wrapper: size of 0 now allowed
Paul Floyd [Sat, 6 Sep 2025 11:52:47 +0000 (13:52 +0200)] 
FreeBSD memalign wrapper: size of 0 now allowed

memalign, the random allocator function amongst allocators

4 weeks agoposix_memalign wrapper - remove newline from malloc trace
Paul Floyd [Sat, 6 Sep 2025 07:16:17 +0000 (09:16 +0200)] 
posix_memalign wrapper - remove newline from malloc trace

4 weeks agoFreeBSD regtest: arm64 scalar
Paul Floyd [Fri, 5 Sep 2025 10:57:44 +0000 (12:57 +0200)] 
FreeBSD regtest: arm64 scalar

Right number of underscores in freebsd7 compat syscall fakes

4 weeks agoFreeBSD regtest and syscall message
Paul Floyd [Fri, 5 Sep 2025 07:15:36 +0000 (09:15 +0200)] 
FreeBSD regtest and syscall message

4 weeks agoFreeBSD regtest: update fake freebsd7 output for amrm64
Paul Floyd [Fri, 5 Sep 2025 07:15:36 +0000 (09:15 +0200)] 
FreeBSD regtest: update fake freebsd7 output for amrm64

First attempt

4 weeks agoBug 509107 - memcheck/tests/duplicate_align_size_errors.cpp fails
Paul Floyd [Fri, 5 Sep 2025 07:04:16 +0000 (09:04 +0200)] 
Bug 509107 - memcheck/tests/duplicate_align_size_errors.cpp fails

4 weeks agoFreeBSD syscall: add ML_(fd_allowed) check for fstat
Paul Floyd [Fri, 5 Sep 2025 06:21:32 +0000 (08:21 +0200)] 
FreeBSD syscall: add ML_(fd_allowed) check for fstat

Also PRE(sys_cap_rights_get) was checking the wrong arg
with ML_(fd_allowed). ARG1 is a version number in the
syscall, ARG2 is the fd.

4 weeks agoSolaris syscall: add ML_(fd_allowed) check for fstat
Paul Floyd [Fri, 5 Sep 2025 06:11:15 +0000 (08:11 +0200)] 
Solaris syscall: add ML_(fd_allowed) check for fstat

4 weeks agoFreeBSD regtest: clean up compat syscall messages
Paul Floyd [Thu, 4 Sep 2025 19:17:43 +0000 (21:17 +0200)] 
FreeBSD regtest: clean up compat syscall messages

Old syscalls never die. They just become freebsdXX_syscall.
And I forget to rename all their arguments.

4 weeks agoFix compilation of tests/arm64/bug484935.c when using fat LTO.
Romain Geissler [Thu, 4 Sep 2025 12:10:12 +0000 (12:10 +0000)] 
Fix compilation of tests/arm64/bug484935.c when using fat LTO.

See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121719

Fix this error:
/tmp/ccfnh7KQ.s: Assembler messages:
/tmp/ccfnh7KQ.s:175: Error: symbol `loop' is already defined

4 weeks agoir_opt.c: Fix mkZeroOfPrimopResultType
Florian Krohm [Thu, 4 Sep 2025 13:01:52 +0000 (13:01 +0000)] 
ir_opt.c:  Fix mkZeroOfPrimopResultType

In c93dba5adbd5d I forgot to adjust mkZeroOfPrimopResultType.

This function needs to go. See also 7270e04ab8eb7.

I should be able to query IROp properties easily and for all IRops.
E.g. instead of calling mkZeroOfPrimopResultType I want this:

mkZero(irop->result_type)

4 weeks agoAdd fd_allowed check to fstat (sys_newfstat)
Mark Wielaard [Wed, 3 Sep 2025 17:20:24 +0000 (19:20 +0200)] 
Add fd_allowed check to fstat (sys_newfstat)

Makes sure that with --track-fds fstat is also checked.

4 weeks agoRemove fdleak.h CLOSE_INHERITED_FDS workaround
Mark Wielaard [Wed, 3 Sep 2025 16:29:43 +0000 (18:29 +0200)] 
Remove fdleak.h CLOSE_INHERITED_FDS workaround

This workaround was necessary with very old perl implementations (from
2008) which might execute programs with some non-standard file
descriptors not closed. The macro would close all file descriptors 3
or higher so --track-fds wouldn't report on them.

More recently --track-fds also reports on bad file descriptor
usage. First only double or bad close calls were reported. This would
cause lots of warnings for the close_inherited file descriptor loop
because almost all of those file descriptors were never opened, so
--track-fds would report those. To work around that an fstat call was
added before the close to make sure the file descriptor existed.

This fstat workaround in close_inherited only worked because fstat
didn't have a fd_allowed check. Which is a bug that should be
fixed. On some systems fstat actually calls the fstatat syscall and
that did recently got the fd_allowed check, so on systems that use
fstatat for fstat various fdleak tests started failing.

We could test for and use close_range, which is smart enough to not
warn about never opened file descriptors in the range. But it seems
simpler to just get rid of the CLOSE_INHERITED_FDS macro because the
problematic perl implementation is now so old that nobody uses it
anymore.

4 weeks agoir_opt.c: Algebraic simplification for Iop_Or1.
Florian Krohm [Wed, 3 Sep 2025 15:09:50 +0000 (15:09 +0000)] 
ir_opt.c:  Algebraic simplification for Iop_Or1.

Adapt function mkOnesOfPrimopResultType accordingly.

4 weeks agoir_opt.c: Algebraic simplification for Iop_Shl/Shr/Sar.
Florian Krohm [Wed, 3 Sep 2025 15:07:52 +0000 (15:07 +0000)] 
ir_opt.c:  Algebraic simplification for Iop_Shl/Shr/Sar.

The simplification rules for 32-bit and 64-bit operands also apply for
8-bit and 16-bit operands.

4 weeks agoir_opt.c: Algebraic simplification for Iop_Sub.
Florian Krohm [Wed, 3 Sep 2025 15:03:08 +0000 (15:03 +0000)] 
ir_opt.c:  Algebraic simplification for Iop_Sub.

The simplification rules for IopSub32/64 also apply for Iop_Sub8/16.

4 weeks agoir_opt.c: Algebraic simplification for Iop_Add.
Florian Krohm [Wed, 3 Sep 2025 15:00:56 +0000 (15:00 +0000)] 
ir_opt.c:  Algebraic simplification for Iop_Add.

The simplification rules for IopAdd32/64 also apply for Iop_Add8/16.

4 weeks agoVEX: Fix function mkOnesOfPrimopResultType
Florian Krohm [Wed, 3 Sep 2025 14:48:39 +0000 (14:48 +0000)] 
VEX: Fix function mkOnesOfPrimopResultType

This function may be called with Iop_Max32U as argument which isn't
handled.

4 weeks agoVEX: Remove functions isZeroU32 and isZeroU64
Florian Krohm [Wed, 3 Sep 2025 14:38:41 +0000 (14:38 +0000)] 
VEX: Remove functions isZeroU32 and isZeroU64

This was forgotten when function isZeroU was added.

5 weeks agoFreeBSD suppression: add a DRD suppression for exterrctl
Paul Floyd [Sun, 31 Aug 2025 16:34:11 +0000 (18:34 +0200)] 
FreeBSD suppression: add a DRD suppression for exterrctl

5 weeks agoFreeBSD syscalls: new getgroups and setgroups
Paul Floyd [Sun, 31 Aug 2025 14:40:30 +0000 (16:40 +0200)] 
FreeBSD syscalls: new getgroups and setgroups

Wasn't quite right for FreeBSD 15.

5 weeks agoBug 508958 - FreeBSD: add getgroups and setgroups wrappers
Paul Floyd [Sun, 31 Aug 2025 14:32:20 +0000 (16:32 +0200)] 
Bug 508958 - FreeBSD: add getgroups and setgroups wrappers

5 weeks agoBug 507867 - perf_event_open group_fd isn't checked
Paul Floyd [Sun, 31 Aug 2025 08:44:49 +0000 (10:44 +0200)] 
Bug 507867 - perf_event_open group_fd isn't checked

5 weeks agoBug 507866 - fanotify_mark dirfd isn't checked
Paul Floyd [Sun, 31 Aug 2025 06:21:23 +0000 (08:21 +0200)] 
Bug 507866 - fanotify_mark dirfd isn't checked

5 weeks agoillumos syscalls: refactor *at directory fd checks
Paul Floyd [Sun, 31 Aug 2025 06:02:00 +0000 (08:02 +0200)] 
illumos syscalls: refactor *at directory fd checks

Mainly to reduyce the amount of copied and pasted code.
Slight improvements to messages to syscalls that have two
directory fds.

5 weeks agoFreeBSD realpathat syscall: fix length of written memory and add a testcase
Paul Floyd [Sat, 30 Aug 2025 20:05:12 +0000 (22:05 +0200)] 
FreeBSD realpathat syscall: fix length of written memory and add a testcase

There were no tests for /proc/currrproc/file
and the length written in post was out by one

5 weeks agolibvex_ir.h: Clarify semantics of division and modulo operation.
Florian Krohm [Sat, 30 Aug 2025 13:39:04 +0000 (13:39 +0000)] 
libvex_ir.h: Clarify semantics of division and modulo operation.

5 weeks agoiropt-test: Constant folding for DivModU32to32 and DivModS32to32
Florian Krohm [Sat, 30 Aug 2025 11:28:03 +0000 (11:28 +0000)] 
iropt-test: Constant folding for DivModU32to32 and DivModS32to32

Needed for Mips. Mips is still disabled in iropt-test because there
are miscompares between the folded the result and the result computed
by the insn sequence that implements the IROp. Several IRops are affected.

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

5 weeks agoiropt-test: Prepare IROp table for mips.
Florian Krohm [Fri, 29 Aug 2025 21:28:05 +0000 (21:28 +0000)] 
iropt-test: Prepare IROp table for mips.

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

5 weeks agoBug 508779 - PRE(sys_prlimit64): reorder check for memory validity
Matthias Schwarzott [Sat, 23 Aug 2025 11:37:46 +0000 (13:37 +0200)] 
Bug 508779 - PRE(sys_prlimit64): reorder check for memory validity

so all errors are displayed and not just the first

5 weeks agoBug 508778 - syscall-wrapper waitid warns about infop=null
Matthias Schwarzott [Sat, 23 Aug 2025 11:37:46 +0000 (13:37 +0200)] 
Bug 508778 - syscall-wrapper waitid warns about infop=null

This is used by e.g. Qt:
https://github.com/qt/qtbase/blob/e17798560b107b7abd5f2cf472d942e8ac4213ff/src/3rdparty/forkfd/forkfd_linux.c#L128

5 weeks agoBug 508777 - amd64-linux: add minimal scalar test
Matthias Schwarzott [Sat, 23 Aug 2025 11:37:46 +0000 (13:37 +0200)] 
Bug 508777 - amd64-linux: add minimal scalar test

5 weeks agoBug 508869 - x86-linux: simplify scalar test output
Matthias Schwarzott [Thu, 28 Aug 2025 20:30:25 +0000 (22:30 +0200)] 
Bug 508869 - x86-linux: simplify scalar test output

5 weeks agoregtest: add vgtest and expected for memcheck duplicate_align_size_errors
Paul Floyd [Fri, 29 Aug 2025 06:22:17 +0000 (08:22 +0200)] 
regtest: add vgtest and expected for memcheck duplicate_align_size_errors

The cpp file and .gitignore change were done at the same
time as the aligned size checks, but I missed out the expected
vgtest and Makefile.am changes. There were also a couple of unused
variables in the cpp file.

5 weeks agoFreeBSD: fix build error
Paul Floyd [Fri, 29 Aug 2025 06:22:17 +0000 (08:22 +0200)] 
FreeBSD: fix build error

Deleteted wrong variable when doing *at() syscall refactoring.

5 weeks agoLinux FreeBSD and Darwin: refactor *at syscall dirfd checks
Paul Floyd [Fri, 29 Aug 2025 05:59:28 +0000 (07:59 +0200)] 
Linux FreeBSD and Darwin: refactor *at syscall dirfd checks

I haven't done Solaris. The code there is less messy because
Solaris doesn't use a negative value for AT_FDCWD, meaning
no explicit or implicit cast from unsigned word to signed
int is needed before comparing to the int dirfd parameter.

5 weeks agoiropt-test: Constant folding for Iop_DivModU64to32 and Iop_DivModS64to32
Florian Krohm [Thu, 28 Aug 2025 20:17:29 +0000 (20:17 +0000)] 
iropt-test: Constant folding for Iop_DivModU64to32 and Iop_DivModS64to32

Function get_selected_values has been tweaked to return more
"interesting" values for test generation. Namely those that,
when interpreted as a signed integer, are boundary (or near
boundary) values.

Also a bit of reorg because for the DivMod.. IROps we need to be a bit
more careful when generating testcases that do not trap or where the
result does not fit in 32 bit.

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

5 weeks agoBug 507869 - Various at syscalls don't check dirfd argument
Paul Floyd [Thu, 28 Aug 2025 19:33:43 +0000 (21:33 +0200)] 
Bug 507869 - Various at syscalls don't check dirfd argument

5 weeks agoiropt-test: Enable for x86 and amd64.
Florian Krohm [Tue, 26 Aug 2025 21:02:09 +0000 (21:02 +0000)] 
iropt-test: Enable for x86 and amd64.

5 weeks agoFix Iop_ClzNat32/64 and Iop_CtzNat32/64 on x86 and amd64.
Florian Krohm [Tue, 26 Aug 2025 20:52:26 +0000 (20:52 +0000)] 
Fix Iop_ClzNat32/64 and Iop_CtzNat32/64 on x86 and amd64.

Handle the special case of 0 operand.

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

5 weeks agoTypo in comment.
Paul Floyd [Tue, 26 Aug 2025 20:11:50 +0000 (22:11 +0200)] 
Typo in comment.

I did correct it, but didn't save before pushing.

5 weeks agoLinux syscalls: add checks for remaining *at() directory fd args
Paul Floyd [Tue, 26 Aug 2025 19:56:55 +0000 (21:56 +0200)] 
Linux syscalls: add checks for remaining *at() directory fd args

5 weeks agoBug 508638 - Self-hosting not working on FreeBSD
Paul Floyd [Tue, 26 Aug 2025 11:32:07 +0000 (13:32 +0200)] 
Bug 508638 - Self-hosting not working on FreeBSD

5 weeks agoLinux syscall: copy and paste error in openat2 fd_allowed check
Paul Floyd [Tue, 26 Aug 2025 11:13:49 +0000 (13:13 +0200)] 
Linux syscall: copy and paste error in openat2 fd_allowed check

5 weeks agoFreeBSD 64bit: client stack changes
Paul Floyd [Tue, 26 Aug 2025 06:42:56 +0000 (08:42 +0200)] 
FreeBSD 64bit: client stack changes

Just use system max stack size, but with a lower limit of 64Mb
Add some -d -d traces

5 weeks agoFreeBSD regtest: turn off uninitilised warnings for readlinkat test
Paul Floyd [Tue, 26 Aug 2025 05:38:32 +0000 (07:38 +0200)] 
FreeBSD regtest: turn off uninitilised warnings for readlinkat test

5 weeks agoFreeBSD: fix guest stack creation for self-hosting
Paul Floyd [Mon, 25 Aug 2025 19:48:53 +0000 (21:48 +0200)] 
FreeBSD: fix guest stack creation for self-hosting

See https://bugs.kde.org/show_bug.cgi?id=508638
Not fully resolved, making progress.

5 weeks agoRemove deprecated IROps Iop_Clz32, Iop_Clz64, Iop_Ctz32, and Iop_Ctz64
Florian Krohm [Sun, 24 Aug 2025 20:46:25 +0000 (20:46 +0000)] 
Remove deprecated IROps Iop_Clz32, Iop_Clz64, Iop_Ctz32, and Iop_Ctz64

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

5 weeks agoPPC specific changes for BC 507033
Florian Krohm [Sun, 24 Aug 2025 20:26:58 +0000 (20:26 +0000)] 
PPC specific changes for BC 507033

Replace the deprecated Iop_Clz64 with Iop_ClzNat64. This is safe to
do because insn selection does not distinguish between Iop_Clz64 and
Iop_ClzNat64:

Iop_Clz64 / Iop_ClzNat64 --isel--> Pun_CLZ64 --emit-->cntlzd

The cntlzd insn has "natural" semantics and a 0 operand is not special.

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

6 weeks agoAdd 507720 to NEWS
Paul Floyd [Sun, 24 Aug 2025 19:36:35 +0000 (21:36 +0200)] 
Add 507720 to NEWS

6 weeks agoDarwin regtest: turn off ada mangling test
Paul Floyd [Sun, 24 Aug 2025 16:34:04 +0000 (18:34 +0200)] 
Darwin regtest: turn off ada mangling test

On Darwin clang adds an underscore to mangle C functions
which interferes with this testcase which tries to fake ada
mangling in C.

6 weeks agoDarwin: fix a warning, unused local
Paul Floyd [Sun, 24 Aug 2025 14:20:18 +0000 (16:20 +0200)] 
Darwin: fix a warning, unused local

6 weeks agoDarwin syscalls: fd handling (part 4)
Paul Floyd [Sun, 24 Aug 2025 14:16:24 +0000 (16:16 +0200)] 
Darwin syscalls: fd handling (part 4)

Most already done.

6 weeks agoDarwin: add VG_(resolved_exename)
Paul Floyd [Sun, 24 Aug 2025 14:11:25 +0000 (16:11 +0200)] 
Darwin: add VG_(resolved_exename)

Possibly not needed. On Linux it's used to check that the guest exe
doen't get opend with a write flag. macOS seems happy to allow that.

6 weeks agoillumos syscalls: fd handling (part 4)
Paul Floyd [Sun, 24 Aug 2025 09:25:51 +0000 (11:25 +0200)] 
illumos syscalls: fd handling (part 4)

Almost everything looked OK. Added a couple of POST_newFd_RES
macro uses.

There are a few functions that create fds other than via RES
(like pipe). For these I think that we need to add a
POST_newFd(fd) macro, plus in a few places refactor so that
RES is available to set the status after ML_(get_next_new_fd).

6 weeks agoFreeBSD regtest: pdfork_pdfill last fix (hopefully)
Paul Floyd [Sat, 23 Aug 2025 19:58:25 +0000 (21:58 +0200)] 
FreeBSD regtest: pdfork_pdfill last fix (hopefully)

Now passes on amd64 arm64 and x86

6 weeks agoFreeBSD regtest: updates to scalar for x86
Paul Floyd [Sat, 23 Aug 2025 22:05:51 +0000 (00:05 +0200)] 
FreeBSD regtest: updates to scalar for x86

Now that there better checks of fds a couple of syscalls using
rubbish values for fd which were above the max files limit.
That changed the syscall return code causing an assert.

Also some left over updates to the expected from previous changes.

6 weeks agoFreeBSD regtest: pdfork_pdkill again
Paul Floyd [Sat, 23 Aug 2025 21:54:16 +0000 (23:54 +0200)] 
FreeBSD regtest: pdfork_pdkill again

x86 needs some filtering, and I think arm64 will need an expected

6 weeks agoFreeeBSD regtest: add the suppression for pdfork_pdkill
Paul Floyd [Sat, 23 Aug 2025 19:35:48 +0000 (21:35 +0200)] 
FreeeBSD regtest: add the suppression for pdfork_pdkill

6 weeks agoFreeBSD regtest: get pdfork_pdkill to pass on arm64
Paul Floyd [Sat, 23 Aug 2025 19:31:13 +0000 (21:31 +0200)] 
FreeBSD regtest: get pdfork_pdkill to pass on arm64

arm64 was giving a few conditional jump errors (suppressed)
and a pdfork was succeeding with uninit flags whilst it was
failing on amd64. Made sure that it has bad flags (-1) but
still uninit.

6 weeks agoFreeBSD regtest: cleanup fd handling
Paul Floyd [Sat, 23 Aug 2025 15:55:27 +0000 (17:55 +0200)] 
FreeBSD regtest: cleanup fd handling

Build error on arm64 and update scalar expected.
scalar not looking right for x86

6 weeks agoFreeBSD syscalls: fd handling (part 3)
Paul Floyd [Sat, 23 Aug 2025 13:42:47 +0000 (15:42 +0200)] 
FreeBSD syscalls: fd handling (part 3)

arm64 file

6 weeks agoFreeBSD syscalls: fd handling (part 2)
Paul Floyd [Sat, 23 Aug 2025 12:19:33 +0000 (14:19 +0200)] 
FreeBSD syscalls: fd handling (part 2)

amd64 and x86 files

6 weeks agoFreeBSD syscalls: fd handling (part 1)
Paul Floyd [Sat, 23 Aug 2025 10:42:24 +0000 (12:42 +0200)] 
FreeBSD syscalls: fd handling (part 1)

For
Bug 507720 - Review syscalls returning file descriptors (other platforms)

Some more recording of fd opens and closes
Lots of checks for the directory fd of *at() syscalls
Fixed a few bugs in pdfork and pdkill (and updated the testcase).
Updated a few message strings.
Started improving readlinkat - needs more work.

6 weeks agoiropt-test: Run tests with and without constant folding.
Florian Krohm [Fri, 22 Aug 2025 17:48:23 +0000 (17:48 +0000)] 
iropt-test: Run tests with and without constant folding.

That way we can check whether the result of constant folding matches
the value computed by the insn sequence that is generated to implement
a specific IROp. Bugs were found for all architectures. s390 has been
fixed. The other architectures are currently disabled.

- irops.tab modified to enable only those IROps that are actually
  implemented for a given architecture. Architectures considered here
  are amd64, x86, ppc32, ppc64be/le
- IRICB_iropt_payload amended to store both the folded and unfolded
  result
- In valgrind_execute_test call IR injection twice: with and without
  constant folding enabled (--vex-iropt-fold-expr=yes/no)

6 weeks agoFreeBSD regtest: update kenv test so that it builds with GCC
Paul Floyd [Fri, 22 Aug 2025 06:58:08 +0000 (08:58 +0200)] 
FreeBSD regtest: update kenv test so that it builds with GCC

Was missing the memory header for std::make_unique,
and GCC doesn't like using smart pointers with cout so use
get().

6 weeks agoiropt-test: Fix an unwanted integer wrap-around.
Florian Krohm [Thu, 21 Aug 2025 21:31:58 +0000 (21:31 +0000)] 
iropt-test: Fix an unwanted integer wrap-around.

6 weeks agovbit-test: Remove preprocessor atrocity to determine endianess.
Florian Krohm [Thu, 21 Aug 2025 12:06:39 +0000 (12:06 +0000)] 
vbit-test: Remove preprocessor atrocity to determine endianess.

Use new function host_is_big_endian instead.

6 weeks agoiropt-test: Fix executable name for secondary platform.
Florian Krohm [Thu, 21 Aug 2025 10:14:08 +0000 (10:14 +0000)] 
iropt-test: Fix executable name for secondary platform.

6 weeks agoFreeeBSD readme: add a section on Capsicum mode
Paul Floyd [Thu, 21 Aug 2025 06:44:04 +0000 (08:44 +0200)] 
FreeeBSD readme: add a section on Capsicum mode

6 weeks agoFreeBSD regtest: add an absolute path test to readlinkat test
Paul Floyd [Wed, 20 Aug 2025 20:22:51 +0000 (22:22 +0200)] 
FreeBSD regtest: add an absolute path test to readlinkat test

6 weeks agoFreeBSD regtest: add a test for readlinkat
Paul Floyd [Wed, 20 Aug 2025 18:40:07 +0000 (20:40 +0200)] 
FreeBSD regtest: add a test for readlinkat

6 weeks agoFreeBSD regtest: fix a minor typo
Paul Floyd [Wed, 20 Aug 2025 18:22:37 +0000 (20:22 +0200)] 
FreeBSD regtest: fix a minor typo

6 weeks agos390: Fix handling of Iop_ExpCmpNE16
Florian Krohm [Wed, 20 Aug 2025 11:21:36 +0000 (11:21 +0000)] 
s390: Fix handling of Iop_ExpCmpNE16

Bug was introduced by yours truly in e3f078d847.

6 weeks agoFreeBSD: fix build after adding mallinfo support for illumos
Paul Floyd [Wed, 20 Aug 2025 05:11:11 +0000 (07:11 +0200)] 
FreeBSD: fix build after adding mallinfo support for illumos

6 weeks agos390: Support Iop_Mul8/16/32/64.
Florian Krohm [Tue, 19 Aug 2025 21:54:35 +0000 (21:54 +0000)] 
s390: Support Iop_Mul8/16/32/64.

Easy as pie and fewer special cases for iropt-test.

6 weeks agos390: Support Iop_ExpCmpNE8 and Iop_ExpCmpNE16.
Florian Krohm [Tue, 19 Aug 2025 21:24:54 +0000 (21:24 +0000)] 
s390: Support Iop_ExpCmpNE8 and Iop_ExpCmpNE16.

Easy as pie and fewer special cases for iropt-test.

6 weeks agos390: Fix code generation for Iop_MullS8/16 and Iop_MullU8/16
Florian Krohm [Tue, 19 Aug 2025 21:11:25 +0000 (21:11 +0000)] 
s390: Fix code generation for Iop_MullS8/16 and Iop_MullU8/16

Multiplication is performed using 4-byte values.
There were two bugs:
(1) Iop_MullS8/16 operands weren't sign-extended
(2) No shifting and OR'ing required to access the result. r11[32:63] has it.

Found by iropt-test.

6 weeks agoBug 507721 - Wire up illumos and Solaris mallinfo
Paul Floyd [Tue, 19 Aug 2025 14:37:50 +0000 (16:37 +0200)] 
Bug 507721 - Wire up illumos and Solaris mallinfo

6 weeks agoBug 507970 - -Wcalloc-transposed-args warnings in valgrind-di-server.c
Paul Floyd [Mon, 18 Aug 2025 18:51:09 +0000 (20:51 +0200)] 
Bug 507970 - -Wcalloc-transposed-args warnings in valgrind-di-server.c

6 weeks agoAdd ppc64le linux hardwire for ld64.so.2 strcmp
Mark Wielaard [Mon, 18 Aug 2025 13:30:47 +0000 (15:30 +0200)] 
Add ppc64le linux hardwire for ld64.so.2 strcmp

When dlopen is used we might end up in an assembly powerpc/strcmp.S
variant that is optimized in a way memcheck cannot proof correct. We
try to intercept strcmp in ld.so, but might fail when strcmp is called
before our interception code is loaded. Having an hardwire for ld.so
strcmp (earlier intercept) would solve this.

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

7 weeks agos390: Fix code generation for Iop_16Uto32(0x...:I16)
Florian Krohm [Thu, 14 Aug 2025 15:35:21 +0000 (15:35 +0000)] 
s390: Fix code generation for Iop_16Uto32(0x...:I16)

Using LHI is wrong as it sign-extends. Use IILF instead.
This has been wrong since day #1. Found by iropt-test.

7 weeks agoPRE(sys_fchownat) not handling VKI_AT_FDCWD
Martin Cermak [Wed, 13 Aug 2025 07:03:13 +0000 (09:03 +0200)] 
PRE(sys_fchownat) not handling VKI_AT_FDCWD

Multiple `make ltpchecks` failures seem tp be caused by
PRE(sys_fchownat) not handling VKI_AT_FDCWD properly.
This specifically impacts aarch64 test results these days.

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

7 weeks agoFix none/tests/cmdline2 breakage introduced in 679e7bced9
Florian Krohm [Wed, 13 Aug 2025 07:52:21 +0000 (07:52 +0000)] 
Fix none/tests/cmdline2 breakage introduced in 679e7bced9

7 weeks agoNew command line flag --vex-iropt-fold-expr
Florian Krohm [Tue, 12 Aug 2025 21:52:18 +0000 (21:52 +0000)] 
New command line flag --vex-iropt-fold-expr

Defaults to "yes".
Add VexControl::iropt_fold_expr and observe it in fold_Expr_WRK.

This flag will be used shortly in the iropt-test program.
Users are not expected to use it which is why I'm not announcing
it in NEWS.

7 weeks agoiropt-test tweak
Florian Krohm [Tue, 12 Aug 2025 21:27:14 +0000 (21:27 +0000)] 
iropt-test tweak

No need to run random tests for binary IROps with 1-bit wide operands.

7 weeks agoFix VALGRIND_CLO_CHANGE behaviour (BZ 508093)
Florian Krohm [Mon, 11 Aug 2025 18:39:28 +0000 (18:39 +0000)] 
Fix VALGRIND_CLO_CHANGE behaviour (BZ 508093)

Command line flags that modify variable vex_control did not have the
desired effect when processed dynamically via VALGRIND_CLO_CHANGE.

The fix is to call the new function LibVEX_set_VexControl in
process_dynamic_option.

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

7 weeks agoFix mips32 FTBFS
Martin Cermak [Fri, 8 Aug 2025 20:31:42 +0000 (22:31 +0200)] 
Fix mips32 FTBFS

Define __NR_statmount and __NR_listmount.
This update makes the source buildable on the mips32 arch.

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

7 weeks agofaccessat and faccessat2 should do better checks
Martin Cermak [Mon, 11 Aug 2025 09:17:58 +0000 (11:17 +0200)] 
faccessat and faccessat2 should do better checks

Do more fine-grained checks within sys_faccessat and sys_faccessat2
syscall wrappers.  Allow passing special value of VKI_AT_FDCWD as a
file descriptor.  Check for valid flags.

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

8 weeks agoAdd several missing syscall hooks to ppc64-linux
Martin Cermak [Fri, 8 Aug 2025 21:46:53 +0000 (23:46 +0200)] 
Add several missing syscall hooks to ppc64-linux

Specifically:

sys_getrlimit
sys_mincore
sys_tkill
sys_unshare
sys_splice
sys_tee
sys_vmsplice
sys_fanotify_init
sys_fanotify_mark
sys_kcmp
sys_bpf

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

8 weeks agoReview the vmsplice syscall wrapper
Martin Cermak [Fri, 8 Aug 2025 21:38:33 +0000 (23:38 +0200)] 
Review the vmsplice syscall wrapper

Reuse the vmsplice syscall wrapper in coregrind/m_syswrap/syswrap-linux.c
for mips64 as well. And make sure arm64-linux and riscv64-linux also use
the POST vmsplice wrapper.

8 weeks agoDistribute auxprogs scripts and data files
Mark Wielaard [Wed, 6 Aug 2025 22:21:42 +0000 (00:21 +0200)] 
Distribute auxprogs scripts and data files

Make sure pybuild.sh, ltp-tester.sh, ltp-apply-patches.sh,
s390-check-opcodes.pl, s390-runone scripts, ltp filters, ltp patches
and pylintrc are added to the dist.

This makes sure users can run the scripts and make ltpchecks not just
from a git checkout, but also from a release or snapshots tar.

Also use the ustar format to package files, the path under
valgrind-x.yy.z/auxprogs/ltp-patches might be larger than 99
chars. automake 1.18 already defaults to the ustar format.

8 weeks agoThe futimesat syscall wrapper doesn't handle AT_FDCWD
Martin Cermak [Tue, 5 Aug 2025 14:54:54 +0000 (16:54 +0200)] 
The futimesat syscall wrapper doesn't handle AT_FDCWD

Update futimesat syscall wrapper so that it doesn't consider the
special value AT_FDCWD (-100) an invalid file descriptor.

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

8 weeks agoMake fchmodat and fchmodat2 syscall wrappers accept AT_FDCWD
Martin Cermak [Tue, 5 Aug 2025 15:36:29 +0000 (17:36 +0200)] 
Make fchmodat and fchmodat2 syscall wrappers accept AT_FDCWD

The fchmodat and fchmodat2 syscall wrappers should accept special
value AT_FDCWD as a valid file descriptor.

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

8 weeks agoAllow for patching LTP sources
Martin Cermak [Tue, 5 Aug 2025 16:06:08 +0000 (18:06 +0200)] 
Allow for patching LTP sources

Sometimes there's an upstream LTP patch that helps testing
valgrind, but it's not yet part of the official LTP tarball.
In such cases it's helpful to be able to patch the LTP sources.
Attached patch allows for that.  It comes with a real life
example patch: LTP commit b62b831cf.

2 months agoAdd bug 503241 s390x: Support z17 changes to the NNPA instruction to NEWS
Mark Wielaard [Tue, 5 Aug 2025 20:29:14 +0000 (22:29 +0200)] 
Add bug 503241 s390x: Support z17 changes to the NNPA instruction to NEWS

This was added in commit 24b634e8ce04de70d4aa6c61a12149df223f9c68

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

2 months agoARM64 specific changes for BZ 507033
Florian Krohm [Sat, 2 Aug 2025 13:22:50 +0000 (13:22 +0000)] 
ARM64 specific changes for BZ 507033

Replace the deprecated Iop_Clz64 with Iop_ClzNat64 which have the
same semantics for non-zero inputs.

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

2 months agoARM specific changes for BZ 507033
Florian Krohm [Sat, 2 Aug 2025 13:14:31 +0000 (13:14 +0000)] 
ARM specific changes for BZ 507033

Rework code to use Iop_ClzNat32 instead of the deprecated Iop_Clz32.

Iop_Clz32 --isel--> ARMun_CLZ --emit--> CLZ insn  with CLZ(0) == 32
Hence, any workaround for a zero input value can be removed.

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

2 months agomips specific changes for BZ 507033
Florian Krohm [Sat, 2 Aug 2025 12:43:54 +0000 (12:43 +0000)] 
mips specific changes for BZ 507033

Rework code to use Iop_ClzNat32 instead of the deprecated Iop_Clz32.
Likewise for Iop_Clz64.

For Iop_Clz32 a CLZ insn will be emitted which behaves naturally when
its input is 0. That is: CLZ(0) == 32.
Similarly, for Iop_Clz64 a DCLZ will be emitted with DCLZ(0) == 64.
That means we can replace Iop_Clz32/64 with Iop_ClzNat32/64 and remove
any IR that handles the input-is-zero case.
See also commit a5c48217e94.

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