]> git.ipfire.org Git - thirdparty/valgrind.git/log
thirdparty/valgrind.git
3 years agoBug 444552 - s390x: Fix sys_ipc semtimedop syscall
Andreas Arnez [Wed, 5 Jan 2022 18:49:19 +0000 (19:49 +0100)] 
Bug 444552 - s390x: Fix sys_ipc semtimedop syscall

On s390x Linux platforms the sys_ipc semtimedop call has four instead of
five parameters, where the timeout is passed in the third instead of the
fifth.

Reflect this difference in the handling of VKI_SEMTIMEDOP.

3 years agoNEWS: Add bug 445916 Demangle Rust v0 symbols with .llvm suffix
Mark Wielaard [Thu, 17 Feb 2022 23:07:44 +0000 (00:07 +0100)] 
NEWS: Add bug 445916 Demangle Rust v0 symbols with .llvm suffix

3 years agoUpdate libiberty demangler
Mark Wielaard [Thu, 17 Feb 2022 17:35:38 +0000 (18:35 +0100)] 
Update libiberty demangler

Update the libiberty demangler using the auxprogs/update-demangler
script to gcc git commit d3b2ead595467166c849950ecd3710501a5094d9.

This update includes:

- libiberty rust-demangle, ignore .suffix
- libiberty: Fix infinite recursion in rust demangler
- Update copyright years
- libiberty: support digits in cpp mangled clone names
- d-demangle: properly skip anonymous symbols
- d-demangle: remove parenthesis where it is not needed

3 years agonone/tests/amd64/avx_estimate_insn.vgtest fails on AMD processors
Mark Wielaard [Tue, 8 Feb 2022 12:12:46 +0000 (13:12 +0100)] 
none/tests/amd64/avx_estimate_insn.vgtest fails on AMD processors

commit ef9ac3aa0fd3ed41d74707ffe49abe9ad2797ddd
"fix avx-1 amd64 test" split off the estimate instructions
into their own testcase avx_estimate_insn.

The commit message suggested that two .exp files would be
added, one for the intel and one for the amd cases.

It seems the .exp-amd variant was forgotten. This commit
adds it.

https://bugs.kde.org/show_bug.cgi?id=413330

3 years agoAdd power_ISA2_05.stdout.exp_Without_FPPO_2 to EXTRA_DIST
Mark Wielaard [Wed, 16 Feb 2022 22:03:00 +0000 (23:03 +0100)] 
Add power_ISA2_05.stdout.exp_Without_FPPO_2 to EXTRA_DIST

3 years agoPowerpc: Additional expected output for memcheck/tests/ppc64/power_ISA2_05 test.
Carl Love [Mon, 14 Feb 2022 17:26:50 +0000 (17:26 +0000)] 
Powerpc: Additional expected output for memcheck/tests/ppc64/power_ISA2_05 test.

Latest compiler is generating slightly different effective address.

3 years agoarm64: Mismatch detected between RDMA and atomics features
Mark Wielaard [Fri, 11 Feb 2022 16:50:47 +0000 (17:50 +0100)] 
arm64: Mismatch detected between RDMA and atomics features

check_hwcaps contains code that tries to enforce Arm architecture's
rules for the support of features (FEAT_) on v8.1. Specifically for
v8.1 FEAT_RDM and FEAT_LSE (named FEAT_ATOMICS in Valgrind) are
mandatory.

But an v8.x implementation can implement any of the v8.{x+1}
features, or not, as it chooses. Also under QEMU, which tends
to implement features on an "as-demanded" basis, you sometimes
end up with an odd combination of features, which does not
strictly comply with the architecture.

So ignore the "v8.x" architecture levels, and look only only at
"is feature X present or not". Unless the features are really not
independent.

https://bugs.kde.org/show_bug.cgi?id=449494

3 years agoPowerpc: Update ACC support to reflect being mapped over vsr registers
Carl Love [Tue, 8 Feb 2022 23:52:33 +0000 (17:52 -0600)] 
Powerpc: Update ACC support to reflect being mapped over vsr registers

The ISA 3.1 implemention provides the effect of ACC and VSRs
logically containing the same data.    Future versions of the
hardware may define new state or redefine the backing state
of the registers.

This reworks the code to support the ACC as implemented as a logical
mapping over the VSR registers, and lays groundwork for a future
implementation utilizing a separate register file.  There
is a single boolean variable, ACC_mapped_on_VSR, that can be set in
disInstr_PPC_WRK(), based on the ISA being used, to select which
implementation model to use.

3 years agoPowerpc: Fix typo in assembly code specification.
Carl Love [Thu, 10 Feb 2022 17:01:06 +0000 (12:01 -0500)] 
Powerpc: Fix typo in assembly code specification.

