2686 Commits

Author SHA1 Message Date
Paul Floyd
80c17e5e70 regtest: undo changes to str_tester as a workaround for darwin checked functions
I had added parens to force the use of the function rarther than a
macro expanding to the _chk version. The _chk functions are now wrapped
so no longer need to keep the workaround.
2026-01-10 15:53:43 +01:00
Paul Floyd
6f06c0aec8 Darwin regtest: ensure no stdout output for memcheck/tests/darwin/deep_badparam
The test was doing a write of an uninit ilocal 32byte char buffer.
This has started outputting junk resulting in a stdout diff. So
make sure that the buffer only contains zeros (but still uninit).
Hope the compiler doesn't get too smart.
2025-12-26 14:20:34 +01:00
Paul Floyd
2911ddad67 Darwin regtest: update a filter following the previous commit 2025-12-26 13:30:41 +01:00
Paul Floyd
bd417daf8b Bug 513636 - Support macOS 12.0 (Monterey)
Intel only for the moment.
2025-12-24 17:36:11 +01:00
Paul Floyd
3932bdc09a Darwin regtest: update for one of the several memalign_args expecteds 2025-12-23 08:31:02 +01:00
Paul Floyd
eab939e9c9 Bug 513533 - Support macOS 11.0 (Big Sur)
Most of the work for this was done by Louis Brunner.
Thanks Louis.
2025-12-20 15:47:50 +01:00
Paul Floyd
2fd107444d regtest: filter leaks from memcheck threadname_xml and update expected 2025-12-19 12:33:50 +01:00
Paul Floyd
d101bbd76e regtest: change memcheck threadname_xml prereq
This was using test -u which doesn't work on Darwin so I changed that to -e.
2025-12-19 07:07:12 +01:00
Paul Floyd
d3cd66160c Darwin: add macOS 10.15 support
== 721 tests, 46 stderr failures, 6 stdout failures, 0 stderrB failures, 0 stdoutB failures, 4 post failures ==

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

Much of the code merged from Louis Brunner's git repo. Many thanks once again
Louis.
2025-12-17 19:42:34 +01:00
Florian Krohm
e40b4d78b8 Testcase tweak: clenup after yourself 2025-12-15 10:24:49 +00:00
Florian Krohm
778fe51a69 testsuite: Tidy. Remove empty .stdout.exp files
As per tests/vg_regtest:

 Expected stdout (filtered) is kept in <test>.stdout.exp* (can be more
 than one expected output).  It can be missing if it would be empty.
2025-12-13 18:37:27 +00:00
Paul Floyd
720d388d91 Darwin regtest: numerous bits of Darwin 18 cleanup
Add a few more ignore-fn options to the massif tests for the
extra leaks that are in Darwin 18.

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

