]> git.ipfire.org Git - thirdparty/valgrind.git/log
thirdparty/valgrind.git
8 months agoregtest: add a fdleak filter for write on write on linux arm64
Paul Floyd [Thu, 21 Nov 2024 07:44:04 +0000 (08:44 +0100)] 
regtest: add a fdleak filter for write on write on linux arm64

8 months agoHelgrind: fix unused result of write warnings
Paul Floyd [Thu, 21 Nov 2024 07:24:35 +0000 (08:24 +0100)] 
Helgrind: fix unused result of write warnings

Thanks to GCC deciding that we can't ignore wur annotated
functions by casting to void we need to do otherwise. It was
either pragmas or adding an annotated unused local. Pragmas
seem to be the least awful.

8 months agoBug 469782 - Valgrind does not support zstd-compressed debug sections
Mikhail Gorodetsky [Sun, 17 Nov 2024 20:14:17 +0000 (21:14 +0100)] 
Bug 469782 - Valgrind does not support zstd-compressed debug sections

8 months agodrd: Split handle_client_request()
Bart Van Assche [Mon, 18 Nov 2024 21:15:36 +0000 (13:15 -0800)] 
drd: Split handle_client_request()

Make handle_client_request() easier to read by splitting it into two
functions: one for Valgrind core client requests and one for thread-
related client requests.

8 months agodrd: Reorder functions
Bart Van Assche [Mon, 18 Nov 2024 21:08:29 +0000 (13:08 -0800)] 
drd: Reorder functions

Reorder two functions such that a forward declaration can be removed.

8 months agodrd: Remove a superfluous if-statement
Bart Van Assche [Mon, 18 Nov 2024 00:20:39 +0000 (16:20 -0800)] 
drd: Remove a superfluous if-statement

Check the client request ID once instead of twice.

8 months agoSolaris - fix a couple of warnings for message formatting
Paul Floyd [Sun, 17 Nov 2024 18:47:24 +0000 (19:47 +0100)] 
Solaris - fix a couple of warnings for message formatting

8 months agoIllumos regtest: turn off memcheck/tests/x86/bug487993
Paul Floyd [Sun, 17 Nov 2024 10:08:34 +0000 (11:08 +0100)] 
Illumos regtest: turn off memcheck/tests/x86/bug487993

For some reason GCC 13.3 on Illumos does not use aligned operator
new when compiling this testcase. So turn it off.

8 months agoarm: hook kcmp syscall
Lucas Stach [Thu, 14 Nov 2024 15:58:23 +0000 (16:58 +0100)] 
arm: hook kcmp syscall

8 months agocoregrind/m_gdbserver/remote-utils.c (prepare_resume_reply): Use memcpy
Mark Wielaard [Thu, 14 Nov 2024 11:25:27 +0000 (12:25 +0100)] 
coregrind/m_gdbserver/remote-utils.c (prepare_resume_reply): Use memcpy

GCC8 (but apparently not later versions) complain about the use of
strncpy when not actually copying a string:

remote-utils.c:1140:14: warning: 'char* strncpy(char*, const char*, size_t)' output truncated before terminating nul copying 6 bytes from a string of the same length [-Wstringop-truncation]
          strncpy (buf, "watch:", 6);
          ~~~~~~~~^~~~~~~~~~~~~~~~~~

This is "harmless" because buf is large enough and we will add more
chars (including a zero terminator) later. But using strncpy here is a
bit odd because we don't really want to copy a string, but an array of
6 chars. So use memcpy here to do so, simplyfing the code.

8 months agoIllumos regtest: x86 mdb diffs wrt Solaris
Paul Floyd [Thu, 14 Nov 2024 07:57:37 +0000 (08:57 +0100)] 
Illumos regtest: x86 mdb diffs wrt Solaris

8 months agovgdb.c (fork_and_exec_valgrind): Fix another off-by-one error write
Mark Wielaard [Tue, 12 Nov 2024 12:34:09 +0000 (13:34 +0100)] 
vgdb.c (fork_and_exec_valgrind): Fix another off-by-one error write