The extra 0 results in an assebler error:
    Error: junk at end of line, first unrecognized character is `x'

3 years agoAdd missing \n in debug printing. No end-user functional change.
Julian Seward [Thu, 10 Feb 2022 04:33:38 +0000 (05:33 +0100)] 
Add missing \n in debug printing.  No end-user functional change.

3 years agoDo not try to record fd name for io_uring_setup
Mark Wielaard [Wed, 9 Feb 2022 22:37:53 +0000 (23:37 +0100)] 
Do not try to record fd name for io_uring_setup

In POST(sys_io_uring_setup) we tried to use record_fd_open_with_given_name
with ARG1 as name. But ARG1 isn't a char pointer. So this might crash with
--track-fds=yes. Since no (file) name is associated with the fd returned by
io_uring_setup use record_fd_open_nameless instead.

https://bugs.kde.org/show_bug.cgi?id=449838

3 years agos390: Fix VFLRX and WFLRX instructions
Andreas Arnez [Mon, 3 Jan 2022 17:15:05 +0000 (18:15 +0100)] 
s390: Fix VFLRX and WFLRX instructions

Due to a typo in s390_irgen_VFLR, the VFLR instruction behaves incorrectly
when its m3 field contains 4, meaning extended format.  In that case VFLR
is also written as VFLRX (or WFLRX) and supposed to round down from the
extended 128-bit format to the long 64-bit format.  However, the typo
checks for m3 == 2 instead, so the value of 4 is unhandled, causing
Valgrind to throw a specification exception.

This fixes the typo.

3 years agoppc64 --track-origins=yes failure because of bad cmov addHRegUse
Mark Wielaard [Tue, 8 Feb 2022 15:36:08 +0000 (16:36 +0100)] 
ppc64 --track-origins=yes failure because of bad cmov addHRegUse

For Pin_CMov getRegUsage_PPCInstr called addHRegUse for the dst
register with HRmWrite, but since this is a conditional move the
register could be both read and written (read + write = modify).
This matches the dst of Pin_FpCMov and Pin_AvCMov.

In a very rare case, and only with --track-origins=yes, this
could cause bad code generation.

This is slightly amazing, this code is from 2005 and as far as
I know we never seen an issue with --track-origins=yes on power
before. And I have been unable to come up simple reproducer.

https://bugs.kde.org/show_bug.cgi?id=449672

3 years agoPowerpc test_isa_3_1_VRT fix
Carl Love [Tue, 1 Feb 2022 21:22:37 +0000 (21:22 +0000)] 
Powerpc test_isa_3_1_VRT fix

The vcmpequq, vcmpgtsq, vcmpgtuq test cases for the dotted versions of the
instructions were issuing the non-dotted instruction.

This patch fixes the issues and updates the expected output.

Note, the issue exposed a bug in the VEX/priv/guest_ppc_toIR.c handling of
the instructions.  That fix is in a separate patch.

3 years agoFix setting condition code for Vector Compare quad word instructions.
Carl Love [Tue, 1 Feb 2022 21:29:30 +0000 (21:29 +0000)] 
Fix setting condition code for Vector Compare quad word instructions.

The vcmpgtsq., vcmpgtuq,, vcmpequq. instructions set the condition code field
6 to 0b1000 for true, 0b0010 for false.  The condition code was being set
according to the typical condition code values for equal and greater than
which is incorrect for these instructions.  The patch fixes the setting of the
condition code as specified in the instructions.

3 years agoAssorted changes to protect from side affects from the feature checking code.
Carl Love [Fri, 14 Jan 2022 23:04:44 +0000 (23:04 +0000)] 
Assorted changes to protect from side affects from the feature checking code.

Patch contributed by Will Schmidt <will_schmidt@vnet.ibm.com>

This problem was initially reported by Tulio, he assisted me in
identifying the underlying issue here.

This was discovered on a Power10, and occurs since the ISA 3.1 support
check uses the brh instruction via a hardcoded ".long 0x7f1401b6" asm stanza.
That encoding writes to r20, and since the stanza does not contain a clobber
the compiler did not know to save or restore that register upon entry or exit.
The junk value remaining in r20 subsequently caused a segfault.

This patch adds clobber masks to the instruction stanzas, as well as
updates the associated comments to clarify which registers are being
used.
    As part of this change I've also
    - updated the .long for the cnttzw instruction to write to r20, and
      zeroed the reserved bits from that instruction so it is properly
      decoded by the disassembler.
    - updated the .long for the dadd instruction to write to f0.

    I've inspected the current codegen with these changes in place, and
    confirm that r20 is now saved and restored on entry and exit from the
    machine_get_hwcaps() function.

bugzilla 447995   Valgrind segfault on power10 due to hwcap checking code

3 years agoAdd a post-release update to the 3.18 release notes.
Nicholas Nethercote [Tue, 4 Jan 2022 05:53:53 +0000 (16:53 +1100)] 
Add a post-release update to the 3.18 release notes.

3 years agoImplement linux rseq syscall as ENOSYS
Mark Wielaard [Fri, 10 Dec 2021 16:41:59 +0000 (17:41 +0100)] 
Implement linux rseq syscall as ENOSYS

This implements rseq for amd64, arm, arm64, ppc32, ppc64,
s390x and x86 linux as ENOSYS (without warning).

glibc will start using rseq to accelerate sched_getcpu, if
available. This would cause a warning from valgrind every
time a new thread is started.

Real rseq (restartable sequences) support is pretty hard, so
for now just explicitly return ENOSYS (just like we do for clone3).

https://sourceware.org/pipermail/libc-alpha/2021-December/133656.html

3 years agoForgot to remove FreeBSD 13 i386 scalar expected
Paul Floyd [Sat, 11 Dec 2021 15:20:58 +0000 (16:20 +0100)] 
Forgot to remove FreeBSD 13 i386 scalar expected

3 years agoFreeBSD syswrap and scalar corrections for i386 and FreeBSD 12.2
Paul Floyd [Sat, 11 Dec 2021 15:08:08 +0000 (16:08 +0100)] 
FreeBSD syswrap and scalar corrections for i386 and FreeBSD 12.2

There are still size/offset diffs on i386 for fexecve and realpathat.

3 years agoBug 446823 FreeBSD - missing syscalls when using libzm4
Paul Floyd [Sat, 11 Dec 2021 11:32:08 +0000 (12:32 +0100)] 
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.

3 years agoOne more FreeBSD scalar fix
Paul Floyd [Fri, 10 Dec 2021 21:11:16 +0000 (22:11 +0100)] 
One more FreeBSD scalar fix

Using a 64 bit mask for an int argument was causing an
extra Conditional jump error

3 years agoFreeBSD scalar - filter didn't account for padding
Paul Floyd [Fri, 10 Dec 2021 20:34:02 +0000 (21:34 +0100)] 
FreeBSD scalar - filter didn't account for padding

Also forgot to remove deleted expected from EXTRA_DIST

3 years agoCorrect some FreeBSD syswrap typos and simplify scalar
Paul Floyd [Fri, 10 Dec 2021 20:18:05 +0000 (21:18 +0100)] 
Correct some FreeBSD syswrap typos and simplify scalar

One typo affected scalar. Also add some more filtering
so that an extra expected is not needed for FreeBSD 13

3 years agoUpdate FreeBSD 12 scalar
Paul Floyd [Fri, 10 Dec 2021 20:04:25 +0000 (21:04 +0100)] 
Update FreeBSD 12 scalar

3 years agoFreeBSD sigreturn arg names again
Paul Floyd [Thu, 9 Dec 2021 21:54:23 +0000 (22:54 +0100)] 
FreeBSD sigreturn arg names again

Also make drd/tests/shared_timed_mutex more robust
Already not great using time delays, but the test seems
to fail intermittently due to spurious wakeups. So instead
of railing straight away, make it "three strikes and you're out".

3 years agoMinor sigreturn code cleaning for sigreturn / FreeBSD
Paul Floyd [Thu, 9 Dec 2021 21:11:04 +0000 (22:11 +0100)] 
Minor sigreturn code cleaning for sigreturn / FreeBSD

More comments + wrapper arg names matching man page
(even if the syscall should never get called directly
from client code).

3 years agoBug 444481 - Don't unmap the vDSO on s390x
Andreas Arnez [Thu, 9 Dec 2021 14:27:41 +0000 (15:27 +0100)] 
Bug 444481 - Don't unmap the vDSO on s390x

Newer Linux kernels on s390x may use the vDSO as a "trampoline" for
syscall restart.  This means that the vDSO is no longer optional, and
unmapping it may lead to a segmentation fault when a system call restart
is performed.

So far Valgrind has been unmapping the vDSO on s390x.  Just don't do this
anymore.

3 years agoBug 446103 - Memcheck: `--track-origins=yes` causes extreme slowdowns for large mmap...
Julian Seward [Wed, 8 Dec 2021 06:52:09 +0000 (07:52 +0100)] 
Bug 446103 - Memcheck: `--track-origins=yes` causes extreme slowdowns for large mmap/munmap.

This patch rewrites the Level 2 origin-tracking cache (ocacheL2) so that
set-address-range-permissions (SARP) operations on it, for large ranges, are
at least a factor of 2.5 x faster.  This is primarily targeted at SARPs in the
range of hundreds to thousands of megabytes.  The Level 1 origin-tracking
cache covers 64MB address space, so SARPs that fit within it are mostly
unaffected.  There are extensive comments in-line.  Changes are:

* Change the Level 2 cache from a single AVL tree (OSet) into 4096 such trees,
  selected by middle bits of the tag, hence "taking out" 12 significant bits
  of search in any given tree.

* For the OCacheLine type, use a union so as to overlay the w32 and descr
  arrays with an array of 64-bit values.  This is used to speed up cases where
  those fields are to be set to zero, or checked against zero.

* Due to the various fast-paths added by this patch, OC_BITS_PER_LINE has
  pretty much been frozen at the current value, 5.

* ocache_sarp_Set_Origins, ocache_sarp_Clear_Origins: deal with large ranges
  in 32-byte steps instead of 4-byte steps.

* MC_(helperc_b_store32), MC_(helperc_b_store16): rewrite these to be (much)
  more efficient.

* fast-return cases for VG_(OSetGen_Lookup) and VG_(OSetGen_Remove) when the
  tree is empty

* a few extra inline hints

3 years agoAdd a Helgrind suppression for FreeBSD, libc++ std::thread terminaton
Paul Floyd [Tue, 7 Dec 2021 19:04:10 +0000 (20:04 +0100)] 
Add a Helgrind suppression for FreeBSD, libc++ std::thread terminaton

3 years agoAdd a test for `cg_diff`.
Nicholas Nethercote [Sun, 5 Dec 2021 21:54:41 +0000 (08:54 +1100)] 
Add a test for `cg_diff`.

3 years agoFix `cg_annotate` warnings when using `cg_diff`.
Nicholas Nethercote [Sun, 5 Dec 2021 21:09:29 +0000 (08:09 +1100)] 
Fix `cg_annotate` warnings when using `cg_diff`.

When running `cg_annotate` on files produced with `cg_diff`, it's common
to get multiple occurrences of this pair of errors:
```
Use of uninitialized value $pairs[0] in numeric lt (<) at
/home/njn/grind/ws1/cachegrind/cg_annotate line 848.
Use of uninitialized value $high in numeric lt (<) at
/home/njn/grind/ws1/cachegrind/cg_annotate line 859.
```

This is because `cg_annotate` wasn't properly handling the case where no
source code lines have annotations, which never happens in the normal
case but does happen in `cg_diff` output.

Happily, it turns out that the warnings were harmless, the fix is
trivial, and it doesn't change the output at all.

3 years agoFix compiler warnings on non-Linux platforms.
Paul Floyd [Sat, 4 Dec 2021 11:34:18 +0000 (12:34 +0100)] 
Fix compiler warnings on non-Linux platforms.

The new clock pthread APIs are not yet implemented on other platforms.
So make them Linux-only for the moment.

The DRD macros that instantiate the wrappers apply to all OSes so
there is no compiler warning there.

3 years agoAdd arm64 test binaries to .gitignore
Mark Wielaard [Thu, 2 Dec 2021 23:04:00 +0000 (00:04 +0100)] 
Add arm64 test binaries to .gitignore

3 years agovalgrind-di-server.c: Fix minor file descriptor leak on error
Mark Wielaard [Thu, 2 Dec 2021 13:41:44 +0000 (14:41 +0100)] 
valgrind-di-server.c: Fix minor file descriptor leak on error

In handle_transaction when a file descriptor is opened for a file,
but then cannot be stat or the file turns out to be zero size we
leak the file descriptor. Call close (fd) before reporting error.

3 years agoBug 446281 Add a DRD suppression for fwrite
Paul Floyd [Wed, 1 Dec 2021 23:25:20 +0000 (00:25 +0100)] 
Bug 446281 Add a DRD suppression for fwrite

Add a suppression for fwrite-like functions.
Helgrind already has a similar suppression.

3 years agoBug 446139 DRD/Helgrind with std::shared_timed_mutex::try_lock_until and try_lock_sha...
Paul Floyd [Wed, 1 Dec 2021 23:03:27 +0000 (00:03 +0100)] 
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

3 years agoFix handling of `#` chars in `cg_diff`.
Nicholas Nethercote [Tue, 30 Nov 2021 03:11:10 +0000 (14:11 +1100)] 
Fix handling of `#` chars in `cg_diff`.

