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

2 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

5 weeks agodoc: add client_syscall_arguments.txt to EXTRA_DIST
Paul Floyd [Thu, 6 Nov 2025 17:43:17 +0000 (18:43 +0100)] 
doc: add client_syscall_arguments.txt to EXTRA_DIST

5 weeks agodoc: add a text file describing client syscall argument handling
Paul Floyd [Thu, 6 Nov 2025 07:33:42 +0000 (08:33 +0100)] 
doc: add a text file describing client syscall argument handling

To help understand all of the shuffling that gets done for
"syscall syscall".

5 weeks agoFreeBSD arm64: reverse normal syscall and syscall syscall args
Paul Floyd [Wed, 5 Nov 2025 08:20:44 +0000 (09:20 +0100)] 
FreeBSD arm64: reverse normal syscall and syscall syscall args

Copied and pasted in the wrong order.

5 weeks agoFreeBSD: cleanup arg handling for syscalls syscall and __syscall
Paul Floyd [Tue, 4 Nov 2025 20:39:00 +0000 (21:39 +0100)] 
FreeBSD: cleanup arg handling for syscalls syscall and __syscall

This is with a view to using the same code for Darwin.

5 weeks agoDarwin: add ML_(get_darwin_syscall_entry)
Paul Floyd [Tue, 4 Nov 2025 19:36:45 +0000 (20:36 +0100)] 
Darwin: add ML_(get_darwin_syscall_entry)

There was a comment saying that exposing the table arrays and
sizes should be fixed (all other OSes use a function). Now done.

Taken from
   https://github.com/LouisBrunner/valgrind-macos

Thanks, Louis Brunner.

6 weeks agoDarwin: clean up use of Z-encoded libc component libraries in vg_replace_strmem.c
Paul Floyd [Tue, 4 Nov 2025 07:27:01 +0000 (08:27 +0100)] 
Darwin: clean up use of Z-encoded libc component libraries in vg_replace_strmem.c

Use macros, mainly for consistency. Not sure how these have evolved post OSX 10.13.

6 weeks agoDarwin: fix redir for memccpy
Paul Floyd [Tue, 4 Nov 2025 06:30:42 +0000 (07:30 +0100)] 
Darwin: fix redir for memccpy

6 weeks agoDarwin: add redir for wcpncpy
Paul Floyd [Mon, 3 Nov 2025 20:56:42 +0000 (21:56 +0100)] 
Darwin: add redir for wcpncpy

6 weeks agoregtest: rename memcheck wcpncpy
Paul Floyd [Mon, 3 Nov 2025 20:43:17 +0000 (21:43 +0100)] 
regtest: rename memcheck wcpncpy

The perl script filter_memcheck removes callstack elements that
are not of interest and changes vg_replace_strmem.c/vg_replace_malloc.c
line numbers to '...'. It protects lines containing the testcase
name.

When the testcase name is the same as the C function being tested
that's not really what we want. My perl isn't really good enough
to be able to only change the line numbers when it is a 'tool file'.
Instead I'm renaming the testcase.

6 weeks agoBug 413369 - unhandled amd64-darwin syscall: unix:151 (getpgid)
Paul Floyd [Sun, 2 Nov 2025 16:45:36 +0000 (17:45 +0100)] 
Bug 413369 - unhandled amd64-darwin syscall: unix:151 (getpgid)

6 weeks agoAnd remove the one that I copied and pasted the wrong name
Paul Floyd [Sat, 1 Nov 2025 18:55:00 +0000 (19:55 +0100)] 
And remove the one that I copied and pasted the wrong name

6 weeks agoAdd missing expected
Paul Floyd [Sat, 1 Nov 2025 18:52:53 +0000 (19:52 +0100)] 
Add missing expected

6 weeks agoDarwin regtest: add an expected for duplicate_align_size_errors
Paul Floyd [Sat, 1 Nov 2025 15:56:20 +0000 (16:56 +0100)] 
Darwin regtest: add an expected for duplicate_align_size_errors

Also start trying to del with some redir issues.
For some libc functions the plain function gets replaced by a
checked version (not sure if this is only for debug builds).

For instance in /usr/include/secure/_string.h there are a load of macros
that look like

/* void *memccpy(void *dst, const void *src, int c, size_t n) */
                __builtin___memccpy_chk (dest, __VA_ARGS__, __darwin_obsz0 (dest))

To defeat these macros I've put the function name in parens. That hasn't
solved the issue. In addition these seems to be an ifunc like mechanism
that resolves calls to platform functions. For instance