commit 646978d9adc5 ("vgdb: Handle EINTR and EAGAIN more
consistently") introduced another off-by-one issue trying to write
back the error from child to parent.

Instead of +1 it should have been +written (which initially is zero).

This is when the child needs to do a chdir and that chdir fails. If
that happens the parent would have gotten the wrong error code.

8 months agovgdb.c (fork_and_exec_valgrind): Fix off-by-one error write
Mark Wielaard [Tue, 12 Nov 2024 12:23:03 +0000 (13:23 +0100)] 
vgdb.c (fork_and_exec_valgrind): Fix off-by-one error write

commit 646978d9adc5 ("vgdb: Handle EINTR and EAGAIN more
consistently") introduced an off-by-one issue trying to write back the
error from child to parent.

Instead of +1 it should have been +written (which initially is zero).

This is in an "should never happen" path, so hopefully didn't really
cause issues. But if it did happen the parent would have gotten the
wrong error code.

8 months agoIllumos regtest: updates in none/tests/amd64-solaris
Paul Floyd [Mon, 11 Nov 2024 08:23:34 +0000 (09:23 +0100)] 
Illumos regtest: updates in none/tests/amd64-solaris

Add a filter for an extra level in a callstack.
Add an expected for changed mdb output.

8 months agoAdd 494218 to NEWS
Paul Floyd [Sun, 10 Nov 2024 15:52:32 +0000 (16:52 +0100)] 
Add 494218 to NEWS

This went in 3.24.

8 months agoIllumos regtest: Add suppressions to none fdleak_cmsg_supp.supp
Paul Floyd [Sat, 9 Nov 2024 20:05:15 +0000 (21:05 +0100)] 
Illumos regtest: Add suppressions to none fdleak_cmsg_supp.supp

8 months agoIllumos regtest: filter more signal messages from bash
Paul Floyd [Sat, 9 Nov 2024 19:05:03 +0000 (20:05 +0100)] 
Illumos regtest: filter more signal messages from bash

8 months agoIllumos regtest: a couple of fixes to none fd tests
Paul Floyd [Sat, 9 Nov 2024 17:43:20 +0000 (18:43 +0100)] 
Illumos regtest: a couple of fixes to none fd tests

8 months agoIllumos regtest: add filters to gdbserver tests
Paul Floyd [Sat, 9 Nov 2024 17:20:26 +0000 (18:20 +0100)] 
Illumos regtest: add filters to gdbserver tests

8 months agoIllumos: Don't call ML_(fd_allowed) from PRE(sys_fstat)
Paul Floyd [Sat, 9 Nov 2024 17:17:26 +0000 (18:17 +0100)] 
Illumos: Don't call ML_(fd_allowed) from PRE(sys_fstat)

This was causing many false positives with --track-fds=yes

8 months agos390x regtest: Add missing memory clobbers in mvc.c
Andreas Arnez [Fri, 8 Nov 2024 13:52:11 +0000 (14:52 +0100)] 
s390x regtest: Add missing memory clobbers in mvc.c

The s390x test case `mvc' was seen to fail when using gcc -O3 with GCC
11.4.1 on Ubuntu:

   mvc: mvc.c:48: main: Assertion `full[i] == 'x'' failed.

In this case the compiler optimized the assertion check away, because it
doesn't consider `full' to be affected by the inline assembly.

Add memory clobbers to fix this.

8 months agos390x regtest: Add missing register clobber in misc3.c
Andreas Arnez [Fri, 8 Nov 2024 13:52:11 +0000 (14:52 +0100)] 
s390x regtest: Add missing register clobber in misc3.c

Depending on compiler options, the translation of test_mvcrl() in
`misc3.c' can misbehave because the inline assembly writes to r0 and
doesn't declare that.

Add a register clobber to fix this.  Also, tell the compiler the actual
length of `from' and `to' instead of the decremented value.

8 months agoCompiler warning: unused label on non-FreeBSD platforms
Paul Floyd [Mon, 4 Nov 2024 12:13:21 +0000 (13:13 +0100)] 
Compiler warning: unused label on non-FreeBSD platforms

Used by a goto to jump over the POST mutex lock userreq,
but only on FreeBSD.

8 months agoHelgrind regtest: fix wrong updates to tc04_free_lock expecteds
Paul Floyd [Mon, 4 Nov 2024 07:06:17 +0000 (08:06 +0100)] 
Helgrind regtest: fix wrong updates to tc04_free_lock expecteds

8 months agoBug 494327 - Crash when running Helgrind built with #define TRACE_PTH_FNS 1
Paul Floyd [Sun, 3 Nov 2024 19:42:43 +0000 (20:42 +0100)] 
Bug 494327 - Crash when running Helgrind built with #define TRACE_PTH_FNS 1

Use write() rather than 'fprintf()' for the TRACE_PTH_FNS blocks for
pthread_mutex_lock and pthread_mutex_lock. Mixing FILE and fd isn't
great, but this is to stderr which gets flushed on every line, and
it is only for developer builds that modify that TRACE_PTH_FNS macro.

8 months agoHelgrind FreeBSD: make previous hack conditonal on version
Paul Floyd [Sun, 3 Nov 2024 19:00:33 +0000 (20:00 +0100)] 
Helgrind FreeBSD: make previous hack conditonal on version

Don't want to ignore any pthread_mutex_lock calls on FreeBSD
14.1 and earlier.

8 months agoBug 494337 - All threaded applications cause still holding lock errors
Paul Floyd [Sun, 3 Nov 2024 18:47:12 +0000 (19:47 +0100)] 
Bug 494337 - All threaded applications cause still holding lock errors

Don't count the first call to pthread_mutex_lock() from exit().

Needed to update a couple of expecteds as exit() is now wrapped
so it turns up in the callstacks.

This is only for FreeBSD.

8 months agoFreeBSD regtest: update x86 scalar expected
Paul Floyd [Sun, 3 Nov 2024 13:18:12 +0000 (14:18 +0100)] 
FreeBSD regtest: update x86 scalar expected

8 months agoFreeBSD regtest: spaces not quite right in scalar fakes
Paul Floyd [Sun, 3 Nov 2024 11:00:52 +0000 (12:00 +0100)] 
FreeBSD regtest: spaces not quite right in scalar fakes

8 months agoclangd fixes
Paul Floyd [Sun, 3 Nov 2024 10:25:47 +0000 (11:25 +0100)] 
clangd fixes

Mainly useless casts and consistent function prototype and
definition arg names.

8 months agoCorrect typos and spelling mistakes
Paul Floyd [Sun, 3 Nov 2024 09:55:57 +0000 (10:55 +0100)] 
Correct typos and spelling mistakes

8 months agoBug 495488 - Add FreeBSD getrlimitusage syscall wrapper
Paul Floyd [Sun, 3 Nov 2024 09:17:17 +0000 (10:17 +0100)] 
Bug 495488 - Add FreeBSD getrlimitusage syscall wrapper

8 months agoFix compiler warnings produced by clang 19.
Paul Floyd [Sun, 3 Nov 2024 08:50:37 +0000 (09:50 +0100)] 
Fix compiler warnings produced by clang 19.

8 months agoAdd /none/tests/use_after_close to .gitignore
Paul Floyd [Sun, 3 Nov 2024 08:12:13 +0000 (09:12 +0100)] 
Add /none/tests/use_after_close to .gitignore

8 months agoFreeBSD syscall: fix syscall name used in kcmp traces.
Paul Floyd [Sat, 2 Nov 2024 21:22:10 +0000 (22:22 +0100)] 
FreeBSD syscall: fix syscall name used in kcmp traces.

8 months agoFreeBSD regtest: add _write to none filter_fdleak
Paul Floyd [Fri, 1 Nov 2024 07:59:19 +0000 (08:59 +0100)] 
FreeBSD regtest: add _write to none filter_fdleak

Also bump up news and configure to 3.25 git.

9 months ago-> 3.24.0 final VALGRIND_3_24_0
Mark Wielaard [Fri, 1 Nov 2024 04:19:38 +0000 (05:19 +0100)] 
-> 3.24.0 final

9 months agoMake const OpenFd *ML_(find_OpenFd) static
Mark Wielaard [Fri, 1 Nov 2024 03:40:22 +0000 (04:40 +0100)] 
Make const OpenFd *ML_(find_OpenFd) static

9 months agoDRM_IOCTLs SYNCOBJ_HANDLE_TO_FD, PRIME_HANDLE_TO_FD and MODE_CREATE_LEASE
Mark Wielaard [Fri, 1 Nov 2024 03:26:45 +0000 (04:26 +0100)] 
DRM_IOCTLs SYNCOBJ_HANDLE_TO_FD, PRIME_HANDLE_TO_FD and MODE_CREATE_LEASE

These three DRM_IOCTLs create new file descriptors, so track them using
ML_(record_fd_open_nameless).

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

9 months agogsl19test does not work properly when /bin/sh is /bin/dash
Florian Krohm [Thu, 31 Oct 2024 23:31:27 +0000 (00:31 +0100)] 
gsl19test does not work properly when /bin/sh is /bin/dash

There were 2 issues:

1) The output redirect operators seem to be bash specific. All output
   went to the terminal.....

2) When invoking valgrind the 'eval' needs to precede
  GSL_TEST_VERBOSE=1. Otherwise that environment variable is not seen
  by valgrind.