Rust v0 symbols can have `#` chars in them, things like this:
```
core::panic::unwind_safe::AssertUnwindSafe<<proc_macro::bridge::server::Dispat
cher<proc_macro::bridge::server::MarkedTypes<rustc_expand::proc_macro_server::Rustc>> as proc_macro::bridge::server::DispatcherTrait>::dispatch::{closure#14}>, ()>
```

`cg_diff` currently messes these up in two ways.
- It treats anything after a `#` in the input file as a comment. In
  comparison, `cg_annotate` only treats a `#` as starting a comment at
  the start of a line.
- It uses `#` to temporarily join file names and function names while
  processing.

This commit adjusts the parsing to fix the first problem, and changes
the joiner sequence to `###` to fix the second problem.

3 years agoBug 446251 TARGET_SIGNAL_THR added to enum target_signal
Paul Floyd [Mon, 29 Nov 2021 21:44:17 +0000 (22:44 +0100)] 
Bug 446251 TARGET_SIGNAL_THR added to enum target_signal

gdb considers FreeBSD SIGTHR to be the evuivalent if SIGLWP
not a signal in its own right. Remove the extra enum entry
(which fixes errors in converting signals from number to
string) and map TARGET_SIGNAL_LWP to SIGTHR.

3 years agoAdd a FreeBSD helgrind suppression for thread exit
Paul Floyd [Sat, 27 Nov 2021 22:49:34 +0000 (23:49 +0100)] 
Add a FreeBSD helgrind suppression for thread exit

