344 Commits

Author SHA1 Message Date
Mark Wielaard
f7ddfc7cfd Regtest: add time cost statistics
Add running time of each (sub) directory in seconds

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

Contributed-by: Jojo R <rjiejie@linux.alibaba.com>
2023-04-15 00:59:34 +02: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
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
Paul Floyd
85bbe2853e FreeBSD support, patch 5
drd and helgrind tests
2021-10-07 21:33:45 +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
Andreas Arnez
62b7052ab5 s390x: Vec-enh-2, test cases
Add test cases for verifying the new/enhanced instructions in the
vector-enhancements facility 2.  For "vector string search" VSTRS add a
memcheck test case.
2021-09-01 14:44:16 +02: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
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
Aaron Merey
fd4e3fb0ff PR432215 Add debuginfod functionality
debuginfod is an HTTP server for distributing ELF/DWARF debugging
information.  When a debuginfo file cannot be found locally, Valgrind
is able to query debuginfod servers for the file using its build-id.

readelf.c: Add debuginfod_find_debug_file(). Spawns a child process to
exec `debuginfod-find` in order to query servers for the debuginfo
file. Also add helper debuginfod_find_path().

pub_core_pathscan.h: Moved from priv_initimg_pathscan.h in order to use
VG_(find_executable)() in readelf.c.

docs: Add information regarding debuginfod to valgrind.1

memcheck/tests/linux: Add new test debuginfod-check.

tests/vg_regtest.in: Clear $DEBUGINFOD_URLS before running any tests.

https://bugs.kde.org/show_bug.cgi?id=432215
2021-02-26 01:38:42 +01:00
Carl Love
affeb57ccd PPC64: ISA 3.1 (new Iops) 128-bit Binary Integer Operations
Add support for:

  dcffixqq DFP Convert From Fixed Quadword Quad
  dctfixqq DFP Convert To Fixed Quadword Quad

  vdivesq Vector Divide Extended Signed Quadword
  vdiveuq Vector Divide Extended Unsigned Quadword
  vdivsq Vector Divide Signed Quadword
  vdivuq Vector Divide Unsigned Quadword

  vmodsq Vector Modulo Signed Quadword
  vmoduq Vector Modulo Unsigned Quadword
  vmulesd Vector Multiply Even Signed Doubleword
  vmuleud Vector Multiply Even Unsigned Doubleword
  vmulosd Vector Multiply Odd Signed Doubleword
  vmuloud Vector Multiply Odd Unsigned Doubleword
  vmsumcud Vector Multiply-Sum & write Carry-out Unsigned Doubleword

  xscvqpsqz VSX Scalar Convert with round to zero Quad-Precision to Signed
    Quadword
  xscvqpuqz VSX Scalar Convert with round to zero Quad-Precision toUnsigned
    Quadword
  xscvsqqp VSX Scalar Convert Signed Quadword to Quad-Precision
  xscvuqqp VSX Scalar Convert Unsigned Quadword to Quad-Precision
2021-02-25 11:15:06 -06:00
Mark Wielaard
208f2d9606 vg_regtest: test-specific environment variables not reset between tests
Test-specific environment variables set in .vgtest files are not reset
between tests. This can result in tests running with environment variables
intended for a previously run test. This can be easily fixed by clearing
the @env and @envB arrays in tests/vg_regtest:read_vgtest_file()

Original patch by Aaron Merey <amerey@redhat.com>

https://bugs.kde.org/show_bug.cgi?id=432672
2021-02-11 18:41:11 +01:00
Julian Seward
3b1710d38c Bug 413547 - regression test does not check for Arm 64 features.
Patches from/by Assad Hashmi (assad.hashmi@linaro.org).
2021-01-07 08:34:14 +01:00
Mark Wielaard
3404c75352 check_headers_and_includes: Add dhat/dhat.h to tool_export_header
dhat now has a public header dhat/dhat.h, this header may include
valgrind.h directly. Make sure check_headers_and_includes knows.
2020-12-08 11:52:16 +01:00
Carl Love
2a88a98f5b valgrind isa 3.1 foundation
header files and other common parts associated with the initial isa v3.1
support
2020-09-22 11:48:25 -05:00
Alexandra Hájková
17d2989a9e amd64: Implement RDSEED
This commit implements amd64 RDSEED instruction, on hosts that have it
and adds the new test case - none/tests/amd64/rdseed based on the existing
rdrand support.

