]> git.ipfire.org Git - thirdparty/valgrind.git/log
thirdparty/valgrind.git
6 hours agoRegtest: add a filter for syscall -> in libc master
Paul Floyd [Thu, 25 Dec 2025 08:22:48 +0000 (09:22 +0100)] 
Regtest: add a filter for syscall -> in libc

6 hours agoClean up a few loose ends from previous commit adding Darwin 21 support.
Paul Floyd [Thu, 25 Dec 2025 08:02:33 +0000 (09:02 +0100)] 
Clean up a few loose ends from previous commit adding Darwin 21 support.

Update NEWS, one missed expected update and left over debug printfs
in a newly failing Darwin testcase.

22 hours agoBug 513636 - Support macOS 12.0 (Monterey) users/paulf/try-mac1200
Paul Floyd [Wed, 24 Dec 2025 16:36:11 +0000 (17:36 +0100)] 
Bug 513636 - Support macOS 12.0 (Monterey)

Intel only for the moment.

22 hours agoDarwin syswrap: 1st arg of posix_spawn can be NULL
Paul Floyd [Wed, 24 Dec 2025 16:15:49 +0000 (17:15 +0100)] 
Darwin syswrap: 1st arg of posix_spawn can be NULL

25 hours agoDRD regtest: half fix tc22_exit_w_lock on macOS 10.15
Paul Floyd [Wed, 24 Dec 2025 13:29:14 +0000 (14:29 +0100)] 
DRD regtest: half fix tc22_exit_w_lock on macOS 10.15

Still has (below main) like Solaris (but unlike macOS 10.14)

26 hours agoDRD regtest: delete tc22_exit_w_lock 32bit variant, rename 64bit one
Paul Floyd [Wed, 24 Dec 2025 12:18:36 +0000 (13:18 +0100)] 
DRD regtest: delete tc22_exit_w_lock 32bit variant, rename 64bit one

The 32bit one isn't used by FreeBSD x86. In the event that it is needed
by some platform I'll put it back.

27 hours agoDarwin suppressions: add another for getaddrinfo
Paul Floyd [Wed, 24 Dec 2025 10:43:44 +0000 (11:43 +0100)] 
Darwin suppressions: add another for getaddrinfo

On macOS 10.15

27 hours agoSolaris regtest: update for drd/tests/tc22_exit_w_lock
Paul Floyd [Wed, 24 Dec 2025 10:38:23 +0000 (11:38 +0100)] 
Solaris regtest: update for drd/tests/tc22_exit_w_lock

I removed -q so that the test passes with Darwin. That
only caused the test to fail on illumos. Ho hum.

42 hours agoDarwin mmap: use ARG5 for VG_(di_notify_mmap)
Paul Floyd [Tue, 23 Dec 2025 20:22:17 +0000 (21:22 +0100)] 
Darwin mmap: use ARG5 for VG_(di_notify_mmap)

The fix for bug280965 (a long long time ago) changed VG_(di_notify_mmap)
so that instead of opening a new fd to peek at the ELF header it would
reuse the same mmap fd with pread() to avoid resetting fcntl flags.
Except that the patch was applied to mmap in syswrap-generic but not
to the mmap in syswrap-darwin. So the problem remained there on Darwin
for 14 years.

44 hours agoDarwin regtest: add prereq for massif/tests/pages_as_heap
Paul Floyd [Tue, 23 Dec 2025 18:01:27 +0000 (19:01 +0100)] 
Darwin regtest: add prereq for massif/tests/pages_as_heap

Darwin has brk() but all it does is return ENOMEM.

44 hours agoDarwin: revert change for async signal termination message
Paul Floyd [Tue, 23 Dec 2025 18:00:48 +0000 (19:00 +0100)] 
Darwin: revert change for async signal termination message

46 hours agoDarwin regtest: one more with a sem_init prereq
Paul Floyd [Tue, 23 Dec 2025 16:18:48 +0000 (17:18 +0100)] 
Darwin regtest: one more with a sem_init prereq

47 hours agoDRD regtest: don't use -q with tc22_exit_w_lock
Paul Floyd [Tue, 23 Dec 2025 15:30:53 +0000 (16:30 +0100)] 
DRD regtest: don't use -q with tc22_exit_w_lock

This seems a better fix than turning off Darwin aysync signal
termination messages.

Also I don't think that the 32bit variant is used any more.

2 days agoDarwin signals: don't try to check for async signals for "Process terminating" message
Paul Floyd [Tue, 23 Dec 2025 13:55:59 +0000 (14:55 +0100)] 
Darwin signals: don't try to check for async signals for "Process terminating" message

Darwin can't tell sync and async apart so don't bother trying.