Two tweaks:

1) Determine the number of available processors and use that in make
   -j when building gsl-1.9

2) Replace -v with -q in the valgrind invocation. The file out-V is
   already quite large (approx 600 MB). It would be enormous with -v.

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

9 months agoReport track-fd errors for fd used which was not opened or already closed
Alexandra Hájková [Wed, 16 Oct 2024 17:38:48 +0000 (13:38 -0400)] 
Report track-fd errors for fd used which was not opened or already closed

Add (optional) pathname, description, where_closed and where_opened
fields to struct FdBadUse. Print those fields when set in fd_pp_Error.

Add a new function ML_(find_OpenFd) that provides a recorded OpenFd
given an fd (or NULL when the fd was never recorded).

In ML_(fd_allowed) when using a file descriptor use ML_(find_OpenFd)
to see if the fd was ever created, if not create an "was never
created" FdBadUse error. If it was created, but already closed create
an "was closed already", filling in as much details as we can.

Add none/tests/use_after_close.vgtest to test, already closed, never
created, invalid, double (double) close and invalid close issues.

Adjust error message in none/tests/fdbaduse.stderr.exp.

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

9 months agoIllumos: fix wartnings
Paul Floyd [Tue, 29 Oct 2024 20:02:38 +0000 (21:02 +0100)] 
Illumos: fix wartnings

