19028 Commits

Author SHA1 Message Date
Paul Floyd
656a88b9ee Code cleaning: use #elif in coregrind/m_trampoline.S
The code was using #else #if with an ever growing list of
Chained #elifs with just one #endif is nicer.
2026-01-11 11:39:55 +01:00
Paul Floyd
cf84985d5b Code cleaning: remove duplicate conditional blocks
vg_replace_strmem.c contained stpcpy twice for VGO_freebsd
2026-01-10 16:04:59 +01:00
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
a859a42723 regtest: clean a bit of unused code 2026-01-09 19:48:42 +01:00
Paul Floyd
5d20965ee0 Fix typo 2026-01-09 19:34:18 +01:00
Mark Wielaard
19a34d1d93 Disable linux madvise MADV_GUARD_INSTALL
glibc 2.42+ (with linux 6.13+) uses MADV_GUARD_INSTALL to setup stack
guard pages. valgrind currently isn't able to track this and such
guard pages also don't show up in /proc maps (only in /proc pagemap
since linux 6.14). For now valgrind fails a madvise MADV_GUARD_INSTALL
syscall with EINVAL. This causes glibc to fall back to mprotect
PROT_NONE which valgrind is able to track.

https://bugs.kde.org/show_bug.cgi?id=511717
2026-01-07 22:20:49 +01:00
Paul Floyd
21e5da76b5 valgrind.h: FreeBSD cleanup
Wasn't undefining the PLAT macros
Add FreeBSD to the head and tail comments for each arch

amd64 is getting crowded, if we add any more OSes then I think
just "amd64 platforms" will be enough rather than listing 5 or 6
or more platforms.
2026-01-06 20:33:16 +01:00
Paul Floyd
827a1b8c30 solaris readlinkat: check that buf is accessible for proc self path a.out 2026-01-04 10:17:15 +01:00
Paul Floyd
8d8023d107 syswrap readlink and linux readlinkat: check that buf is accessible for proc self exe case
Also update the t testcases to cover this.
2026-01-04 09:34:54 +01:00
Mark Wielaard
294742a2d9 Fix bug514094,vgtest typo in none/tests/Makefile.am 2026-01-03 22:50:28 +01:00
Paul Floyd
dae37ecd26 regtest: fix warning
Added a nice const named variable then didn't use it
2026-01-03 22:32:56 +01:00
Paul Floyd
987034c441 Regtest: add missing readlinkat_self files 2026-01-03 22:16:58 +01:00
Paul Floyd
bd9edb8fcd readlink[at] syswrap: limit copy to bufsiz when path is proc self exe 2026-01-03 21:17:00 +01:00
Paul Floyd
5c0f5e604b Bug 514094 - readlink("/proc/self/exe") overwrites buffer beyond its return value
Used the reproducer as the basis for a test on Solaris and Linux.
2026-01-03 18:52:59 +01:00
Paul Floyd
bf154d815a Solaris: set VG_(resolved_exename) in load_client()
Haven't needed it yet, but I would like to try using it in the
readlink syscall wrapper.
2026-01-03 18:24:34 +01:00
Mark Wielaard
4fa4d04a6f VEX: Fix srcdir != builddir build
commit 370531396a ("s390: Use objdump machinery to disassemble insns")
broke srcdir != builddir builds with:

../../../VEX/priv/objdump/s390-dis.c:26:10: fatal error: main_util.h: No such file or directory
   26 | #include "main_util.h"     // vex_strlen
      |          ^~~~~~~~~~~~~

This comes from including the "wrong" priv directory for main_util.h
in Makefile.vex.am. Fix this by adding -I$(srcdir)/priv. This was
always wrong but didn't cause issues till now because of the extra
objdump subdir.
2026-01-03 14:08:38 +01:00
Florian Krohm
370531396a s390: Use objdump machinery to disassemble insns
New directory VEX/priv/objdump to contain the bits and pieces
needed from binutils.

s390_disasm.c removed as the S390_DISASM machinery is no longer
needed.
host_s390_defs.c and guest_s390_toIR.c adjusted accordingly.

Part of fixing https://bugs.kde.org/show_bug.cgi?id=510840
2026-01-02 16:44:49 +00:00
Paul Floyd
3ed264869c libcfile VG_(lstat): make the #else #elif darwin
and add a proper #else with a #error, which was missing
2026-01-01 18:56:28 +01:00
Paul Floyd
aa03f7e8d1 Update AUTHORS
Add an entry for Louis Brunner describing his macOS work.
Update my own entry to match the one for the 'developers' page
on valgrind.org.
2026-01-01 09:56:54 +01:00
Florian Krohm
26a2ed8106 s390 disasm-test: Add --all-except-exrl command line option.
EX and EXRL need special scaffolding and treatment.

Part of fixing https://bugs.kde.org/show_bug.cgi?id=510840
2025-12-31 18:55:37 +00:00
Florian Krohm
7cb9b9bcfa VEX: Support %i format
Small pre-patch for objdump-based disassembly.

Part of fixing https://bugs.kde.org/show_bug.cgi?id=510840
2025-12-31 18:48:13 +00:00
Paul Floyd
b35aa82658 Regtest: use basic stderr filter for none/tests/iropt-test
This was doing no filtering. macOS needs filtering in every
directory otherwise there wioll be a failure with a diff from
dsymutil like