2 days agoDarwin regtest: add a prereq for helgrind/tests/bug327548
Paul Floyd [Tue, 23 Dec 2025 13:31:02 +0000 (14:31 +0100)] 
Darwin regtest: add a prereq for helgrind/tests/bug327548

sem_init returns ENOSYS on Darwin so use the DRD script to check
that sem_init is supported (i.e., not Darwin).

2 days agoDarwin helgrind: change api error handling for pthread_rwlock_trywrlock
Paul Floyd [Tue, 23 Dec 2025 13:29:19 +0000 (14:29 +0100)] 
Darwin helgrind: change api error handling for pthread_rwlock_trywrlock

This may return EDEADLK is the rwlock is already locked by the same
thread. Darwin seems to be the only OS that does this.

2 days agoDarwin regtest: update none apple-main-arg for macOS 10.14
Paul Floyd [Tue, 23 Dec 2025 09:55:25 +0000 (10:55 +0100)] 
Darwin regtest: update none apple-main-arg for macOS 10.14

Looks like the apple pointer to the executable name started having a prefix
starting with macOS 10.14.

2 days agoDarwin regtest: update for one of the several memalign_args expecteds
Paul Floyd [Tue, 23 Dec 2025 07:31:02 +0000 (08:31 +0100)] 
Darwin regtest: update for one of the several memalign_args expecteds

2 days agoDarwin: fix x86 build on macOS 10.13 (and probably 10.14)
Paul Floyd [Tue, 23 Dec 2025 07:27:29 +0000 (08:27 +0100)] 
Darwin: fix x86 build on macOS 10.13 (and probably 10.14)

2 days agoDarwin: add newline to if statements
Paul Floyd [Tue, 23 Dec 2025 06:25:57 +0000 (07:25 +0100)] 
Darwin: add newline to if statements

For some reason on macOS 12 the apple pointer is wrong. It's a pain
to debug code where the if and the true statement are on the same
line.

3 days agoHelgrind regtest: add asserts to cond_timedwait_test.c
Paul Floyd [Mon, 22 Dec 2025 09:19:30 +0000 (10:19 +0100)] 
Helgrind regtest: add asserts to cond_timedwait_test.c

This test fails on Darwin, It looks like Darwin uses another mutex
and it's complaining that the condition mutex is not locked when
the unlock call is made. I made these changes when checking that the
testcase has the same behaviour on FreeBSD.

4 days agoDarwin: revert a bit of overzealous merging
Paul Floyd [Sat, 20 Dec 2025 18:44:39 +0000 (19:44 +0100)] 
Darwin: revert a bit of overzealous merging

4 days agoDarwin: fix a compiler warning
Paul Floyd [Sat, 20 Dec 2025 17:51:43 +0000 (18:51 +0100)] 
Darwin: fix a compiler warning

Make a function static since it's only used in the one compilation unit.

4 days agoBug 513533 - Support macOS 11.0 (Big Sur)
Paul Floyd [Sat, 20 Dec 2025 12:01:26 +0000 (13:01 +0100)] 
Bug 513533 - Support macOS 11.0 (Big Sur)

Most of the work for this was done by Louis Brunner.
Thanks Louis.

6 days agoregtest: filter leaks from memcheck threadname_xml and update expected
Paul Floyd [Fri, 19 Dec 2025 11:33:50 +0000 (12:33 +0100)] 
regtest: filter leaks from memcheck threadname_xml and update expected

6 days agoregtest: change memcheck threadname_xml prereq
Paul Floyd [Fri, 19 Dec 2025 06:07:12 +0000 (07:07 +0100)] 
regtest: change memcheck threadname_xml prereq

This was using test -u which doesn't work on Darwin so I changed that to -e.

6 days agoBug 258140 - Valgrind on OS X always reports some memory "still reachable"
Paul Floyd [Fri, 19 Dec 2025 05:58:51 +0000 (06:58 +0100)] 
Bug 258140 - Valgrind on OS X always reports some memory "still reachable"

Just needed one more suppression for the minimal test in the bugzilla
item. I expect that there will be a seemingly endless number of leaks
in Darwin (different libs, later versions).

7 days agoDarwin and FreeBSD: and the two platforms to the check that 32bit executables can...
Paul Floyd [Thu, 18 Dec 2025 07:36:25 +0000 (08:36 +0100)] 
Darwin and FreeBSD: and the two platforms to the check that 32bit executables can be built

I don't think that I've ever tested this on a FreeBSD amd64 install without 32bit support.

This check is required on Darwin 19 and later.

7 days agoconfigure.ac: tabs to spaces in block setting PLATFORM PRI and SEC variables
Paul Floyd [Thu, 18 Dec 2025 07:30:07 +0000 (08:30 +0100)] 
configure.ac: tabs to spaces in block setting PLATFORM PRI and SEC variables

