16323 Commits

Author SHA1 Message Date
Mark Wielaard
89423f5d8b Intercept stpcpy also in ld.so for arm64
On other arches stpcpy () is intercepted for both libc.so and ld.so.
But not on arm64, where it is only intercepted for libc.so.

This can cause memcheck warnings about the use of stpcpy () in ld.so
when called through dlopen () because ld.so contains its own copy of
that functions.

Fix by introducing VG_Z_LD_LINUX_AARCH64_SO_1 (the encoded name of
ld.so on arm64) and using that in vg_replace_strmem.c to intercept
stpcpy.

https://bugs.kde.org/show_bug.cgi?id=407307
2019-05-07 21:20:04 +02:00
Mark Wielaard
bd27ad3ff3 Hook linux copy_file_range syscall on arm. 2019-05-05 16:01:41 +02:00
Alexandra Hajkova
5f00db054a Add support for the copy_file_range syscall
Support amd64, x86, arm64, ppc64, ppc32 and s390x architectures.
Also add sys-copy_file_range test case.
2019-05-05 15:27:13 +02:00
Philippe Waroquiers
4d089e27d9 Make the list of horrible filter_gdb sed expressions somewhat less horrible
The sed expressions and the comments of these expression were at 2 different
places, making this already horrible list of expressions even more
horrible to understand/maintain.

So, restructure to allow the comments for an expression be close
to the expression.
2019-04-27 18:18:03 +02:00
Petar Jovanovic
9dd746e898 mips: fix file permission of guest_mips_toIR.c
Revert accidentally modified file permissions back to 0644.
2019-04-22 22:49:48 +00:00
Petar Jovanovic
50dd9600ab mips: fix mips32r6 and mips64r6 compilation issue
Add missing variable declarations.
Modify local_sys_write_stderr to use movn if available, and use
seleqz/selnez instructions otherwise.
2019-04-19 21:25:38 +00:00
Alexandra Hájková
b1cc37ddb6 filter_gdb: add regexp to filter out names which starts with a "."
such names are used for "function descriptors" on ppc64

https://bugs.kde.org/show_bug.cgi?id=406561
2019-04-19 12:16:42 +02:00
Philippe Waroquiers
30f889ce10 Prepare NEWS for 3.16.0
So that the fixed bugs and changes can be documented directly.
2019-04-18 21:08:43 +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
Philippe Waroquiers
b4403d38c7 Fix minor leaks in dhat.
Only leaks in dh_fini, and only once.
But fixing these leaks is easier than maintain suppression entries.
2019-04-18 20:41:44 +02:00
Julian Seward
88b9aad08a Advance the head to 3.16.0.GIT. 2019-04-18 06:38:36 +02:00
Bart Van Assche
7ebdd45026 drd/tests/tsan_unittest: Avoid that this test reads from uninitialized memory
Reported-by: Philippe Waroquiers <philippe.waroquiers@skynet.be>
2019-04-17 17:42:22 -07:00
Julian Seward
608cb11914 Second attempt at a 3.15.0 final version. 2019-04-13 12:37:42 +02:00
Julian Seward
270037da8b Bug 406465 - arm64 instruction selector fails on "t0 = <expr>" where <expr> has type Ity_F16. 2019-04-13 12:34:06 +02:00
Julian Seward
cbb2ed6b17 -> 3.15.0 final 2019-04-12 07:35:34 +02:00
Mark Wielaard
535d2ff4f2 none/tests/amd64-linux/map_32bits.vgtest fails too easily
On various systems none/tests/amd64-linux/map_32bits.vgtest fails with:
first mmap: Cannot allocate memory.

The problem is that the --aspace-minaddr is too tight. Newer glibc seem
to mmap some memory and so even our first mmap with MMAP_32BIT will fail.

The solution is to make a bit more memory < 2GB available.
If there is 16MB available the test always seems to succeed without
needing too many tries. The original 256K is too low.