This happens when using std::thread.

3 years agoAnticipate testcase problems with GCC 12
Paul Floyd [Tue, 23 Nov 2021 22:37:02 +0000 (23:37 +0100)] 
Anticipate testcase problems with GCC 12

There will be a lot more to come.

On amd64 Linux
In faultstatus was seeing the division by zero and emitting a ud2 opcode.
In wrap3 a pair of mutually recursive functions were being inlined.
When forced not to be inlined GCC merged them into a single function.
It cannot see that the client requests have diffeent behaviour.

3 years agoDisable auxv PAGESIZES workaround on FreeBSD 13
Paul Floyd [Tue, 23 Nov 2021 20:58:45 +0000 (21:58 +0100)] 
Disable auxv PAGESIZES workaround on FreeBSD 13

Leaving it in place for 11 (which is now EOL) and 12 - not
woth the complexity for them. Improve comment for supporession.

Also add a pointer to the illumos source web page for lwp_unlock_mutex
in case the syswrap ever needs improving.

3 years agoAdd missing syscall wrapper on Solaris
Paul Floyd [Mon, 22 Nov 2021 03:12:16 +0000 (04:12 +0100)] 
Add missing syscall wrapper on Solaris

I tried to test drd/tests/pth_mutex_signal on Solaris
(you never know) but encountered a missing syscall
wrapper. So this adds a very basic wrapper for lwp_mutex_unlock.

Also update a Solaris expected that I missed amongst the FreeBSD changes.

3 years agoreaddwarf3.c (parse_inl_DIE) inlined_subroutine can appear in namespaces
Mark Wielaard [Mon, 22 Nov 2021 12:07:59 +0000 (13:07 +0100)] 
readdwarf3.c (parse_inl_DIE) inlined_subroutine can appear in namespaces

This was broken by commit 75e3ef0f3 "readdwarf3: Skip units without
addresses when looking for inlined functions". Specifically by this
part: "Also use skip_DIE instead of read_DIE when not parsing
(skipping) children"

rustc puts concrete function instances in namespaces (which is
allowed in DWARF since there is no strict separation between type
declarations and program scope entries in a DIE tree), the inline
parser didn't expect this and so skipped any DIE under a namespace
entry. This wasn't an issue before because "skipping" a DIE tree was
done by reading it, so it wasn't actually skipped. But now that we
really skip the DIE (sub)tree (which is faster than actually parsing
it) some entries were missed in the rustc case.

https://bugs.kde.org/show_bug.cgi?id=445668

3 years agoBug 445300 [PATCH] Fix building tests with Musl
Paul Floyd [Mon, 22 Nov 2021 07:42:53 +0000 (08:42 +0100)] 
Bug 445300 [PATCH] Fix building tests with Musl

Patch contributed by
   Alyssa Ross <hi@alyssa.is>

3 years agoAdd drd pthread_mutex_signal testcase executable to .gitignore
Paul Floyd [Mon, 22 Nov 2021 07:40:07 +0000 (08:40 +0100)] 
Add drd pthread_mutex_signal testcase executable to .gitignore

3 years agodrd-manual.xml: Fix link to libstdc++ manual GLIBCXX_FORCE_NEW reference.
Mark Wielaard [Sun, 21 Nov 2021 14:25:14 +0000 (15:25 +0100)] 
drd-manual.xml: Fix link to libstdc++ manual GLIBCXX_FORCE_NEW reference.

3 years agodrd: Add a test program that interrupts pthread_mutex_lock()
Bart Van Assche [Sat, 20 Nov 2021 21:59:22 +0000 (13:59 -0800)] 
drd: Add a test program that interrupts pthread_mutex_lock()

This test fails, probably due to differences between native signal handling
and signal handling in the Valgrind core.