Macro redefinition, calculating the size of an array and printf
format specifiers.

9 months agomacOS: compiler warnings
Paul Floyd [Tue, 29 Oct 2024 19:31:06 +0000 (20:31 +0100)] 
macOS: compiler warnings

Debug traces in vgdb.

9 months agoBug 495470 - s390x: Add s390-opcodes.csv to distribution
Andreas Arnez [Tue, 29 Oct 2024 16:43:15 +0000 (17:43 +0100)] 
Bug 495470 - s390x: Add s390-opcodes.csv to distribution

Include s390-opcodes.csv in the distribution, since it is referenced in
README.s390.

9 months agoBug 493959 - s390x: Fix regtest failure for op00 with /bin/dash
Florian Krohm [Tue, 29 Oct 2024 15:24:31 +0000 (16:24 +0100)] 
Bug 493959 - s390x: Fix regtest failure for op00 with /bin/dash

On different machines /bin/sh may be impersonated by different shells, and
those behave differently as to whether they write "Illegal instruction ..."
to stderr.  While newer versions of bash do not, dash does.

For the op00 test case this means that an additional line may be written
to `op00.stderr.out', depending on which shell is being used.  Hence
adding "Illegal instruction ..." as an expected line to `op00.stderr.exp'
wouldn't work on all systems.

Instead, fix this issue by adding the case of "illegal instruction" to the
general filtering logic in filter_stderr_basic.in, where various other
messages of this kind are already filtered out.

Reviewed-by: Andreas Arnez <arnez@linux.ibm.com>
9 months agomacOS Helgrind: fix wrong wrapper for sem_trywait.
Paul Floyd [Mon, 28 Oct 2024 21:10:30 +0000 (22:10 +0100)] 
macOS Helgrind: fix wrong wrapper for sem_trywait.

9 months agoBug 495469 - aligned_alloc and posix_memalign missing MALLOC_TRACE with returned...
Paul Floyd [Mon, 28 Oct 2024 19:36:17 +0000 (20:36 +0100)] 
Bug 495469 - aligned_alloc and posix_memalign missing MALLOC_TRACE with returned pointer

9 months agoLinux regtest: update arm64 expected with sigaltstack extra details.
Paul Floyd [Mon, 28 Oct 2024 18:56:37 +0000 (19:56 +0100)] 
Linux regtest: update arm64 expected with sigaltstack extra details.

9 months agoSet version to 3.24.0-RC1
Mark Wielaard [Sun, 27 Oct 2024 23:13:19 +0000 (00:13 +0100)] 
Set version to 3.24.0-RC1

Also update vg-lifespan which is used for documentation copyright years.

9 months agoFreeBSD regtest: final part of scalar rationalisation, x86 expected
Paul Floyd [Sun, 27 Oct 2024 21:58:32 +0000 (22:58 +0100)] 
FreeBSD regtest: final part of scalar rationalisation, x86 expected

9 months agoFreeBSD regtest: add fakes for older versions in scalar
Paul Floyd [Sun, 27 Oct 2024 20:54:55 +0000 (21:54 +0100)] 
FreeBSD regtest: add fakes for older versions in scalar

Syscalls added for FreeBSD 15 or thereabouts.

9 months agoFreeBSD regtest: remove scalar for version 15+
Paul Floyd [Sun, 27 Oct 2024 20:21:51 +0000 (21:21 +0100)] 
FreeBSD regtest: remove scalar for version 15+

Now also merged into scalar.c

9 months agoFreeBSD regtest: remove test for version 13+ syscalls
Paul Floyd [Sun, 27 Oct 2024 19:17:03 +0000 (20:17 +0100)] 
FreeBSD regtest: remove test for version 13+ syscalls

Now merged into main scalar.c

9 months agoFreeBSD regtest: add fakes for FreeBSD < 13
Paul Floyd [Sun, 27 Oct 2024 17:59:12 +0000 (18:59 +0100)] 
FreeBSD regtest: add fakes for FreeBSD < 13