https://bugs.kde.org/show_bug.cgi?id=406422
2019-04-11 18:08:08 +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
45d3fef65e -> 3.15.0.RC2 2019-04-11 09:16:40 +02:00
Mark Wielaard
0c8be9bbed gdbserver_tests fails because of gdb output change.
The 'done.' in "Reading symbols from <exe>...done." is optional.

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

Reported-by: Roger Light <roger@atchoo.org>
2019-04-10 19:30:30 +02:00
Alexandra Hájková
12addd0644 gdbserver_tests: adjust filtering for the new gdb output
mcsigpass and mcsignopass tests fails due to the slightly different
gdb output. Filter the tests output to make it the same for different
gdb version. Change mcsigpass and mcsignopass .exp to fit filtered
.out.

More generic regexp by Stefan Maksimovic <stefan.maksimovic@rt-rk.com>.

https://bugs.kde.org/show_bug.cgi?id=406355
2019-04-10 18:55:55 +02:00
Mark Wielaard
4960f47c7d dhat is broken on x86 (32bit)
dhat will crash on x86 (32bit) because it doesn't handle Vg_CoreClientReq
in its track_post_mem_write.

dh_handle_noninsn_write will be called with Vg_CoreClientReq during
shutdown when trying to setup an argument for the freeres_wrapper().
On other architectures this will be done through a register, but on
x86 we setup the argument on the stack. See final_tidyup () in
coregrind/m_main.c.

Just handle it like a syscall memory argument write.

https://bugs.kde.org/show_bug.cgi?id=406354
2019-04-10 17:06:55 +02:00
Mark Wielaard
69cbd01e74 More memcheck/tests/libstdc++.supp suppressions
memcheck/tests/leak_cpp_interior might fail because depending on compiler
and arch used the suppression file used doesn't catch some allocations
through the DT_INIT_ARRAY functions.

That memory doesn't actually leak, it gets freed by the
__gnu_cxx::__freeres hook. But since this testcase shows leaks while
running, not after the program ends, it needs to suppress these allocations.

https://bugs.kde.org/show_bug.cgi?id=406360
2019-04-10 17:04:02 +02:00
Mark Wielaard
08f20ed4af Add missing cachegrind/tests/a.c to EXTRA_DIST.
cachegrind/callgrind fails ann[12] tests because of missing a.c

These testcases fail because the dist tar is missing the a.c
(auto-annotated) source file. Fix by adding it to EXTRA_DIST.

https://bugs.kde.org/show_bug.cgi?id=406352
2019-04-10 17:00:27 +02:00
Julian Seward
b2d2da64b0 GET_STARTREGS for s390: fix register constraint (per comments from Andreas Arnez). 2019-04-08 14:16:48 +02:00
Julian Seward
d847ab5f5b -> 3.15.0.RC1 2019-04-08 10:16:18 +02:00
Julian Seward
ce94d674de Fix broken links in the Massif manual. 2019-04-08 09:29:03 +02:00
Julian Seward
832ff31c81 Misc doc updates for upcoming 3.15.0 release. 2019-04-08 08:08:19 +02:00
Julian Seward
9a8e749a7d Update __VALGRIND_MINOR__ for the upcoming 3.15 release. 2019-04-08 08:07:39 +02:00
Julian Seward
40f8eb8d4c Finalise bug-fix status notes. 2019-04-08 07:22:28 +02:00
Julian Seward
b7c807f584 Finalise wording w.r.t. the MPL. 2019-04-08 07:18:55 +02:00
Nicholas Nethercote
b71265fbc9 Mention --num-callers more in DHAT docs. 2019-04-08 10:18:38 +10:00
Nicholas Nethercote
19738d1a42 Mention massif-visualizer in the Massif docs. 2019-04-08 10:14:18 +10:00
Mark Wielaard
8a97bdbb1b Install dhat viewer files in libexec.
libexec seems a better location than libdir. libexec is for internal
binaries or scripts that are not intended to be executed directly.

