16821 Commits

Author SHA1 Message Date
Josef Weidendorfer
5e41080720 Callgrind: Broader handling of _dl_runtime_resolve variants
This is a supplement to commit 86277041

To improve its results, Callgrind does special handling for
the runtime linker entry point to resolve symbols. However,
it only used the exact symbol name "_dl_runtime_resolve",
as well as specific machine code templates (when the runtime
linker was stripped from symbol names) as basis.
Recent glibc added multiple similar symbol names as variants,
such as _dl_runtime_resolve_xsave.

The above-mentioned commit 86277041 solves this by extending
the check for machine code templates for specific Linux
distributions.
This patch extends this for more architectures and variants
by checking if a function starts with "_dl_runtime_resolve".
Furthermore, the original function names of the variants
still are visible in the output (and not forced to the prefix).

While the heuristic that every function symbol starting
with the prefix "_dl_runtime_resolve" as being an entry point
into the runtime linker for resolving a function address may
be a bit rough, this prefix is not expected to be used often in
other source code for anything else.

The worst case is a slightly misleading call graph only
visible in a very specific situation: if the wrongly-detected
function does a tail call (ie instead of returning, jumping
to another function), it will be shown as 2 calls in a row
from the original caller.
2021-04-08 00:50:00 +02:00
Carl Love
19cae12c17 PPC64 rename xvcvbf16sp to xvcvbf16spn. Fix up comments for xvcvspbf16 and xvcvbf16spn instructions. 2021-04-07 10:19:35 -05:00
Tom Hughes
c45be42862 Record BZ#423963 fix 2021-04-07 00:54:51 +01:00
Tom Hughes
e08a82991a Only process clone results in the parent thread
Fixes BZ#423963
2021-04-06 22:44:36 +01:00
Carl Love
d41d3662e6 Create initial new release entry in NEWS file for a future release. 2021-04-01 10:28:12 -05:00
root
c589b65293 Reduced precision Missing Integer based outer tests 2021-03-31 10:31:27 -05:00
Carl Love
e09fdaf569 PPC64: Reduced-Precision: Missing Integer-based Outer Product Operations
Add support for:

pmxvi16ger2 VSX Vector 16-bit Signed Integer GER (rank-2 update), Prefixed
   Masked
pmxvi16ger2pp VSX Vector 16-bit Signed Integer GER (rank-2 update) (Positive
   multiply, Positive accumulate), Prefixed Masked
pmxvi8ger4spp VSX Vector 8-bit Signed/Unsigned Integer GER (rank-4 update) with
   Saturation (Positive multiply, Positive accumulate), Prefixed Masked
xvi16ger2 VSX Vector 16-bit Signed Integer GER (rank-2 update)
xvi16ger2pp VSX Vector 16-bit Signed Integer GER (rank-2 update) (Positive
   multiply, Positive accumulate)
xvi8ger4spp VSX Vector 8-bit Signed/Unsigned Integer GER (rank-4 update) with
   Saturation (Positive multiply, Positive accumulate)
2021-03-31 10:31:22 -05:00
root
c8fa838be4 Reduced Precision bfloat16 outer product tests 2021-03-31 10:31:16 -05:00
Carl Love
078f89e99b PPC64: Reduced-Precision - bfloat16 Outer Product & Format Conversion Operations
Add support for:

pmxvbf16ger2 Prefixed Masked VSX Vector bfloat16 GER (Rank-2 Update)
pmxvbf16ger2pp Prefixed Masked VSX Vector bfloat16 GER (Rank-2 Update) Positive
  multiply, Positive accumulate
pmxvbf16ger2pn Prefixed Masked VSX Vector bfloat16 GER (Rank-2 Update) Positive
  multiply, Negative accumulate
pmxvbf16ger2np Prefixed Masked VSX Vector bfloat16 GER (Rank-2 Update) Negative
  multiply, Positive accumulate
pmxvbf16ger2nn Prefixed Masked VSX Vector bfloat16 GER (Rank-2 Update) Negative
  multiply, Negative accumulate
xvbf16ger2VSX Vector bfloat16 GER (Rank-2 Update)
xvbf16ger2pp VSX Vector bfloat16 GER (Rank-2 Update) Positive multiply, Positive
  accumulate
