240 Commits

Author SHA1 Message Date
Paul Floyd
0ae17c117e FreeBSD: auxv changes for FreeBSD 13.2 2023-04-13 22:45:46 +02:00
Paul Floyd
ab6d3928a5 regtest: warning cleanup
All for clang and mostly Apple clang
There are still numerous deprecated warnings on macOS 10.13
(sem* functions, syscall, sbrk, i386, PIEi, OSSpinLocki, swapcontext, getcontext)
2023-04-10 10:33:54 +02:00
Nicholas Nethercote
551874920f Rewrite cg_merge in Python.
It's currently written in C, but `cg_annotate` and `cg_diff` are written in
Python. It's better to have them all in the same language.

The good news is that the Python code is 4.5x shorter than the C code.
The bad news is that the Python code is roughly 3x slower than the C
code. But `cg_merge` isn't used that often, so I think it's a reasonable
trade-off.
2023-03-28 14:54:27 +11:00
Paul Floyd
2fa68c1cc7 auxchecks: fix building on FreeBSD
FreeBSD has a sha256sum that doesn't take long args (--check)
GNU sha256sum exists as gsha256sum so add a check for that to
configure.ac
2023-03-07 23:49:22 +01:00
Paul Floyd
a6101db692 Try to correct configure script for warning flags with values
Some -W flags come with and without an =
(usually for warning levels)
But some only have the form -Wfoo=42 and -Wno-foo
2023-02-21 22:05:13 +01:00
Paul Floyd
fe008c8739 regtest: remove compiler warnings with clang 2023-02-19 10:10:59 +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
36b9fea113 Linux regtest: openat2 not available on older systems
The x86-linux/scalar testcase fas failing to compile.
So split out openat2 into a separate test with a condfigure test.
2023-01-10 21:00:22 +01:00
Paul Floyd
99dfad28a5 Cleanup warnings
Now no warnings on Fedora 36
For a short while
2023-01-09 23:57:01 +01:00
Paul Floyd
1cea0e151b Cleanup of warnings, mostly -Wno-unused-but-set-variable 2023-01-08 17:51:37 +01:00
Paul Floyd
4dcfc05c20 Fixes related to Bug 392331
1. Added C++17 check to configure.ac
2. Needed Linux version of suppression
3. Added a filter for pthread_cond_signal
2022-12-26 09:04:17 +01:00
Paul Floyd
316282cd3b Bug 463027 - broken check for MPX instruction support in assembler 2022-12-23 14:49:39 +01:00
Paul Floyd
4ff2185f45 FreeBSD: remove dependency on elf header and make VKI_ copies of AT defines
Also prepare NEWS and configure.ac for 3.21.0
2022-10-28 16:52:50 +02:00
Mark Wielaard
5147d671e4 -> 3.20.0 final 2022-10-24 13:59:17 +02:00
Mark Wielaard
b112a9b37a Set version to 3.20.0-RC1 and update NEWS 2022-10-20 01:40:12 +02:00
Paul Floyd
4fb52a67b5 Cleanup of str* and mem* functions
Add function checks to configure.ac
Use the configure HAVE_ macro rather than OS-dependent tests.
I suspect that a lot of the tests hve been obsolete for many
years. Add wrappers to FreeBSD.
:w
2022-06-01 22:09:50 +02:00
Paul Floyd
8187a60ac3 Add a configure test for -ansi and use it for none/tests/ansi 2022-04-19 22:21:37 +02:00
Dario Binacchi
9c9fd9ae24 coregrind: fix compilation for uclibc
It fixes a known iusse whose details are described at [1] and more
generally it guarantees that Valgrind is properly compiled for ulibc.

[1] https://www.mail-archive.com/valgrind-users@lists.sourceforge.net/msg05295.html

Suggested-by Michael Trimarchi <michael@amarulasolutions.com>
Co-developed-by: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
2022-04-19 10:44:07 +02:00
Mark Wielaard
9fd4181b0e Set version to 3.20.0.GIT 2022-04-13 00:34:39 +02:00
Paul Floyd
3e7774ea5a Bug 452274 memcheck crashes with Assertion 'sci->status.what == SsIdle' failed
FreeBSD (and Darwin) use the carry flag for syscall syscall status.
That means that in the assembler for do_syscall_for_client_WRK
they have a call to LibVEX_GuestAMD64_put_rflag_c (amd64) or
LibVEX_GuestX86_put_eflag_c (x86). These also call WRK functions.

The problem is that do_syscall_for_client_WRK has carefully crafted
labels correspinding to IP addresses. If a signal interrupts
processdings, IP can be compared to these addresses so that
VG_(fixup_guest_state_after_syscall_interrupted) can work
out how to resume the syscall. But if IP is in the save
carry flag functions, the address is not recognized and
VG_(fixup_guest_state_after_syscall_interrupted) fails.