If we want to change the location again it is now simple.
Just change the dhat/Makefile.am dhatdir variable.
2019-04-08 00:02:21 +02:00
Mark Wielaard
06d1d39fdc Add arm64 do_syscall_WRK implementation to memcheck/tests/leak-segv-jmp.
On arm64-linux memcheck/tests/leak-segv-jmp would fail because there
was no do_syscall_WRK implementation for that architecture. Implement
and adjust line numbers in .exp file to make it PASS.
2019-04-07 22:27:52 +02:00
Mark Wielaard
19906dc4d9 Add (minimal) manual page for valgrind-di-server.
This adds a minimal man page for the experimental valgrind-di-server
so that we have manual pages for all (auxiliary) programs we install.
2019-04-07 18:29:02 +02:00
Carl Love
7804ba3deb PPC64, fix test_isa_3_0_other.c test
Valgrind ppc64 test_isa_3_0_other test will attempt to display
all of the bits of the XER as part of the test case results.
The tests have no existing logic to clear those bits, so this can
pick up straggling values that cascade into a testcase failure.
This adds some code to correct this in two directions;
    - Print only the bits that are expected by the tests.  This
    is currently just the OV and OV32 bits.
    - print all of the bits when run under higher verbosity levels.

Bugzilla 406198 - none/tests/ppc64/test_isa_3_0_other test sporadically
                  including CA bit in output

Patch submitted by  Will Schmidt <will_schmidt@vnet.ibm.com>
Patch reviewed, committed by: Carl Love <cel@us.ibm.com>
2019-04-05 15:04:23 -05:00
Julian Seward
d36ea889d8 Bug 404843 - s390x: backtrace sometimes ends prematurely.
On s390x-linux, adds CFI based unwinding for %f0..%f7, since these are sometimes
used by gcc >= 8.0 to spill integer register values in leaf functions.  Hence the
lack of unwinding them was causing unwind failures on this platform.
2019-04-05 20:10:46 +02:00
Carl Love
82e94fff80 PPC64, patch to test case issues reported in bugzilla 401827 and 401828.
This corrects a valgrind instruction emulation issue revealed by
a GCC change.
The xscvdpsp,xscvdpspn,xscvdpuxws instructions each convert
double precision values to single precision values, and write
the results into bits 0-32 of the 128 bit target register.
To get the value into the normal position for a scalar register
the result needed to be right-shifted 32 bits, so gcc always
did that.
It was determined that hardware also always did that, so the (redundant)
gcc shift was removed.
This exposed an issue because valgrind was only writing the result to
bits 0-31 of the target register.

This patch updates the emulation to write the result to both of the involved
32-bit fields.

VEX/priv/guest_ppc_toIR.c:
  - rearrange ops in dis_vx_conv to update more portions of the target
    register with copies of the result.   xscvdpsp,xscvdpspn,xscvdpuxws

none/tests/ppc64/test_isa_2_06_part1.c
  - update res32 checking to explicitly include fcfids and fcfidus in the
    32-bit result grouping.

none/tests/ppc64/test_isa_2_07_part2.c
  - correct NULL initializer for logic_tests definition

[*1] - GCC change referenced:
    2017-09-26  Michael Meissner  <meissner@linux.vnet.ibm.com>
            * config/rs6000/rs6000.md (movsi_from_sf): Adjust code to
              eliminate doing a 32-bit shift right or vector extract after
              doing  XSCVDPSPN.

patch submitted by:   Will Schmidt <will_schmidt@vnet.ibm.com>
reviewed, committed by:  Carl Love <cel@us.ibm.com>
2019-04-04 12:31:05 -05:00
Julian Seward
6b054f132c DHAT: when the run ends, print a how-to-view-the-profile hint message. n-i-bz.
The aim is to make it zero-effort for users to view the profile after
a run.  The printed message is as follows:

  To view the resulting profile, open
    file:///path/to/valgrind/installation/lib/valgrind/dh_view.html
  in a web browser, click on "Load..." and then select the file
    /path/to/dhat.out.12345
  Scroll to the end the displayed page to see a short
  explanation of some of the abbreviations used in the page.