It was a mix of tabs and spaces, hard to read without the right tab width
setting.

7 days agoBug 513522 - m_libcassert.c: 'ordered comparison of pointer with integer zero' compil...
Paul Floyd [Thu, 18 Dec 2025 06:59:38 +0000 (07:59 +0100)] 
Bug 513522 - m_libcassert.c: 'ordered comparison of pointer with integer zero' compiler warning

7 days agos390 disasm-test: Add constraint for VPDI insn.
Florian Krohm [Wed, 17 Dec 2025 22:31:41 +0000 (22:31 +0000)] 
s390 disasm-test: Add constraint for VPDI insn.

7 days agoDarwin: add macOS 10.15 support
Paul Floyd [Sun, 14 Dec 2025 20:04:08 +0000 (21:04 +0100)] 
Darwin: add macOS 10.15 support

== 721 tests, 46 stderr failures, 6 stdout failures, 0 stderrB failures, 0 stdoutB failures, 4 post failures ==

A couple more failures in none (empty-exe and scripts/shell). Otherwise quite like
macOS 10.14.

Much of the code merged from Louis Brunner's git repo. Many thanks once again
Louis.

8 days agoLinux ppc32: map a few more syscalls
Sertonix [Mon, 15 Dec 2025 18:29:40 +0000 (18:29 +0000)] 
Linux ppc32: map a few more syscalls

9 days agoWrap new lsm_list_modules syscall
Martin Cermak [Tue, 16 Dec 2025 08:52:29 +0000 (09:52 +0100)] 
Wrap new lsm_list_modules syscall

The lsm_list_modules syscall returns a list of the active LSM ids. On
success this function returns the number of @ids array elements. This
value may be zero if there are no LSMs active. If @size is insufficient
to contain the return data -E2BIG is returned and @size is set to the
minimum required size. In all other cases a negative value indicating
the error is returned.

SYSCALL_DEFINE3(lsm_list_modules, u64 __user *, ids, u32 __user *, size,
                u32, flags)

Declare lsm_list_modules wrappers in priv_syswrap-linux.h and hook it
for {amd64,arm,arm64,mips64,ppc32,ppc64,riscv64,s390x,x86}-linux.

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

9 days agos390: Clarify a variable name.
Florian Krohm [Mon, 15 Dec 2025 22:38:37 +0000 (22:38 +0000)] 
s390: Clarify a variable name.

10 days agoTestcase tweak: clenup after yourself
Florian Krohm [Mon, 15 Dec 2025 10:24:49 +0000 (10:24 +0000)] 
Testcase tweak: clenup after yourself

10 days agoDarwin DRD: redirs for semaphore functions
Paul Floyd [Sun, 14 Dec 2025 19:23:10 +0000 (20:23 +0100)] 
Darwin DRD: redirs for semaphore functions

Like 2802b31ae644301ee641dcae20d1f84373615d54 for Helgrind.
Use the DRD script supported_sem_init in Helgrind tests that use
semaphores, it's clearer than just using tests/os_test

10 days agos390: Fix build failure
Florian Krohm [Sun, 14 Dec 2025 17:26:24 +0000 (17:26 +0000)] 
s390: Fix build failure

Followup to 778fe51a69eb099bc6cbfa616986310560a8b828.

10 days agoDarwin helgrind: redirs for semaphore functions
Paul Floyd [Sun, 14 Dec 2025 17:21:19 +0000 (18:21 +0100)] 
Darwin helgrind: redirs for semaphore functions

The semaphore functions are not in the pthread library (similar to FreeBSD).
Change the redirs to use libsystem_kernel.dylib

Unfortunately this doesn't help much. Darwin has deprecated these functions
so the tests will compile (with a warning) but at runtime they all fail
with errors like ENOSYS and EBADF.

11 days agoDarwin fdleaks: fix handling of recvmsg cmsg
Paul Floyd [Sun, 14 Dec 2025 12:31:18 +0000 (13:31 +0100)] 
Darwin fdleaks: fix handling of recvmsg cmsg

In the Darwin headers the macro __DARWIN_ALIGN32 is used for
the CMSG macros. We were using just ALIGN which looks like
it uses __DARWIN_ALIGN for 8 byte alignment. Using the
wrong alignment gate a wrong count of fds and check_cmsg_for_fds
was only calling ML_(record_fd_open_named) for one fd. The result
was fd errors when writing to a second fd that should have been
recorded.

11 days agoDarwin regtest: update none ioctl_moans
Paul Floyd [Sun, 14 Dec 2025 09:05:04 +0000 (10:05 +0100)] 
Darwin regtest: update none ioctl_moans

This testcase needs IOCTL_REQUEST_BASE to be set to some bogus
value with the platform dependent "no direction" flag set.
That flag wasn't being set for Darwin and so the testcase was
failing.