The crash in the title happens because the interrupted
syscall does not reset its status, and on the next syscall
it is expected that the status be idle.

To fix this I added global variables that get set to 1
just before calling the save carry flag functions, and cleared
just after. VG_(fixup_guest_state_after_syscall_interrupted)
can then check this and work out which section we are in
and resume the syscall correctly.

Also:

Start a new NEWS section for 3.20

Add a regtest for this and also a similar one for Bug 445032
(x86-freebsd only, new subdir).

I saw that this problem also probably exists with macOS, so I made
the same changes there (not yet tested)
2022-04-12 23:50:48 +02:00
Paul Floyd
68ac5ca0ea Fix building on macOS
Adds a feature check for clockid_t

Also fix a typo in a macro affecting pthread_mutex_clocklock on Linux.
2022-04-11 22:32:45 +02:00
Mark Wielaard
8d3c8034b8 -> 3.19.0 final. 2022-04-11 15:29:18 +02:00
Mark Wielaard
116b93b490 -> 3.19.0.RC2 2022-04-09 02:13:46 +02:00
Randy MacLeod
2c0fb66569 Fix out of tree builds.
The paths to these files need to be fully specified in
the out of tree build case. glibc-2.X.supp is a generated file so the
full path is deliberately not specified in that case.

Also adjust the mpi include dir location as valgrind.h is
generated as well and needs to be taken out of build dir.

Also adjust the location of generated xml file. And the search paths
for the xmllint, xsltproc and xmlto programs.

Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
2022-04-07 23:44:02 +02:00
Paul Floyd
bbc3bcab0a Bug 451843 - valgrind fails to start on a FreeBSD system which enforces W^X
Also add FreeBSD 13.1 to configure.ac
2022-04-03 15:50:38 +02:00
Mark Wielaard
25c406975b 3.19.0-RC1 Add some NEWS entries 2022-04-02 19:13:12 +02:00
Mark Wielaard
ff84a3542e configure.ac: AC_HEADER_TIME is deprecated just check for sys/time.h
AC_HEADER_TIME is deprecated and checks for various things, like
whether you can include both time.h and sys/time.h together. Which
is fine on all systems these days. Just check whether sys/time.h
is available. HAVE_SYS_TIME_H is used once in the code base in the
timerfd-syscall.c testcase. So even this limited check might be
overkill.
2022-04-01 17:28:24 +02:00
Paul Floyd
bb178889c7 Bug 446823 FreeBSD - missing syscalls when using libzm4
Adds syscall wrappers for __specialfd and __realpathat.
Also remove kernel dependency on COMPAT_FREEBSD10.

This change also reorganizes somewhat the scalar test
and adds configure time checks for the FreeBSD version,
allowing regression tests to be compiled depending on the
FreeBSD release.

From now on, scalar.c will contain syscalls for FreeBSD 11 and 12
and subsequent releases will get their own scalar, starting with
scalar_13_plus.c.
2021-12-11 12:32:08 +01:00
Paul Floyd
c2607e093c Bug 446139 DRD/Helgrind with std::shared_timed_mutex::try_lock_until and try_lock_shared_until false positives
also
Bug 446138 DRD/Helgrind with std::timed_mutex::try_lock_until false positives
2021-12-02 00:03:27 +01:00
Paul Floyd
e484eee0bd Bug 445300 [PATCH] Fix building tests with Musl
Patch contributed by
   Alyssa Ross <hi@alyssa.is>
2021-11-22 08:42:53 +01:00
Paul Floyd
9abfed23c0 Bug 445504 Using C++ condition_variable results in bogus "mutex is locked simultaneously by two threads" warning(edit)
Add intercepts for pthread_cond_clockwait to DRD and Helgrind
Also testcase from bugzilla done by Bart, with configure check
2021-11-19 08:34:53 +01:00
Mark Wielaard
0cf05f82d4 Set version to 3.19.0.GIT in configure.ac
And update docs/internals/release-HOWTO.txt.
2021-10-28 14:10:56 +02:00
Mark Wielaard
5aca524f5a Set version once in configure.ac, use in valgrind.h andvg-entities.xml
Currently the version is updated in 3 places, configure.ac,
include/valgrind.h and docs/xml/vg-entities.xml. This goes wrong from
time to time. So only define the version (and release date) once in
configure.ac and update both other places at configure time.
2021-10-17 23:14:50 +02:00
Mark Wielaard
42b08ed5bd -> 3.18.1 final
Now with __VALGRIND_MINOR__ set to 18 in include/valgrind.h
2021-10-15 14:23:59 +02:00
Mark Wielaard
048e16ea5a -> 3.18.0 final 2021-10-15 13:11:34 +02:00
Mark Wielaard
20abe9e148 -> 3.18.0.RC1 2021-10-12 23:57:00 +02:00
Paul Floyd
c3002642d3 Bug 439326 - Valgrind 3.17.0 won't compile with Intel 2021 oneAPI compilers
Also reorder NEWS
2021-10-09 21:25:22 +02:00
Paul Floyd
e2e5d75f5c FreeBSD support, patch 11
coregrind added files
the key mechanics and the syscall wrappers
2021-10-09 14:11:48 +02:00
Paul Floyd
7c5d720a2b FreeBSD support, patch 10
memcheck
No code changes. A few modified tests. Adds new FreeBSD specific tests.
2021-10-09 12:37:17 +02:00
Paul Floyd
53dd9bd255 FreeBSD support, patch 9
cachegrind callgrind dhat exp-bbv gdbserver_tests massif none mpi shared

