]> git.ipfire.org Git - thirdparty/valgrind.git/log
thirdparty/valgrind.git
8 days 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.

8 days 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'.

8 days 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

9 days 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.

9 days 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.

9 days 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),

9 days 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

9 days 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

9 days 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.

9 days 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.

10 days 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.

10 days 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])

10 days 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.

10 days 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?).

10 days 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

11 days 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.

11 days 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

11 days 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

12 days 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

12 days 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.

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

2 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

2 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

2 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

2 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

2 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

2 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.

2 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

2 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")
2 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

2 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

2 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).

2 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.

2 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

2 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

2 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.

2 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.

2 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

2 weeks agos390: Renumber hardware capabilities (BZ 509562)
Florian Krohm [Thu, 27 Nov 2025 21:18:40 +0000 (21:18 +0000)] 
s390: Renumber hardware capabilities (BZ 509562)

Plenty of room for new ones again.

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

2 weeks agoDarwin massif: more ingore functions in regtest, x86 new uses unsigned long
Paul Floyd [Thu, 27 Nov 2025 19:12:26 +0000 (20:12 +0100)] 
Darwin massif: more ingore functions in regtest, x86 new uses unsigned long

2 weeks agoDarwin: many fixes for OSX 10.13
Paul Floyd [Thu, 27 Nov 2025 06:22:18 +0000 (07:22 +0100)] 
Darwin: many fixes for OSX 10.13

Most of these changes are from Louis Brunner's GitHub repo.
The most imortant changes are to the memory space and to the code
related to getting the host filename during startup. This means
that when Valgrind crashes or hits an assert we now get a legible
host stacktrrace.

This also fixes none/tests/darwin/bug228343

2 weeks agoAdd missing massif filter file
Paul Floyd [Thu, 27 Nov 2025 12:26:20 +0000 (13:26 +0100)] 
Add missing massif filter file

2 weeks agoMassif regtest: filter ignore functions, part 1
Paul Floyd [Thu, 27 Nov 2025 12:14:43 +0000 (13:14 +0100)] 
Massif regtest: filter ignore functions, part 1

This is mainly for Darwin which has numerous leaks that
need to be ignored. This filter removes all --ignore-fn options
from the "out" expecteds. This should allow adding endless
functions to ignore in the vgtest files without having to
also update the out.exp files as well.

Part 2 will be for the verbose output which adds ignore files
to the stderr.exp references.

2 weeks agoProvide missing syswraps for file_getattr and file_setattr
Martin Cermak [Thu, 27 Nov 2025 08:25:07 +0000 (09:25 +0100)] 
Provide missing syswraps for file_getattr and file_setattr

The syscalls take fd and path. If path is absolute, fd is not
used. If path is empty, fd can be AT_FDCWD or any valid fd which
will be used to get/set attributes on.

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

2 weeks agoDarwin regtest: add filters for memcheck x86 sh-mem-vec128-plo*
Paul Floyd [Wed, 26 Nov 2025 20:37:10 +0000 (21:37 +0100)] 
Darwin regtest: add filters for memcheck x86 sh-mem-vec128-plo*

Need to bash the output to make it look like posix_memalign.
Also add -q because Darwin libc is incontinent.

2 weeks agoDarwin new/delete wrappers: fix on x86
Paul Floyd [Wed, 26 Nov 2025 20:22:51 +0000 (21:22 +0100)] 
Darwin new/delete wrappers: fix on x86

Untested code is always full of surprises.

Darwin x86 doesn't use size_t for the size (where 32bit
size_t is unsigned int and 64but size_t is unsigned long).
Instead it uses unsigned long on both platforms.

That changes the mangled name. It's all 'm' for unsigned long
rather than 32bit 'j' for unsigned short and 64bit 'm'
for unsigned long.

2 weeks agoA few more syscall comments and doc tweaks
Paul Floyd [Wed, 26 Nov 2025 19:27:43 +0000 (20:27 +0100)] 
A few more syscall comments and doc tweaks