This patch adds printing of the message, then filters it out in
dhat/tests/filter_stderr, and updates the .stderr.exp files to
remove blank lines.
2019-04-04 12:08:26 +02:00
Petar Jovanovic
37f09ed248 mips32: pass correct syscall value to kernel in case of __NR_syscall
The syscall number has to be put in register v0 before call into the kernel.
This was omitted when system call is __NR_syscall (and when the syscall
argument is the system call number of interest).

Patch by Nikola Milutinovic.
2019-04-03 17:40:08 +00:00
Alexandra Hajkova
965876e22b Support arm64 core dump
Fixes BZ #405722.
Implements coredump-elf.c fill_prstatus()
and fill_fpu () for VGP_arm64_linux.
2019-04-02 13:47:30 +02:00
Julian Seward
ec4fcffbac Update NEWS and docs/internals/3_14_BUGSTATUS.txt to reflect current bug-fix status. 2019-04-01 15:31:13 +02:00
Philippe Waroquiers
46e02beb61 Announce fix 405782 "VEX temporary storage exhausted" when attempting to debug slic3r-pe
This bug was fixed by various optimisations done by Julian.
2019-03-30 19:09:31 +01:00
Petar Jovanovic
dc950d964b mips: get rid of format and implicit-fallthrough warnings
Indicate when the fall through from the previous case label is intentional.
Fix format warnings related to arguments in printf calls.
2019-03-28 18:35:17 +01:00
Petar Jovanovic
a10556ba88 update NEWS about fixed KDE #400975
KDE #400975 has been fixed with commit
e61d13087096139024788393218367572751b4b6
2019-03-28 10:20:47 +00:00
Petar Jovanovic
92ecddd13e mips: code refactoring (NFC)
Code in VEX/priv/guest_mips_toIR.c is notably refactored.
DSP ASE dissasembly has been put in a separate file: guest_mipsdsp_toIR.c.

Patch by Aleksandar Rikalo.
2019-03-27 18:42:05 +00:00
Mark Wielaard
8ed9b61432 Use ULong instead of unsigned long in s390_irgen_EX_SS.
ovl was defined as an unsigned long. This would cause warnings from gcc:

  guest_s390_toIR.c:195:30: warning: right shift count >= width of type
  [-Wshift-count-overflow]

when building on 32bit arches, or building a 32bit secondary arch.

Fix this by defining ovl as ULong which is always guaranteed 64bit.
2019-03-27 15:51:34 +01:00
Mark Wielaard
f04ae9f359 Use gcc -Wimplicit-fallthrough=2 by default if available
GCC 7 instroduced -Wimplicit-fallthrough
https://developers.redhat.com/blog/2017/03/10/wimplicit-fallthrough-in-gcc-7/

It caught a couple of bugs, but it does need a bit of extra comments to
explain when a switch case statement fall-through is deliberate. Luckily
with -Wimplicit-fallthrough=2 various existing comments already do that.
I have fixed the bugs, but adding explicit break statements where
necessary and added comments where the fall-through was correct.

https://bugs.kde.org/show_bug.cgi?id=405430
2019-03-27 15:34:45 +01:00
Petar Jovanovic
d6da48fe5a mips: use local labels for do_acasW()
use local labels for do_acasW() to avoid defining symbols multiple times
when the function gets inlined.

It fixes assembler error reported in KDE #400164.
2019-03-25 19:53:21 +01:00
Petar Jovanovic
77d4c217ce update .gitignore with amd64 tests f16c and rdrand
Add
  /none/tests/amd64/f16c
  /none/tests/amd64/rdrand

to .gitignore.
2019-03-25 17:45:04 +00:00