]> git.ipfire.org Git - thirdparty/valgrind.git/log
thirdparty/valgrind.git
2 months agoarm64: add a configure check for crypto support
Paul Floyd [Sun, 10 May 2026 07:34:19 +0000 (09:34 +0200)] 
arm64: add a configure check for crypto support

This is related to https://bugs.kde.org/show_bug.cgi?id=391311
In the patch for that bugzilla item there is a build time fix.
Without the crypto tests the test will fail.

If there are no issues with this configure test I'll split off a new
test v8crypto from fp_and_simd.

2 months agoRegtest: remove duplicate break from iropt-test/unary.c
Paul Floyd [Sat, 9 May 2026 19:34:26 +0000 (21:34 +0200)] 
Regtest: remove duplicate break from iropt-test/unary.c

Louis Brunner fixed this and I noticed the diff so merging
it upstream.

2 months ago[mips] fix CmpLE32U and Max32U ops
Petar Jovanovic [Sat, 9 May 2026 13:46:27 +0000 (13:46 +0000)] 
[mips] fix CmpLE32U and Max32U ops

CmpLE32U operation was incorrectly implemented as a signed comparaison,
use less-or-same for unsigned.

Max32U operation was incorrectly implemented using the SLT instruction,
use the unsigned variant SLTU.

This partially fixes none/tests/iropt-test.

Patch by:
Dimitrije Dzunic <dimitrije.dzunic@htecgroup.com>
Aleksandar Rikalo <aleksandar.rikalo@htecgroup.com>

2 months agoarm64: update comment for DCZID_EL0
Paul Floyd [Fri, 8 May 2026 13:43:21 +0000 (15:43 +0200)] 
arm64: update comment for DCZID_EL0

2 months agoBug 487418 - [arm64] Cleanup M{SR,RS} instructions (part 1)
Paul Floyd [Fri, 8 May 2026 11:04:42 +0000 (13:04 +0200)] 
Bug 487418 - [arm64] Cleanup M{SR,RS} instructions (part 1)

This is point 6 on the list.
1. Cache the DZP bit from mrs dczid_el0 in a new field arm64_data_zero_prohibited of VexArchInfo
2. Use the cached values from VexArchInfo for mrs dczid_el0 rather than a dirty helper
3. Add a check to dc zva that the above DZP wasn't set. If it is then print a message
and stop with a Ijk_SigILL.

2 months agoRegtest: make x86 and amd64 inf and nan production cross platform, part 2
Paul Floyd [Fri, 8 May 2026 10:47:41 +0000 (12:47 +0200)] 
Regtest: make x86 and amd64 inf and nan production cross platform, part 2

This is for FreeBSD and probably Darwin as well.

Now that we have the same nan generation on all platforms we only need two
expecteds for these tests, one where printf of a negative nan outputs
-nan and the other where it outputs nan.

So, add an expected for FreeSD x86. Rationalise the amd64 expecteds.
There were 2 for FreeBSD only differentiated by the mkPosNan codegen.
Now just the one is needed. While I'm at it make the expected name
more consistent, exp-freebsd rather than exp.freebsd.

2 months agoRegtest: make x86 and amd64 inf and nan production cross platform
Paul Floyd [Fri, 8 May 2026 07:05:42 +0000 (09:05 +0200)] 
Regtest: make x86 and amd64 inf and nan production cross platform

We were using 1.0/0.0 to produce a positive inf and 0.0/0.0 to
produce a postive nan. GCC and clang handle the nan case
differently. GCC generates the division which counterintuitively
results in a negative nan. clang does constant folding and
directly generates a positive nan.

This change uses __builtin_inf and __builtin_nan instead. These
were added back with GCC 3.3 so there should be no backwards
compatibility issues.

2 months agoexp-bbv clone_test: Cleanup
Florian Krohm [Wed, 6 May 2026 20:50:19 +0000 (20:50 +0000)] 
exp-bbv clone_test: Cleanup

2 months agoComplete x86 ROUNDSS, ROUNDSD support and add testcases
Mark Wielaard [Sat, 2 May 2026 17:03:20 +0000 (19:03 +0200)] 
Complete x86 ROUNDSS, ROUNDSD support and add testcases

x86 already supported SSE 4.1 ROUNDSS and ROUNDSD instructions like
amd64. But was missing two small fixes.

commit 20277ab2a575ffb50eb4efd58b6a554ffc2927e1 (vex svn r2074)
Handle non-immediate-rounding-mode versions of ROUND{P,S}{S,D}.

commit 779b619c76900dd8d1aa16bb0c693918006019ee (vex svn r2211)
Ignore the precision flag in the ROUND{SS,SD,PS,PD} rounding mode.