Also try again to make mprotect fail. It doesn't fail
with a bogus 'prot' on FreeBSD 12.4.

9 months agoFreeBSD regtest: start removing versioned scalar variants
Paul Floyd [Sun, 27 Oct 2024 17:14:20 +0000 (18:14 +0100)] 
FreeBSD regtest: start removing versioned scalar variants

9 months agoFreeBSD: put back stacktrace hack for syscalls in older versions
Paul Floyd [Sun, 27 Oct 2024 16:48:58 +0000 (17:48 +0100)] 
FreeBSD: put back stacktrace hack for syscalls in older versions

9 months agoFreeBSD regtest: x86 scalar expected
Paul Floyd [Sun, 27 Oct 2024 14:27:38 +0000 (15:27 +0100)] 
FreeBSD regtest: x86 scalar expected

9 months agoFreeBSD regtest: cleanup scalar
Paul Floyd [Sun, 27 Oct 2024 13:22:58 +0000 (14:22 +0100)] 
FreeBSD regtest: cleanup scalar

Make more tests fail. Add a few more tests. Add some asserts
for tests that don't return -1 on failure.

9 months agoFreeBSD x86 scalar: update expected after fix for sigwait
Paul Floyd [Sun, 27 Oct 2024 09:54:23 +0000 (10:54 +0100)] 
FreeBSD x86 scalar: update expected after fix for sigwait

9 months agoFreeBSD sigwait syscall: fixes for unusual return codes
Paul Floyd [Sun, 27 Oct 2024 08:15:31 +0000 (09:15 +0100)] 
FreeBSD sigwait syscall: fixes for unusual return codes

sigwait doesn't follow the usual syscall convention of
returning -1 on error and setting errno. Instead it
returns errno and 0 means success.

Previously the POST was getting called on failure, potentially
resulting in memory getting incorrectly marked as accessible and
initialized.

Also only flag 'may block' if the first sigset argument is
accessible.

9 months agoFreeBSD Helgrind: turn off check for locks held on exit for FreeBSD 14.2
Paul Floyd [Fri, 25 Oct 2024 21:25:26 +0000 (23:25 +0200)] 
FreeBSD Helgrind: turn off check for locks held on exit for FreeBSD 14.2

thread-safe exit included in FreeBSD 14.2-PRERELEASE

9 months agoTypos in comments about syscall stacktraces.
Paul Floyd [Fri, 25 Oct 2024 06:40:26 +0000 (08:40 +0200)] 
Typos in comments about syscall stacktraces.

9 months agoPowerPC, dcbf instruction
Carl Love [Wed, 23 Oct 2024 23:25:23 +0000 (18:25 -0500)] 
PowerPC, dcbf instruction

ISA 2.7 and ISA 3.0 "accepts" L = 0 to 3, ISA 3.1 "accepts: L = 0 to 7.
Removed the L field check so valgrind will match the real hardware.  For
the purposes of Valgrind the dcbf instruction is a NOP anyway so it will
not change the behavior of Valgrind.

9 months agoHelgrind: use static asserts in client requests
Paul Floyd [Tue, 15 Oct 2024 06:23:43 +0000 (08:23 +0200)] 
Helgrind: use static asserts in client requests

Thanks, clangd.

9 months agoBug 494218 - Remove FREEBSD_VERS from configure and build
Paul Floyd [Sun, 6 Oct 2024 19:12:44 +0000 (21:12 +0200)] 
Bug 494218 - Remove FREEBSD_VERS from configure and build

9 months agoBug 445235 - Java/Ada/D demangling is probably broken
Paul Floyd [Sat, 12 Oct 2024 14:03:22 +0000 (16:03 +0200)] 
Bug 445235 - Java/Ada/D demangling is probably broken

Ada demangling is now functional.

There maybe some missing functionality like the _GLOBAL_
mentioned in the bugzilla item.

9 months agoFreeBSD regtest: add missing helgrind expecteds
Paul Floyd [Sat, 12 Oct 2024 11:18:41 +0000 (13:18 +0200)] 
FreeBSD regtest: add missing helgrind expecteds

9 months agoFreeBSD helgrind: temporary (?) fix for Bug 494337
Paul Floyd [Sat, 12 Oct 2024 07:10:21 +0000 (09:10 +0200)] 
FreeBSD helgrind: temporary (?) fix for Bug 494337

FreeBSD 15 has added a pthread lock to exit() to ensure that atexit handling
is thread safe. Unfortunately that lock gets leaked which messes up just about
all of the Helgrind tests.

Supression won't work as the callstack is the same for both genuine leaks
and this deliberate leak.

This change simply turns off the check for FreeBSD >= 15.

