16965 Commits

Author SHA1 Message Date
Paul Floyd
eaf0525704 Change nightly script to only print assembler if it is present.
On FreeBSD 'as' is part of the optional 'binutils' packkage.
By default, clang uses its built-in assembler and 'as' is not
used.
2021-10-23 09:02:58 +02:00
Paul Floyd
717a82afe0 Make the nightly conf files for FreeBSD more generic
I don't want to either rename or add new versions of these files
for every release.
2021-10-19 21:31:10 +02:00
Paul Floyd
aea6ca5ce7 Update a few FreeBSD suppressions
Make one more generic
Add one for the libc buffer used by libc++ std::cout
2021-10-19 20:03:39 +02:00
Julian Seward
3abc6d815c guest_amd64_toIR.c: use the VexAbiInfo mechanism to remove an ifdef freebsd. n-i-bz. 2021-10-19 16:19:31 +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
95468b34f1 Remove executable bits from source files (drd_main.c, pub_tool_machine.h) 2021-10-15 18:02:25 +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
ecc22f252f coregrind: Vg_FnNameKind recognize __libc_start_call_main as below main
Depending on architecture glibc has various functions that set things
up to call "main". glibc 2.34 added  __libc_start_call_main (at least
on ppc64le and s390x). Other variants recognized are __libc_start_main,
generic_start_main and variants of those names.

This fixes the massif/tests/deep-D and massif/tests/mmapunmap on ppc64le.
2021-10-13 17:13:39 +02:00
Julian Seward
eb41d3be47 Very minor updates for 3.18. 2021-10-13 17:06:10 +02:00
Mark Wielaard
d37cedc1ef NEWS: add various core changes and arm64 additions
Add demangler update, __libc_freeres not being called on fatal signal,
DWARF reader improvements, glibc 2.34 support and various new arm64
v8.2 updates.

Remove Tool Changes section, since there were no user visible
changes to the tools in 3.18.0.
2021-10-13 13:50:32 +02:00
Mark Wielaard
20abe9e148 -> 3.18.0.RC1 2021-10-12 23:57:00 +02:00
Paul Floyd
5675b90cc0 Previous fix was out by one version tag.
memalign must have been added with FreeBSD 12.2
2021-10-12 23:33:17 +02:00
Mark Wielaard
970820852e vgdb: only queue up to 64 pending signals when waiting for SIGSTOP
We should not queue infinite pending signals so we won't run out of
memory when the SIGSTOP never arrives.
2021-10-12 23:25:40 +02:00
Mark Wielaard
ef95220dda Implement BPF_MAP_LOOKUP_AND_DELETE_ELEM and BPF_MAP_FREEZE
Implement BPF_MAP_LOOKUP_AND_DELETE_ELEM (command 21) and
BPF_MAP_FREEZE (command 22) and produce a WARNING instead of a fatal
error for unrecognized BPF commands.

https://bugs.kde.org/show_bug.cgi?id=426148
2021-10-12 23:15:41 +02:00
Lubomir Rintel
a21e890f82 Add close_range(2) support
This is a system call introduced in Linux 5.9.

It's typically used to bulk-close file descriptors that a process inherited
without having desired so and doesn't want to pass them to its offspring
for security reasons. For this reason the sensible upper limit value tends
to be unknown and the users prefer to stay on the safe side by setting it
high.

This is a bit peculiar because, if unfiltered, the syscall could end up
closing descriptors Valgrind uses for its purposes, ending in no end of
mayhem and suffering.

This patch adjusts the upper bounds to a safe value and then skips over
the descriptor Valgrind uses by potentially calling the real system call
with sub-ranges that are safe to close.

The call can fail on negative ranges and bad flags -- we're dealing with
the first condition ourselves while letting the real call fail on bad
flags.