nm /usr/lib/system/*dylib | grep memcc
0000000000081e14 T ___memccpy_chk
                 U __platform_memccpy
                 I _memccpy (indirect for __platform_memccpy)
0000000000004eb4 T __platform_memccpy

That matches what I see in lldb (memccpy then function lookup code then _platform_memccpy).

Need to look at how indirects work.

6 weeks agoDarwin regtest: use -q in 2 tests with heap summary diffs
Paul Floyd [Sat, 1 Nov 2025 12:37:28 +0000 (13:37 +0100)] 
Darwin regtest: use -q in 2 tests with heap summary diffs

6 weeks agoclang-tidy: fix some redundant cast warnings.
Paul Floyd [Sat, 1 Nov 2025 12:20:04 +0000 (13:20 +0100)] 
clang-tidy: fix some redundant cast warnings.

6 weeks agoDarwin suppression: add a leak suppression for fwrite
Paul Floyd [Sat, 1 Nov 2025 12:19:11 +0000 (13:19 +0100)] 
Darwin suppression: add a leak suppression for fwrite

6 weeks agoDarwin regtest: another leaky xml test and a suppression test
Paul Floyd [Thu, 30 Oct 2025 21:01:44 +0000 (22:01 +0100)] 
Darwin regtest: another leaky xml test and a suppression test

The suppression test needed to use the same lable for Darwin
and other OSes.

6 weeks agoDarwin regtest: various filters
Paul Floyd [Thu, 30 Oct 2025 20:29:28 +0000 (21:29 +0100)] 
Darwin regtest: various filters

Use -q to hide Darwin leaks in HEAP SUMMARY
The pcmpgt test uses uint64_t whish is unsigned long long on Darwin
but unsigned long on all other amd64 OSes
Swap malloc_zone_memalign with posix_memalign

6 weeks agoDarwin regtest: filter malloc_zone_memalign
Paul Floyd [Thu, 30 Oct 2025 20:00:59 +0000 (21:00 +0100)] 
Darwin regtest: filter malloc_zone_memalign

6 weeks agoDarwin regtest: changes to filters and sed commands
Paul Floyd [Thu, 30 Oct 2025 14:17:50 +0000 (15:17 +0100)] 
Darwin regtest: changes to filters and sed commands

Darwin libc is quite incontinent, so use filter_xml_leak
in a few places rather than filter_xml.

Also old Darwin 17.7 sed doesn't understand "+1d" to delete the
matched line and the next line. So use N to join, s to delete the
newline and another match with d to delete the joined linbes.

6 weeks agoBug 511329 - Darwin and FreeBSD: Move setting of carry flag out of ML_(do_syscall_for...
Paul Floyd [Wed, 29 Oct 2025 21:09:08 +0000 (22:09 +0100)] 
Bug 511329 - Darwin and FreeBSD: Move setting of carry flag out of ML_(do_syscall_for_client_WRK) part 3

Remove guest_SETC and GENOFFSET

6 weeks agoBug 511329 - Darwin and FreeBSD: Move setting of carry flag out of ML_(do_syscall_for...
Paul Floyd [Wed, 29 Oct 2025 20:30:35 +0000 (21:30 +0100)] 
Bug 511329 - Darwin and FreeBSD: Move setting of carry flag out of ML_(do_syscall_for_client_WRK) part 2

This changeset includes the changes to ML_(do_syscall_for_client_WRK)
for the 2 supported Darwin platforms.

To come: remove SETC from guest state and OFFSET.

6 weeks agocomment: add FreeBSD syscall registers to syswrap-main comments
Paul Floyd [Wed, 29 Oct 2025 19:48:52 +0000 (20:48 +0100)] 
comment: add FreeBSD syscall registers to syswrap-main comments

6 weeks agoregtest: broadan none fdleak_cmsg_supp accept suppression
Paul Floyd [Wed, 29 Oct 2025 20:18:54 +0000 (21:18 +0100)] 
regtest: broadan none fdleak_cmsg_supp accept suppression

6 weeks agoBug 511329 - Darwin and FreeBSD: Move setting of carry flag out of ML_(do_syscall_for...
Paul Floyd [Wed, 29 Oct 2025 18:50:05 +0000 (19:50 +0100)] 
Bug 511329 - Darwin and FreeBSD: Move setting of carry flag out of ML_(do_syscall_for_client_WRK) part 1

This changeset includes the changes to ML_(do_syscall_for_client_WRK)
for the 3 supported FreeBSD platforms.

To come: Darwin x86/amd64 and removing the SETC flag from the guest state
(and its OFFSET).

6 weeks agoFreeBSD regtest: rationalise memcheck test-plo-no expecteds
Paul Floyd [Wed, 29 Oct 2025 19:40:44 +0000 (20:40 +0100)] 
FreeBSD regtest: rationalise memcheck test-plo-no expecteds

Now just one 32bit expected.

6 weeks agoFreeBSD comment: fix amd64 do_syscall_WRK arg comments
Paul Floyd [Wed, 29 Oct 2025 15:08:28 +0000 (16:08 +0100)] 
FreeBSD comment: fix amd64 do_syscall_WRK arg comments

I recently changed the amd64 syscall to lower the max number
of args handled but didn't update the corresponding comment.

6 weeks agoFreeBSD regtest: clobber R11 for memcheck/tests/leak_cpp_interior
Paul Floyd [Wed, 29 Oct 2025 14:54:59 +0000 (15:54 +0100)] 
FreeBSD regtest: clobber R11 for memcheck/tests/leak_cpp_interior

6 weeks agoDarwin regtest: simplify memcheck filter_supp
Paul Floyd [Wed, 29 Oct 2025 13:25:04 +0000 (14:25 +0100)] 
Darwin regtest: simplify memcheck filter_supp

The filter removes used suppression lines and duplicate lines.
Old Darwin sed doesn't understand 'M{}', so use "cat -s" to remove
duplicate blank lines instead.

6 weeks agoDarwin: gettaddrinfo suppressions and wildcard memmove redir
Paul Floyd [Wed, 29 Oct 2025 10:20:22 +0000 (11:20 +0100)] 
Darwin: gettaddrinfo suppressions and wildcard memmove redir

6 weeks agowarnings: one more -Wno-deprecated-declarations flag
Paul Floyd [Wed, 29 Oct 2025 07:06:28 +0000 (08:06 +0100)] 
warnings: one more -Wno-deprecated-declarations flag

7 weeks agos390x: Testcase workaround
Florian Krohm [Mon, 27 Oct 2025 13:09:04 +0000 (13:09 +0000)] 
s390x: Testcase workaround

GCC 14.2.0 does not recognize convert to fixed/logical opcodes:

bfp-convert.c: Assembler messages:
bfp-convert.c:205: Error: Unrecognized opcode: `cfebra'
bfp-convert.c:210: Error: Unrecognized opcode: `cgebra'
...
bfp-convert.c:314: Error: Unrecognized opcode: `clfebr'
bfp-convert.c:314: Error: Unrecognized opcode: `clgebr'
...

7 weeks agoRemove a FIXME.
Florian Krohm [Sun, 26 Oct 2025 22:08:48 +0000 (22:08 +0000)] 
Remove a FIXME.

538 to go.

7 weeks agos390x: Enable "convert to logical" BFP test
Florian Krohm [Sun, 26 Oct 2025 21:45:32 +0000 (21:45 +0000)] 
s390x: Enable "convert to logical" BFP test

This was disabled because I had thought that a negative
operand value should result in a condition code of 1. Not so.
Additionally the operand value must be 0 after rounding.

7 weeks agoregtest: update none/tests/linux/bug506910.cpp to add errno value
Paul Floyd [Sun, 26 Oct 2025 19:41:38 +0000 (20:41 +0100)] 
regtest: update none/tests/linux/bug506910.cpp to add errno value

This test recently had a couple of failures. Don't know why, but know
that errno wasn't the expected ELOOP. This change adds the value of
errno.

7 weeks agoregtest: correct a typo
Paul Floyd [Sun, 26 Oct 2025 17:44:18 +0000 (18:44 +0100)] 
regtest: correct a typo

nothow instead of nothrow

7 weeks agoconfigure.ac: fix build lzcnt test to work on both i386 and amd64
Mark Wielaard [Sun, 26 Oct 2025 14:23:23 +0000 (15:23 +0100)] 
configure.ac: fix build lzcnt test to work on both i386 and amd64

The BUILD_LZCNT_TESTS conditional is used in both
none/tests/x86/Makefile.am and none/tests/amd64/Makefile.am to check
whether to build the lzcnt32 and lzcnt64 test program. However the
configure test uses %rax which is only available on amd64. Use %eax
instead to make sure the configure test succeeds on both i386 and
amd64.

7 weeks agoregtest: use FLAG_NO_PIE
Paul Floyd [Sun, 26 Oct 2025 08:47:20 +0000 (09:47 +0100)] 
regtest: use FLAG_NO_PIE

Now sure that the compiler won't complain.

7 weeks agoregtest: fix typo in previous commmit that was supposed to fix deprecated declaration...
Paul Floyd [Sun, 26 Oct 2025 08:33:32 +0000 (09:33 +0100)] 
regtest: fix typo in previous commmit that was supposed to fix deprecated declaration warnings

I even managed to copy the line 3 more times without noticing.

7 weeks agoDarwin: deprecated warning cleanup
Paul Floyd [Sat, 25 Oct 2025 21:04:37 +0000 (23:04 +0200)] 
Darwin: deprecated warning cleanup

Mainly sem* and syscall().

7 weeks agoAvoid linker warnings in various x86/amd64 testcases.
Florian Krohm [Sat, 25 Oct 2025 20:50:22 +0000 (20:50 +0000)] 
Avoid linker warnings in various x86/amd64 testcases.

Like so:
/usr/bin/ld: int3-x86.o: warning: relocation in read-only section `.text'
/usr/bin/ld: warning: creating DT_TEXTREL in a PIE

Link with -no-pie.

7 weeks agoBug 487055 - memcheck/tests/x86-linux/scalar fails running in Docker
Paul Floyd [Sat, 25 Oct 2025 15:56:50 +0000 (17:56 +0200)] 
Bug 487055 - memcheck/tests/x86-linux/scalar fails running in Docker

Also move to 3.27.0.GIT.

Will this fix some of the failures in the nightly tests?

7 weeks ago-> 3.26.0 final VALGRIND_3_26_0
Mark Wielaard [Fri, 24 Oct 2025 18:24:02 +0000 (20:24 +0200)] 
-> 3.26.0 final

7 weeks agoDon't warn about fcntl F_GETFD with --track-fds
Mark Wielaard [Fri, 24 Oct 2025 16:31:31 +0000 (18:31 +0200)] 
Don't warn about fcntl F_GETFD with --track-fds

fcntl F_GETFD is used to check if a file descriptor is valid, so only
make sure it isn't a valgrind fd, otherwise we might warn, with
--track-fds=bad for any bad fd.

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

7 weeks agoSilence false positive failure of LTP munmap01
Martin Cermak [Mon, 13 Oct 2025 07:53:56 +0000 (09:53 +0200)] 
Silence false positive failure of LTP munmap01

After upgrading LTP testsuite version to 20250930 (tracked in bug
510169) munmap01 syscall test started failing.  It however turns out
that this testcase was substantially rewritten and the failure is
expected.  This update will silence mentioned false positive.

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

7 weeks agoNEWS: Add bug 510694 Handle qExecAndArgs remote protocol packet
Mark Wielaard [Fri, 24 Oct 2025 14:48:09 +0000 (16:48 +0200)] 
NEWS: Add bug 510694 Handle qExecAndArgs remote protocol packet

Fixed in f80358f109d1 server.c: handle qExecAndArgs remote protocol packet

7 weeks agoserver.c: handle qExecAndArgs remote protocol packet
Alexandra Hájková [Wed, 15 Oct 2025 10:27:25 +0000 (06:27 -0400)] 
server.c: handle qExecAndArgs remote protocol packet

New qExecAndArgs packet has been added recently to GDB's remote
protocol.

The new qExecAndArgs packet is sent from GDB, and gdbserver replies
with a packet that includes the executable filename and the arguments
string that were used for starting the initial inferior.

On the GDB side this information can be used to update GDB's state,
the 'show remote exec-file' will reflect how gdbserver was started,
and 'show args' will reflect the arguments used for starting the
inferior.

When running valgrind together with GDB like this:

./vg-in-place --tool=memcheck --vgdb-error=0 /bin/ls -lh

~/build/gdb/gdb/gdb
target remote | coregrind/vgdb
We can now ask GDB to show the executable's arguments:

(gdb) show args

Argument list to give program being debugged when it is started is "-lh".

or the executable's name:

(gdb) show remote exec-file
The remote exec-file is "/bin/ls".

7 weeks agogdbserver_tests: Avoid l10n problems with gdb tests
Matthias Schwarzott [Fri, 24 Oct 2025 04:26:51 +0000 (06:26 +0200)] 
gdbserver_tests: Avoid l10n problems with gdb tests

GNU gdb (Ubuntu 12.1-0ubuntu1) 12.1
with LANG=de_DE.UTF-8

Fixes these issues:
== 26 tests, 0 stderr failures, 0 stdout failures, 14 stderrB failures, 10 stdoutB failures, 0 post failures ==
gdbserver_tests/hginfo                   (stdoutB)
gdbserver_tests/hginfo                   (stderrB)
gdbserver_tests/hgtls                    (stdoutB)
gdbserver_tests/mcblocklistsearch        (stderrB)
gdbserver_tests/mcbreak                  (stdoutB)
gdbserver_tests/mcbreak                  (stderrB)
gdbserver_tests/mcclean_after_fork       (stdoutB)
gdbserver_tests/mcclean_after_fork       (stderrB)
gdbserver_tests/mcinfcallWSRU            (stderrB)
gdbserver_tests/mcleak                   (stdoutB)
gdbserver_tests/mcleak                   (stderrB)
gdbserver_tests/mcmain_pic               (stdoutB)
gdbserver_tests/mcmain_pic               (stderrB)
gdbserver_tests/mcvabits                 (stdoutB)
gdbserver_tests/mcvabits                 (stderrB)
gdbserver_tests/mcwatchpoints            (stdoutB)
gdbserver_tests/mssnapshot               (stdoutB)
gdbserver_tests/mssnapshot               (stderrB)
gdbserver_tests/nlgone_abrt              (stderrB)
gdbserver_tests/nlgone_return            (stderrB)
gdbserver_tests/nlpasssigalrm            (stdoutB)
gdbserver_tests/nlpasssigalrm            (stderrB)
gdbserver_tests/nlself_invalidate        (stderrB)
gdbserver_tests/nlsigvgdb                (stderrB)

All issues are similar to this:
  --- mcblocklistsearch.stderrB.exp
  +++ mcblocklistsearch.stderrB.out
  @@ -1,7 +1,8 @@
   vgdb-error value changed from 0 to 999999
  -Breakpoint 1 at 0x........: file leak-tree.c, line 42.
  -Breakpoint 2 at 0x........: file leak-tree.c, line 68.
  +Haltepunkt 1 at 0x........: file leak-tree.c, line 42.
  +Haltepunkt 2 at 0x........: file leak-tree.c, line 68.
   Continuing.
  +Warnung: Missing auto-load script at offset 0 in section .debug_gdb_scripts
   Breakpoint 1, f () at leak-tree.c:42
   42        t->l    = mk();   // B
   Continuing.
  @@ -63,4 +64,4 @@
     0x........[16] indirect loss record 4
     0x........[16] indirect loss record 5
   monitor command request to kill this process
  -Remote connection closed
  +Remote Verbindung wurde beendet

7 weeks agoconfigure.ac: Use primary arch flags for openssl and libaio checks
Mark Wielaard [Thu, 23 Oct 2025 23:12:19 +0000 (01:12 +0200)] 
configure.ac: Use primary arch flags for openssl and libaio checks

Make sure that the configure check for openssl/crypto and libaio use
the primary arch flags. These are used in testcases for the primary
arch and should compile and link with the primary arch flags (which
are empty on most arches, but are set explicitly on e.g. mips).

Move the libaio check after the compiler check flags.

7 weeks agonone/tests/s390x/bfp-emit testcase: Assorted fixes.
Florian Krohm [Thu, 23 Oct 2025 22:35:27 +0000 (22:35 +0000)] 
none/tests/s390x/bfp-emit testcase: Assorted fixes.

Make function check_valgrind_output actually check something..
Remove --check-prereq logic. It is not needed. I think I was doing some
experiment of using objdump to make sure the insns written out by
valgrind match those produced by objdump. And then there was different
behaviour of objdump in different versions.

7 weeks agos390x testcases: Fix valgrind invocation
Florian Krohm [Thu, 23 Oct 2025 21:10:57 +0000 (21:10 +0000)] 
s390x testcases: Fix valgrind invocation

coregrind/valgrind works iff valgrind was installed beforehand.
But we don't know that. Use vg-in-place instead.

7 weeks agos390-runone: Add command line option --cc=... to choose a compiler.
Florian Krohm [Thu, 23 Oct 2025 21:06:41 +0000 (21:06 +0000)] 
s390-runone: Add command line option --cc=... to choose a compiler.

gcc is still default, --cc=whatever overrides.

7 weeks agoHook up ioprio_{get,set}, [vm]splice, tee and bpf syscalls on arm-linux
Mark Wielaard [Wed, 22 Oct 2025 23:23:48 +0000 (01:23 +0200)] 
Hook up ioprio_{get,set}, [vm]splice, tee and bpf syscalls on arm-linux

7 weeks agoFix a compiler warning about an unused variable on some platforms.
Florian Krohm [Tue, 21 Oct 2025 17:45:52 +0000 (17:45 +0000)] 
Fix a compiler warning about an unused variable on some platforms.