I see two possible proper fixes. One would be to allow one lock on exit.
The problem with that is that we will need to tell apart a clean exit
(1 lock allowed) and any kind of abort that doesn't call exit (no locks
allowed). That's going to be tricky as the Helgrind check is done before
we get back to core and know whether it is an abort or a clean exit.

The other thing would be to hack the lock counting. If we can detect that
it's a pthread_mutex_lock called from exit() then we could ignore that for
counting purposes. That would mean a possibly significant overhead for
each call to pthread_mutex_lock on FreeBSD.

9 months agoAdd none/tests/fdbaduse to .gitignore
Paul Floyd [Sat, 12 Oct 2024 06:24:09 +0000 (08:24 +0200)] 
Add none/tests/fdbaduse to .gitignore

9 months agofd regtest: add filter to new fdbaduse testcase
Paul Floyd [Sat, 12 Oct 2024 05:39:00 +0000 (07:39 +0200)] 
fd regtest: add filter to new fdbaduse testcase

9 months agoAdd BadFdExtra core error.
Alexandra Hájková [Tue, 25 Jun 2024 15:27:16 +0000 (11:27 -0400)] 
Add BadFdExtra core error.

Introduce a new FdBadFd type with associated extra info struct.
Which for now just holds the fd number (no path or description).
fd_pp_Error and fd_update_extra have been updated to handle the
new type and produce xml when requested.

Rename showing_core_errors to showing_core_warning
(returns yes when the tools wants to show core errors,
-q isn't given and we aren't producing xml).

In ML_(fd_allowed) we now call VG_(maybe_record_error) to
generate a real error (that can be suppressed and shows up
in the xml output with full execution backtrace). For now
we also produce the legacy warnings when --track-fds=yes
isn't given.

Add none/tests/fdbaduse.vgtest to test the new FdBadUse
core error.

This is the first part of reporting bad fd usage errors.
We are also tracking already closed file descriptors which
should also produce errors like these. The current bad file
descriptors are just those that are negative or above the
current file limit of the process.

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

9 months agoBug 494252 - s390x: Fix disassembly for LOCHI and friends
Florian Krohm [Wed, 9 Oct 2024 15:10:08 +0000 (17:10 +0200)] 
Bug 494252 - s390x: Fix disassembly for LOCHI and friends

The disassembly for LOCHI, LOCGHI, and LOCHHI is bogus.  For instance, the
instruction

    lochi  %r3,7,5

is disassembled as

    lochi  %r5,3,0,.+10

instead of

    lochinhe %r3,7

It seems that s390_format_RIE_RUPIX was copy-pasted from
s390_format_RIS_RUPI without adjusting it appropriately.  Fix this.

Reviewed-by: Andreas Arnez <arnez@linux.ibm.com>
9 months agos390x: Add missing early-clobber to GET_STARTREGS
Andreas Arnez [Wed, 9 Oct 2024 15:10:08 +0000 (17:10 +0200)] 
s390x: Add missing early-clobber to GET_STARTREGS

The inline assembly for GET_STARTREGS in m_libcassert.c writes to its
output before using the input argument.  But since the compiler doesn't
know this, it is allowed to allocate the same register for both, causing
problems.  This has been seen when compiling Valgrind with -O0, after
which memcheck/tests/leak-autofreepool-5 fails due to SIGSEGV.

Fix this by declaring the output as early-clobber, so the compiler knows
about the restriction.

9 months agoBug 493970 - s390x: Drop saving/restoring FPC upon helper call
Andreas Arnez [Wed, 9 Oct 2024 15:10:08 +0000 (17:10 +0200)] 
Bug 493970 - s390x: Drop saving/restoring FPC upon helper call

Saving the FPC before each helper call and restoring it afterwards creates
unnecessary overhead, and it may also not be desirable.

Drop it.  Also remove the functions in host_s390_defs.c responsible for
emitting LFPC and STFPC instructions.  And since this frees up the FPC
save slot on the stack, adjust the stack layout accordingly.

9 months agoFix some issues with GSL for `make auxchecks'
Andreas Arnez [Wed, 9 Oct 2024 15:10:08 +0000 (17:10 +0200)] 
Fix some issues with GSL for `make auxchecks'

When trying to reproduce Bug 423908, I ran into some trouble performing
`make auxchecks', due to problems in GSL:

Newer compilers complain about incompatible pointer types in argument
passing between

  unsigned int *

and

  size_t *

This affects the fifth argument of function gsl_eigen_jacobi() in
eigen/jacobi.c.  Fix this by passing the right pointer type at invocation.

Also, the configure checks for IEEE comparisons and for IEEE denormalized
values don't work as intended, because they call exit() without declaring
it and thus fail independently from those features being supported.  Fix
this by using `return' instead.