https://bugs.kde.org/show_bug.cgi?id=439090
2021-10-12 22:58:45 +02:00
Mark Wielaard
cf9ebf8313 coregrind: Don't call final_tidyup (__libc_freeres) on FatalSignal
When a program gets a fatal signal (one it doesn't handle) valgrind
terminates the program. Before termination it will try to call
final_tidyup which tries to run __libc_freeres and
__gnu_cxx::__freeres to get rid of some memory glibc or libstdc++
don't normally release.

But when the program got the fatal signal in a critical section inside
glibc it might leave the datastructures in a bad state and cause
__libc_freeres to crash.  This makes valgrind itself crash just before
producing its own error summary, making the valgrind run unusable.

A reproducer can found at
https://bugzilla.redhat.com/show_bug.cgi?id=1952836 and
https://bugzilla.redhat.com/show_bug.cgi?id=1225994#c7

This reproducer is really a worse case scenario with multiple threads
racing to get into the critical section that when interrupted will
make __libc_freeres unable to cleanup. But it seems a good policy in
general. If a program is terminated by a fatal signal instead of
normal termination, it seems not having some of the glibc/libstdc++
resource cleaned up is an expected thing.

https://bugs.kde.org/show_bug.cgi?id=443605
2021-10-12 22:48:02 +02:00
Mark Wielaard
3eba47604d filter_gdb: Handle r = SYSCALL_CANCEL as alternative for return SYSCALL_CANCEL
This happens with glibc 2.33 when debuginfo is installed.
2021-10-12 22:44:08 +02:00
Paul Floyd
79a1439786 Fix building memalign2 test on older FreeBSD 2021-10-12 21:47:45 +02:00
Mark Wielaard
0b86d267c6 filter_xml: Filter out '@*' from <fn> symbol names
With glibc 2.34 we would start seeing some function names ending in
'@*' this was already filtered out using drd/tests/filter_stderr.in
but not when using the drd xml tests. This would make
drd/tests/thread_name_xml and drd/tests/bar_bad_xml fail.

Filter this out in the memcheck/tests/filter_xml script, which is
also used by the drd test filters.

Tested against glibc 2.34, 2.33 and 2.17 on x86_64.
2021-10-12 20:01:52 +02:00
Paul Floyd
22857ddd1d filter_stderr also needs to handle FreeBSD libthr 2021-10-12 19:31:04 +02:00
Mark Wielaard
df838bccab drd/tests: Extract start_thread which can come from libpthread or libc
The drd/tests/tc21_pthonce and drd/tests/annotate_barrier tests
would fail if start_thread came from libc (as it does in glibc 2.34)
instead of from libpthread. Extract start_thread in filter_stderr.in
and update the backtraces in annotate_barrier.stderr.exp and in
tc21_pthonce.stderr.exp

Tested against glibc 2.34, 2.33 and 2.17 on x86_64.
2021-10-12 18:51:23 +02:00
Paul Floyd
2269aeb76c Dnother iteration for getting the right expected line numbers. 2021-10-11 08:16:32 +02:00
Paul Floyd
46607a76bd memalign is available on FreeBSD as a non-portable interface
Remove #if block protecting memalign calls
2021-10-10 22:15:59 +02:00
Paul Floyd
8c0f72667e Fix the ramaining easily fixable warnings with clang
There's one remaining
memalign2.c:29:9: warning: unused variable 'piece' [-Wunused-variable]
because of a block of #if FreeBSD for memalign that looks unnecessary

Otherwise all that is left is a few like

warning: unknown warning option '-Wno-alloc-size-larger-than'; did you mean '-Wno-frame-larger-than='? [-Wunknown-warning-option]

because there is no standard for compiler arguments.
2021-10-10 21:56:49 +02:00
Paul Floyd
03f1c090f6 Remove a couple more warnings
suffix rule with dependency generates a warning
https://www.gnu.org/software/make/manual/html_node/Error-Messages.html
(bottom of page)

the other is a short initialized with an int literal that wraps to
a negative short value
2021-10-10 20:32:44 +02:00
Mark Wielaard
bfd28bb9f8 Remove more warnings from tests
GCC12 catches various issues in tests at compile time that we want to
catch at runtime. Also glibc 2.34 deprecated various mallinfo related
functions. Add the relevant -Wno-foobar flags to those tests.  In one
case, unit_oset.c, the warning was correct and the uninitialized
variable was explicitly set.
2021-10-10 17:19:34 +02:00
Mark Wielaard
7b1a2b1edd Fix printf warning in libmpiwrap.c
libmpiwrap.c:1379:45: warning: format '%d' expects argument of type 'int',
but argument 5 has type 'MPI_Request' {aka 'struct ompi_request_t *'}

Unfortunately MPI_Request is an opaque type (we don't really know what
is in struct ompi_request_t) so we cannot simply print it as int. In
other places we print an MPI_Request as 0x%lx by casting it to an
unsigned long. Do the same here.
2021-10-10 16:38:24 +02:00
Mark Wielaard
4015813336 Remove some warnings from tests
Various tests do things which we want to detect at runtime, like
ignoring the result of malloc or doing a deliberate impossibly large
allocation or operations that would result in overflowing or
truncated strings, that generate a warning from gcc.

In once case, mq_setattr called with new and old attrs overlapping,
this was explicitly fixed, in others -Wno-foobar was added to silence
the warning. This is safe even for older gcc, since a compiler will
ignore any -Wno-foobar they don't know about - since they do know they
won't warn for foobar.
2021-10-10 15:56:50 +02:00
Paul Floyd
d187106a76 Updating a few expecteds based on valgrind-testresults
I tried to work out what the expecteds should be based on the changes to
the testcase source so there may be a bit more to do.
2021-10-10 12:03:38 +02:00
Paul Floyd
1c57706fbd Bug 443314 - In the latest GIT version, Valgrind with "--trace-flags" crashes at "al" register 2021-10-09 23:02:28 +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
80459895c4 FreeBSD support, last loose ends
One merge I missed and make a couple of changes to remove
compiler warnings.
2021-10-09 15:13:50 +02:00
Paul Floyd
68bb7c063f FreeBSD support, patch 12
coregrind modified files
2021-10-09 15:01:08 +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
1bbd829adb FreeBSD support, patch 10
Missing new expected file
2021-10-09 12:51:41 +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
3c53eea626 Add copyright statements to added FreeBSD headers 2021-10-08 22:08:12 +02:00
Paul Floyd
a456fcef6d FreeBSD support, patch 9 supplemental
These files are now derived objects and should have been removed in the
previous change.
2021-10-07 23:02:29 +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
3d25fd4a6c FreeBSD support, patch 8b
nightly directory
2021-10-07 21:39:25 +02:00
Paul Floyd
85bbe2853e FreeBSD support, patch 5
drd and helgrind tests
2021-10-07 21:33:45 +02:00
Mark Wielaard
f22758d6da Fix make distcheck by removing references to uncommitted files
Some files for the freebsd port have not yet committed, but were
already referenced in the Makefiles. Remove those references for
now to make distcheck happy.

	* coregrind/Makefile.am (valgrind_SOURCES): Remove
	launcher-freebsd.c
	* drd/tests/Makefile.am (check_PROGRAMS): Remove
	thread_name_freebsd.
	* none/tests/Makefile.am (SUBDIRS): Remove freebsd.
	(DIST_SUBDIRS): Likewise.
	* none/tests/freebsd/filter_stderr: Removed.
2021-10-07 13:43:19 +02:00
Paul Floyd
a6096335c3 FreeBSD support, patch 8a
docs directory
2021-10-07 08:30:33 +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
Paul Floyd
e207312100 FreeBSD support, patch 5
helgrind code
Mainly intercepts and changes to conditional compilation
2021-10-06 22:17:18 +02:00
Paul Floyd
7074904a37 FreeBSD support, patch 4
DRD code
Mainly just intercepts, but also a hairy fix for early acces to
pthread_self()
2021-10-06 21:50:49 +02:00
Paul Floyd
7774acbc9c FreeBSD support, patch 3
include directory
New FreeBSD specific headers
SONAMES for FreeBSD libraries
2021-10-06 21:24:17 +02:00
Paul Floyd
33012dd82b FreeBSD support, patch 1
Primarily these changes concern the nature of alignment generated signals. On Linux, these produce SIGSEGV and n FreeBSD they produce SIGBUS.
2021-10-05 13:02:27 +02:00