xvbf16ger2pn VSX Vector bfloat16 GER (Rank-2 Update) Positive multiply, Negative
  accumulate
xvbf16ger2np VSX Vector bfloat16 GER (Rank-2 Update) Negative multiply, Positive
  accumulate
xvbf16ger2nn VSX Vector bfloat16 GER (Rank-2 Update) Negative multiply, Negative
  accumulate
xvcvbf16sp VSX Vector Convert bfloat16 to Single-Precision format
xvcvspbf16 VSX Vector Convert with round Single-Precision to bfloat16 format
2021-03-31 10:31:11 -05:00
Carl Love
4bcc6c8a97 VSX Permute Control Vector Generate Operation tests. 2021-03-30 10:38:45 -05:00
Carl Love
3cc0232c46 PPC64: ISA 3.1 VSX PCV Generate Operations
xgenpcvbm VSX Vector Generate PCV from Byte Mask
xxgenpcvdmVSX Vector Generate PCV from Doubleword Mask
xxgenpcvhmVSX Vector Generate PCV from Halfword Mask
xxgenpcvwmVSX Vector Generate PCV from Word Mask
2021-03-30 10:37:19 -05:00
Bart Van Assche
7cd4d78163 memcheck/tests/linux/stack_changes: Only run this test if setcontext() is available
See also https://bugs.kde.org/show_bug.cgi?id=434775 .
2021-03-28 20:48:22 -07:00
Bart Van Assche
7b32db280e configure.ac: Sort AC_CHECK_FUNCS() arguments alphabetically 2021-03-28 20:24:58 -07:00
Bart Van Assche
c9e88f3459 configure, drd: Only build the swapcontext test if swapcontext() is available
Add a configure test for swapcontext() since MUSL does not provide a
swapcontext() implementation. See also
https://bugs.kde.org/show_bug.cgi?id=434775 .
2021-03-22 19:21:15 -07:00
Julian Seward
06a6b1799c Move tag to 3.18.0.GIT. Onwards and upwards etc :-) 2021-03-22 16:07:30 +01:00
Paul Floyd
dde556d51f Add musl.supp to SUPP_FILES 2021-03-20 08:51:52 +01:00
Julian Seward
997b3b5b96 -> 3.17.0 final. 2021-03-19 09:50:54 +01:00
Julian Seward
07f0cdcbb4 Properly guard an include of <sys/auxv.h>.
See comments at https://bugs.kde.org/show_bug.cgi?id=413547#c11.
2021-03-19 09:09:52 +01:00
Julian Seward
1e4a20c6db Improve the summary paragraph for the 3.17 NEWS entry. 2021-03-17 18:16:03 +01:00
Mark Wielaard
8616808ab3 Add isa_3_1_register_defines.h to Makefile.am noinst_HEADERS
Make sure isa_3_1_register_defines.h ends up in the dist tarball.
2021-03-17 17:57:03 +01:00
Julian Seward
ce929211d5 -> 3.17.0.RC2 2021-03-17 12:35:38 +01:00
Paul Floyd
e531f994c6 Two fixes for Darwin 'make check'
mempcpy is not available on Darwin, so make it conditional like Solaris.

also sys/auxv.h does not exist so make including it conditional.
2021-03-17 09:12:21 +01:00
Julian Seward
3415e1e1ac Bug 401416 - Compile failure with openmpi 4.0.
In short, use the missing symbol names only when compiling against OpenMPI
version 3 or below, or when compiling against a non-OpenMPI implementation.
Modified version of a patch originally from Mark Wielaard.
2021-03-17 08:10:49 +01:00
Mark Wielaard
3751e963fa Add memcheck/tests/linux/debuginfod-check.pl to EXTRA_DIST
debuginfod-check.pl is necessary as pre-check for make regtest.
2021-03-15 15:47:54 +01:00
Julian Seward
d695fb68e5 -> 3.17.0.RC1 2021-03-13 20:52:01 +01:00
Julian Seward
a049da18b3 amd64 front end: try to avoid a Memcheck false positive related to CPUID. n-i-bz.
In the amd64 front end, CPUID is implemented by calling dirty helper.  The way
the side-effects for this call are declared can lead to false positives from
Memcheck.  This is a somewhat inelegant "fix", but it's the least-worst that
can be done without changing parameter-passing for the helper functions
involved.  A big in-line comment explains the problem and fix.
2021-03-13 19:20:50 +01:00
Julian Seward
2157125296 mc_translate.c: enable further uses of DLexpensive for scalar EQ/NE comparisons
mc_translate.c: enable further cases where scalar integer EQ/NE comparisons
use expensive instrumentation by default:

  x86, amd64  for 16-bit comparisons
  arm, arm64  for 32-bit comparisons