Mostly these are just updates (and new testcases) under new/tests
The other directories have just #ifdef changes
2021-10-07 22:41:22 +02:00
Paul Floyd
85bbe2853e FreeBSD support, patch 5
drd and helgrind tests
2021-10-07 21:33:45 +02:00
Paul Floyd
e2583c02a5 FreeBSD support, patch 2
Files in the root directory
Several Makefile.am files that have dependencies on FreeBSD autoconf
variables. Included a few new filter files to act as placeholders
to create new freebsd subdirectories.

Updated NEWS with the FreeBSD bugzilla items plus a couple of other
items fixed indirectly.
2021-10-07 08:18:47 +02:00
Paul Floyd
b128b20e66 FreeBSD support, patch 7
tests directory
configure.ac to generate tests/filter_discards and tests/filter_stderr_basic
.gitignore to ignore these generated filters
2021-10-06 22:58:15 +02:00
Carl Love
518a2d59ac Fix dfp tests.
Due to changes between the compiler and linker, we need to add .machine
arguments to configure file to properly detect the availability of the
dfp instructions.

Add print statement if HAS_DFP is not enabled to make it
easier to determine when HAS_DFP is not enabled.
2021-09-30 17:30:13 -05:00
Carl Love
475916cbd3 Add .machine directives for the darn instruction 2021-09-30 17:30:09 -05:00
Carl Love
e23c2a2291 Fixes to add .machine directives for assembly instructions 2021-09-30 17:30:05 -05:00
carl love
a9b5f6cfeb Configure,makefile and test case fixes for older powerpc targets.
Assorted changes to fix up compile issues as seen during regression
testing of VG on hardware back as far as Power 6 (ISA 2.05).
2021-09-30 17:29:54 -05:00
Andreas Arnez
724460764d configure.ac: Avoid the use of "which"
The "which" command is not always installed, but configure.ac uses it in
the function AC_HWCAP_CONTAINS_FLAG to force invocation of the executable
"true" rather than the shell builtin with the same name.  (The point here
is to get LD_SHOW_AUXV=1 evaluated by the dynamic loader.)

Another option might be to hard-wire the location /bin/true, because the
filesystem hierarchy standard requires it to be there.  However, the FHS
doesn't apply to BSDs and at least some FreeBSD versions do not stick to
that specific rule.

On the other hand, the "env" command seems to be available on all relevant
platforms, so use that instead.
2021-09-30 16:28:49 +02:00
Mark Wielaard
a1364805fc Update helgrind and drd suppression libc and libpthread paths in glibc 2.34
glibc 2.34 moved all pthread functions into the main libc library.
And it changed the (in memory) path of the main libc library to
libc.so.6 (before it was libc-2.xx.so).

This breaks various standard suppressions for helgrind and drd.
Fix this by doing a configure check for whether we are using glibc
2.34 by checking whether pthread_create is in libc instead of in
libpthread. If we are using glibc then define GLIBC_LIBC_PATH and
GLIBC_LIBPTHREAD_PATH variables that point to the (regexp) path
of the library that contains all libc functions and pthread functions
(which will be the same path for glibc 2.34+).

Rename glibc-2.34567-NPTL-helgrind.supp to glibc-2.X-helgrind.supp.in
and glibc-2.X-drd.supp to glibc-2.X-drd.supp.in and replace the
GLIBC_LIBC_PATH and GLIBC_LIBPTHREAD_PATH at configure time.

The same could be done for the glibc-2.X.supp.in file, but hasn't
yet because it looks like most suppressions in that file are obsolete.
2021-07-21 18:31:26 +02:00
Michael Forney
b7634ed3e4 configure.ac: Fix portability of test(1) expression for C99 support
The == operator is non-standard, use = instead.

[ bvanassche: added "configure.ac: " prefix in front of patch subject ]
2021-05-13 20:16:49 -07:00