2 weeks agoDarwin: fix x86 build and client syscall
Paul Floyd [Wed, 26 Nov 2025 19:25:10 +0000 (20:25 +0100)] 
Darwin: fix x86 build and client syscall

2 weeks agoAdd pmaxsd and pminsd support for x86 32 bit
Alexandra Hájková [Tue, 11 Nov 2025 12:34:10 +0000 (07:34 -0500)] 
Add pmaxsd and pminsd support for x86 32 bit

Support pmaxsd and pminsd instructions in guest_x86_toIR.c and host_x86_isel.c
and modify the none/tests/x86/sse4-x86.stdout.exp to match pmaxsd and
pminsd support.

2 weeks agosse4-common.h: make changes to make test_PMAXSD usable for 32bit
Alexandra Hájková [Tue, 11 Nov 2025 09:17:36 +0000 (04:17 -0500)] 
sse4-common.h: make changes to make test_PMAXSD usable for 32bit

Modify DO_imm_r_r macro called by test_PMAXSD to use xmm7 register
when testing on 32bit.

2 weeks agoAdd none/tests/sse4-common.h header
Alexandra Hájková [Tue, 4 Nov 2025 18:59:10 +0000 (13:59 -0500)] 
Add none/tests/sse4-common.h header

Refactor none/tests/amd64/sse4-64.c and none/tests/x86/sse4-x86.c
to use a common none/tests/sse4-common.h header. This eliminates
code redundancies and makes it easier to add new SSE4 tests for both
architectures more easily. The shared header contains common helper functions,
type definitions, and test macros previously duplicated in both files.

2 weeks agoDarwin ,gitignore: add a wildcard for dSYM direatories in none
Paul Floyd [Wed, 26 Nov 2025 17:53:49 +0000 (18:53 +0100)] 
Darwin ,gitignore: add a wildcard for dSYM direatories in none

2 weeks agos390x_features.c cleanup
Florian Krohm [Wed, 26 Nov 2025 16:50:42 +0000 (16:50 +0000)] 
s390x_features.c cleanup

Remove detection of unneeded facilities: zarch, n3, exrl, mi3
Rename s390x-vx2 --> s390x-vxe2 to be consistent with VEX_HWCAPS_S390X_VXE2
Change vec2_float.vgtest accordingly

2 weeks agoFreeBSD regtest: turn off a few gdbserver tests on systems with sysctl debug.ptrace_a...
Paul Floyd [Tue, 25 Nov 2025 20:04:17 +0000 (21:04 +0100)] 
FreeBSD regtest: turn off a few gdbserver tests on systems with sysctl debug.ptrace_attach_transparent

FreeBSD 15 (out soon) and 16 (the dev branch) have changed the behaviour
of ptrace. When vgdb uses ptrace to get Valgrind to poll gdbserver
to get out of blocking syscalls the client may return a bogus result
from the syscall.

Setting the syscall to 0 turns off this change and all 3 affected testcases
should return to normal behaviour. However, setting the syscall needs root
privileges. So I've added a test to see if the syscall is present and set
to 1. If it is the prereq is not satisfied.

2 weeks agoFreeBSD startup: do not skip exename if it is not present
Paul Floyd [Tue, 25 Nov 2025 20:03:35 +0000 (21:03 +0100)] 
FreeBSD startup: do not skip exename if it is not present

Don't remember why this code was there. Allowing no exename
is a bad idea (argv[0] will be NULL). I don't think there is
a need any more for this permissiveness.

3 weeks agoMemory allegedly uninitialized after ioctl(PROCMAP_QUERY)
Martin Cermak [Tue, 25 Nov 2025 14:07:09 +0000 (15:07 +0100)] 
Memory allegedly uninitialized after ioctl(PROCMAP_QUERY)

Fix ioctl(fd, PROCMAP_QUERY, ...) so that valgrind correctly considers
memory referenced by vma_name_size and vma_name_addr members of struct
procmap_query as initialized by ioctl().