+--49940-- run: /usr/bin/dsymutil "./iropt-test-sec"
2025-12-28 11:34:38 +01:00
Paul Floyd
48ff6038d0 Regtest: another test that needs to increase the value for an 'unused' fd. 2025-12-27 18:56:39 +01:00
Paul Floyd
937c2e74d0 Regtest: increase the 'unused' fd value in none use_after_close
Darwin 22 dyld seems to use 9 fds. We were using 7 as the 'unused'
value but that will soon be no longer true on all platforms.
2025-12-27 18:48:28 +01:00
Florian Krohm
f0baae48d1 VEX: Add function vex_vsprintf.
Small pre-patch for objdump-based disassembly.

Part of fixing https://bugs.kde.org/show_bug.cgi?id=510840
2025-12-26 20:24:50 +00: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
cfd2926a34 Darwin memcmp redir: fix platform related issue
Replacing just _platform_memcmp results in crashes when returning
from the call. Instead on macOS 12 we need to replace the variant(s?).
2025-12-26 13:20:15 +01:00
Paul Floyd
db47a91c49 Darwin redir: add a replacement for memmem
Of course, a bit different from the existing one.
2025-12-26 10:19:53 +01:00
Alexandra Hájková
c3339bae0e Add SSE4.1 PMULLD instruction for x86 32 bit
Support pmulld (packed multiply 32-bit doubleword integers) instruction
in guest_x86_toIR.c and host_x86_isel.c. Add test function to
sse4-common.h and update none/tests/x86/sse4-x86.c to test the
instruction.

BZ: https://bugs.kde.org/show_bug.cgi?id=513475
2025-12-26 09:17:48 +01:00
Paul Floyd
a1009028c4 Regtest: add a filter for syscall -> in libc 2025-12-25 09:22:48 +01:00
Paul Floyd
af48d83637 Clean up a few loose ends from previous commit adding Darwin 21 support.
Update NEWS, one missed expected update and left over debug printfs
in a newly failing Darwin testcase.
2025-12-25 09:02:33 +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
1d48f6d4ec Darwin syswrap: 1st arg of posix_spawn can be NULL 2025-12-24 17:15:49 +01:00
Paul Floyd
68ce22acc7 DRD regtest: half fix tc22_exit_w_lock on macOS 10.15
Still has (below main) like Solaris (but unlike macOS 10.14)
2025-12-24 14:29:14 +01:00
Paul Floyd
7e77fe49cc DRD regtest: delete tc22_exit_w_lock 32bit variant, rename 64bit one
The 32bit one isn't used by FreeBSD x86. In the event that it is needed
by some platform I'll put it back.
2025-12-24 13:18:36 +01:00
Paul Floyd
ff435bb437 Darwin suppressions: add another for getaddrinfo
On macOS 10.15
2025-12-24 11:44:19 +01:00
Paul Floyd
738cb901f7 Solaris regtest: update for drd/tests/tc22_exit_w_lock
I removed -q so that the test passes with Darwin. That
only caused the test to fail on illumos. Ho hum.
2025-12-24 11:38:23 +01:00
Paul Floyd
49c4a70bb2 Darwin mmap: use ARG5 for VG_(di_notify_mmap)
The fix for bug280965 (a long long time ago) changed VG_(di_notify_mmap)
so that instead of opening a new fd to peek at the ELF header it would
reuse the same mmap fd with pread() to avoid resetting fcntl flags.
Except that the patch was applied to mmap in syswrap-generic but not
to the mmap in syswrap-darwin. So the problem remained there on Darwin
for 14 years.
2025-12-23 21:22:17 +01:00
Paul Floyd
ea251064d1 Darwin regtest: add prereq for massif/tests/pages_as_heap
Darwin has brk() but all it does is return ENOMEM.
2025-12-23 19:01:27 +01:00
Paul Floyd
6b50f48292 Darwin: revert change for async signal termination message 2025-12-23 19:00:48 +01:00
Paul Floyd
5da2908c1b Darwin regtest: one more with a sem_init prereq 2025-12-23 17:18:48 +01:00
Paul Floyd
3b4a7e565c DRD regtest: don't use -q with tc22_exit_w_lock
This seems a better fix than turning off Darwin aysync signal
termination messages.

Also I don't think that the 32bit variant is used any more.
2025-12-23 16:34:16 +01:00
Paul Floyd
46a94ba8c3 Darwin signals: don't try to check for async signals for "Process terminating" message
Darwin can't tell sync and async apart so don't bother trying.
2025-12-23 14:55:59 +01:00
Paul Floyd
c07766dbdd Darwin regtest: add a prereq for helgrind/tests/bug327548
sem_init returns ENOSYS on Darwin so use the DRD script to check
that sem_init is supported (i.e., not Darwin).
2025-12-23 14:31:02 +01:00
Paul Floyd
6f12489dbf Darwin helgrind: change api error handling for pthread_rwlock_trywrlock
This may return EDEADLK is the rwlock is already locked by the same
thread. Darwin seems to be the only OS that does this.
2025-12-23 14:29:19 +01:00
Paul Floyd
7fa0593648 Darwin regtest: update none apple-main-arg for macOS 10.14
Looks like the apple pointer to the executable name started having a prefix
starting with macOS 10.14.
2025-12-23 10:55:25 +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
19919fedef Darwin: fix x86 build on macOS 10.13 (and probably 10.14) 2025-12-23 08:27:29 +01:00
Paul Floyd
e51e4f47ff Darwin: add newline to if statements
For some reason on macOS 12 the apple pointer is wrong. It's a pain
to debug code where the if and the true statement are on the same
line.
2025-12-23 07:25:57 +01:00