Add these and adapt the ROUNDSS and ROUNDSD testcases so they work on
both amd64 and x86. Move get_mxcsr, set_mxcsr, get_sse_roundingmode
and set_sse_roundingmode from sse4-64.c to sse4-common.h (and add x86
variants). Move ROUNDSD and ROUNDSS test function and make them use
XMMREG_DST instead of xmm11 (which isn't available on x86).

Add testcase output for test_ROUNDSD_w_immediate_rounding(),
test_ROUNDSS_w_immediate_rounding(), test_ROUNDSD_w_mxcsr_rounding()
and test_ROUNDSS_w_mxcsr_rounding() to sse4-x86.stdout.exp.

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

2 months agolackey tests: Include missing Makefile.tool-tests.am
Florian Krohm [Wed, 6 May 2026 13:01:54 +0000 (13:01 +0000)] 
lackey tests: Include missing Makefile.tool-tests.am

2 months agoMakefile.vex.am --> VEX/Makefile.am
Florian Krohm [Tue, 5 May 2026 20:59:02 +0000 (20:59 +0000)] 
Makefile.vex.am --> VEX/Makefile.am

Makefile.vex.am was a left-over from the days when VEX resided in a
repository of its own.

2 months agoRegtest Linux ppc64le: add an expected for memcheck sys-execveat
Paul Floyd [Tue, 5 May 2026 04:37:39 +0000 (06:37 +0200)] 
Regtest Linux ppc64le: add an expected for memcheck sys-execveat

2 months agoFix gxx304 testcase.
Florian Krohm [Mon, 4 May 2026 15:21:35 +0000 (15:21 +0000)] 
Fix gxx304 testcase.

Testcases ought to clean up after themselves.

2 months agomake clean to remove artifacts from failed regression tests.
Florian Krohm [Mon, 4 May 2026 14:49:16 +0000 (14:49 +0000)] 
make clean to remove artifacts from failed regression tests.

2 months agoDarwin syswrap: make kdebug_trace_string helpers conditional
Paul Floyd [Mon, 4 May 2026 06:21:32 +0000 (08:21 +0200)] 
Darwin syswrap: make kdebug_trace_string helpers conditional

Only for OSX 10.11 and later. Part of cleanup for
https://bugs.kde.org/show_bug.cgi?id=519604

2 months agoREADME_DEVELOPERS: improve updating zstd instructions
Paul Floyd [Sun, 3 May 2026 17:51:49 +0000 (19:51 +0200)] 
README_DEVELOPERS: improve updating zstd instructions

and a couple of typos.

2 months agoMention 519574 - 'valgrind 3.27 --fair-sched=yes does not work' in NEWS
Mark Wielaard [Sun, 3 May 2026 14:07:53 +0000 (16:07 +0200)] 
Mention 519574 - 'valgrind 3.27 --fair-sched=yes does not work' in NEWS

2 months agoDarwin: make sure that VKI_AT_FDCWD is defined on old systems
Paul Floyd [Sun, 3 May 2026 13:16:10 +0000 (15:16 +0200)] 
Darwin: make sure that VKI_AT_FDCWD is defined on old systems

We claim support for OSX 10.8 and 10.9 byut they don't have
AT_FDCWD. So define it ourselves.

Part of the fixes for https://bugs.kde.org/show_bug.cgi?id=519604

2 months agoDarwin persona syscall: use the SYS_persona macro to detect at build time
Paul Floyd [Sun, 3 May 2026 06:39:07 +0000 (08:39 +0200)] 
Darwin persona syscall: use the SYS_persona macro to detect at build time

It looks like I broke OSX 10.10 build when I added the persona wrapper.
Rather than hard code the version for persona this should work on
all platforms. In the longer term I'd like to do the same as Linux
and FreeBSD and not use a VERS macro for Darwin syscalls.

2 months agoChange XMMREG_DST in sse4-common.h back to xmm11 for amd64
Mark Wielaard [Sat, 2 May 2026 20:59:23 +0000 (22:59 +0200)] 
Change XMMREG_DST in sse4-common.h back to xmm11 for amd64

XMMREG_DST for amd64 (x86_64) was accidentially set to xmm7 instead of
using xmm11 in commit a1904db1dd0ee8c046a3fd89c822463cd496d78e.
Add SSE4.1 PBLENDVB, BLENDVPS and BLENDVPD

Change it back to xmm11 to make sure a register that isn't available
in 32bit mode is tested. No changes to any of the test results because
of this.

2 months agoDarwin: fix a typo in a macro conditional
Paul Floyd [Sat, 2 May 2026 07:21:55 +0000 (09:21 +0200)] 
Darwin: fix a typo in a macro conditional

2 months agoFreeBSD suppression: broaden _malloc_postfork for FreeBSD 16
Paul Floyd [Fri, 1 May 2026 20:17:12 +0000 (20:17 +0000)] 
FreeBSD suppression: broaden _malloc_postfork for FreeBSD 16

2 months agoDarwin fixup_macho_loadcmds: make build more flexible
Paul Floyd [Fri, 1 May 2026 09:16:17 +0000 (11:16 +0200)] 
Darwin fixup_macho_loadcmds: make build more flexible

Part of work for https://bugs.kde.org/show_bug.cgi?id=519604

The value of maxprot for the __UNIXSTACK load command changed
from 7 to 3 during the macOS 10.14 lifecycle. Our code used
the SDK value to decide which to check for. MacPorts buildbot
targets all macOS 10.14 versions which does not work with our
assumption that latest 10.14 SDK => maxprot 3. In order to make
this more flexible we now allow maxprot 3 or 7 on macOS 10.14.

This is just for fixup_macho_commands that just gets used
once for each tool during builds.

2 months agoDarwin syswrap: move PRE(mach_voucher_extract_attr_recipe_trap)
Paul Floyd [Thu, 30 Apr 2026 19:43:07 +0000 (21:43 +0200)] 
Darwin syswrap: move PRE(mach_voucher_extract_attr_recipe_trap)

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

I think that this was in a >= DARWIN_10_12 #if block, causing
build a build failure on 10.11.

2 months agoBug 519613 - Valgrind incorrectly unpacks the result of sys_port (port_getn) on error...
Paul Floyd [Thu, 30 Apr 2026 19:00:55 +0000 (21:00 +0200)] 
Bug 519613 - Valgrind incorrectly unpacks the result of sys_port (port_getn) on error, leading to a ~60s wallclock time delay on every call

Patch provided by Arran Cudbard-Bell <a.cudbardb@freeradius.org>

2 months agoBug 519574 - valgrind 3.27 "--fair-sched=yes" does not work
Paul Floyd [Wed, 29 Apr 2026 17:55:13 +0000 (19:55 +0200)] 
Bug 519574 - valgrind 3.27 "--fair-sched=yes" does not work

2 months agoBug 519539 - Darwin shm_open mode is optional and depends on oflag
Paul Floyd [Tue, 28 Apr 2026 20:03:22 +0000 (22:03 +0200)] 
Bug 519539 - Darwin shm_open mode is optional and depends on oflag

3 months agoDarwin doc: describe apple pointer area and Massif woes
Paul Floyd [Mon, 27 Apr 2026 06:45:40 +0000 (08:45 +0200)] 
Darwin doc: describe apple pointer area and Massif woes

3 months agoDarwin suppression: add a suppression for fork on macOS 13
Paul Floyd [Mon, 27 Apr 2026 06:26:27 +0000 (08:26 +0200)] 
Darwin suppression: add a suppression for fork on macOS 13

3 months agoDarwin regtest: add missing expected
Paul Floyd [Sun, 26 Apr 2026 11:09:26 +0000 (13:09 +0200)] 
Darwin regtest: add missing expected

3 months agoDarwin syswrap: fixes for mach_msg2
Paul Floyd [Sun, 26 Apr 2026 10:10:07 +0000 (12:10 +0200)] 
Darwin syswrap: fixes for mach_msg2

Don't exclude macOS 13, fixes for the POST. Also add a suppression
for this trap when it is called during initialisation.

3 months agoDarwin regtest: re-enable none/tests/scripts/shell
Paul Floyd [Sun, 26 Apr 2026 05:37:45 +0000 (07:37 +0200)] 
Darwin regtest: re-enable none/tests/scripts/shell

With a Darwin expected. I may need to add another expected
for older versions of Darwin.

3 months agoDarwin suppression: add another suppresion for startup allocations
Paul Floyd [Sun, 26 Apr 2026 05:36:02 +0000 (07:36 +0200)] 
Darwin suppression: add another suppresion for startup allocations

3 months agoBump version to 3.28.0.GIT
Paul Floyd [Sat, 25 Apr 2026 06:06:16 +0000 (08:06 +0200)] 
Bump version to 3.28.0.GIT

3 months agoRecognize ioctl UFFDIO_* operations
Martin Cermak [Fri, 24 Apr 2026 11:21:05 +0000 (13:21 +0200)] 
Recognize ioctl UFFDIO_* operations

The userfaultfd* LTP testcases demonstrate how valgrind
isn't aware of the ioctl UFFDIO_* operations.  Teach
Valgrind to recognize those per linux/fs/userfaultfd.c.

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

3 months agoUse SSizeT for VG_(readlink) result in VG_(realpath)
Mark Wielaard [Wed, 22 Apr 2026 12:15:28 +0000 (14:15 +0200)] 
Use SSizeT for VG_(readlink) result in VG_(realpath)

VG_(readlink) returns a negative value if it fails. Which is checked
for right after the call. But if SizeT is unsigned, so that check
always fails. Use SSizeT instead for the result variable.

3 months agoUpdate vg-lifespan (copyright) years
Mark Wielaard [Tue, 21 Apr 2026 00:02:08 +0000 (02:02 +0200)] 
Update vg-lifespan (copyright) years

3 months ago-> 3.27.0 final VALGRIND_3_27_0
Mark Wielaard [Mon, 20 Apr 2026 22:40:56 +0000 (00:40 +0200)] 
-> 3.27.0 final

3 months agoUpdate NEWS entries
Mark Wielaard [Mon, 20 Apr 2026 15:24:23 +0000 (17:24 +0200)] 
Update NEWS entries

- New VALGRIND_REPLACES_MALLOC and VALGRIND_GET_TOOLNAME client requests.
- Linux lightweight guard pages support (--max-guard-pages=N).
- x86 (32bit) (partial) SSE4.1 instruction support.
- Linux Test Project (LTP) v20260130 was integrated.

3 months agoAdd documentation for new client requests in manual-core-adv.xml
Mark Wielaard [Mon, 20 Apr 2026 15:12:10 +0000 (17:12 +0200)] 
Add documentation for new client requests in manual-core-adv.xml

Document VALGRIND_REPLACES_MALLOC and VALGRIND_GET_TOOLNAME.

3 months agoSet version to 3.27.0-RC2
Mark Wielaard [Sat, 18 Apr 2026 00:18:20 +0000 (02:18 +0200)] 
Set version to 3.27.0-RC2

3 months agoAdd MOVNTDQA SSE4.1 support for x86
Mark Wielaard [Wed, 18 Feb 2026 16:48:15 +0000 (17:48 +0100)] 
Add MOVNTDQA SSE4.1 support for x86

Add handling of MOVNTDQA to VEX/priv/guest_x86_toIR.c based on the
guest_amd64_toIR.c implementation.

Move test_MOVNTDQA from none/tests/amd64/sse4-64.c to
none/tests/sse4-common.h and add the same test to
none/tests/x86/sse4-x86.c with new MOVNTDQA output in stdout.exp.

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

3 months agoAdd SSE4.1 MPSADBW for x86 32-bit
Alexandra Hájková [Wed, 15 Apr 2026 15:42:38 +0000 (11:42 -0400)] 
Add SSE4.1 MPSADBW for x86 32-bit

Move the MPSADBW computation helper and IR builder from
guest_amd64_helpers.c and guest_amd64_toIR.c into a new
header guest_generic_helpers.h and guest_generic_sse.h,
so the helpers could be shared between x86 and amd64
implementaions.

Move MPSADBW tests into the shared sse4-common.h so they are
also exercised on x86.

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

3 months agoDarwin suppressions and massif ignore function
Paul Floyd [Thu, 16 Apr 2026 19:25:08 +0000 (21:25 +0200)] 
Darwin suppressions and massif ignore function

Suppresss a few more still reachables. Suppress a Helgrind race in
getaddrinfo. Add another massif --ignore-fn.

3 months agoAdd PCMPEQQ SSE4.1 support for x86
Mark Wielaard [Thu, 12 Mar 2026 00:22:32 +0000 (01:22 +0100)] 
Add PCMPEQQ SSE4.1 support for x86

Add handling of PCMPEQQ to VEX/priv/guest_x86_toIR.c based on the
guest_amd64_toIR.c implementation. Handle Iop_CmpEQ64x2 using
h_generic_calc_CmpEQ64x2 in VEX/priv/host_x86_isel.c.

Move test_PCMPEQQ from none/tests/amd64/sse4-64.c to
none/tests/sse4-common.h and add the same test to
none/tests/x86/sse4-x86.c with new PCMPEQQ output in stdout.exp.

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

3 months agoDarwin massif: another load of functions to ignore for macOS 10.14
Paul Floyd [Thu, 16 Apr 2026 06:56:54 +0000 (08:56 +0200)] 
Darwin massif: another load of functions to ignore for macOS 10.14

overloaded-new is still failing due to a 64byte allocation diff that
is hiding somewhere.

3 months agoDarwin distribution: add m_mach/priv_dyld_internals.h to noinst_HEADERS
Paul Floyd [Wed, 15 Apr 2026 19:37:41 +0000 (21:37 +0200)] 
Darwin distribution: add m_mach/priv_dyld_internals.h to noinst_HEADERS

This caused build failure of 3.27 RC1 on macOS 11 to 13.

3 months agos390: Bug fix in insn selection
Florian Krohm [Tue, 14 Apr 2026 21:36:18 +0000 (21:36 +0000)] 
s390: Bug fix in insn selection

The bug was introduced in b3830b82f4 and exposed by GCC when compiling
with -g (without -O2). Here's the thing:

      if (expr->Iex.Binop.op == Iop_Add64) {
--->     ULong disp = arg2->Iex.Const.con->Ico.U64;
         if (arg2->tag == Iex_Const && ulong_fits_signed_20bit(disp)) {
            h1 = s390_isel_int_expr(env, arg1);

This possibly segfaults when arg2 is not a constant.
Optimising GCC figures it can first check arg2->tag == Iex_Const
which is cheaper than disp = arg2->Iex.Const.con->Ico.U64;
Nice one.

Regtested with both default compiler flags and -g only.

3 months agoBug 518951: Fix the fsconfig() syscall retval
Martin Cermak [Tue, 14 Apr 2026 19:48:05 +0000 (21:48 +0200)] 
Bug 518951: Fix the fsconfig() syscall retval

Make the fsconfig02 LTP testcase happy by fixing the
fsconfig() retval.

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

3 months agoSoalris regtest: remove unused expected
Paul Floyd [Tue, 14 Apr 2026 19:14:23 +0000 (21:14 +0200)] 
Soalris regtest: remove unused expected

With the previous commit one expected is no longer needed since
Solaris now generates callstacks similar to other OSes.

3 months agoSolaris helgrind wrapper and regtest
Paul Floyd [Tue, 14 Apr 2026 19:01:21 +0000 (21:01 +0200)] 
Solaris helgrind wrapper and regtest

Modify the pthread_rwlock_init wrapper so that it is similar
to other OSes (it was not using a _WRK function). Update the
Solaris stderr filter and one Solaris specific expexted.

3 months agos390x: Update some IBM copyright notices
Andreas Arnez [Tue, 14 Apr 2026 11:38:11 +0000 (13:38 +0200)] 
s390x: Update some IBM copyright notices

Some of the copyright notices in `*s390*' source files were really
outdated.  Fix this.

3 months agoFreeBSD suppression: broaden rtld sigprocmask param suppression
Paul Floyd [Tue, 14 Apr 2026 06:05:52 +0000 (08:05 +0200)] 
FreeBSD suppression: broaden rtld sigprocmask param suppression

Make sure that it suppresses even if rtld debuginfo is not
installed.

3 months agoUpdate copyright notices in FreeBSD-related source files
Paul Floyd [Tue, 14 Apr 2026 05:46:09 +0000 (07:46 +0200)] 
Update copyright notices in FreeBSD-related source files

3 months agoUpdate Valgrind and Tool printed copyright years
Paul Floyd [Tue, 14 Apr 2026 05:29:18 +0000 (07:29 +0200)] 
Update Valgrind and Tool printed copyright years

I've limited this to only those that have changed since the last
copyright year update.

3 months agoSet version to 3.27.0-RC1
Mark Wielaard [Tue, 14 Apr 2026 00:34:26 +0000 (02:34 +0200)] 
Set version to 3.27.0-RC1

3 months agoUpdate libiberty demangler
Mark Wielaard [Tue, 14 Apr 2026 00:26:44 +0000 (02:26 +0200)] 
Update libiberty demangler

Update the libiberty demangler using the auxprogs/update-demangler
script to gcc git commit a8290fb163443276c3df6b20024c6874f93c560c.

This update includes:

- Fix resource exhaustion in rust demangler (PR demangler/106641)
- Update copyright years.

3 months agohelgrind: add --track-destroy command line option
Aaron Merey [Mon, 13 Apr 2026 03:46:19 +0000 (23:46 -0400)] 
helgrind: add --track-destroy command line option

Add --track-destroy=no|yes|all that if enabled warns if
pthread_mutex_init or pthread_rwlock_init is called using a guest
address that helgrind has already associated with another rwlock or
mutex, suggesting a missing pthread_*_destroy call.

Additionally if --track-destroy=all, then at process exit
helgrind will report all rwlocks and mutexes that were explicitly
initialized but never destroyed.

This option defaults to off since missing calls to pthread_*_destroy
are not necessarily bugs.  Locks that weren't explicitly initialized
are skipped to reduce the number of spurious warnings.

3 months agohelgrind: fix lock-kind mismatch assert failure
Aaron Merey via Valgrind-developers [Mon, 13 Apr 2026 03:46:18 +0000 (23:46 -0400)] 
helgrind: fix lock-kind mismatch assert failure

tl_assert(lk->kind == LK_rdwr) in evhH__post_thread_r_acquires_lock
may fail in cases where memory containing an rwlock or mutex is
reused for a lock of a different kind without having called
pthread_*_destroy on the first lock.

Fix this by having map_locks_lookup_or_create detect when a lock kind at
a given guest address has changed from an rwlock to mutex or mutex to
rwlock.  The old lock record is removed and a new one is added reflecting
the current lock kind.

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

3 months agohelgrind: add --show-events debug cmdline option
Aaron Merey via Valgrind-developers [Mon, 13 Apr 2026 03:46:17 +0000 (23:46 -0400)] 
helgrind: add --show-events debug cmdline option

SHOW_EVENTS in hg_main.c controls whether helgrind prints a trace of its
internal synchronization, threading and memory events.  It is set to 0
by default to disable the trace and the only way to enable it is to
modify the source code and rebuild valgrind.

This patch replaces SHOW_EVENTS with clo_show_events that is set using
the new helgrind cmdline option --show-events.  Information about this
option is included under helgrind's --help-debug.

3 months agoDarwin regtest: add an expected for drd tc22_exit_w_lock
Paul Floyd [Mon, 13 Apr 2026 06:29:30 +0000 (08:29 +0200)] 
Darwin regtest: add an expected for drd tc22_exit_w_lock

The callstack is much the same as the Solaris expected, just with
an extre 'kill()'.

3 months agoBug 518609 - Setting double verbose interferes with symbol loading (FreeBSD 16)
Paul Floyd [Sun, 12 Apr 2026 19:44:45 +0000 (21:44 +0200)] 
Bug 518609 - Setting double verbose interferes with symbol loading (FreeBSD 16)

More complete fix, not just libc.

3 months agoFreeBSD regtest: add a (below main) filter for one of the massif tests.
Paul Floyd [Sun, 12 Apr 2026 14:36:27 +0000 (16:36 +0200)] 
FreeBSD regtest: add a (below main) filter for one of the massif tests.

deep-D.post.out did contain "__libc_start1 (worktrees/main/lib/libc/csu/libc_start1.c:180)"
rather than "(below main)"

(on FreeBSD 16).

3 months agoBug 518609 - Setting double verbose interferes with symbol loading (FreeBSD 16)
Paul Floyd [Sat, 11 Apr 2026 19:55:26 +0000 (21:55 +0200)] 
Bug 518609 - Setting double verbose interferes with symbol loading (FreeBSD 16)

This change uses the same forced loading of libc.so as Linux uses.
Each OS has its own version for libc.so (6 for Linux, 7 for FreeBSD,
1 for Solaris and Darwin has a completely different system).

This papers over the real problem - a split debug file is being treated like
an ELF object.

3 months agoFreeBSD suppression: sigprocmask param from rtld
Paul Floyd [Sat, 11 Apr 2026 17:50:47 +0000 (19:50 +0200)] 
FreeBSD suppression: sigprocmask param from rtld

Intermittent and difficult to reproduce.

Hopefully this will resolve thread_alloca and/or
lsframe1 regtest fails (as well as false positives
in the real world).

3 months agoFreeBSD regtest: make timing_safe more consistent
Paul Floyd [Sat, 11 Apr 2026 15:09:52 +0000 (17:09 +0200)] 
FreeBSD regtest: make timing_safe more consistent

This test was failing on FreeeBSD 16 arm64. I don't think that
it's anything that has changed, just that the test was flaky.

The problem is in the MEMCMP replacement code which has a word
alignment check before doing word sized comparisons. The test
was comparing a string literal on the stack with an strdup'd
copy. strdup should give 8/16 byte alignment for 32bit/64bit
platforms. There's no guarantee for the string literal.

To make this stable I've changed the literal from pointer to
alignas(16) array and replaced the strdup with aligned_alloc and
memcpy. I've also added asserts that the stack and heap addresses
16byte aligned.

3 months agoTestsuite: Patch the LTP sources to fix compile time problem
Martin Cermak [Fri, 10 Apr 2026 13:02:40 +0000 (15:02 +0200)] 
Testsuite:  Patch the LTP sources to fix compile time problem

Patch ltp-full-20260130.tar to fix openat2() compile time problem.

3 months agoDRD: remove a couple of unused function prototypes
Paul Floyd [Thu, 9 Apr 2026 18:31:02 +0000 (20:31 +0200)] 
DRD: remove a couple of unused function prototypes

3 months agoFreeBSD regtest: rename a C variable
Paul Floyd [Wed, 8 Apr 2026 06:30:45 +0000 (08:30 +0200)] 
FreeBSD regtest: rename a C variable

One FreeBSD test was using a varaible called 'nullptr'.
clang 22 now complains about that because it is a reserved
keyword in C 23. Rename it to 'nullpointer'.

3 months agoDarwin syswrap: add a wrapper for persona
Paul Floyd [Tue, 7 Apr 2026 20:21:53 +0000 (22:21 +0200)] 
Darwin syswrap: add a wrapper for persona

3 months agos390: Fix s390_emit_IPM which has one (not two) register operands.
Florian Krohm [Mon, 6 Apr 2026 20:04:18 +0000 (20:04 +0000)] 
s390: Fix s390_emit_IPM which has one (not two) register operands.

This has been wrong (in a harmless way) since day #1.

3 months agoFreeBSD helgrind: add a suppression for ostream padding
Paul Floyd [Mon, 6 Apr 2026 13:59:53 +0000 (15:59 +0200)] 
FreeBSD helgrind: add a suppression for ostream padding

3 months agoFreeBSD helgrind: broaden suppression for pthread_create
Paul Floyd [Mon, 6 Apr 2026 11:33:20 +0000 (13:33 +0200)] 
FreeBSD helgrind: broaden suppression for pthread_create

Previous suppression worked on a source build of FreeBSD but not a binary install.

3 months agoFreeBSD arm64: fix do_syscall_WRK
Paul Floyd [Sun, 5 Apr 2026 15:29:43 +0000 (17:29 +0200)] 
FreeBSD arm64: fix do_syscall_WRK

Back in Sept 2025 this function was refactored a bit because
is was being passed an argument that was never used. That
shifted down the sysno by one slot. Because I can't count
I changed it from moving from the stack to moving from x9
into x8. The source should be x7. This worked by accident
in optimised builds probably because sysno was in x9
from an earlier function that shuffles the arguments.

3 months agoFreeBSD helgrind: add a default suppression for pthread_create
Paul Floyd [Sun, 5 Apr 2026 08:34:25 +0000 (10:34 +0200)] 
FreeBSD helgrind: add a default suppression for pthread_create

New with FreeBSD 16.

3 months agoFreeBSD regtest: filters for source installs of FreeBSD, part 2
Paul Floyd [Sun, 5 Apr 2026 06:18:44 +0000 (08:18 +0200)] 
FreeBSD regtest: filters for source installs of FreeBSD, part 2

There are a few exceptions to the general rules that were added
in the previous commit.

3 months agoFreeBSD regtest: filters for source installs of FreeBSD
Paul Floyd [Sat, 4 Apr 2026 20:17:02 +0000 (22:17 +0200)] 
FreeBSD regtest: filters for source installs of FreeBSD

It looks like cfarm427 and cfarm430 are installed from source.
That changes some of the error callstacks (due to generated
filenames and paths in the source build). This adds filters
for the syscalls.

I'm still seeing quite a few helgrind and massif fails.

3 months agoBug 518482 - FreeBSD: assert in parse_procselfmaps when built with GNU binutils
Paul Floyd [Fri, 3 Apr 2026 19:05:50 +0000 (21:05 +0200)] 
Bug 518482 - FreeBSD: assert in parse_procselfmaps when built with GNU binutils

parse_procselfmaps rewritten to not use any hard coded counts.

Previously the code was counting mappings from sysctl KERN_PROC_VMMAP
and when it saw the host rx mapping it was saving state for the next
pass in the loop, which it was assuming would be the rw segment
mapped to swap.  The counts were hard coded for GCC and clang and
assumed GCC used ld.bfd and clang used ld.lld. That assumption
is not safe.

Now the code uses a lookahead. Something that I had not previously seen
is that the host RW PT_LOAD can be partially or wholly mapped as swap.
The lookahead checks for the first rw swap mapping that follows
an RX file mapping (RW wholly mapped as swap) or an RW file
mapping (RW partially mapped as swap). The first time that condition
is met the RW swap mapping will also be recorded as if it were a
file mapping. The current iteration then skips two kinfo_vmentry
records rather than one.

3 months agoconfigure: fix issue with PUSH/POP C++ language
Paul Floyd [Thu, 2 Apr 2026 17:48:22 +0000 (19:48 +0200)] 
configure: fix issue with PUSH/POP C++ language

3 months agoDarwin syswrap: add fcntl F_GETPROTECTIONCLASS
Paul Floyd [Thu, 2 Apr 2026 11:53:34 +0000 (13:53 +0200)] 
Darwin syswrap: add fcntl F_GETPROTECTIONCLASS

This is in Louis Brunner's port, but tagged macOS 14 whilst I see
it on macOS 13.

I've used #if defined(VKI_F_GETPROTECTIONCLASS) rather than
use DARWIN_VERS as little as possible.

3 months agomemcheck: Small simplification when ANDing guard conditions
Andreas Arnez [Thu, 2 Apr 2026 11:20:44 +0000 (13:20 +0200)] 
memcheck: Small simplification when ANDing guard conditions

Memcheck's complainIfUndefined() function contains logic where a Boolean
AND is "emulated" by converting both operands to I32, applying Iop_And32,
and converting the result back to I1.

Since Iop_And1 was introduced a while ago, just use that directly instead.

3 months agomemcheck: Optimize AND/OR with constant
Andreas Arnez [Thu, 2 Apr 2026 10:50:17 +0000 (12:50 +0200)] 
memcheck: Optimize AND/OR with constant

In memcheck, when instrumenting a bitwise AND/OR with a constant, the
current logic yields unnecessarily complicated code.

For instance, the general formula for the resulting vbits of `a1 OR a2' is

  (v1 | v2) & (~a1 | v1) & (~a2 | v2)

But when a2 is a constant, this could be reduced to

  v1 & ~a2

To do this, we could alternatively

  (A) add an appropriate optimization to ir_opt.c
  (B) prevent the complicated code from being generated in the first place

The latter should result in better performance overall, because fewer
objects have to be generated (and eliminated again).

So this implements (B).  The implementation follows the spirit of the
existing logic.

3 months agoconfigure: group together C++ checks
Paul Floyd [Mon, 13 Oct 2025 19:13:04 +0000 (21:13 +0200)] 
configure: group together C++ checks

3 months agoAdd PTEST SSE4.1 support for x86
Mark Wielaard [Wed, 18 Mar 2026 17:18:38 +0000 (18:18 +0100)] 
Add PTEST SSE4.1 support for x86

Add handling of PTEST to VEX/priv/guest_x86_toIR.c based on the
guest_amd64_toIR.c implementation (dis_xTESTy_128 and finish_xTESTy,
but only for 128 bit PTEST). Take tests from amd64/sse4-64.c with same
test vectors to make sure flag results are the same.

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

3 months agoFreeBSD sanity-level checks: clean up maybe_merge_procmap_stack()
Paul Floyd [Wed, 1 Apr 2026 19:42:52 +0000 (21:42 +0200)] 
FreeBSD sanity-level checks: clean up maybe_merge_procmap_stack()

This was using hard coded max stack size values. Use sysctl instead,
as suggested in the comments.

S$xlight complication for x86 on amd64 - need to checks
compat.ia32.maxssiz first. If that fails then the binary is
running on an x86 kernel and fall back to using kern.maxssiz.

3 months agoAdd SSE4.1 PBLENDVB, BLENDVPS and BLENDVPD
Alexandra Hájková [Wed, 18 Feb 2026 16:43:28 +0000 (11:43 -0500)] 
Add SSE4.1 PBLENDVB, BLENDVPS and BLENDVPD

Add decoding of PBLENDVB (0x66 0F 38 10), BLENDVPS (0x66 0F 38 14)
and BLENDVPD (0x66 0F 38 15) for x86 32-bit in guest_x86_toIR.c.

Copy do_SseAssistedVectorAndScalar from VEX/priv/host_amd64_isel.c
to VEX/priv/host_x86_isel.c and modify it for x86 32 bit.

Also fix h_generic_calc_SarN64x2 and h_generic_calc_SarN8x16 to use
VEX_REGPARM(3), required for the x86 helper call convention.

Move PBLENDVB, BLENDVPS and BLENDVPD tests from sse4-64.c into
the shared sse4-common.h so they are also exercised on x86.

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

3 months agoHide the --max-guard-pages cmdline switch on non-linux
Martin Cermak [Wed, 1 Apr 2026 12:46:11 +0000 (14:46 +0200)] 
Hide the --max-guard-pages cmdline switch on non-linux

Hide the --max-guard-pages command line switch on non-linux,
update none/tests/cmdline{1,2} accordingly.  Related to bug

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

3 months agoBug 514297 - Track madvise MADV_GUARD_INSTALL in address space manager
Martin Cermak [Tue, 31 Mar 2026 15:50:48 +0000 (17:50 +0200)] 
Bug 514297 - Track madvise MADV_GUARD_INSTALL in address space manager

Linux 6.13+ and Glibc 2.42+ introduce lightweight stack guard
pages based on madvise() syscall.

The purpose of a guard page is to prevent buggy (or malicious)
code from overrunning a memory region. An inaccessible page
placed at the end of a region will cause a segmentation fault
should the running process try to read or write to it;
well-placed guard pages can trap a number of common buffer
overruns and similar problems. Prior to 6.13, though, the only
way to put a guard page into a process's address space was to set
the protections on one or more pages with mprotect(); that works,
but at the cost of creating a new virtual memory area (VMA) to
contain the affected page(s). Placing a lot of guard pages will
create a lot of VMAs, which can slow down many memory-management
functions.

The new guard-page feature addresses this problem by working at
the page-table level rather than creating a new VMA. A process
can create guard pages with a call to madvise(), requesting the
MADV_GUARD_INSTALL operation. The indicated range of memory will
be rendered inaccessible; any data that might have been stored
there prior to the operation will be deleted. There is an
operation (MADV_GUARD_REMOVE) to remove guard pages as well.

https://lwn.net/Articles/1011366/

With glibc commit a6fbe36b7f31 and others, a guard page is
installed for each new thread.  In the future, guard pages might
be used also for DSOs supporting multiple kernel page sizes.
Except for madvise, a guard page may also be removed via
munmap().  This update introduces the support for this new type
of linux guard pages into Valgrind.

Add new --max-guard-pages command line switch to allow
customizing the maximal count of guard pages Valgrind can handle.
Add new testcase memcheck/tests/linux/madv_guard.

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

3 months agoDarwin suppressions: several helgrind suppressions
Paul Floyd [Tue, 31 Mar 2026 11:40:08 +0000 (13:40 +0200)] 
Darwin suppressions: several helgrind suppressions

Mainly from our friend, getaddrinfo.
I'm still seeing a lock held at exit.

3 months agoppc: Fix BZ 517596
Florian Krohm [Mon, 30 Mar 2026 20:06:03 +0000 (20:06 +0000)] 
ppc: Fix BZ 517596

Found by cppcheck. Reported by dcb314@hotmail.com.

3 months agoDarwin regtest and suppressions: more for Darwin 19
Paul Floyd [Mon, 30 Mar 2026 11:25:52 +0000 (13:25 +0200)] 
Darwin regtest and suppressions: more for Darwin 19

I upgraded my VM host and I suspect that this changed the default
CPU features and CPUID. Result: new races for DRD and Helgrind
in the getaddrinfo, one new leak in dyd and lots of new allocations
picked up by the massif tests.

4 months agoBug 518159 - pth_once issues on Darwin
Paul Floyd [Thu, 26 Mar 2026 08:05:13 +0000 (09:05 +0100)] 
Bug 518159 - pth_once issues on Darwin

4 months agoVEX: Remove VEXGLO_N_ALWAYSDEFD
Florian Krohm [Fri, 27 Mar 2026 15:14:59 +0000 (15:14 +0000)] 
VEX: Remove VEXGLO_N_ALWAYSDEFD

Use flexible array instead.

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

4 months agoDarwin regtest: add an expected for none empty-exe
Paul Floyd [Thu, 26 Mar 2026 20:12:48 +0000 (21:12 +0100)] 
Darwin regtest: add an expected for none empty-exe

A bit like the previous commit, the bahaviour of /bin/sh
has changed with macOS 10.15.

Up to and including 10.14 (and other OSes) the shell just reads
the empty file and does nothing.

With macOS 10.15, the shell reads the empty file and then starts
a subshell which does nothing.

The result is a missing carriage return on stderr.

4 months agoDarwin regtest: make new version of scripts shell test
Paul Floyd [Thu, 26 Mar 2026 19:28:14 +0000 (20:28 +0100)] 
Darwin regtest: make new version of scripts shell test

The behaviour of /bin/sh changed with macOS 10.15. When trying to
exec a new process that will fail the child process still gets
created. On older versions of macOS execve fails like it does on
Linux and FreeBSD.

On Darwin, the shell test now gets run twice, once normally and
once with --trace-children=yes.

4 months agos390x: Exploit "load address" in isel
Andreas Arnez [Thu, 26 Mar 2026 12:33:17 +0000 (13:33 +0100)] 
s390x: Exploit "load address" in isel

Compared to AGHI, the "load address" instrucions LA and LAY can be
beneficial for register allocation since they allow for distinct source
and destination operands.  This can often avoid unnecessary register
moves.

Exploit them when appropriate in isel.

4 months agos390x: Exploit instructions for bitwise NAND and NOR in isel
Andreas Arnez [Thu, 26 Mar 2026 12:33:17 +0000 (13:33 +0100)] 
s390x: Exploit instructions for bitwise NAND and NOR in isel

Newer z/Architecture machines have the instructions NORK and NOGRK for
calculating bit-wise NOR, as well as NNRK and NNGRK for bitwise NAND.
Exploit those when applicable.

4 months agos390x: Exploit `and/or with complement' in isel
Andreas Arnez [Thu, 26 Mar 2026 12:33:17 +0000 (13:33 +0100)] 
s390x: Exploit `and/or with complement' in isel

The miscellaneous-instruction-extensions facility 3 provides the
z/Architecture instructions NCRK, NCGRK, OCRK, and OCGRK.  For operands
`a' and `b' these bitwise operations yield

    a and not(b)
    a or not(b)

Exploit these instructions in the instruction selector.

4 months agoBug 486180 - [Valgrind][MIPS] 'VexGuestArchState' has no member named 'guest_IP_AT_SY...
Paul Floyd [Fri, 20 Mar 2026 06:28:09 +0000 (07:28 +0100)] 
Bug 486180 - [Valgrind][MIPS] 'VexGuestArchState' has no member named 'guest_IP_AT_SYSCALL'

This change completely removes IP_AT_SYSCALL.

It used to be used during syscall handling to get the IP in the case
of a syscall restart. Now all platforms use simplys
 "IP -= size of op syscall".

It was also used by s390 for extension handling, That now uses
VG_(get_IP)(tid);

4 months agoBug 518078 - Configure should accept names for GDB other than "gdb"
Paul Floyd [Wed, 25 Mar 2026 12:19:56 +0000 (13:19 +0100)] 
Bug 518078 - Configure should accept names for GDB other than "gdb"