Extend ioctl syscall wrappers with needed PRE_MEM_WRITE() and
mainly POST_MEM_WRITE().  Add a testcase.

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

3 weeks agos390: PFPO facility related cleanups (BZ 509562)
Florian Krohm [Tue, 25 Nov 2025 13:50:37 +0000 (13:50 +0000)] 
s390: PFPO facility related cleanups  (BZ 509562)

The PFPO facility is always present on the supported machines.
- Remove VEX_HWCAPS_S390X_PFPO, s390_host_has_pfpo and EmFail_S390X_pfpo
- Update tests/s390x_features.c and none/tests/s390x/pfpo
- Update memcheck/tests/vbit-test

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

3 weeks agos390: load/store-on-condition / high-word facility related cleanups (BZ 509562)
Florian Krohm [Tue, 25 Nov 2025 13:23:52 +0000 (13:23 +0000)] 
s390: load/store-on-condition / high-word facility related cleanups  (BZ 509562)

The load/store-on-condition / high-word facility is always present on the
supported machines.
- Remove VEX_HWCAPS_S390X_LSC and s390_host_has_lsc
- Update tests/s390x_features.c and none/tests/s390x/high-word

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

3 weeks agos390: floating-point-support-enhancement facility related cleanups (BZ 509562)
Florian Krohm [Tue, 25 Nov 2025 13:03:37 +0000 (13:03 +0000)] 
s390: floating-point-support-enhancement facility related cleanups  (BZ 509562)

The floating-point-support-enhancement facility is always present on the
supported machines.
- Remove VEX_HWCAPS_S390X_FGX and s390_host_has_fgx
- Remove wrapper functions: s390_emit_LGDRw, s390_emit_LDGRw

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

3 weeks agos390: general-instructions-extension facility related cleanups (BZ 509562)
Florian Krohm [Tue, 25 Nov 2025 09:14:11 +0000 (09:14 +0000)] 
s390: general-instructions-extension facility related cleanups  (BZ 509562)

The general-instructions-extension facility is always present on the
supported machines.
- Remove VEX_HWCAPS_S390X_GIE and s390_host_has_gie
- Remove wrapper functions: s390_emit_MFYw, s390_emit_MHYw, s390_emit_MSFIw
- Update tests/s390x_features.c

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

3 weeks agoBug 512571 - regtest problems with darwin dsymuti
Paul Floyd [Tue, 25 Nov 2025 07:20:06 +0000 (08:20 +0100)] 
Bug 512571 - regtest problems with darwin dsymuti

There was alrwady a stderr filter for dsymutil, but only for DRD.
So I moved that to tests/filter_stderr_basic.in

I added single quotes around $dir in tests/vg_regtest.in for
arch_test and os_test. That now prevents directory names containing
spaces from being seen as more than one argument.

3 weeks agos390: extended-immediate facility related cleanups (BZ 509562)
Florian Krohm [Mon, 24 Nov 2025 23:21:29 +0000 (23:21 +0000)] 
s390: extended-immediate facility related cleanups  (BZ 509562)

The extended-immediate facility is always present on the supported
machines.
- Remove VEX_HWCAPS_S390X_EIMM and s390_host_has_eimm
- Remove unused functions: s390_emit_LLILH, s390_emit_IILL, s390_emit_IILH,
  s390_emit_IIHL, s390_emit_IIHH
- Remove wrapper functions: s390_emit_NILFw, s390_emit_OILFw, s390_emit_XILFw,
  s390_emit_LBRw, s390_emit_LGBRw, s390_emit_LHRw, s390_emit_LGHRw,
  s390_emit_LGFIw, s390_emit_LLCRw, s390_emit_LLGCRw, s390_emit_LLHRw,
  s390_emit_LLGHRw, s390_emit_LLCw, s390_emit_LLHw, s390_emit_LLILFw,
  s390_emit_AFIw, s390_emit_SLFIw, s390_emit_SLGFIw, s390_emit_LTw,
  s390_emit_LTGw, s390_emit_CFIw, s390_emit_CLFIw
