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
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.
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.
Rewritten in perl.
Command line options added.
Minimise assembler file by throwing out any function prologue stuff GCC
might stick into a function. Also remove insns following the svc as they
are not reachable.
Error handling: capture errors/warnings from the assembler.
Why all this? https://bugs.kde.org/show_bug.cgi?id=509572
The quotactl_fd works in a similar way to quotactl. They both manipulate
disk quotas. They differ in how the target file system is specified.
While quotactl takes path, quotactl_fd takes a file descriptor.
Declare a quotactl_fd 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
Martin Cermak [Wed, 17 Sep 2025 14:27:09 +0000 (16:27 +0200)]
Run the LTP tests with LTP_QUIET
Introduce a new LTP_QUIET env var which suppresses certain
types of LTP log messages, specifically TCONF, TWARN, TINFO,
and TDEBUG. This helps us keep the test logs briefer, while
still keeping the important information in the logs.
This update avoids several false positives, specifically with
the following testcases: eventfd2_03, shmctl05, mlock03,
poll02, prctl09, setsockopt10, and select02.
This update also adds a brief summary for the LTP testsuite,
something like the following:
Paul Floyd [Wed, 17 Sep 2025 18:05:09 +0000 (20:05 +0200)]
FreeBSD regtest: clean up none auxv test
I got fed up with this changing all the time, needing endless
expecteds for x86, amd65, arm64, and each FreeBSD version
So now I'm generating the expected on the fly, doing the same auxv
filtering as previously plus swapping unsupported AT_ values
with AT_IGNORE / number 01. The awk script will still need occasional
maintenance but it should be less frequent.
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