This fixes 'Bug 434193 - GCC 9+ inlined strcmp causes "Conditional jump or move depends on
uninitialised value" report'.

Patch from Mike Crowe <mac@mcrowe.com>.
2021-03-12 17:59:01 +01:00
Andreas Arnez
ce4b0e0677 s390x: Update "reading material" in README.s390
Update the links to the z/Architecture and the s390x ABI.
2021-03-10 19:16:18 +01:00
Andreas Arnez
6ed09a6603 s390x: Improve isel for Iop_V128to64 and friends
The existing instruction selector for Iop_V128to64, Iop_V128HIto64, and
Iop_V128to32 stores the vector register on the stack and then reads the
requested integer value back from the stack into the target GPR.  This is
fairly inefficient.

Load the requested value directly from the vector register into the target
GPR instead, using S390_VEC_GET_ELEM.
2021-03-10 17:40:58 +01:00
Andreas Arnez
19dc8c467e s390x: Fix printing wrong/no vector registers in disassembler
A typo in s390_disasm.c causes some vector registers to be printed wrong,
or not at all.  This is fixed.
2021-03-09 19:13:37 +01:00
Mark Wielaard
0f0205f683 vgdb might crash if valgrind is killed
This is an odd corner case, but happens specifically with the gdb
testcase make check TESTS=gdb.base/valgrind-infcall-2.exp. At the
end valgrind gets killed with SIGKILL (-9) which cannot be blocked.
But vgdb at the time is inside waitstopped. It sees the process wasn't
exited (WIFEXITED(status) is false) and so assumes the process was
stopped by a signal. Which it asserts:

      assert (WIFSTOPPED(status));
      signal_received = WSTOPSIG(status);
      if (signal_received == signal_expected)
         break;

But the assert fails and vgdb dumps core. The gdb testcase doesn't care,
because it already finished its test and just makes sure all processes
are gone. But it slowly fills your disk with core files (if you have
enabled them) when running the testsuite.

The fix is to simply check first whether the program has termined
normally or by getting a fatal signal.

https://bugs.kde.org/show_bug.cgi?id=434035
2021-03-09 18:51:57 +01:00
Andreas Arnez
484b7dd1e8 Bug 430429 - s390x: Fix clang compile error in valgrind.h
It has been observed that clang emits an error in valgrind.h for the macro
VALGRIND_DO_CLIENT_REQUEST_EXPR:

 "[...] unsupported inline asm: input with type 'int' matching output with
 type 'volatile unsigned long'"

Fix this with an explicit cast of the input to 'unsigned long int.'

The patch has been suggested by Jonathan Albrecht.
2021-03-09 17:36:12 +01:00
Balint Reczey
8b1961511c Don't look for debug alt file in debug image if it is already found
With dwz the .gnu_debuglink section may appear duplicated in the
debug file referenced originally in the .gnu_debuglink section.

https://bugs.launchpad.net/ubuntu/+source/valgrind/+bug/1848211

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

Signed-off-by: Balint Reczey <balint.reczey@canonical.com>
2021-03-09 16:38:15 +01:00
Philippe Waroquiers
c79180a3af Fix nlcontrolc.vgtest hanging on newer glibc and/or arm64
This test verifies that GDB can interrupt a process with all threads
blocked in a long select syscall.
The test used to terminate by having GDB modifying the select argument.
However, modifying the select argument works only for specific arch
and/or specific versions of glibc.
The test then blocks on other architectures/glibc versions.

The previous version of the test was:
  * first launching sleepers so as to have all threads blocked in long select
  * interrupting these threads
  * changing the select time arg so that the threads burn cpu
  * and then change variables to have the program exit.