- Update tests/s390x_features.c

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

3 weeks agoFix a typo.
Florian Krohm [Mon, 24 Nov 2025 22:31:44 +0000 (22:31 +0000)] 
Fix a typo.

3 weeks agos390: ETF2/ETF3-enhancement facilities related cleanups (BZ 509562)
Florian Krohm [Mon, 24 Nov 2025 18:39:39 +0000 (18:39 +0000)] 
s390: ETF2/ETF3-enhancement facilities related cleanups  (BZ 509562)

The ETF2/ETF3-enhancement facilities are always present on
the supported machines.
- Remove VEX_HWCAPS_S390X_ETF2 and s390_host_has_etf2
- Remove VEX_HWCAPS_S390X_ETF3 and s390_host_has_etf3
- Update tests/s390x_features.c

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

3 weeks agos390: message-security-assist facility related cleanups (BZ 509562)
Florian Krohm [Mon, 24 Nov 2025 18:16:22 +0000 (18:16 +0000)] 
s390: message-security-assist facility related cleanups  (BZ 509562)

The message-security-assist facility is always present on
the supported machines.
- Remove VEX_HWCAPS_S390X_MSA and s390_host_has_msa
- Remove EmFail_S390X_msa

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

3 weeks agos390: MSA4 facility related cleanups (BZ 509562)
Florian Krohm [Mon, 24 Nov 2025 17:56:44 +0000 (17:56 +0000)] 
s390: MSA4 facility related cleanups  (BZ 509562)

The message-security-assist-extension-4 facility is always present on
the supported machines.
- Remove VEX_HWCAPS_S390X_MSA4 and s390_host_has_msa4
- Remove EmFail_S390X_msa4

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

3 weeks agos390: decimal-floating-point facility related cleanups (BZ 509562)
Florian Krohm [Mon, 24 Nov 2025 16:40:23 +0000 (16:40 +0000)] 
s390: decimal-floating-point facility related cleanups  (BZ 509562)

The decimal-floating-point facility is always present on the supported
machines.
- Remove VEX_HWCAPS_S390X_DFP and s390_host_has_dfp
- Remove EmFail_S390X_DFP_insn
- Update tests/s390x_features.c

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

3 weeks agoDarwin regtest: make a variant of none require-text-symbol-2
Paul Floyd [Mon, 24 Nov 2025 11:55:15 +0000 (12:55 +0100)] 
Darwin regtest: make a variant of none require-text-symbol-2

This test looks for a bogus symbol in libc.so. But Darwin
has no libc.so, so make this variant that looks in libsystem_c.dylib.
The -2 variant now has a !os_test darwin prereq and the new -3 variant
has an os_test darwin prereq.

3 weeks agos390: floating-point-extension facility related cleanups (BZ 509562)
Florian Krohm [Sun, 23 Nov 2025 22:51:53 +0000 (22:51 +0000)] 
s390: floating-point-extension facility related cleanups  (BZ 509562)

The floating-point-extension facility is always present on the supported
machines.
- Remove s390_host_has_fpext and VEX_HWCAPS_S390X_FPEXT
- Remove EmWarn_S390X_fpext_rounding and EmFail_S390X_fpext
- Remove testscases none/tests/s390x/fpext_fail and fpext_warn
- Update tests/s390x_features.c and memcheck/tests/vbit-test

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

3 weeks agoFreeBSD wrapper: typo in aligned_alloc redir
Paul Floyd [Sun, 23 Nov 2025 20:33:08 +0000 (21:33 +0100)] 
FreeBSD wrapper: typo in aligned_alloc redir

3 weeks agoFreeBSD regtest: add checks for required kernel modules and sysctl
Paul Floyd [Sun, 23 Nov 2025 20:07:12 +0000 (21:07 +0100)] 
FreeBSD regtest: add checks for required kernel modules and sysctl

memcheck/tests/descr_belowsp requires a sysctl
memcheck/tests/freebsd/scalar requires a kenrnel module

neither of trhe above are cleard/loaded by default.