3 years agomemcheck/tests/libstdc++.supp: rename suppression
Mark Wielaard [Fri, 19 Nov 2021 14:00:27 +0000 (15:00 +0100)] 
memcheck/tests/libstdc++.supp: rename suppression

The name malloc-leaks-cxx-stl-string-classes-debug was confusing
since the suppression wasn't a leak, not part of stl, string,
classes or debug. Rename it to libstdcxx-emergency-eh-alloc-pool
to indicate it is part of the emergency exception handling memory
pool.

Note that suppression is only needed for some test cases, normally
the pool is cleaned up as part of cxx_freeres.

3 years agoBug 445504 Using C++ condition_variable results in bogus "mutex is locked simultaneou...
Paul Floyd [Fri, 19 Nov 2021 07:34:53 +0000 (08:34 +0100)] 
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

3 years agoAdd some details for running regtests on FreeBSD.
Paul Floyd [Thu, 18 Nov 2021 18:52:46 +0000 (19:52 +0100)] 
Add some details for running regtests on FreeBSD.

3 years agoBug 445607 Unhandled amd64-freebsd syscall: 247
Paul Floyd [Wed, 17 Nov 2021 22:15:23 +0000 (23:15 +0100)] 
Bug 445607 Unhandled amd64-freebsd syscall: 247

I can't find much in the way of documentation for this.
Added to scalar, but no specific tests.

3 years agoBug 444925 fexecve syscall wrapper not properly implemented
Paul Floyd [Sun, 14 Nov 2021 21:06:14 +0000 (22:06 +0100)] 
Bug 444925 fexecve syscall wrapper not properly implemented

Implement fexecve and a few testcases on FreeBSD.

3 years agoAdd a FreeBSD suppression for fun:_malloc_postfork
Paul Floyd [Sun, 14 Nov 2021 15:42:31 +0000 (16:42 +0100)] 
Add a FreeBSD suppression for fun:_malloc_postfork

This was causing drd/tests/fork-parallel to fail intermittently.
It's due to the use of a jemalloc-specific mutex.

3 years agoamd64 front end: add more spec rules:
Julian Seward [Sat, 13 Nov 2021 18:59:07 +0000 (19:59 +0100)] 
amd64 front end: add more spec rules:

   S  after SHRQ
   Z  after SHLQ
   NZ after SHLQ
   Z  after SHLL
   S  after SHLL

The lack of at least one of these was observed to cause occasional false
positives in Memcheck.

Plus add commented-out cases so as to complete the set of 12 rules
{Z,NZ,S,NS} after {SHRQ,SHLQ,SHLL}.  The commented-out ones are commented
out because I so far didn't find any use cases for them.

3 years agoRemove a default suppession for GCC/libstdc++
Paul Floyd [Sat, 13 Nov 2021 17:09:20 +0000 (18:09 +0100)] 
Remove a default suppession for GCC/libstdc++

This is covered by cxx-freeres

3 years agoBugs 435732 and 403802 again
Paul Floyd [Sat, 13 Nov 2021 11:31:41 +0000 (12:31 +0100)] 
Bugs 435732 and 403802 again

This time with debuginfo removed.

Also update the vgtest files for a couple of massif tests
(and also the expected because of the commmand line change).
Not yet tested these two with debuginfo installed.

3 years agoBug 445415 - arm64 front end: alignment checks missing for atomic instructions.
Julian Seward [Sat, 13 Nov 2021 08:27:01 +0000 (09:27 +0100)] 
Bug 445415 - arm64 front end: alignment checks missing for atomic instructions.

For the arm64 front end, none of the atomic instructions have address
alignment checks included in their IR.  They all should.  The effect of
missing alignment checks in the IR is that, since this IR will in most cases
be translated back to atomic instructions in the back end, we will get
alignment traps (SIGBUS) on the host side and not on the guest side, which is
(very) incorrect behaviour of the simulation.

3 years agoAdd missing NEWS entry for bug 444399 (== 434283).
Julian Seward [Sat, 13 Nov 2021 08:08:27 +0000 (09:08 +0100)] 
Add missing NEWS entry for bug 444399 (== 434283).

3 years agoNo longer need FreeBSD expected for C++ demangle test
Paul Floyd [Fri, 12 Nov 2021 23:25:43 +0000 (00:25 +0100)] 
No longer need FreeBSD expected for C++ demangle test

3 years agoBugs 435732 and 403802
Paul Floyd [Fri, 12 Nov 2021 23:00:38 +0000 (00:00 +0100)] 
Bugs 435732 and 403802

The problem is that the testcase specific suppression has stacks
that are too specific. This causes breakage with different versions
of GCC and libstdc++. The suppression only needs to mask the memory
pool used for standard io.

There are several suppression stanzas so future tweaks may still be
necessary.

3 years agoMake memcheck tests demangle and demangle-rust clang-friendly.
Paul Floyd [Fri, 12 Nov 2021 22:44:54 +0000 (23:44 +0100)] 
Make memcheck tests demangle and demangle-rust clang-friendly.

Clang uses CMOV for ternary operators which does not immediately
trigger an error. Using double free and new/free mismatch still
poses no problem with clang but still uses the demangling.

Also update .gitignore