https://bugs.kde.org/show_bug.cgi?id=424298
2020-09-03 23:33:07 +02:00
Philippe Waroquiers
4bed5a4a0a Some further refinement to outer suppressions 2020-05-02 20:18:06 +02:00
Philippe Waroquiers
c8acc28af1 Update the 'inner outer' suppression entries 2020-05-02 17:07:34 +02:00
Julian Seward
40187fcd61 Remove the exp-sgcheck tool.
It only ever worked on x86 and amd64, and even on those it had a high false
positive rate and was slow.  Everything it does, ASan can do faster, better,
and on more architectures.  So there's no reason to keep this tool any more.
2020-04-17 19:25:32 +02:00
Andreas Arnez
3a2711c659 s390x: Add CPU model for z15
Make the z15 CPU models known to Valgrind.  Add test case output for z15
to the "ecag" test.  Also ensure that the facility bits for CPU facilities
unsupported by Valgrind are unset, particularly for the new
deflate-conversion facility.
2020-02-28 15:34:22 +01:00
Rhys Kidd
d5e3b38f72 Fix non-glibc build of the test suite with s390x_features
s390x_features is built unconditionally on a range of platforms, accordingly
any non-portable or glibc-specific functionality must be guarded.

Fixes error reported when running 'make check' or 'make regtest' on a platform
with an alternative libc that Valgrind supports, in this case Apple's libc:

  s390x_features.c:13:10: fatal error: 'features.h' file not found
  #include <features.h>  // __GLIBC_PREREQ
           ^
  1 error generated.

Fixes: 161d22f0a ("s390x: Fix vector facility (vx) check in test suite")
2020-01-28 19:33:03 +11:00
Petar Jovanovic
deae79f733 mips: Add nanoMIPS support to Valgrind 4/4
Necessary changes to support nanoMIPS on Linux.