3 weeks agoEnsure none/tests/linux/mremap[456].c remove the shared memory
Philippe Waroquiers [Sun, 23 Nov 2025 15:49:01 +0000 (16:49 +0100)] 
Ensure none/tests/linux/mremap[456].c remove the shared memory

As otherwise, each execution of a test leaves some shared memory lingering.

Verified by doing:
   ipcs -m | wc
   mremap4
   ipcs -m | wc

and that the nr does not increase after the fix.

3 weeks agomalloc-trace: format with %lu not %zu (SizeT is not size_t).
Paul Floyd [Sat, 22 Nov 2025 18:51:14 +0000 (19:51 +0100)] 
malloc-trace: format with %lu not %zu (SizeT is not size_t).

3 weeks agoDarwin syscalls: correctly set EIP/RIP in ML_(fixup_guest_state_to_restart_syscall)
Paul Floyd [Fri, 21 Nov 2025 21:02:41 +0000 (22:02 +0100)] 
Darwin syscalls: correctly set EIP/RIP in ML_(fixup_guest_state_to_restart_syscall)

The code was using arch->vex.guest_IP_AT_SYSCALL but that got cleaned out on amd64
a while ago. Use EIP/RIP - 2 instead, like other x86 and amd64 platforms.

This fixes 5 more memcheck regression tests.

3 weeks agos390: STFLE related cleanups (BZ 509562)
Florian Krohm [Fri, 21 Nov 2025 16:54:13 +0000 (16:54 +0000)] 
s390: STFLE related cleanups  (BZ 509562)

The STFLE insn is always present on the supported machines.
- Remove s390_host_has_stfle, VEX_HWCAPS_S390X_STFLE, and EmFail_S390X_stfle
- Update tests/s390x_features.c

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

3 weeks agos390: long displacement facility related cleanups (BZ 509562)
Florian Krohm [Fri, 21 Nov 2025 15:51:53 +0000 (15:51 +0000)] 
s390: long displacement facility related cleanups  (BZ 509562)

The long displacement facilities are always present on the supported
machines.
- Remove s390_host_has_ldisp and VEX_HWCAPS_S390X_LDISP
- Update tests/s390x_features.c

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

3 weeks agos390: Code cleanup due to availability of STCKF insn. (BZ 509562)
Florian Krohm [Thu, 20 Nov 2025 23:06:31 +0000 (23:06 +0000)] 
s390: Code cleanup due to availability of STCKF insn. (BZ 509562)

Remove EmFail_S390X_ecag, s390_host_has_stckf, and VEX_HWCAPS_S390X_STCKF.
Update none/tests/s390x/stckf.vgtest and tests/s390x_features.c

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

3 weeks agoDarwin traces: add a "Reading syms from [filename]" message
Paul Floyd [Thu, 20 Nov 2025 12:53:12 +0000 (13:53 +0100)] 
Darwin traces: add a "Reading syms from [filename]" message

Makes comparison with ELF loading easier

3 weeks agonone/tests/s390x/Makefile.am (EXTRA_DIST): Remove ecag.stdout.exp-z10ec
Mark Wielaard [Thu, 20 Nov 2025 01:17:18 +0000 (02:17 +0100)] 
none/tests/s390x/Makefile.am (EXTRA_DIST): Remove ecag.stdout.exp-z10ec

Fixes: 3a1a378eec4e ("s390: Code cleanup due to availability of ECAG insn")
3 weeks agos390: Code cleanup due to availability of ECAG insn. (BZ 509562)
Florian Krohm [Wed, 19 Nov 2025 14:26:15 +0000 (14:26 +0000)] 
s390: Code cleanup due to availability of ECAG insn. (BZ 509562)

Remove EmFail_S390X_ecag
Remove none/tests/s390x/ecag.stdout.exp-z10ec because z10-EC predates Z196

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

3 weeks agos390: Set min. required machine model to z196. (BZ 509562)
Florian Krohm [Wed, 19 Nov 2025 13:27:51 +0000 (13:27 +0000)] 
s390: Set min. required machine model to z196. (BZ 509562)

