Andreas Arnez [Wed, 10 Sep 2025 17:05:40 +0000 (19:05 +0200)]
Bug 509517 - s390x: Add even/odd-lane memcheck test for VME etc.
Add an s390x-specific memcheck test case for the correct handling of
even/odd lanes with various vector insns. The test fails before applying
the fix for Bug 509517 and succeeds afterwards.
Andreas Arnez [Mon, 15 Sep 2025 13:39:11 +0000 (15:39 +0200)]
Bug 509517 - s390x: Fix even/odd lane confusion for VME etc.
Fix the swapping of even/odd IROps generation in guest_s390_toIR.c for
VME, VMO, VMLE, VMLO, VMAE, VMAO, VMALE, and VMALO. Adjust the code
generation for the according IROps to match the documentation in
libvex_ir.h.
sys_futex_waitv - Wait on a list of futexes
@waiters: List of futexes to wait on
@nr_futexes: Length of futexv
@flags: Flag for timeout (monotonic/realtime)
@timeout: Optional absolute timeout.
@clockid: Clock to be used for the timeout, realtime or monotonic.
Given an array of `struct futex_waitv`, wait on each uaddr. The thread wakes
if a futex_wake() is performed at any uaddr. The syscall returns immediately
if any waiter has *uaddr != val. *timeout is an optional timeout value for
the operation. Each waiter has individual flags. The `flags` argument for
the syscall should be used solely for specifying the timeout as realtime, if
needed. Flags for private futexes, sizes, etc. should be used on the
individual flags of each waiter. Returns the array index of one of the woken
futexes. No further information is provided.
Declare a futex_waitv 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
Paul Floyd [Wed, 10 Sep 2025 19:53:22 +0000 (21:53 +0200)]
Helgrind regtest: use older C++ dialect for bug392331.cpp
Old versions of GCC (like 6.3) claim some C++17 support but
apparently not CTAD
https://en.cppreference.com/w/cpp/language/class_template_argument_deduction.html
So, go backwards and explicitly give the std::mutex template type for the locks.
Martin Cermak [Wed, 3 Sep 2025 14:02:26 +0000 (16:02 +0200)]
Wrap the remap_file_pages syscall
The remap_file_pages() system call is used to create a nonlinear
mapping, that is, a mapping in which the pages of the file are
mapped into a nonsequential order in memory. It is deprecated
but in some cases it may still be used. LTP remap_file_pages01
and remap_file_pages02 test-cover it.
Declare a remap_file_pages 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
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.
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
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.
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.
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
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).
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.
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.