17287 Commits

Author SHA1 Message Date
Paul Floyd
4c80a467a9 FreeBSD: fix internal sysctlbyname
I used the libc interface rather than the syscall interface.
The syscall also has the name length which libc adds.
2023-02-03 13:51:04 +01:00
Paul Floyd
cdabd4ba74 Regtest: foix warning from drd test pth_mutex_signal.c
GCC on RHEL 7.6 ARM complains about the empty init list.

I also noticed that we are using the SA_NOTIFY form of sigaction
(with that union member and handler prototype) but not setting the
SA_NOTIFY flag. Seems harmless in this case as we don't use
the siginfo or context.
2023-02-03 13:48:22 +01:00
Paul Floyd
7003f40be9 FreeBSD: improve internal syscallbyname
Post FreeBSD 12.2 this is a syscall that does everything
(rather than needing an undocumented syscall).
2023-02-02 22:06:38 +01:00
Paul Floyd
a8e350c6d1 GDB regtest: add filter for gdb python load, RHEL 7.4 ARM 2023-02-02 21:51:21 +01:00
Mark Wielaard
e4c5c764e8 Add valgrind-monitor[-def].py to EXTRA_DIST
So as to make sure these get copied into the tarball.
Fixes make distcheck.
2023-02-01 23:53:17 +01:00
Paul Floyd
fd7daaa5e0 FreeBSD: cleanup launcher
cppcheck spotted a bug in the skipping of whitespace between shebang
and interpreter command. This could potentially cause the platform
to be misidentified (for x86 on amd64).
2023-02-01 21:45:46 +01:00
Paul Floyd
bca6837b15 Pack Lackey Event structure
Seen by cppcheck. Will reduced size from 4 to 3 words on 64bit platforms.
2023-02-01 21:44:31 +01:00
Paul Floyd
b1aba91160 FreeBSD: cleanup and refactor syscalls readlink and readlinkat
There was some code to handle /proc/curproc/file (a symlink to
the exe that wee need to bodge as it refers to the tool exe).
But it was neither tested nor working.

Can't use the same technique as Linux and Solaris which have more
complete /proc filesystems where each pid has symlinks for
each open file, which we use for the guest. Instead need to
copy the path ourselves. So move sys_readlink out of generic.