Bail out if machine is too old.

This is the 1st installment of a series of patches raising the min.
required machine model to z196.
Part of fixing https://bugs.kde.org/show_bug.cgi?id=509562

3 weeks agoDarwin macho debuginfo: fix RW load count
Paul Floyd [Wed, 19 Nov 2025 08:00:54 +0000 (09:00 +0100)] 
Darwin macho debuginfo: fix RW load count

Was counting all RW loads. However, load_thing_file() has the extra
requirement that the filesize be greater than 0. If the filesize is
0 then an anon map gets done and the associated segment doesn't get
flagged as being RW.

Also add the prot value to the macho load_segment mmap traces.

This fixes memcheck/tests/static_malloc

4 weeks agoLinux arm regtest: add another leak suppression and broaden filter
Paul Floyd [Sun, 16 Nov 2025 17:41:31 +0000 (17:41 +0000)] 
Linux arm regtest: add another leak suppression and broaden filter

4 weeks agoLinux syscall wrappers: remove some quotes from parameter names
Paul Floyd [Sun, 16 Nov 2025 07:44:45 +0000 (08:44 +0100)] 
Linux syscall wrappers: remove some quotes from parameter names

The PRE_REG_READX macros already textify the argument names so there
are no need for quotes. For consistency I've removed them here.

4 weeks agoDarwin launcher: executable path changes
Paul Floyd [Sat, 15 Nov 2025 13:31:36 +0000 (14:31 +0100)] 
Darwin launcher: executable path changes

Fixes
memcheck/tests/execve2
Merged from
https://github.com/LouisBrunner/valgrind-macos.git

4 weeks agos390x: Support FPC rounding mode 0b111
Florian Krohm [Sat, 15 Nov 2025 12:27:27 +0000 (12:27 +0000)] 
s390x: Support FPC rounding mode 0b111

When get_bfp_rounding_mode_from_fpc was added Irrm_PREPARE_SHORTER was
not available. The rounding mode 0x111 in the FPC was mapped to Irrm_NEAREST
with fingers crossed.
When Irrm_PREPARE_SHORTER was added later on it was forgotten to adjust this
function. Now fixed. Comments and bfp-convert testcase  adjusted.

4 weeks agos390x decode_bfp_rounding_mode: complete list of rounding modes.
Florian Krohm [Sat, 15 Nov 2025 11:35:07 +0000 (11:35 +0000)] 
s390x decode_bfp_rounding_mode: complete list of rounding modes.

4 weeks agoDarwin regtest: filter and quieten sh-mem-vec256-plo-yes/no
Paul Floyd [Sat, 15 Nov 2025 10:41:04 +0000 (11:41 +0100)] 
Darwin regtest: filter and quieten sh-mem-vec256-plo-yes/no

4 weeks agoBug 512037 - malloc trace does not print free size or alignment
Paul Floyd [Thu, 13 Nov 2025 19:32:28 +0000 (20:32 +0100)] 
Bug 512037 - malloc trace does not print free size or alignment

4 weeks agos390x: Fix BZ 512030
Florian Krohm [Thu, 13 Nov 2025 11:46:11 +0000 (11:46 +0000)] 
s390x: Fix BZ 512030

As obvious when inspecting the neighbourhood.

4 weeks agoBug 511972 - valgrind-3.26.0 tests fail to build on upcomig gcc-16: unrecognized...
Paul Floyd [Wed, 12 Nov 2025 20:46:23 +0000 (21:46 +0100)] 
Bug 511972 - valgrind-3.26.0 tests fail to build on upcomig gcc-16: unrecognized command-line option '-Wno-alloc-size-larger-than=18446744073709551615'

Initial patch from Sergei Trofimovich, thanks.

5 weeks agoDarwin: update wqthread_hijack arguments
Paul Floyd [Tue, 11 Nov 2025 14:57:14 +0000 (15:57 +0100)] 
Darwin: update wqthread_hijack arguments