9 months agoFreeBSD regtest: one more scalar twiddle
Paul Floyd [Wed, 9 Oct 2024 06:03:36 +0000 (08:03 +0200)] 
FreeBSD regtest: one more scalar twiddle

9 months agoAdd change to sigaltstack error messages to NEWS.
Paul Floyd [Tue, 8 Oct 2024 19:37:10 +0000 (21:37 +0200)] 
Add change to sigaltstack error messages to NEWS.

9 months agoSolaris regtest: update scalar for sigaltstack changes
Paul Floyd [Tue, 8 Oct 2024 14:50:12 +0000 (16:50 +0200)] 
Solaris regtest: update scalar for sigaltstack changes

9 months agomacOS regtest: give up trying to build bug492210.c
Paul Floyd [Tue, 8 Oct 2024 19:03:17 +0000 (21:03 +0200)] 
macOS regtest: give up trying to build bug492210.c

macOS has to make everything difficult. Global names need
to be decorated with an underscore prefix. And you can't
just read from global variables, you have to do something
like a rip-relative lea.

9 months agoLinux regtest: update scalar expected for sigaltstack
Paul Floyd [Tue, 8 Oct 2024 12:09:52 +0000 (14:09 +0200)] 
Linux regtest: update scalar expected for sigaltstack

9 months agoFreeBSD regtest: update x86 scalar expected
Paul Floyd [Tue, 8 Oct 2024 13:52:09 +0000 (15:52 +0200)] 
FreeBSD regtest: update x86 scalar expected

9 months agosigaltstack syscall: improve error messages
Paul Floyd [Tue, 8 Oct 2024 11:19:08 +0000 (13:19 +0200)] 
sigaltstack syscall: improve error messages

Previously the same message was generated for the 3 members of
stack_t.

Also on FreeBSD I get a Conditional jump error with this syscall
but not on all platforms, so I've added a suppression.

9 months agoFreeBSD regtest: fake missing syscalls on arm64 in scalar test
Paul Floyd [Mon, 7 Oct 2024 19:59:58 +0000 (21:59 +0200)] 
FreeBSD regtest: fake missing syscalls on arm64 in scalar test

9 months agoFreeBSD regtest: add FAKE macros for scalar
Paul Floyd [Mon, 7 Oct 2024 05:34:59 +0000 (07:34 +0200)] 
FreeBSD regtest: add FAKE macros for scalar

FreeBSD 15 removed the never-implemented sbrk syscall.
Arm64 also has a few missing syscalls (backward compat ones
that predate the arm64 port). Rather than having an ever
increasing number of expecteds the aim is to use these
FAKE macros. It's a bit fiddly to get the matching text.

9 months agoFreeBSD regtest: auxv test string map has version dependend size
Paul Floyd [Sat, 5 Oct 2024 14:10:02 +0000 (16:10 +0200)] 
FreeBSD regtest: auxv test string map has version dependend size

9 months agoImplement /proc/self/exe readlink[at] fallback in POST handler
Mark Wielaard [Sun, 22 Sep 2024 21:24:34 +0000 (23:24 +0200)] 
Implement /proc/self/exe readlink[at] fallback in POST handler

Calling the readlink[at] syscall directly from the PRE handler defeats
the FUSE_COMPATIBLE_MAY_BLOCK (SfMayBlock) flag. Add a POST handler
that only explicitly calls the readlink[at] handler for the
/proc/self/exe fallback (this should be fine unless /proc is also
implemented as fuse in this process).

Adjust readlink[at] GENX_ and LINX_ syswrap macros to GENXY and LINXY.

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

9 months agoAdd missing FUSE_COMPATIBLE_MAY_BLOCKs
Mark Wielaard [Sat, 21 Sep 2024 20:27:24 +0000 (22:27 +0200)] 
Add missing FUSE_COMPATIBLE_MAY_BLOCKs

Various syscalls (in particular "at" variants) PRE handlers were
missing a FUSE_COMPATIBLE_MAY_BLOCK statement.

Add it to the generic PRE handlers of access and statfs64. And the
linux PRE handlers of mknodat, fchownat, futimesat, utimensat,
utimensat_time64, renameat, renameat2, readlinkat, fchmodat,
fchmodat2, faccessat and faccessat2.

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

9 months agoImplement stable variant of sync_file ioctls
Mark Wielaard [Sat, 31 Aug 2024 17:47:27 +0000 (19:47 +0200)] 
Implement stable variant of sync_file ioctls

We implemented an old staging android variant of the sync_file
ioctls. But the data structures and ioctl numbers changed when these
were upstreamed in the table linux kernel.

This implements the SYNC_IOC_MERGE, SYNC_IOC_FILE_INFO and
SYNC_IOC_SET_DEADLINE ioctls. And makes sure to record the new file
descriptor created by SYNC_IOC_MERGE.

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