11 days agos390: Tweak a few helper functions.
Florian Krohm [Sat, 13 Dec 2025 22:12:23 +0000 (22:12 +0000)] 
s390: Tweak a few helper functions.

11 days agotestsuite: Tidy. Remove empty .stdout.exp files
Florian Krohm [Sat, 13 Dec 2025 18:37:27 +0000 (18:37 +0000)] 
testsuite: Tidy. Remove empty .stdout.exp files

As per tests/vg_regtest:

 Expected stdout (filtered) is kept in <test>.stdout.exp* (can be more
 than one expected output).  It can be missing if it would be empty.

12 days agovex: change ISelEnv allocation
Florian Krohm [Fri, 12 Dec 2025 20:43:55 +0000 (20:43 +0000)] 
vex: change ISelEnv allocation

No need for dynamic memory allocation. Local variable will do just
fine. Saves roughly 136 bytes per IRSB on s390.

13 days agoDarwin suppression: another Helgrind suppression for getaddrinfo in 10.14
Paul Floyd [Fri, 12 Dec 2025 12:47:54 +0000 (13:47 +0100)] 
Darwin suppression: another Helgrind suppression for getaddrinfo in 10.14

2 weeks agos390x: Simplify single multiplications
Andreas Arnez [Fri, 5 Dec 2025 17:01:22 +0000 (18:01 +0100)] 
s390x: Simplify single multiplications

So far the single-multiplication instructions are implemented by taking
the low half of a widening multiply.  This pattern is then recognized by
the instruction selector, which combines it to a single multiplication
again.

This is unnecessarily complicated, since single-multiply operations can be
expressed directly by Iop_Mul32 and Iop_Mul64 instead.  So do this,
simplifying the code generation.

Also, since Iop_Mul32 and Iop_Mul64 haven't really been used before, the
instruction selector generates sub-optimal code for them.  Fix that.

2 weeks agoDarwin regtest: update a few expecteds
Paul Floyd [Thu, 11 Dec 2025 08:06:38 +0000 (09:06 +0100)] 
Darwin regtest: update a few expecteds

One predated correct redirection of the C++ library operator new
One has a few line number changes plus I removed an assert that is firing
(asserts firing in tests is never a good thing). And the last one is just
line number changes.

2 weeks agoDarwin libcproc: fix for VG_(read_millisecond_timer)
Paul Floyd [Thu, 11 Dec 2025 08:03:08 +0000 (09:03 +0100)] 
Darwin libcproc: fix for VG_(read_millisecond_timer)

This function had some peculiar workaround for how the result
was handled. That peculiarity seems to have gone away (some time
before Darwin 17). Now use 'normal' handling for the result for
Darwin 17+.

This was causing some DRD timed mutex testcases to fail.

Code copied from Louis Brunner.

2 weeks agoDarwin DRD: add a bodge for LLVM DWARF that our reader does not like
Paul Floyd [Thu, 11 Dec 2025 07:03:46 +0000 (08:03 +0100)] 
Darwin DRD: add a bodge for LLVM DWARF that our reader does not like

Longer term, need to understand Apple DWARF quirks and adapt to them
as necessary.

2 weeks agoDarwin warnings: add options to turn off warnings from system headers
Paul Floyd [Wed, 10 Dec 2025 12:35:49 +0000 (13:35 +0100)] 
Darwin warnings: add options to turn off warnings from system headers

Darwin 18 / clang 11 are quite noisy with nullability and expansion
to defined warnings in the system headers.

2 weeks agoRegtest: fix and x86 test unused function warning
Paul Floyd [Wed, 10 Dec 2025 12:16:54 +0000 (13:16 +0100)] 
Regtest: fix and x86 test unused function warning

2 weeks agoDarwin regtest: numerous bits of Darwin 18 cleanup
Paul Floyd [Wed, 10 Dec 2025 07:58:25 +0000 (08:58 +0100)] 
Darwin regtest: numerous bits of Darwin 18 cleanup

Add a few more ignore-fn options to the massif tests for the
extra leaks that are in Darwin 18.

Add some suppressions to a couple of memcheck tests that use
num-callers of 2 or 3. The shorter callsteack means some of the
many Darwin default suppressions don't match which was causing
these tests to fail.

Add more DRD suppressions for getaddrinfo. There seems to be a never
ending amount of conflicts in dyld.

2 weeks agoDarwin: add macOS 10.14 support
Paul Floyd [Tue, 9 Dec 2025 13:06:06 +0000 (14:06 +0100)] 
Darwin: add macOS 10.14 support

== 714 tests, 77 stderr failures, 5 stdout failures, 0 stderrB failures, 0 stdoutB failures, 33 post failures ==