Part 4/4 - Other changes (mainly include/*)

Patch by Aleksandar Rikalo, Dimitrije Nikolic, Tamara Vlahovic,
Nikola Milutinovic and Aleksandra Karadzic.

Related KDE issue: #400872.
2019-12-31 12:05:33 +00:00
Andreas Arnez
161d22f0af s390x: Fix vector facility (vx) check in test suite
When checking the prereqisuites of running a vector test case, it is not
sufficient to check for the appropriate CPU facility bit.  It must also be
verified that the kernel and hypervisor(s) have actually enabled the
vector facility.  There are various ways of checking this.  E.g., we could
try executing a vector instruction and handle any signals.  Or we can
check the HWCAP for the appropriate bit.  This patch does the latter.
2019-08-09 19:57:18 +02:00
Ilya Leoshkevich
91d53d1167 Bug 404406 - s390x: test z14 miscellaneous instructions
Reuse the existing infrastructure for add, sub and mul.
Add cc checks to all mul tests.
Write a new test for bic.

Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
2019-06-12 20:19:33 +02:00
Andreas Arnez
65d8e9ed96 s390x: Add models "z14" and "z14 ZR1"
Add IBM z14 and IBM z14 ZR1 to the list of known machine models.  Add an
expected output variant for z14 to the s390x-specific "ecag" test case.
In README.s390, refer to a current version of the z/Architecture
Principles of Operation that describes the instructions introduced with
IBM z14.
2019-06-12 20:12:21 +02:00
Mark Wielaard
461cc5c003 Cleanup GPL header address notices by using http://www.gnu.org/licenses/
Sync VEX/LICENSE.GPL with top-level COPYING file. We used 3 different
addresses for writing to the FSF to receive a copy of the GPL. Replace
all different variants with an URL <http://www.gnu.org/licenses/>.

The following files might still have some slightly different (L)GPL
copyright notice because they were derived from other programs:

- files under coregrind/m_demangle which come from libiberty:
  cplus-dem.c, d-demangle.c, demangle.h, rust-demangle.c,
  safe-ctype.c and safe-ctype.h
- coregrind/m_demangle/dyn-string.[hc] derived from GCC.
- coregrind/m_demangle/ansidecl.h derived from glibc.
- VEX files for FMA detived from glibc:
  host_generic_maddf.h and host_generic_maddf.c
- files under coregrin/m_debuginfo derived from LZO:
  lzoconf.h, lzodefs.h, minilzo-inl.c and minilzo.h
- files under coregrind/m_gdbserver detived from GDB:
  gdb/signals.h, inferiors.c, regcache.c, regcache.h,
  regdef.h, remote-utils.c, server.c, server.h, signals.c,
  target.c, target.h and utils.c

Plus the following test files:

- none/tests/ppc32/testVMX.c derived from testVMX.
- ppc tests derived from QEMU: jm-insns.c, ppc64_helpers.h
  and test_isa_3_0.c
- tests derived from bzip2 (with embedded GPL text in code):
  hackedbz2.c, origin5-bz2.c, varinfo6.c
- tests detived from glibc: str_tester.c, pth_atfork1.c
- test detived from GCC libgomp: tc17_sembar.c
- performance tests derived from bzip2 or tinycc (with embedded GPL
  text in code): bz2.c, test_input_for_tinycc.c and tinycc.c
2019-05-26 20:07:51 +02:00
Philippe Waroquiers
da00accdd7 Add missing outer argument when self-hosting valgrind.
The outer valgrind tries to run libc and libcxx free res functions
in the guest (which in case of self-hosting is a valgrind tool).
And that fails.

So, disable running such free res functions.
2019-04-18 20:41:44 +02:00
Mark Wielaard
eacf885df2 filter_libc: remove the line holding the futex syscall error entirely
The current filter might leave empty lines behind.
This is caused by the fact that glibc used to not include a newline
in the message. But since glibc 2.29 it does.

https://bugs.kde.org/show_bug.cgi?id=405205
Reported-by: Stefan Maksimovic <stefan.maksimovic@rt-rk.com>
2019-04-11 18:04:56 +02:00
Julian Seward
472b067e39 amd64: Implement RDRAND, VCVTPH2PS and VCVTPS2PH.
Bug 398870 - Please add support for instruction vcvtps2ph
Bug 353370 - RDRAND amd64->IR: unhandled instruction bytes: 0x48 0xF 0xC7 0xF0

This commit implements:

* amd64 RDRAND instruction, on hosts that have it.

* amd64 VCVTPH2PS and VCVTPS2PH, on hosts that have it.

  The presence/absence of these on the host is now reflected in the CPUID
  results returned to the guest.  So code that tests for these features in
  CPUID and acts accordingly should "just work".

* New test cases, none/tests/amd64/rdrand and none/tests/amd64/f16c.  These
  are built if the host's assembler can handle them, in the usual way.
2019-03-17 21:43:26 +01:00
Julian Seward
cad6b8a984 Fix "make post-regtest-checks" after 441bfc5f51c7f5f80cc6491d23cbe2dc711d191f (dhat overhaul). 2019-02-02 16:10:50 +01:00
Nicholas Nethercote
441bfc5f51 Overhaul DHAT.
This commit thoroughly overhauls DHAT, moving it out of the
"experimental" ghetto. It makes moderate changes to DHAT itself,
including dumping profiling data to a JSON format output file. It also
implements a new data viewer (as a web app, in dhat/dh_view.html).

The main benefits over the old DHAT are as follows.

- The separation of data collection and presentation means you can run a
  program once under DHAT and then sort the data in various ways. Also,
  full data is in the output file, and the viewer chooses what to omit.

- The data can be sorted in more ways than previously. Some of these
  sorts involve useful filters such as "short-lived" and "zero reads or
  zero writes".

- The tree structure view avoids the need to choose stack trace depth.
  This avoids both the problem of not enough depth (when records that
  should be distinct are combined, and may not contain enough
  information to be actionable) and the problem of too much depth (when
  records that should be combined are separated, making them seem less
  important than they really are).

- Byte and block measures are shown with a percentage relative to the
  global count, which helps gauge relative significance of different
  parts of the profile.

- Byte and blocks measures are also shown with an allocation rate
  (bytes and blocks per million instructions), which enables comparisons
  across multiple profiles, even if those profiles represent different
  workloads.

- Both global and per-node measurements are taken at the global heap
  peak ("At t-gmax"), which gives Massif-like insight into the point of
  peak memory use.

- The final/liftimes stats are a bit more useful than the old deaths
  stats. (E.g. the old deaths stats didn't take into account lifetimes
  of unfreed blocks.)

- The handling of realloc() has changed. The sequence `p = malloc(100);
  realloc(p, 200);` now increases the total block count by 2 and the
  total byte count by 300. Previously it increased them by 1 and 200.
  The new handling is a more operational view that better reflects the
  effect of allocations on performance. It makes a significant
  difference in the results, giving paths involving reallocation (e.g.
  repeated pushing to a growing vector) more prominence.

Other things of note:

- There is now testing, both regression tests that run within the
  standard test suite, and viewer-specific tests that cannot run within
  the standard test suite. The latter are run by loading
  dh_view.html?test=1 in a web browser.

- The commit puts all tool lists in Makefiles (and similar files) in the
  following consistent order: memcheck, cachegrind, callgrind, helgrind,
  drd, massif, dhat, lackey, none; exp-sgcheck, exp-bbv.

- A lot of fields in dh_main.c have been given more descriptive names.
  Those names now match those used in dh_view.js.
2019-02-01 14:54:34 +11:00
Julian Seward
d44563c49e Bug 385412 - s390x: new non-vector z13 instructions not implemented
Apart from instructions with vector operands, Valgrind does not implement the
additional z/Architecture instructions introduced with z13.

These are:
- load and zero rightmost byte (LZRF, LZRG);
- load logical and zero rightmost byte (LLZRGF);
- load halfword high immediate on condition (LOCHHI);
- load halfword immediate on condition (LOCHI, LOCGHI);
- load high on condition (LOCFHR, LOCFH);
- store high on condition (STOCFH);
- perform pseudorandom number operation (PPNO), with the functions
  PPNO-Query and PPNO-SHA-512-DRNG;
- load count to block boundary (LCBB).

Patches from Vadim Barkov (vbrkov@gmail.com), with coordination, testing
and format cleanups from Andreas Arnez (arnez@linux.ibm.com).
2018-07-24 10:10:40 +02:00
Petar Jovanovic
1910188124 Add processing of sized delete operators into filter_libc
C++14 introduces sized delete operators and Valgrind support is added
by 6ef6f73. In addition, stderr filter which is used by Regtest should
be able to recognize this particular form in error report (just like
the other kinds of delete operators) in order to provide uniform output.

Fixes memcheck/tests/mismatches failure on non C++14 builds.

Patch by Aleksandar Rikalo.
2018-06-21 11:59:51 +02:00
Petar Jovanovic
9fc2bfba5c mips: add tests for mips32/mips64 R6
This set of tests covers MIPS r6 specific instructions:

  none/tests/mips32/MIPS32r6int
  none/tests/mips32/branch_pc
  none/tests/mips32/branches_r6
  none/tests/mips32/fp_r6
  none/tests/mips32/pc_instructions_r6

  none/tests/mips64/MIPS64r6int
  none/tests/mips64/branch_pc
  none/tests/mips64/branches_r6
  none/tests/mips64/fp_r6
  none/tests/mips64/pc_instructions_r6
  none/tests/mips64/r6_instructions

The following tests had to be changed to be applicaple for Rev6:

  none/tests/libvex_test.c

  none/tests/mips32/LoadStore
  none/tests/mips32/LoadStore1
  none/tests/mips32/MIPS32int
  none/tests/mips32/MoveIns
  none/tests/mips32/branches
  none/tests/mips32/change_fp_mode
  none/tests/mips32/mips32_dsp
  none/tests/mips32/vfp

  none/tests/mips64/arithmetic_instruction
  none/tests/mips64/branches
  none/tests/mips64/fpu_arithmetic
  none/tests/mips64/fpu_load_store
  none/tests/mips64/load_store
  none/tests/mips64/load_store_multiple
  none/tests/mips64/move_instructions

The following tests are not applicable for Rev6:

  none/tests/mips32/fpu_branches
  none/tests/mips32/unaligned_load_store

  none/tests/mips64/branch_and_jump_instructions
  none/tests/mips64/change_fp_mode
  none/tests/mips64/fpu_branches
  none/tests/mips64/load_store_unaligned
  none/tests/mips64/unaligned_load
  none/tests/mips64/unaligned_load_store.

Contributed by:
  Tamara Vlahovic, Aleksandar Rikalo and Aleksandra Karadzic.

Related BZ issue - #387410.
2018-02-01 18:37:28 +01:00
Mark Wielaard
5a705cfa90 Don't cast an initializer to the struct type in power_insn_available.c.
In C99 mode casting the initializer to the struct type will cause gcc
to report an error like:
power_insn_available.c:38:1: error: initializer element is not constant

Simply removing the unnecessary cast fixes this (and is also valid C90).
2018-01-18 11:28:11 +01:00
Julian Seward
f1a49eeb42 Bug 385408 - s390x: z13 vector "support" instructions not implemented. Patch from Vadim Barkov (vbrkov@gmail.com).
(from bug 385408 comment 0):
Valgrind currently lacks support for the z/Architecture vector "support"
instructions introduced with z13.  These are documented in the
z/Architecture Principles of Operation, Eleventh Edition (March, 2015),
chapter 21: "Vector Overview and Support Instructions".
2018-01-11 18:20:27 +01:00
Petar Jovanovic
0e1fa562e9 mips: MSA tests
This set of tests covers the whole MSA instruction set:

  none/tests/mips32/msa_arithmetic
  none/tests/mips32/msa_comparison
  none/tests/mips32/msa_data_transfer
  none/tests/mips32/msa_fpu
  none/tests/mips32/msa_logical_and_shift
  none/tests/mips32/msa_shuffle

  none/tests/mips64/msa_arithmetic         (symlink to mips32)
  none/tests/mips64/msa_comparison         (symlink to mips32)
  none/tests/mips64/msa_data_transfer
  none/tests/mips64/msa_fpu                (symlink to mips32)
  none/tests/mips64/msa_logical_and_shift  (symlink to mips32)
  none/tests/mips64/msa_shuffle            (symlink to mips32)

Contributed by:
  Tamara Vlahovic, Aleksandar Rikalo and Aleksandra Karadzic.

Related BZ issue - #382563.
2017-10-27 16:27:25 +02:00
Ivo Raisr
63032324b0 Change SVN to GIT in various places and simple scripts. 2017-08-14 15:27:27 +02:00
Ivo Raisr
246bb0e25f Remove TileGX/Linux port.
Fixes BZ#379504.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16340
2017-05-08 17:21:59 +00:00
Ivo Raisr
38edd50c0e Update copyright end year to 2017 in preparation for 3.13 release.
n-i-bz



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16333
2017-05-04 15:09:39 +00:00
Philippe Waroquiers
ec6077e25a Outer/inner setup : allow append to outer args, use a bigger --num-callers
* Similarly to what was done in revision r16104 for vg_perf, have a way
  to append to predefined vg_regtest outer args, rather than only be able
  to replace them.
* increase the num callers for outer tool to 40.
  (This is in preparation of a future commit, that will allow outer tool
  to append the inner guest stack trace to reported errors in the inner)


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16133
2016-11-12 11:22:50 +00:00
Ivo Raisr
5f128b048c Fix compiler warning about unused function on Solaris
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16113
2016-11-02 22:07:11 +00:00
Mark Wielaard
ee8cfbc434 Add libc_test to workaround pth_cond_destroy_busy test hangs.
This is a workaround for bug #371396. It adds a new test program
that can be used skip tests given a specific libc implementation
and optionally a specific minimum version. Currently only glibc
is recognized. This is used for the drd and helgrind tests
pth_cond_destroy_busy to be skipped on glibc 2.24.90+.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16097
2016-10-21 00:02:10 +00:00
Carl Love
ffb3146248 Fix for missing ISA changes in HW cap stuff needs updating patch
A couple things got missed in the previous HW cap stuff needs updating patch
that cause the vbit tester to fail.  The fixes are based on the patch
submitted by Mark Weilaard.

The changes were missed in Valgrind commit 16034

bugzilla 370265

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16037
2016-10-11 17:01:42 +00:00
Carl Love
c45ae57a04 Power configure fixes.
This patch makes the following updates:
  - Update the configure scripts to fix a configure/build issue seen on Power 7
  - Update the ISA 3.0 hwcaps string.
  - Update the ISA 3.0 ifdef value to be consistent with the hwcaps string

The patch was submitted by Will Schmidt.  Patch reviewed and tested by Carl Love
on Power 7, Power 8 LE and BE, ISA 3.0 simulator for LE and BE.

Bugzilla 369175

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16034
2016-10-10 18:09:01 +00:00
Mark Wielaard
c5556b2094 Testcases for fma4 instructions. Bug #369000.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15961
2016-09-19 12:41:38 +00:00
Carl Love
d2450cd776 Power PC test suite for ISA 3.0, part 5 of 5
The test suite support for the Power PC ISA 3.0 instructions added in
VEX commit 3244 is added in this commit.

bugzilla 364948

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15938
2016-08-15 21:54:04 +00:00
Mark Wielaard
64a5086cb1 Add arm64-linux to tests/platform_test.
Prevent executing arm64-linux specific tests on other arches.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15827
2016-03-10 07:59:33 +00:00
Ivo Raisr
912bede3dd Sanitize signal mask in ppoll and pselect syscalls
Reported and Linux patch contributed by Steven Smith <sos22@archy.org.uk>
Fixes BZ#359871



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15823
2016-03-08 09:04:48 +00:00
Petar Jovanovic
e7e2cc219f Allow 8k and 32k page sizes
Allow 8k and 32k page sizes in memalign and other memory related tests.
This fixes crashes in the tests on systems with 8k or 32k pagesize.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15815
2016-02-26 16:05:29 +00:00
Florian Krohm
a696c9e44a s390: Fix BZ #359289, adding support for popcnt insn.
Companion patch is VEX r3210.
Patch by Andreas Arnez (arnez@linux.vnet.ibm.com).


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15792
2016-02-17 20:00:59 +00:00