10 months agoUpdate README.s390
Andreas Arnez [Tue, 1 Oct 2024 11:20:29 +0000 (13:20 +0200)] 
Update README.s390

The link to the "z/Architecture Principles of Operation" document is out
of date.  Update it.

10 months agos390x: Add bug 440180 to NEWS
Andreas Arnez [Tue, 1 Oct 2024 11:12:44 +0000 (13:12 +0200)] 
s390x: Add bug 440180 to NEWS

As reported in Bug 440180, the s390x disassembler could run into an
assertion failure due to the maximum mnemonic length being exceeded.  This
was fixed with commit 67a2bb759a7c9c76fd6aa142bdb6fe342a5998e2.

10 months agoFreeBSD regtest: remove unneeded expected file
Paul Floyd [Mon, 30 Sep 2024 19:09:15 +0000 (21:09 +0200)] 
FreeBSD regtest: remove unneeded expected file

Previously I had #ifdef'd the freebsd7 compatibility syscalls
in the scalar test for all platforms when adding the arm64
port. They are now back for amd64 and x86 so the previous
expected also covers FreeBSD >= 14.0 and the extra expected
file is now superfluous and removed.

10 months agoFreeBSD syscalls and regtest, cleanup freebsd7 compatible syscalls on arm64
Paul Floyd [Mon, 30 Sep 2024 18:52:58 +0000 (20:52 +0200)] 
FreeBSD syscalls and regtest, cleanup freebsd7 compatible syscalls on arm64

None of the freebsd7 interfaces exist on arm64 as the OS
wasn't ported until well after FreeBSD 7.

10 months agoLinux regtest: fix for memcheck/tests/amd64/bug492210
Paul Floyd [Sun, 29 Sep 2024 18:22:10 +0000 (18:22 +0000)] 
Linux regtest: fix for memcheck/tests/amd64/bug492210

On Arch Linux I get an error concerning the use of PIE and
an uninitialized variable warning. Add the no PIE flag
and also turn off the warning.

10 months agomacOS: fix build after changes for Bug 492663
Paul Floyd [Sun, 29 Sep 2024 18:08:21 +0000 (20:08 +0200)] 
macOS: fix build after changes for Bug 492663

Missed updating the macOS sections.

10 months agoFreeBSD procctl syscall: change arg name in error messages
Paul Floyd [Sun, 29 Sep 2024 08:02:33 +0000 (10:02 +0200)] 
FreeBSD procctl syscall: change arg name in error messages

The man page was inconsistent in the use of 'data' or 'arg'
for the fourth argument. I chose to use 'arg'. The manpage
has now been cleaned up and uses 'data'. So I'm switching to
use the same name.

10 months agoFreeBSD: start reducing uses of FREEBSD_VERS
Paul Floyd [Sun, 29 Sep 2024 07:32:11 +0000 (09:32 +0200)] 
FreeBSD: start reducing uses of FREEBSD_VERS

The goal is to remove version checking from configure.ac,
like Linux. There's a long way to go still.

10 months agoCompiler warning in ML_(check_elf_and_get_rw_loads) again
Paul Floyd [Sat, 28 Sep 2024 06:32:35 +0000 (08:32 +0200)] 
Compiler warning in ML_(check_elf_and_get_rw_loads) again

This fime for p_vaddr

10 months agoCompiler warning in ML_(check_elf_and_get_rw_loads)
Paul Floyd [Sat, 28 Sep 2024 06:20:25 +0000 (08:20 +0200)] 
Compiler warning in ML_(check_elf_and_get_rw_loads)

GCC 12.2 complains that
 previous_rw_a_phdr.p_vaddr + previous_rw_a_phdr.p_filesz
may be using p_filesz uninitialized

That's only possible if ML_(img_get) somehow fails to read all
of a program header such that p_memsz is greater than 0 but
p_filesz remains uninitialized. Hardly likely since p_memsz
comes after p_filesz in the structure.

10 months agoFreeBSD: remove code for FreeBSD 10
Paul Floyd [Fri, 27 Sep 2024 20:18:24 +0000 (22:18 +0200)] 
FreeBSD: remove code for FreeBSD 10

FreeBSD 10 was never really tested - fully working FreeBSD support
arrived around the time of FreeBSD 11.3 and 12.1. FreeBSD had
already been EOL around 2 years by then.

10 months agoFreeBSD regtest: fix "filter_fdleak is missing in dist_noinst_SCRIPTS"
Paul Floyd [Mon, 16 Sep 2024 06:13:15 +0000 (08:13 +0200)] 
FreeBSD regtest: fix "filter_fdleak is missing in dist_noinst_SCRIPTS"