The new version does:
  * first launches sleepers so that all threads are burning cpu.
  * interrupting these threads
  * change the local variables of sleepers so that the threads will
    block in a long select syscall
  * interrupt these threads
  * kill the program.

With this new version, we still check the behaviour of gdb+vgdbserver
for both burning and sleep threads, but without having the termination
depending on modifying select syscall argument.

Tested on debian amd64 and on ubuntu arm64 (to check the test does not hang
on an arm64 platform).
2021-03-07 22:35:58 +01:00
Julian Seward
2ab8ab38a3 Bug 432552 - [AArch64] invalid error emitted for pre-decremented byte and half-word addresses. 2021-03-05 09:38:30 +01:00
Carl Love
3c31707cd3 VSX Mask Manipulation operation tests. 2021-03-04 12:57:16 -06:00
Carl Love
82777ee408 ISA 3.1 VSX Mask Manipulation Operations
Add support for:

mtvsrbmMove to VSR Byte Mask
mtvsrbmiMove To VSR Byte Mask Immediate
mtvsrdmMove to VSR Doubleword Mask
mtvsrhmMove to VSR Halfword Mask
mtvsrqmMove to VSR Quadword Mask
mtvsrwmMove to VSR Word Mask
vcntmbbVector Count Mask Bits Byte
vcntmbdVector Count Mask Bits Doubleword
vcntmbhVector Count Mask Bits Halfword
vcntmbwVector Count Mask Bits Word
vexpandbmVector Expand Byte Mask
vexpanddmVector Expand Doubleword Mask
vexpandhmVector Expand Halfword Mask
vexpandqmVector Expand Quadword Mask
vexpandwmVector Expand Word Mask
vextractbmVector Extract Byte Mask
vextractdmVector Extract Doubleword Mask
vextracthmVector Extract Halfword Mask
vextractqmVector Extract Quadword Mask
vextractwmVector Extract Word Mask

Re-implemented the copy_MSB_bit_fields() function.  It can be done similarly to
the implementation of the vgnb instruction leveraging the clean helpers
used for the vgnb instruction.

Reimplemented the vexpandXm instructions eliminating
the call to copy_MSB_bit_fileds() and the need for the
for(i = 0; i< max; i++) loop.

Reimplemented the mtvsrXm instructions to remove the
need for the for(i = 0; i< max; i++) loop.