Simplify the handling of the resolved guest exe name - store it in
a global like VG_(args_the_exename).
2023-01-31 21:52:36 +01:00
Paul Floyd
a4e5942b32 Remove warning caused by D demangle testcase 2023-01-30 21:13:13 +01:00
Mark Wielaard
42d35e6d2a bug464969_d_demangle.cpp: Always print "Xa"
bug464969_d_demangle depends on producing an error about an
uninitialized variable. But it prints something different
to stdout based on the value of that variable. Which can
produce failures. Make sure to always print the same thing
to stdout.
2023-01-30 10:27:35 +01:00
Bart Van Assche
4978c9f657 drd/tests/pth_mutex_signal: Port to Darwin
This patch includes a revert of commit 2e873534bb49 ("macOS: drd
pth_mutex_signal test doesn't build").
2023-01-29 15:26:11 -08:00
Paul Floyd
82282a6676 Bug 464969 - D language demangling
Patch from witold.baryluk@gmail.com

(also added a testcase)
2023-01-29 22:07:52 +01:00
Paul Floyd
2e873534bb macOS: drd pth_mutex_signal test doesn't build
pth_mutex_signal.c:50:13: error: use of undeclared identifier 'SIGRTMAX'
  sigaction(NATIVE_IO_INTERRUPT_SIGNAL, &signalAction, NULL);

Put this target under a condition for the moment.
2023-01-29 18:00:59 +01:00
Paul Floyd
44a6e87492 Compiler warning expansion to defined
Clang doesn't like
m_debuginfo/tinfl.c:182:45: warning: macro expansion producing 'defined' has undefined behavior [-Wexpansion-to-defined]
2023-01-29 17:49:11 +01:00
Paul Floyd
ea733f262e macOS: Try to fix build, doesn't like .debug_gdb_scripts 2023-01-29 17:35:08 +01:00
Paul Floyd
a1f3651505 Remove one lingering trace of tilegx 2023-01-28 22:08:29 +01:00
Mark Wielaard
3155bacf26 tsan_thread_wrappers_pthread.h: Only include cstdint for C++11
Fixes build on older g++.
2023-01-28 21:54:03 +01:00
Mark Wielaard
092d908544 configure.ac: Update AC_PROG_CC checks
AM_PROG_CC_C_O has been obsolete since automake 1.14.
AC_PROG_CC does the same check. With autoconf 2.70 we
must use AC_PROG_CC (which will check for c11 and c99),
for earlier versions we'll use AC_PROG_CC_C99.
2023-01-28 21:11:38 +01:00
Paul Floyd
45c61d598f Illumos: regtest filters and gitignore
Filter for the gdb python autoload warnings
Filter for another variation of shell abort messages
2023-01-28 18:27:16 +01:00
Paul Floyd
cbba7f699a Regtest: broaden suppression for helgrind bug 392331
Inlining differences on different Linux platforms.
2023-01-27 20:00:26 +01:00
Paul Floyd
f7e4bb4af2 Bug 382034 - Testcases build fixes for musl 2023-01-27 08:42:06 +01:00
Paul Floyd
dee222c6e8 Bug 464859 - Build failures with GCC-13 (drd tsan_unittest)
Patch submitted by
	Khem Raj <raj.khem@gmail.com>
2023-01-27 08:30:41 +01:00
Paul Floyd
57c1641d04 Linux regtest: some extra filtering for helgrind bug392331
Was failing on rhel 7.6
2023-01-27 08:22:19 +01:00
Paul Floyd
0df691f9d9 Linux regtest: forgot prereq test for scalar_openat2 2023-01-27 07:40:31 +01:00
Paul Floyd
5830ece5cd FreeBSD: update comment about __sysctlbyname and kern.proc.pathname 2023-01-25 08:31:09 +01:00
Paul Floyd
e2eeebafa6 FreeBSD: fix compile of auxv on FreeBSD 12 2023-01-24 22:00:44 +01:00
Paul Floyd
e56436d560 FreeBSD: fix build on older OSes
A bad copy-and-paste broke compilation on FreeBSD 12.
2023-01-24 21:54:09 +01:00
Paul Floyd
8dba06c771 FreeBSD: remove different reserved fds number
No idea where it originated. Causes no problems on
FreeBSD 13.1 amd64.
2023-01-24 21:03:48 +01:00
Paul Floyd
7886c072e1 FreeBSD: switch to FreeBSD 12 versions of syscalls for fstat etc
This was a change that enabled 64bit inodes (ino64).

Also a couple of typos in READMEs.
2023-01-24 20:41:15 +01:00
Paul Floyd
5a6f1c1322 Bug 435441 - valgrind fails to interpose malloc on musl 1.2.2 due to weak symbol name and no libc soname
Patch by Michael Forney <mforney@mforney.org>
2023-01-23 09:05:50 +01:00
Paul Floyd
7f95310985 FreeBSD: More details on interrupting vgdb and correct 1 typo. 2023-01-23 07:27:55 +01:00
Paul Floyd
c15993dcb4 FreeBSD: start adding more checks for /proc
Also add a couple of expecteds.
2023-01-22 21:48:51 +01:00
Paul Floyd
f7983be3f2 FreeBSD: improve auxv filter
Didn't work id the clone directory isn't 'valgrind'
2023-01-22 09:41:49 +01:00
Paul Floyd
a526bbd051 FreeBSD: Fix auxv AT_EXECPATH
This was being copied from the host. Now it's synthesized for
the guest. Also improve the none/freebsd/auxv test to
print a few of the strings in auxv (but not the envp ones).
2023-01-21 20:49:30 +01:00
Paul Floyd
2b1c6db9c8 Two more debuginfo.c typos 2023-01-21 18:09:47 +01:00
Paul Floyd
5d38764204 Bug 464476 - Firefox fails to start under Valgrind
On FreeBSD, Firefox uses the kern.proc.pathname.PID sysctl
to get the binary path (where PID can be the actual pid
or -1). The user path is /usr/local/bin/firefox which is
a symlink to /usr/local/lib/firefox/firefox.

This was failing because we were not handling this MIB.
That meant that the sysctl returned the path for the
binary of the running tool (e.g.,
/home/paulf/scratch/valgrind/memcheck/memcheck-amd64-freebsd).
Firefox looks for files in the same directory.
Since it was the wrong directory it failed to find them and
exited.

I also noticed a lot of _umtx_op errors. On analysis they
are spurious. The wake ops take an "obj" argument, a pointer
to a variable. They only use the address as a key for
lookups and don't read the contents.
2023-01-21 17:55:09 +01:00
Paul Floyd
ded1adc432 FreeBSD: small change for pthread mutex types
It seems what is 'normal' and 'default' is not
portable.

And a bit more debuginfo mmap comment fixing
2023-01-21 13:51:50 +01:00
Paul Floyd
6d8ea1bd86 Cleanup mmap comments in debuginfo.c 2023-01-21 13:34:47 +01:00
Mark Wielaard
fdda0bece6 m_debuginfo: Suppress warning about not handling entry_value ops
The warning: evaluate_Dwarf3_Expr: unhandled DW_OP_ 0xf3 isn't
very helpful. This means we didn't handle DW_OP_GNU_entry_value.

DW_OP_GNU_entry_value (or DWARF5 DW_OP_entry_value) means interpreting
the given DWARF expression using register values as they were upon
entering the function. Which is non-trivial to implement.

We can fail the evaluation of the DWARF expression without warning
about it by default, since it isn't really needed for any current
valgrind functionality (and it is only done with --read-var-info=yes.
2023-01-15 14:24:31 +01:00
Paul Floyd
cae2118d95 FreeBSD: some _umtx_op corrections
mutex trylock doesn't user timer arguments
plain mutex lock doesn't need restart

still not sure about mutex trylock
2023-01-15 09:05:55 +01:00
Paul Floyd
30cdbfbb2c FreeBSD: some more clangd refactoring 2023-01-15 07:20:08 +01:00
Paul Floyd
3c9cb7a711 Remove execute bit from drd tests std_string.cpp 2023-01-14 16:24:00 +01:00
Paul Floyd
ed73978bdb Update wrong expecteds for Bug 241072 2023-01-12 08:00:27 +01:00
Paul Floyd
8fcc813468 Bug 241072 List tools in --help output 2023-01-11 21:42:41 +01:00
Andreas Arnez
4f4cd4b8d5 s390: Add z16 support to ecag testcase
The testcase 'none/tests/s390x/ecag' requires expected output from any
machine it runs on.  This is missing for z16, so add it.
2023-01-11 16:44:38 +01:00
Andreas Arnez
d6073d34d4 s390: Add test for short/extended vector float insns
Several issues with vector floating point instructions have gone unnoticed
due to a lack of test coverage in this area.  Add a test case that
improves the coverage, particuarly when dealing with short and extended
floating point formats.
2023-01-11 16:44:38 +01:00
Andreas Arnez
1b8dcec1b4 s390: Stop CC clobbering by VFMIN and VFMAX
Valgrind's implementation of the VFMIN and VFMAX instructions clobbers the
condition code, which is wrong.  Stop doing that.
2023-01-11 16:44:38 +01:00
Andreas Arnez
73ab2978f8 s390: Un-swap implementations of VFCH and VFCHE
When running under Valgrind, the VFCH instruction behaves like VFCHE, and
vice versa.  Fix this.
2023-01-11 16:44:38 +01:00
Andreas Arnez
e05f55c77c s390: Fix VFMA, VFMS, VFNMA, and VFNMS for 128-bit FP
When trying to execute any of the vector float multiply-and-add family
instructions, Valgrind panics with the message "Iex_Qop with F128 data".

So far all F128 operations were implemented with instructions that operate
on FP register pairs.  However, such instructions don't exist for
Iop_MAddF128 and Iop_MSubF128, so they must be implemented with vector
instructions instead.  This was missed when emitting them in
"guest_s390_toIR.c".

Add the missing support.  This also involves adding a few new features to
host_s390_defs:

* a new vector operation S390_VEC_INIT_FROM_FPRS

* the capability to move the left half of a VR to an FPR

* S390_VEC_FLOAT_MADD/_MSUB for 128-bit sizes
2023-01-11 16:44:38 +01:00
Andreas Arnez
6da4025b59 Bug 460356 -- s390: Fix code generation for Iop_Sqrt32Fx4
There is no instruction selector for Iop_Sqrt32Fx4, leading to Valgrind
panicking with the message:

   s390_isel_vec_expr: cannot reduce tree

Fix this.
2023-01-11 16:44:38 +01:00