3 years agoBug 444399 - disInstr(arm64): unhandled instruction 0xC87F2D89 (LD{,A}XP and ST{...
Julian Seward [Fri, 12 Nov 2021 12:08:45 +0000 (13:08 +0100)] 
Bug 444399 - disInstr(arm64): unhandled instruction 0xC87F2D89 (LD{,A}XP and ST{,L}XP).  FOLLOWUP FIX.

This is an attempt to un-break 'make dist', as broken by the main commit for
this bug, which was 530df882b8f60ecacaf2b9b8a719f7ea1c1d1650.

3 years agoBug 444399 - disInstr(arm64): unhandled instruction 0xC87F2D89 (LD{,A}XP and ST{...
Julian Seward [Fri, 12 Nov 2021 11:13:45 +0000 (12:13 +0100)] 
Bug 444399 - disInstr(arm64): unhandled instruction 0xC87F2D89 (LD{,A}XP and ST{,L}XP).

This is unfortunately a big and complex patch, to implement LD{,A}XP and
ST{,L}XP.  These were omitted from the original AArch64 v8.0 implementation
for unknown reasons.

(Background) the patch is made significantly more complex because for AArch64
we actually have two implementations of the underlying
Load-Linked/Store-Conditional (LL/SC) machinery: a "primary" implementation,
which translates LL/SC more or less directly into IR and re-emits them at the
back end, and a "fallback" implementation that implements LL/SC "manually", by
taking advantage of the fact that V serialises thread execution, so we can
"implement" LL/SC by simulating a reservation using fields LLSC_* in the guest
state, and invalidating the reservation at every thread switch.

(Background) the fallback scheme is needed because the primary scheme is in
violation of the ARMv8 semantics in that it can (easily) introduce extra
memory references between the LL and SC, hence on some hardware causing the
reservation to always fail and so the simulated program to wind up looping
forever.

For these instructions, big picture:

* for the primary implementation, we take advantage of the fact that
  IRStmt_LLSC allows I128 bit transactions to be represented.  Hence we bundle
  up the two 64-bit data elements into an I128 (or vice versa) and present a
  single I128-typed IRStmt_LLSC in the IR.  In the backend, those are
  re-emitted as LDXP/STXP respectively.  For LL/SC on 32-bit register pairs,
  that bundling produces a single 64-bit item, and so the existing LL/SC
  backend machinery handles it.  The effect is that a doubleword 32-bit LL/SC
  in the front end translates into a single 64-bit LL/SC in the back end.
  Overall, though, the implementation is straightforward.

* for the fallback implementation, it is necessary to extend the guest state
  field `guest_LLSC_DATA` to represent a 128-bit transaction, by splitting it
  into _DATA_LO64 and DATA_HI64.  Then, the implementation is an exact
  analogue of the fallback implementation for single-word LL/SC.  It takes
  advantage of the fact that the backend already supports 128-bit CAS, as
  fixed in bug 445354.  As with the primary implementation, doubleword 32-bit
  LL/SC is bundled into a single 64-bit transaction.

Detailed changes:

* new arm64 guest state fields LLSC_DATA_LO64/LLSC_DATA_LO64 to replace
  guest_LLSC_DATA

* (ridealong fix) arm64 front end: a fix to a minor and harmless decoding bug
  for the single-word LDX/STX case.

* arm64 front end: IR generation for LD{,A}XP/ST{,L}XP: tedious and
  longwinded, but per comments above, an exact(ish) analogue of the singleword
  case

* arm64 backend: new insns ARM64Instr_LdrEXP / ARM64Instr_StrEXP to wrap up 2
  x 64 exclusive loads/stores.  Per comments above, there's no need to handle
  the 2 x 32 case.

* arm64 isel: translate I128-typed IRStmt_LLSC into the above two insns

* arm64 isel: some auxiliary bits and pieces needed to handle I128 values;
  this is standard doubleword isel stuff

* arm64 isel: (ridealong fix): Ist_CAS: check for endianness of the CAS!

* arm64 isel: (ridealong) a couple of formatting fixes

* IR infrastructure: add support for I128 constants, done the same as V128
  constants

* memcheck: handle shadow loads and stores for I128 values

* testcase: memcheck/tests/atomic_incs.c: on arm64, also test 128-bit atomic
  addition, to check we really have atomicity right

* testcase: new test none/tests/arm64/ldxp_stxp.c, tests operation but not
  atomicity.  (Smoke test).

3 years agoBug 445354 - arm64 backend: incorrect code emitted for doubleword CAS.
Julian Seward [Fri, 12 Nov 2021 09:40:48 +0000 (10:40 +0100)] 
Bug 445354 - arm64 backend: incorrect code emitted for doubleword CAS.

The sequence of instructions emitted by the arm64 backend for doubleword
compare-and-swap is incorrect.  This could lead to incorrect simulation of the
AArch8.1 atomic instructions (CASP, at least).  It also causes failures in the
upcoming fix for v8.0 support for LD{,A}XP/ST{,L}XP in bug 444399, at least
when running with the fallback LL/SC implementation
(`--sim-hints=fallback-llsc`, or as autoselected at startup).  In the worst
case it can cause segfaulting in the generated code, because it could jump
backwards unexpectedly far.

The problem is the sequence emitted for ARM64in_CASP:

* the jump offsets are incorrect, both for `bne out` (x 2) and `cbnz w1, loop`.

* using w1 to hold the success indication of the stxp instruction trashes the
  previous value in x1.  But the value in x1 is an output of ARM64in_CASP,
  hence one of the two output registers is corrupted.  That confuses any code
  downstream that want to inspect those values to find out whether or not the
  transaction succeeded.

The fixes are to

* fix the branch offsets

* use a different register to hold the stxp success indication.  w3 is a
  convenient check.

3 years agoAdd demangle-rust to check_PROGRAMS
Mark Wielaard [Thu, 11 Nov 2021 17:02:09 +0000 (18:02 +0100)] 
Add demangle-rust to check_PROGRAMS

The demangle-rust.vgtest would fail because the demangle-rust binary
wasn't build by default. Add it to check_PROGRAMS and define
demangle_rust_SOURCES to make sure it is always build.

3 years agoAdd scalar.stderr.exp-freebsd130-x86 to EXTRA_DIST
Mark Wielaard [Wed, 10 Nov 2021 08:05:20 +0000 (09:05 +0100)] 
Add scalar.stderr.exp-freebsd130-x86 to EXTRA_DIST

3 years agoAdd demangle-rust.vgtest demangle-rust.stderr.exp to EXTRA_DIST
Mark Wielaard [Wed, 10 Nov 2021 08:02:36 +0000 (09:02 +0100)] 
Add demangle-rust.vgtest demangle-rust.stderr.exp to EXTRA_DIST

3 years agoFix Rust v0 demangling.
Nicholas Nethercote [Tue, 9 Nov 2021 01:30:07 +0000 (12:30 +1100)] 
Fix Rust v0 demangling.

It's currently broken due to a silly test that prevents the v0
demangling code from even running.

The commit also adds a test, to avoid such problems in the future.

3 years agoSome FreeBSD cleaning
Paul Floyd [Tue, 9 Nov 2021 22:19:19 +0000 (23:19 +0100)] 
Some FreeBSD cleaning

Add a scalar expected for FreeBSD 13 i386
Add SIGLIBRT define

3 years agoBug 445032 valgrind/memcheck crash with SIGSEGV when SIGVTALRM timer used and libthr...
Paul Floyd [Tue, 9 Nov 2021 22:11:15 +0000 (23:11 +0100)] 
Bug 445032 valgrind/memcheck crash with SIGSEGV when SIGVTALRM timer used and libthr.so associated

The problem was that 'struct sigframe' has both a uContext struct
member and a puContext pointer to that struct. And puContext wasn't
being initialized to point to uContext.

It seems that the pthread sigreturn code uses puContext on i386.
amd64, with register arguments, didn't have this problem.

3 years agovbit-test F16 Iops are tested on the wrong architectures
Mark Wielaard [Mon, 8 Nov 2021 16:12:12 +0000 (17:12 +0100)] 
vbit-test F16 Iops are tested on the wrong architectures

Because of what looks like some copy/paste issues the new F16 Iops
seem to be tested on the wrong architectures. They are only implemented
on arm64. So this patch only enables them for arm64.

https://bugs.kde.org/show_bug.cgi?id=444831

3 years agoValgrind Add powerpc R=1 tests
Carl Love [Mon, 1 Nov 2021 16:18:32 +0000 (11:18 -0500)] 
Valgrind Add powerpc R=1 tests

Contributed by Will Schmidt <will_schmidt@vnet.ibm.com>

This includes updates and adjustments as suggested by Carl.

Add tests that exercise PCRelative instructions.
These instructions are encoded with R==1, which indicate that
the memory accessed by the instruction is at a location
relative to the currently executing instruction.

These tests are built using -Wl,-text and -Wl,-bss
options to ensure the location of the target array is at a
location with a specific offset from the currently
executing instruction.

The write instructions are aimed at a large buffer in
the bss section; which is checked for updates at the
completion of each test.

In order to ensure consistent output across assorted
systems, the tests have been padded with ori, nop instructions
and align directives.

Detailed changes:
 * Makefile.am: Add test_isa_3_1_R1_RT and test_isa_3_1_R1_XT tests.
 * isa_3_1_helpers.h: Add identify_instruction_by_func_name() helper function
   to indicate if the test is for R==1.
   Add helpers to initialize and print changes to the pcrelative_write_target
   array.
   Add #define to help pad code with a series of eyecatcher ORI instructions.
     * test_isa_3_1_R1_RT.c: New test.
     * test_isa_3_1_R1_XT.c: New test.
     * test_isa_3_1_R1_XT.stdout.exp: New expected output.
     * test_isa_3_1_R1_XT.stdout.exp: New expected output.
     * test_isa_3_1_R1_RT.stderr.exp: New expected output.
     * test_isa_3_1_R1_RT.stderr.exp: New expected output.

     * test_isa_3_1_R1_RT.vgtest: New test handler.
     * test_isa_3_1_R1_XT.vgtest: New test handler.

     * test_isa_3_1_common.c: Add indicators (updates_byte,updates_halfword,
       updates_word) indicators to control the output from the R==1 tests.
       Add helper check for "_R1" to indicate if instruction is coded with R==1.
       Add init and print helpers for the pcrelative_write_target array.

3 years agoFix for the prefixed stq instruction in PC relative mode.
Carl Love [Wed, 20 Oct 2021 20:40:13 +0000 (20:40 +0000)] 
Fix for the prefixed stq instruction in PC relative mode.

The pstq instruction for R=1, was not using the correct effective address.
The EA_hi and EA_lo should have been based on the value of EA as calculated
by the function calculate_prefix_EA.  Unfortuanely, the EA_hi and EA_lo
addresses were still using the previous code (not PC relative) to calculate
the address from the contants of RA plus the offset.

3 years agogdbserver_tests: Filter out glibc hwcaps libc.so
Mark Wielaard [Tue, 2 Nov 2021 13:27:45 +0000 (14:27 +0100)] 
gdbserver_tests: Filter out glibc hwcaps libc.so

On some systems the gdbserver_tests would fail because the filter
for the optimized hwcaps subdir didn't match because the file is
called slightly differently, with the version number before .so
instead of after. For example: /lib64/glibc-hwcaps/power9/libc-2.28.so

Add one extra filter for this pattern.

3 years agoBug 444571 - PPC, fix the lxsibzx and lxsihzx so they only load their respective...
Carl Love [Fri, 29 Oct 2021 21:30:33 +0000 (16:30 -0500)] 
Bug 444571 - PPC, fix the lxsibzx and lxsihzx so they only load their respective sized data.

The lxsibzx was doing a 64-bit load.  The result was initializing
additional bytes in the register that should not have been initialized.
The memcheck/tests/linux/dlclose_leak test detected the issue.  The
code generation uses lxsibzx and stxsibx with -mcpu=power9.  Previously
the lbz and stb instructions were generated.

The same issue was noted and fixed with the lxsihzx instruction.  The
memcheck/tests/linux/badrw test now passes as well.

https://bugs.kde.org/show_bug.cgi?id=444571

3 years agoBug 444242 - s390x: Sign-extend "relative long" offset in EXRL
Andreas Arnez [Fri, 22 Oct 2021 17:55:12 +0000 (19:55 +0200)] 
Bug 444242 - s390x: Sign-extend "relative long" offset in EXRL

In s390_irgen_EXRL, the offset is zero-extended instead of sign-extended,
typically causing Valgrind to crash when a negative offset occurs.

Fix this with a new helper function that calculates a "relative long"
address from a 32-bit offset.  Replace other calculations of "relative
long" addresses by invocations of this function as well.  And for
consistency, do the same with "relative" (short) addresses.

3 years agoSet version to 3.19.0.GIT in configure.ac
Mark Wielaard [Thu, 28 Oct 2021 12:10:49 +0000 (14:10 +0200)] 
Set version to 3.19.0.GIT in configure.ac

And update docs/internals/release-HOWTO.txt.

3 years agoPrepare NEWS for the next release
Andreas Arnez [Thu, 28 Oct 2021 10:21:28 +0000 (12:21 +0200)] 
Prepare NEWS for the next release

Add a placeholder for the next release to the NEWS file and start the list
of fixed bugs with Bug 444495.

3 years agoBug 444495 - dhat/tests/copy fails on s390x
Paul Floyd [Wed, 27 Oct 2021 19:37:00 +0000 (21:37 +0200)] 
Bug 444495 - dhat/tests/copy fails on s390x

Add -fno-builtin to ensure that the copy functions get called and so dhat
can intercept and count them.

3 years agoChange nightly script to only print assembler if it is present.
Paul Floyd [Sat, 23 Oct 2021 07:02:58 +0000 (09:02 +0200)] 
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.

3 years agoMake the nightly conf files for FreeBSD more generic
Paul Floyd [Tue, 19 Oct 2021 19:31:10 +0000 (21:31 +0200)] 
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.

3 years agoUpdate a few FreeBSD suppressions
Paul Floyd [Tue, 19 Oct 2021 18:03:39 +0000 (20:03 +0200)] 
Update a few FreeBSD suppressions

Make one more generic
Add one for the libc buffer used by libc++ std::cout

3 years agoguest_amd64_toIR.c: use the VexAbiInfo mechanism to remove an `ifdef freebsd`. n...
Julian Seward [Tue, 19 Oct 2021 14:19:31 +0000 (16:19 +0200)] 
guest_amd64_toIR.c: use the VexAbiInfo mechanism to remove an `ifdef freebsd`.  n-i-bz.

3 years agoSet version once in configure.ac, use in valgrind.h andvg-entities.xml
Mark Wielaard [Sun, 17 Oct 2021 20:13:25 +0000 (22:13 +0200)] 
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.

3 years agoRemove executable bits from source files (drd_main.c, pub_tool_machine.h)
Mark Wielaard [Fri, 15 Oct 2021 16:00:52 +0000 (18:00 +0200)] 
Remove executable bits from source files (drd_main.c, pub_tool_machine.h)

3 years ago-> 3.18.1 final VALGRIND_3_18_1
Mark Wielaard [Fri, 15 Oct 2021 12:23:54 +0000 (14:23 +0200)] 
-> 3.18.1 final

Now with __VALGRIND_MINOR__ set to 18 in include/valgrind.h

3 years ago-> 3.18.0 final VALGRIND_3_18_0
Mark Wielaard [Fri, 15 Oct 2021 11:00:42 +0000 (13:00 +0200)] 
-> 3.18.0 final

3 years agocoregrind: Vg_FnNameKind recognize __libc_start_call_main as below main
Mark Wielaard [Wed, 13 Oct 2021 15:05:29 +0000 (17:05 +0200)] 
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.

3 years agoVery minor updates for 3.18.
Julian Seward [Wed, 13 Oct 2021 15:06:10 +0000 (17:06 +0200)] 
Very minor updates for 3.18.

3 years agoNEWS: add various core changes and arm64 additions
Mark Wielaard [Wed, 13 Oct 2021 11:49:15 +0000 (13:49 +0200)] 
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.

3 years ago-> 3.18.0.RC1
Mark Wielaard [Tue, 12 Oct 2021 21:57:00 +0000 (23:57 +0200)] 
-> 3.18.0.RC1

3 years agoPrevious fix was out by one version tag.
Paul Floyd [Tue, 12 Oct 2021 21:04:52 +0000 (23:04 +0200)] 
Previous fix was out by one version tag.

memalign must have been added with FreeBSD 12.2

3 years agovgdb: only queue up to 64 pending signals when waiting for SIGSTOP
Mark Wielaard [Tue, 12 Oct 2021 21:25:32 +0000 (23:25 +0200)] 
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.

3 years agoImplement BPF_MAP_LOOKUP_AND_DELETE_ELEM and BPF_MAP_FREEZE
Mark Wielaard [Tue, 12 Oct 2021 21:15:41 +0000 (23:15 +0200)] 
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

3 years agoAdd close_range(2) support
Lubomir Rintel [Mon, 4 Oct 2021 13:40:29 +0000 (15:40 +0200)] 
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

3 years agocoregrind: Don't call final_tidyup (__libc_freeres) on FatalSignal
Mark Wielaard [Tue, 12 Oct 2021 20:47:57 +0000 (22:47 +0200)] 
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

3 years agofilter_gdb: Handle r = SYSCALL_CANCEL as alternative for return SYSCALL_CANCEL
Mark Wielaard [Tue, 12 Oct 2021 20:41:30 +0000 (22:41 +0200)] 
filter_gdb: Handle r = SYSCALL_CANCEL as alternative for return SYSCALL_CANCEL

This happens with glibc 2.33 when debuginfo is installed.

3 years agoFix building memalign2 test on older FreeBSD
Paul Floyd [Tue, 12 Oct 2021 19:47:45 +0000 (21:47 +0200)] 
Fix building memalign2 test on older FreeBSD

3 years agofilter_xml: Filter out '@*' from <fn> symbol names
Mark Wielaard [Tue, 12 Oct 2021 18:01:45 +0000 (20:01 +0200)] 
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.