The computations for vexpandXm and mtvsrXm instructions
can be done much more efficiently.
2021-03-04 12:33:48 -06:00
Mark Wielaard
b92d30bb6d arm64: Handle sp, lr, fp as DwReg in CfiExpr
When copy_convert_CfiExpr_tree sees a DwReg on arm64 we simply call
I_die_here; This causes an issue in the case we really do have to handle
that case (see https://bugzilla.redhat.com/show_bug.cgi?id=1923493).

Handle the stack pointer (sp), link register (x30) and frame pointer (x29),
which we already keep in D3UnwindRegs, like we do for other architectures
in evalCfiExpr and copy_convert_CfiExpr_tree.

https://bugs.kde.org/show_bug.cgi?id=433898
2021-03-04 19:24:06 +01:00
Mark Wielaard
23223e28a5 Add an entry on the new --track-fds=all option to NEWS. 2021-03-03 16:02:33 +01:00
Paul Floyd
c136213d46 Keep on churning.
Without #define _XOPEN_SOURCE macports clang 9.0.1 on OSX 10.7.5 was
giving me

In file included from swapcontext.c:12:
/usr/include/ucontext.h:43:2: error: The deprecated ucontext routines require
      _XOPEN_SOURCE to be defined
 ^
swapcontext.

So I added #define _XOPEN_SOURCE

But that gives, on Solaris 11.3

In file included from /usr/include/limits.h:12:0,
                 from /usr/gcc/4.8/lib/gcc/i386-pc-solaris2.11/4.8.2/include-fixed/limits.h:168,
                 from /usr/gcc/4.8/lib/gcc/i386-pc-solaris2.11/4.8.2/include-fixed/syslimits.h:7,
                 from /usr/gcc/4.8/lib/gcc/i386-pc-solaris2.11/4.8.2/include-fixed/limits.h:34,
                 from swapcontext.c:7:
/usr/include/sys/feature_tests.h:354:2: error: #error "Compiler or options invalid for pre-UNIX 03 X/Open applications  and pre-2001 POSIX applications"
 #error "Compiler or options invalid for pre-UNIX 03 X/Open applications \
  ^

So make the #define _XOPEN_SOURCE conditional on darwin.
2021-03-03 08:53:51 +01:00
Paul Floyd
f9ee4517a0 Modify cxx17_aligned_new testcase to accommdate clang.
Explicitly use ordinary scalar delete and update the expecteds.
Otherwise g++ uses sized scalar delete whilse clang uses
ordinary scalar delete which causes a diff.
2021-03-02 17:48:14 +01:00
Paul Floyd
b030c481dc Added one redir too many on Solaris, which causes a runtime error. 2021-03-02 17:45:22 +01:00
Paul Floyd
8fd6de1cfe Fix compilation on OS X 2021-03-02 17:41:47 +01:00
Paul Floyd
e42badd060 Bug 388787 - Support for C++17 new/delete
These over-aligned new and delete operators were added in C++ 17.
2021-03-02 13:32:22 +01:00
Mark Wielaard
262ca91cff Remove deep-D.post.exp-ppc64 from EXTRA_DIST.
massif/tests/deep-D.post.exp-ppc64 was remove in commit 24a94df73
"VG_(get_fnname_kind): Recognize gcc "optimized" below main functions."
but was still listed in massif/tests/Makefile.am (EXTRA_DIST). Causing
make dist to fail.
2021-03-01 00:39:54 +01:00
Mark Wielaard
24a94df738 VG_(get_fnname_kind): Recognize gcc "optimized" below main functions.
The VG_(get_fnname_kind) function detects some special "below main"
function names. Specifically __libc_start_main and generic_start_main
both of which are used to call the actual main () function from the
application. We already recognized one variant, generic_start_main.isra.0,
but only for powerpc. Recognize all possibly specialed optimized variants
gcc can produce by simply checking for the function name with dot as
prefix. This fixes the memcheck/tests/supp_unknown.vgtest and
massif/tests/deep-D.vgtest with gcc 11.

We can now also get rid of the special cases in
massif/tests/deep-D.post.exp-ppc64 and memcheck/tests/supp_unknown.supp.

https://bugs.kde.org/show_bug.cgi?id=430158
2021-03-01 00:26:00 +01:00
Mike Hommey
5d45e212a6 sys_newfstatat: don't complain if |file_name| is NULL.
This is a followup to 2a7d3ae76, in the case rust code runs against a
glibc that supports statx but a kernel that doesn't, in which case glibc
falls back to fstatat.

https://bugs.kde.org/show_bug.cgi?id=433641
2021-02-28 22:31:25 +01:00
Mark Wielaard
9e9d1a1713 Fix README spelling mistake adb -> and
Reported by: satbek@unist.ac.kr

https://bugs.kde.org/show_bug.cgi?id=433629
2021-02-28 21:07:54 +01:00
Mark Wielaard
c9d1cd0db3 Use pkglibexec as vglibdir.
vglibdir is the directory from where valgrind loads its internal tool
executables and vgpreloads. Currently vglibdir is pkglibdir, so those
internal tools are intermingeled with normal executables and libraries
that the user might use directly.

Make vglibdir equal to pkglibexecdir so the internal tools get installed
and loaded from libexec and don't get get stored under lib.

This leaves just the static archives and the mpiwrapper libraries that
the user would link/load themselves under pkglibdir.

This seems more in line with the FHS lib/libexec standard and makes it
slightly easier to combine the tools from a multilib target (say the
memcheck-amd64-linux and memcheck-x86-linux tools) because they would
be installed under the same directory, while the pkglibdir can differ
depending on arch/target (lib/lib64).

https://bugs.kde.org/show_bug.cgi?id=433323
2021-02-28 17:49:40 +01:00
Bart Van Assche
ae15c01f72 none/tests/ifunc.c: Fix a compiler warning
Fix the following compiler warning:

ifunc.c:9:15: warning: 'ifunc' resolver for 'test' should return 'void (*)(int)' [-Wattribute-alias=]
    9 | static void (*resolve_test(void))(void)
      |               ^~~~~~~~~~~~
2021-02-27 20:40:50 -08:00