Taken from Louis Brunner's GitHub repo.

Now when I launch TextEdit with memcheck it doesnt fail straight away.
I get a few memcheck errors and then it hangs. Looks like the 3 threads
are all running JITted code with one blocked having access errors.

5 weeks agoWarnings: fix executable stack warnings from x86 assmebler tests.
Paul Floyd [Tue, 11 Nov 2025 13:15:51 +0000 (13:15 +0000)] 
Warnings: fix executable stack warnings from x86 assmebler tests.

5 weeks agoDarwin syscall: fix signal masks
Paul Floyd [Mon, 10 Nov 2025 21:15:51 +0000 (22:15 +0100)] 
Darwin syscall: fix signal masks

Merged From Louis Brunner's git repo. Fixes a few more regtest
failures with OSX 10.13 amd64.

5 weeks agoDarwin syscall args: missing piece for layout
Paul Floyd [Mon, 10 Nov 2025 08:25:54 +0000 (09:25 +0100)] 
Darwin syscall args: missing piece for layout

Getting the layout and PRE_REG_READX in the PRE wrappers should
now be correct for amd64.

5 weeks agoDarwin redirs: add several str* amd mem* redirs to vg_replace_strmem.c
Paul Floyd [Sun, 9 Nov 2025 20:57:01 +0000 (21:57 +0100)] 
Darwin redirs: add several str* amd mem* redirs to vg_replace_strmem.c

Mostly these are _chk variants. I've also undone a change that
forced the compiler to not use these variants.

5 weeks agoDarwin: rework syscall arg handling
Paul Floyd [Sun, 9 Nov 2025 18:28:13 +0000 (19:28 +0100)] 
Darwin: rework syscall arg handling

There were numerous issues, particularly with syscall SYS_syscall
and the scalar tests. Only tested on amd64, I don't have access to
an OSX 10.12 or earlier machine to do any testing.

The key elements in VG_(client_syscall) are, when the PRE wrapper
does not handle the syscall

1. getSyscallArgsFromGuestState
2. getSyscallArgLayout
3. call PRE wrapper

either blocking

4. putSyscallArgsIntoGuestState
5. do_syscall_for_client

or non-blocking

6. VG_(do_syscall)

What has changed
----------------
struct SyscallArgs now like FreeBSD, stores both the
canonical_sysno (which is the final syscall number, never
SYS_syscall) and the original_sysno (which can be SYS_syscall).
These get set in getSyscallArgsFromGuestState which has
changed accordingly.

getSyscallArgsFromGuestState has changed to always get the layout
coresponding to the canonical layout. This was the cause of the
problems with the scalar tests - the arguments were effectively
out by one.

Many subsequent changes to the scalar test, filter and expected.
The scalar test still isn't quite right. __NR_kevent_qos is missing
a scalar error from argument 6. That's the one with special case
handling because it is a register argument for a normal syscall
but a stack argument for syscall SYS_syscall.

5 weeks agoFreeBSD regtest: getsockopt and setsockopt scalar tests were wrong
Paul Floyd [Sun, 9 Nov 2025 08:29:17 +0000 (09:29 +0100)] 
FreeBSD regtest: getsockopt and setsockopt scalar tests were wrong

getsockopt was miscopied as setsockopt and the memory checks
weere not good.

5 weeks agoFreeBSD regtest: add comments for a sched_setaffinity equivalent
Paul Floyd [Fri, 7 Nov 2025 19:40:21 +0000 (20:40 +0100)] 
FreeBSD regtest: add comments for a sched_setaffinity equivalent

Trying to get a fix for nlvgdbsigqueue flakiness.

FreeBSD has cpuset_setaffinity which is similar to sched_setaffinity.
Howeever, it needs privileges in order to be used. So I've just put the
code there in a comment.

5 weeks agoBug 511713 - Refactor syscall argument handling
Paul Floyd [Thu, 6 Nov 2025 18:40:15 +0000 (19:40 +0100)] 
Bug 511713 - Refactor syscall argument handling