x86 tests are all failing due to unsupported instructions
I need to go through the Massif tests to filter out all of the new macOS leaks.

Otherwise fairly similar to trhe results on macOS 10.13

2 weeks agoAdd SSE4.1 min/max instructions for x86 32 bit
Alexandra Hájková [Tue, 2 Dec 2025 16:06:58 +0000 (11:06 -0500)] 
Add SSE4.1 min/max instructions for x86 32 bit

Support pmaxsb, pminsb, pmaxuw, pminuw, pmaxud and pminud instructions
in guest_x86_toIR.c and host_x86_isel.c. Move test functions from
amd64/sse4-64.c to sse4-common.h and update none/tests/x86/sse4-x86.c
and sse4-x86.stdout.exp to test all min/max instructions.

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

2 weeks agoDarwin: fix warning for hack to prevent crashes during stacktrace generation
Paul Floyd [Tue, 9 Dec 2025 08:47:45 +0000 (09:47 +0100)] 
Darwin: fix warning for hack to prevent crashes during stacktrace generation

2 weeks agoDarwin: remove support for old systems
Paul Floyd [Tue, 9 Dec 2025 08:41:01 +0000 (09:41 +0100)] 
Darwin: remove support for old systems

Valgrind no longer builds on Darwin 11 / Mac OS X 10.7. So remove support
for Darwin 9 to Darwin 11 inclusive.

2 weeks agoDarwin: add most of the missing bits for Darwin 18 support
Paul Floyd [Tue, 9 Dec 2025 07:58:46 +0000 (08:58 +0100)] 
Darwin: add most of the missing bits for Darwin 18 support

Code merged from Louis Brunner. Also add a but of doc about the
oldest OSX that we support. Unfortunately I don't know which version
that is.

2 weeks agoDarwin suppressions: merge old suppression files to darwin-legacy.supp
Paul Floyd [Tue, 9 Dec 2025 06:33:49 +0000 (07:33 +0100)] 
Darwin suppressions: merge old suppression files to darwin-legacy.supp

Merge files for Darwin 10 to 16 into a legacy file.  Rename the Darwin 17
file as just darwin.supp. I'll add suppressions to that file, at least for
10.14 and 10.15. When I get to Darwin 20 and the dyld shared cache
we'll see, that might need a new set of suppression files.

Remove freebsd-helgrind-dbgrtld.supp. I thought that it would be useful
but it wasn't. When I merged the Darwin suppression files I wrote a little
duplication detection tool (only for exact duplicates). This found one
duplicate in solaris12.supp that I've removed.

2 weeks agoDarwin suppressions: add suppressions for shared_timed_mutex testcase
Paul Floyd [Mon, 8 Dec 2025 19:35:17 +0000 (20:35 +0100)] 
Darwin suppressions: add suppressions for shared_timed_mutex testcase

The test still fails with 12 errors (should be 0). There are a load
of errors that I've never seen before, Like

Thread #2: Bug in libpthread: write lock granted on mutex/rwlock which is currently wr-held by a different thread

and

Thread #1 unlocked lock at 0x100005228 currently held by thread #3

There are some serious problems there.

2 weeks agoDarwin suppressions: split out a new Helgrind suppression file
Paul Floyd [Mon, 8 Dec 2025 19:26:21 +0000 (20:26 +0100)] 
Darwin suppressions: split out a new Helgrind suppression file

Rename darwin10-drd.supp to darwin-drd.supp, this will be the
basis for all Darwin suppressions.

2 weeks agoWrap new lsm_get_self_attr and lsm_set_self_attr syscalls
Martin Cermak [Mon, 8 Dec 2025 12:20:25 +0000 (13:20 +0100)] 
Wrap new lsm_get_self_attr and lsm_set_self_attr syscalls

Create a system call lsm_get_self_attr() to provide the security
module maintained attributes of the current process.
Create a system call lsm_set_self_attr() to set a security
module maintained attribute of the current process.
Historically these attributes have been exposed to user space via
entries in procfs under /proc/self/attr.

Declare lsm_get_self_attr and lsm_set_self_attr wrappers in
priv_syswrap-linux.h and hook it for {amd64,arm,arm64,mips64,\
ppc32,ppc64,riscv64,s390x,x86}-linux.

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

2 weeks agoDarwin suppressions: start cleaning up the suppression files
Paul Floyd [Mon, 8 Dec 2025 07:24:46 +0000 (08:24 +0100)] 
Darwin suppressions: start cleaning up the suppression files

This commit moves DRD suppressions from darwin17.supp to darwin10-drd.supp.
It also removes some pthread lib suppressions. There's an obj suppression
at the top level for libsystem_pthread.dylib that should cover all that.