Add more DRD suppressions for getaddrinfo. There seems to be a never
ending amount of conflicts in dyld.
2025-12-10 08:58:25 +01:00
Paul Floyd
95a1dfad82 FreeBSD regtest: minor typo in test error message 2025-12-07 09:36:20 +01:00
Paul Floyd
19054d9a8f 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.
2025-12-05 13:47:19 +01:00
Paul Floyd
bf7c22738b 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
2025-11-27 13:26:57 +01:00
Paul Floyd
7256b7bf01 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.
2025-11-26 21:37:10 +01:00
Paul Floyd
8e93514465 Darwin: fix x86 build and client syscall 2025-11-26 20:26:08 +01:00
Martin Cermak
2b4b31de69 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
2025-11-25 16:50:34 +01:00
Florian Krohm
5e0aa0cefa 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
2025-11-25 13:50:37 +00:00
Florian Krohm
610f0e4b5d 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
2025-11-23 22:54:18 +00:00
Paul Floyd
ff940096a8 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.
2025-11-23 21:09:07 +01:00
Paul Floyd
5f32997518 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.
2025-11-16 08:44:45 +01:00
Paul Floyd
ec0ec30b0a Darwin regtest: filter and quieten sh-mem-vec256-plo-yes/no 2025-11-15 11:41:04 +01:00
Paul Floyd
dd3ac939d1 Bug 512037 - malloc trace does not print free size or alignment 2025-11-13 20:32:28 +01:00
Paul Floyd
51c5973d9d 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.
2025-11-12 21:46:23 +01:00
Paul Floyd
a8e1583c93 Warnings: fix executable stack warnings from x86 assmebler tests. 2025-11-11 13:15:51 +00:00
Paul Floyd
c430409dd6 Darwin syscall args: missing piece for layout
Getting the layout and PRE_REG_READX in the PRE wrappers should
now be correct for amd64.
2025-11-10 09:25:54 +01:00
Paul Floyd
ed27b47d81 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.
2025-11-09 21:57:01 +01:00
Paul Floyd
7f71b26b92 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.
2025-11-09 19:54:58 +01:00
Paul Floyd
f1ae846a7f FreeBSD regtest: getsockopt and setsockopt scalar tests were wrong
getsockopt was miscopied as setsockopt and the memory checks
weere not good.
2025-11-09 09:29:17 +01:00
Paul Floyd
8a5e8c6bb7 Darwin: fix redir for memccpy 2025-11-04 07:30:42 +01:00
Paul Floyd
d2bd46b27e 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.
2025-11-03 21:43:17 +01:00
Paul Floyd
ab5770e5c5 And remove the one that I copied and pasted the wrong name 2025-11-01 19:55:00 +01:00
Paul Floyd
d5bd1e6208 Add missing expected 2025-11-01 19:52:53 +01:00
Paul Floyd
87631266a5 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.
2025-11-01 16:56:20 +01:00
Paul Floyd
5ef9990f87 Darwin regtest: use -q in 2 tests with heap summary diffs 2025-11-01 13:38:24 +01:00
Paul Floyd
78ea7c8237 Darwin regtest: another leaky xml test and a suppression test
The suppression test needed to use the same lable for Darwin
and other OSes.
2025-10-30 22:01:44 +01:00
Paul Floyd
8aaa141241 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
2025-10-30 21:29:28 +01:00
Paul Floyd
931b7ead24 Darwin regtest: filter malloc_zone_memalign 2025-10-30 21:00:59 +01:00
Paul Floyd
6a490eeb27 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.
2025-10-30 19:02:43 +01:00
Paul Floyd
57b894baf7 FreeBSD regtest: rationalise memcheck test-plo-no expecteds
Now just one 32bit expected.
2025-10-29 20:40:44 +01:00
Paul Floyd
951a45bdb7 FreeBSD regtest: clobber R11 for memcheck/tests/leak_cpp_interior 2025-10-29 15:55:40 +01:00
Paul Floyd
4a30e21612 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.
2025-10-29 14:25:04 +01:00
Paul Floyd
7e1b044013 regtest: correct a typo
nothow instead of nothrow
2025-10-26 18:45:25 +01:00
Paul Floyd
7a64c4c869 regtest: use FLAG_NO_PIE
Now sure that the compiler won't complain.
2025-10-26 09:49:20 +01:00
Paul Floyd
b6cd12b0f8 Darwin: deprecated warning cleanup
Mainly sem* and syscall().
2025-10-25 23:04:37 +02:00
Florian Krohm
f22e76d1bf 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.
2025-10-25 20:50:22 +00:00
Paul Floyd
4ccb893e7b 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?
2025-10-25 17:56:50 +02:00
Mark Wielaard
3392155359 Upgrade to GNU General Public License version 3
- Update COPYING and VEX/LICENSE.GPL to version 3.
- Update README, NEWS, docs/manual license and contributing text.
- Update file headers to say either version 3 of the License,
  or (at your option) any later version.
- Leave tests and perf file headers as is, unless the code is derived
  from Valgrind/VEX.
- Leave valgrind.h, cachegrind.h, callgrind.h, drd.h, helgrind.h,
  memcheck.h and dhat.h Hybrid-BSD licensed.
2025-10-18 00:55:07 +02:00
Paul Floyd
b0161e3096 regtest: move memcheck realloc3 CFLAGS
It was inside a block for C++ 17 features. Old systems
not supporting that lost the default AM_CFLAGS with -g.
2025-10-14 07:25:25 +02:00