I want to avoid having 20+ Darwin suppression files (and rising with
every new version). I'd like to have something a bit more like FreeBSD,
with one suppression file for memcheck, one for DRD and one for Helgrind.
That might be a bit optimistic (especially when DSC support lands). So
what I'll do to begin with is to merge all of the Darwin <= 16 memcheck
files into one darwin-legacy.supp, split out a new darwin-helgrind.supp
file and rename darwin10-drd.supp to just darwin-drd.supp. That leaves
darwin9-drd.supp which I'll either rename or merge.

2 weeks agoDarwin: make fixup_macho_loadcmds.c less version dependent
Paul Floyd [Sun, 7 Dec 2025 21:11:19 +0000 (22:11 +0100)] 
Darwin: make fixup_macho_loadcmds.c less version dependent

Remove a load of DARWIN_VERS checks. It's a pointless maintenance
burden. Add suppport for SDK >= 10.4.6. First step to adding
macOS 10.14 Mojave support.

2 weeks agoFreeBSD and Darwin: clean up fake sigreturn syscall numbers
Paul Floyd [Sun, 7 Dec 2025 20:59:40 +0000 (21:59 +0100)] 
FreeBSD and Darwin: clean up fake sigreturn syscall numbers

Firstly make them a bit more similar. Secondly, switch Darwin
from using __NR_MAXSYSCALL which changes with every Darwin version
to using 1000 like FreeBSD.

Change NEWS for macOS 10.13, it has now progressed beyond
'preliminary'.

2 weeks agoIf valgrind crashes (e.g. on SEGV) and debug log > 0, report aspacemgr status
Philippe Waroquiers [Sun, 7 Dec 2025 20:14:20 +0000 (21:14 +0100)] 
If valgrind crashes (e.g. on SEGV) and debug log > 0, report aspacemgr status

Might help to see what goes wrong in bug 511717 gdbdserver read memory SIGSEGV

2 weeks agoDarwin: fix debug only build
Paul Floyd [Sun, 7 Dec 2025 12:30:19 +0000 (13:30 +0100)] 
Darwin: fix debug only build

Was filing to link. Optimised builds were smart enough to optimise away
a call to a function that I haven't merged into the repo yet.

2 weeks agoDarwin syscall: initial wrapper for kernelrpc_mach_vm_purgable_control_trap
Paul Floyd [Sun, 7 Dec 2025 10:48:51 +0000 (11:48 +0100)] 
Darwin syscall: initial wrapper for kernelrpc_mach_vm_purgable_control_trap

Need to add verification of regs and read/write mem.

2 weeks agoDarwin syscall: initial wrapper for mach_voucher_extract_attr_recipe
Paul Floyd [Sun, 7 Dec 2025 08:52:04 +0000 (09:52 +0100)] 
Darwin syscall: initial wrapper for mach_voucher_extract_attr_recipe

It doesn't do any checking yet. However, with this change running
TextEditor with --tool=none gets as far as drawing a white box on
the screen. Then it fails because there is a missing mach trap handler
for

/* 11 */ MACH_TRAP(_kernelrpc_mach_vm_purgable_control_trap, 4, 5, munge_wlww),

2 weeks agoDarwin syswrap: remove a couple of duplicate table entries
Paul Floyd [Sun, 7 Dec 2025 08:43:39 +0000 (09:43 +0100)] 
Darwin syswrap: remove a couple of duplicate table entries

Probably harmless but it was generating a couple of compiler warnings

2 weeks agoFreeBSD regtest: minor typo in test error message
Paul Floyd [Sun, 7 Dec 2025 08:36:20 +0000 (09:36 +0100)] 
FreeBSD regtest: minor typo in test error message

2 weeks agoDarwin mach_msg_host: move assign_port_name to post
Paul Floyd [Sun, 7 Dec 2025 07:50:32 +0000 (08:50 +0100)] 
Darwin mach_msg_host: move assign_port_name to post

There's a GrP comment saying that assign_port_name should only be called on success.
And indeed when it is called in the PRE and it can't find the info for the port
then the code will assert.

2 weeks agoDarwin stacktraces: add a hack to prevent segfault when dereferencing bp
Paul Floyd [Sun, 7 Dec 2025 06:54:23 +0000 (07:54 +0100)] 
Darwin stacktraces: add a hack to prevent segfault when dereferencing bp

Can now turn a couple more helgrind tests back on.
Need to get to the bottom of the bp dereferencing issue. There is a test
already so it us supposed to be safe.

2 weeks agoDarwin client stack: add an assert to check the stringtable doesn't get overwritten
Paul Floyd [Sat, 6 Dec 2025 10:09:19 +0000 (11:09 +0100)] 
Darwin client stack: add an assert to check the stringtable doesn't get overwritten

As per the previous change for FreeBSD.

2 weeks agoFreeBSD client stack: add an assert to check the stringtable doesn't get overwritten
Paul Floyd [Sat, 6 Dec 2025 09:50:38 +0000 (10:50 +0100)] 
FreeBSD client stack: add an assert to check the stringtable doesn't get overwritten

There's already an assert that the stringsize calculated matches the
stringsize writte. This adds a check that the pointer table area
does not overwrite the stringtable (that is, that the NULL pointer after the
last auxv entry pointer does not overwrite the first string [either the
interpreter or argv[0])

2 weeks agoDarwin configure: updates to SDK checking and not yet suppoorted Darwin versions
Paul Floyd [Sat, 6 Dec 2025 07:19:36 +0000 (08:19 +0100)] 
Darwin configure: updates to SDK checking and not yet suppoorted Darwin versions

Merged from Louis Brunner

I was just adding support for OSX 10.13 but that is just making more
work (avoiding parts of merges that will probably need to be added back later).

This should allow me to merge code that uses macros for OSX/macOS versions
which don't yet have support in the repo.

2 weeks agoDarwin: also clean up client stack creation
Paul Floyd [Fri, 5 Dec 2025 20:59:34 +0000 (21:59 +0100)] 
Darwin: also clean up client stack creation

Make stringbase and strtab be based off clstack_end + 1
rather than clstack_end. clstack_end is the address of the
last byte of the stack, not one past the end of the stack.
That means that it is not word aligned. Adding 1 makes
the calculation word aligned.

Depending on the length of the string table with rounding
it could happen that the executable_path pointer would
overwrite the start of argv[0] in the string table.

I think that that there are supposed to be 0-16 bytes between
the end of the pointers and the string table (or is that
ELF?).

2 weeks agoFreeBSD: a bit of cleaning of client stack creation
Paul Floyd [Fri, 5 Dec 2025 20:44:56 +0000 (21:44 +0100)] 
FreeBSD: a bit of cleaning of client stack creation

Remove some commented out rounding
Make stringbase point to a word boundary, not one before

2 weeks agoDarwin: no need to turn off alignment assert in leak check
Paul Floyd [Fri, 5 Dec 2025 12:47:19 +0000 (13:47 +0100)] 
Darwin: no need to turn off alignment assert in leak check

Mixed up 2 files with previous commit. This also contains
a missing proto and the previous commit fixes issues with badly formed
segments. Needs more investigation.

2 weeks agoDarwin: add a couple of missing function prototypes
Paul Floyd [Fri, 5 Dec 2025 12:44:41 +0000 (13:44 +0100)] 
Darwin: add a couple of missing function prototypes

2 weeks agoarm: Remove global arm_hwcaps and one FIXME.
Florian Krohm [Thu, 4 Dec 2025 20:38:24 +0000 (20:38 +0000)] 
arm: Remove global arm_hwcaps and one FIXME.

Followup to cd9d7d0d2edeef5ef37582c6d6fa55ca3c3bcccd

3 weeks agoAdd ARG4 checks for quotactl and quotactl_fd syswraps
Martin Cermak [Thu, 4 Dec 2025 13:00:59 +0000 (14:00 +0100)] 
Add ARG4 checks for quotactl and quotactl_fd syswraps

ARG4 can point to different things of varion sizes based on the
cmd arg.  Handle all the possible options and provide missing
checks.

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

3 weeks agoChange the data type of libvex_Backend::emit.
Florian Krohm [Wed, 3 Dec 2025 22:26:57 +0000 (22:26 +0000)] 
Change the data type of libvex_Backend::emit.

Both the s390 and arm insn emitters need to know the host's hardware
capabilities. Today, these are provided by means of global variables
s390_host_hwcaps and arm_hwcaps. To eliminate that kludge the emit
function is changed. Instead of passing VexEndness we now pass a pointer
to VexArchInfo which provides both the endianess and hardware capabilities.

Those global variables will be removed in a followup patch.

3 weeks agos390: Remove unused function parameter
Florian Krohm [Wed, 3 Dec 2025 17:15:42 +0000 (17:15 +0000)] 
s390: Remove unused function parameter

3 weeks agoDarwin regtest: DRD filters and more suppressions
Paul Floyd [Mon, 1 Dec 2025 21:26:10 +0000 (22:26 +0100)] 
Darwin regtest: DRD filters and more suppressions

3 weeks agoDarwin: update readmacho code
Paul Floyd [Mon, 1 Dec 2025 08:04:46 +0000 (09:04 +0100)] 
Darwin: update readmacho code

Code from Louis Brunner

3 weeks agoLinux Helgrind: add a suppression for _dl_allocate_tls_init
Paul Floyd [Mon, 1 Dec 2025 07:18:56 +0000 (08:18 +0100)] 
Linux Helgrind: add a suppression for _dl_allocate_tls_init

Seen on Fedora 43 amd64

3 weeks agoLinux DRD suppression: add an entry for __is_decorate_maps_enabled
Paul Floyd [Mon, 1 Dec 2025 07:12:30 +0000 (08:12 +0100)] 
Linux DRD suppression: add an entry for __is_decorate_maps_enabled

Seen on Fedora 43

3 weeks agoNEWS / README.s390 update
Florian Krohm [Sun, 30 Nov 2025 21:52:32 +0000 (21:52 +0000)] 
NEWS / README.s390 update

BZ 509562 closed

3 weeks agoDarwin: update x86 syswrap code
Paul Floyd [Sun, 30 Nov 2025 17:21:56 +0000 (18:21 +0100)] 
Darwin: update x86 syswrap code

Code from Louis Brunner.

3 weeks agoDarwin: update syscalls
Paul Floyd [Sun, 30 Nov 2025 16:27:17 +0000 (17:27 +0100)] 
Darwin: update syscalls

Code merged from Louis Brunner, mainly up to OSX 10.13

3 weeks agoAdd sse4-common.h to none/tests/Makefile.am noinst_HEADERS
Mark Wielaard [Sun, 30 Nov 2025 14:58:38 +0000 (15:58 +0100)] 
Add sse4-common.h to none/tests/Makefile.am noinst_HEADERS

Fixes: 5e584556a9b9 ("Add none/tests/sse4-common.h header")
3 weeks agoDarwin: add code for text_slide
Paul Floyd [Sun, 30 Nov 2025 14:51:20 +0000 (15:51 +0100)] 
Darwin: add code for text_slide

Code from Louis Brunner

3 weeks agos390: Remove S390_NUM_FACILITY_DW; fix testcase stfle.c (BZ 509562)
Florian Krohm [Sun, 30 Nov 2025 08:33:41 +0000 (08:33 +0000)] 
s390: Remove S390_NUM_FACILITY_DW; fix testcase stfle.c (BZ 509562)

Now that the stfle insn is available we can use it to tell uas how
many double words are needed to store all facility bits. Hence,
S390_NUM_FACILITY_DW can go.

none/tests/s390x/stfle.c: The bug is here

  if (bit_to_test < 64)
    return (hoststfle[0] & (1ULL << (63 - bit_to_test)));
  else if (bit_to_test < 128)
    return (hoststfle[1] & (1ULL << (63 - bit_to_test)));
  else if (bit_to_test < 192)
    return (hoststfle[2] & (1ULL << (63 - bit_to_test)));

when bit_to_test >= 64.  Now fixed and test added.

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

3 weeks agodebuginfo: small code simplification
Paul Floyd [Sat, 29 Nov 2025 20:52:00 +0000 (21:52 +0100)] 
debuginfo: small code simplification

Merge two identical cases (and there may be a third if and when
Darwin arm64 makes it here).

3 weeks agoDarwin: updates to macho loading and turn off hanging regtests
Paul Floyd [Sat, 29 Nov 2025 20:14:44 +0000 (21:14 +0100)] 
Darwin: updates to macho loading and turn off hanging regtests

Code merges from Louis Brunner.
Turn off 7 tests that are hanging.
Updates to filtering.

3 weeks agoDarwin: update signal tramp, helgrind and drd suppressions
Paul Floyd [Fri, 28 Nov 2025 21:49:25 +0000 (22:49 +0100)] 
Darwin: update signal tramp, helgrind and drd suppressions

Change a couple of testcase asserts to match Darwin quirks.
Signal tramp from Louis Brunner

3 weeks agoDarwin .gitignore: add lines for cachegrind callgrind and lackey dSYM directories
Paul Floyd [Fri, 28 Nov 2025 12:39:26 +0000 (13:39 +0100)] 
Darwin .gitignore: add lines for cachegrind callgrind and lackey dSYM directories

3 weeks agoDarwin DRD and Helgrind: clean up suppressions
Paul Floyd [Fri, 28 Nov 2025 12:36:43 +0000 (13:36 +0100)] 
Darwin DRD and Helgrind: clean up suppressions

Also fix one DRD testcase where a pthread function returns a
different error code.

3 weeks agoDarwin Helgrind/DRD: change pthread lib, more filters and suppressions
Paul Floyd [Fri, 28 Nov 2025 06:44:51 +0000 (07:44 +0100)] 
Darwin Helgrind/DRD: change pthread lib, more filters and suppressions

And turn off one test that is hanging. More to come.

3 weeks agos390: Tidy and a bit of constification
Florian Krohm [Thu, 27 Nov 2025 21:21:59 +0000 (21:21 +0000)] 
s390: Tidy and a bit of constification