]> git.ipfire.org Git - thirdparty/valgrind.git/log
thirdparty/valgrind.git
6 years agos390x: Clean up s390-check-opcodes.pl
Andreas Arnez [Tue, 14 May 2019 15:19:34 +0000 (17:19 +0200)] 
s390x: Clean up s390-check-opcodes.pl

Fix false positives when invoking s390-check-opcodes.pl.  Also clean up
some code formatting issues in that script.  Add the instructions TPEI and
IRBM to guest_s390_toIR.c and s390-opcodes.csv, so they are not longer
warned about.

6 years agos390x: Add models "z14" and "z14 ZR1"
Andreas Arnez [Tue, 2 Oct 2018 11:47:50 +0000 (13:47 +0200)] 
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.

6 years agolinux x86 and amd64 memory protection key syscalls.
Mark Wielaard [Wed, 29 May 2019 22:29:58 +0000 (00:29 +0200)] 
linux x86 and amd64 memory protection key syscalls.

This implements minimal support for the pkey_alloc, pkey_free and
pkey_mprotect syscalls. pkey_alloc will simply indicate that pkeys
are not supported. pkey_free always fails. pkey_mprotect works just
like mprotect if the special pkey -1 is provided.

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

6 years agoDocument that --xml=yes automatically activates --leak-check=full
Philippe Waroquiers [Sun, 2 Jun 2019 19:01:36 +0000 (21:01 +0200)] 
Document that --xml=yes automatically activates --leak-check=full

6 years agoHook up membarrier syscall for arm-linux.
Mark Wielaard [Fri, 31 May 2019 13:11:35 +0000 (15:11 +0200)] 
Hook up membarrier syscall for arm-linux.

6 years agoFix -Wdiscarded-qualifiers warnings in launcher-linux.c
Mark Wielaard [Thu, 30 May 2019 01:40:56 +0000 (03:40 +0200)] 
Fix -Wdiscarded-qualifiers warnings in launcher-linux.c

commit f15bee "Fix memory leak in launcher-linux.c" introduced some
warnings about passing const pointers to free.

    warning: passing argument 1 of ‘free’ discards ‘const’ qualifier from
    pointer target type [-Wdiscarded-qualifiers]

This was because that code was a little too "smart". The compiler cannot
know that we really only call free () when the pointer was dynamically
allocated. Simplify the code a little to just always allocate a new
string in find_client and always free that string in select_platform.

6 years agoExpose rdrand and f16c through cpuid also if the host only has avx.
Mark Wielaard [Mon, 27 May 2019 20:19:27 +0000 (22:19 +0200)] 
Expose rdrand and f16c through cpuid also if the host only has avx.

The amd64 CPUID dirtyhelpers are mostly static since they emulate some
existing CPU "family". The avx2 ("i7-4910MQ") CPUID variant however
can "dynamicly" enable rdrand and/or f16c if the host supports them.
Do the same for the avx_and_cx16 ("i5-2300") CPUID variant.

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

6 years agoPPC64, Update testcases for vlogefp, vexptefp instructions
Carl Love [Tue, 28 May 2019 19:03:59 +0000 (14:03 -0500)] 
PPC64, Update testcases for vlogefp, vexptefp instructions

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

6 years agoPPC64, Add support for vlogefp, vexptefp instructions
Carl Love [Tue, 28 May 2019 19:07:04 +0000 (14:07 -0500)] 
PPC64, Add support for vlogefp, vexptefp instructions

Add Iop_Exp2_32Fx4 to VEX/pub/libvex_ir.h to support the 2^x instruction.

Enable the existing test support for the two instructions in
none/tests/ppc64/subnormal_test.c and none/tests/ppc64/jm-insns.c.

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

6 years agoPPC64, Subnormal testcase changes
Carl Love [Tue, 28 May 2019 16:33:00 +0000 (11:33 -0500)] 
PPC64, Subnormal testcase changes

VEX patch fixed issues with generating subnormal results.

This patch adds a specific test case and updates the expected values for
the existing test case.

Update jm-vmx tests, add subnormal test case.

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

6 years agoPPC64, fix issues with dnormal values in the vector fp instructions.
Carl Love [Tue, 28 May 2019 16:26:13 +0000 (11:26 -0500)] 
PPC64, fix issues with dnormal values in the vector fp instructions.

The result of the floating point instructions vmaddfp, vnmsubfp,
vaddfp, vsubfp, vmaxfp, vminfp, vrefp, vrsqrtefp, vcmpeqfp, vcmpeqfp,
vcmpgefp, vcmpgtfp are controlled by the setting of the NJ bit in
the VSCR register.  If VSCR[NJ] = 0; then denormalized values are
handled as specified by Java and the IEEE standard.  If the bit is
a 1, then the denormalized element in the vector is replaced with
a zero.

Valgrind was not properly handling the denormalized case for these
instructions.  This patch fixes the issue.

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

6 years agoBug 407764 - s390x: drd fails on z13 due to function wrapping issue
Andreas Arnez [Thu, 23 May 2019 15:17:43 +0000 (17:17 +0200)] 
Bug 407764 - s390x: drd fails on z13 due to function wrapping issue

The s390x-specific inline assembly macros for function wrapping in
include/valgrind.h have a few issues.

When the compiler uses vector registers, such as with "-march=z13", all
vector registers must be declared as clobbered by the callee.  Because
this is missing, many drd test failures are seen with "-march=z13".

Also, the inline assemblies write the return value into the target
register before restoring r11.  If r11 is used as the target register,
this means that the restore operation corrupts the result.  This bug
causes failures with memcheck's "wrap6" test case.

These bugs are fixed.  The clobber list is extended by the vector
registers (if appropriate), and the target register is now written at the
end, after restoring r11.

6 years agoppc64: Arguments to iselInt128Expr_to_32x4 should be initialized.
Mark Wielaard [Mon, 27 May 2019 18:31:35 +0000 (20:31 +0200)] 
ppc64: Arguments to iselInt128Expr_to_32x4 should be initialized.

Make sure to initialize the arguments to iselInt128Expr_to_32x4.
iselInt128Expr_to_32x4 will check that iselInt128Expr_to_32x4_wrk
has assigned the correct type of values to the arguments. But if
the arguments were never initialized it might not be able to when
iselInt128Expr_to_32x4_wrk was unable to assign a value.

Reviewed-by: Carl Love <cel@us.ibm.com>
6 years agoFix coding nit in x86amd64g_calculate_FXTRACT.
Mark Wielaard [Tue, 28 May 2019 15:20:31 +0000 (17:20 +0200)] 
Fix coding nit in x86amd64g_calculate_FXTRACT.

The current code "return getExp ? posInf : posInf;" looks like a typo.
But when the argument is positive infinity then both the significand
and the exponent are positive infinity (there is a fxtract testcase that
checks that). So no need to check getExp. Just always return posInf
if arg == posInf, but add a comment explaining why.

6 years agohost_amd64_defs.c don't initialize opc and subopc_imm in emit_AMD64Instr.
Mark Wielaard [Mon, 27 May 2019 18:50:02 +0000 (20:50 +0200)] 
host_amd64_defs.c don't initialize opc and subopc_imm in emit_AMD64Instr.

In the case of Ain_SseShiftN we first assign zero to opc and subopc_imm
before handling the various subops. But since we will (and must) always
assign a valid value to opc and subopc_imm we might get a compiler warning
about the values never being read before storing a different value.

So explicitly don't assign a value. Then the compiler will warn if we
would ever forget to assign it a value value later on before using it.

6 years agoCleanup GPL header address notices by using http://www.gnu.org/licenses/
Mark Wielaard [Sat, 25 May 2019 22:32:28 +0000 (00:32 +0200)] 
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

6 years agoFix DIP instruction name typos in guest_amd64_toIR.c.
Mark Wielaard [Sat, 25 May 2019 14:38:42 +0000 (16:38 +0200)] 
Fix DIP instruction name typos in guest_amd64_toIR.c.

DIP would print the wrong instruction name for blendps, vroundpd and
vpinsrq. Which would be confusing when trying to debug the disassembly.
These were probably typos or copy/paste errors since they would print
very similar instruction names.

6 years agoFix memory leak in launcher-linux.c
Mark Wielaard [Sat, 25 May 2019 14:31:02 +0000 (16:31 +0200)] 
Fix memory leak in launcher-linux.c

When the clientname argument is not a full absolute path we reconstruct
the full path using $PATH. This reconstructed full path would be leaked.
This is small and insignificant. But valgrind should give a good example.
So free the path again when we are done and allocated the memory.
Also don't print the path twice in the debug output if we didn't need to
construct a new different path for it.

6 years agovgdb: Fix read check in report_pid.
Mark Wielaard [Sat, 25 May 2019 14:25:19 +0000 (16:25 +0200)] 
vgdb: Fix read check in report_pid.

When read fails it will return -1. In which case we might assign
cmdline[sz] = 0 and print a garbage cmdline. Fix the test to check
the return value is > 0.

6 years agoFix memcheck/tests/linux/sys-copy_file_range open call (mode).
Mark Wielaard [Fri, 24 May 2019 19:51:31 +0000 (21:51 +0200)] 
Fix memcheck/tests/linux/sys-copy_file_range open call (mode).

sys-copy_file_range.c calls open with O_CREAT flag and so must provide
a mode argument. valgrind memcheck actually caught this ommission on
some arches (fedora rawhide i686 specifically).

This is a small additional fixup for
https://bugs.kde.org/show_bug.cgi?id=407218

6 years agoMake memcheck/tests/x86-linux/scalar test work under root.
Mark Wielaard [Mon, 20 May 2019 11:08:41 +0000 (13:08 +0200)] 
Make memcheck/tests/x86-linux/scalar test work under root.

Running the testsuite as root isn't really recommended.
But lets not make tests fail unnecessarily when running as root.
Similar to the arm64-linux/scalar fixes. Plus 32bit variants that
don't exist on arm64.

Pass really invalid arguments to setuid[32], setgid[32], acct, fchown[32].
Make setresgid[32], setresuid[32], setregid[32], setreuid[32] always succeed.

6 years agoMake memcheck/tests/arm64-linux/scalar test work under root.
Mark Wielaard [Sun, 19 May 2019 22:09:59 +0000 (00:09 +0200)] 
Make memcheck/tests/arm64-linux/scalar test work under root.

Running the testsuite as root isn't really recommended.
But lets not make tests fail unnecessarily when running as root.
Pass really invalid arguments to setuid, setgid, acct and fchown.
Make setresgid, setresuid, setregid and setreuid always succeed.

6 years agoaarch64 (arm64) isn't a supported architecture for exp-sgcheck.
Mark Wielaard [Sat, 18 May 2019 12:55:50 +0000 (14:55 +0200)] 
aarch64 (arm64) isn't a supported architecture for exp-sgcheck.

exp-sgcheck/pc_main.c contains:

   #if defined(VGA_arm) || defined(VGA_arm64)
      VG_(printf)("SGCheck doesn't work on ARM yet, sorry.\n");
      VG_(exit)(1);
   #endif

But exp-sgcheck/tests/is_arch_supported checked against uname -m
which returns aarch64 (not arm64). Fix the test check so the
exp-sgcheck tests are skipped instead of producing failures.

6 years agoAdd a test for the new gdbserver adddress[length] syntax.
Philippe Waroquiers [Sat, 18 May 2019 10:10:40 +0000 (12:10 +0200)] 
Add a test for the new gdbserver adddress[length] syntax.

6 years agoHave gdbserver accepts the syntax address[length]
Philippe Waroquiers [Thu, 16 May 2019 19:34:37 +0000 (21:34 +0200)] 
Have gdbserver accepts the syntax address[length]

The syntax address[length] can be used in all the gdbserer monitor
commands that need an address and optional length argument.

This commit also fixes an error message, and removes trailing whitespaces
in m_gdbserver.c

6 years agoExplicitly make testcase variable for sys-copy_file_range undefined.
Mark Wielaard [Wed, 15 May 2019 19:30:00 +0000 (21:30 +0200)] 
Explicitly make testcase variable for sys-copy_file_range undefined.

On some systems an extra warning could occur when a variable in
the memcheck/tests/linux/sys-copy_file_range testcase was undefined,
but (accidentially) pointed to known bad memory. Fix by defining the
variable as 0, but then marking it explicitly undefined using memcheck
VALGRIND_MAKE_MEM_UNDEFINED.

Followup for https://bugs.kde.org/show_bug.cgi?id=407218

6 years agomips: hook linux copy_file_range syscall
Petar Jovanovic [Fri, 10 May 2019 16:35:02 +0000 (16:35 +0000)] 
mips: hook linux copy_file_range syscall

Allow copy_file_range syscalls on MIPS32 and MIPS64.
Update .gitignore.

Related Bugzilla issue - KDE #407218.

6 years agomips64: allow Loongson baseline
Petar Jovanovic [Wed, 8 May 2019 15:17:25 +0000 (17:17 +0200)] 
mips64: allow Loongson baseline

Allow Loongson baseline on MIPS64. This fixes KDE #406824.

6 years agoIntercept stpcpy also in ld.so for arm64
Mark Wielaard [Tue, 7 May 2019 19:20:04 +0000 (21:20 +0200)] 
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

6 years agoHook linux copy_file_range syscall on arm.
Mark Wielaard [Sun, 5 May 2019 14:01:41 +0000 (16:01 +0200)] 
Hook linux copy_file_range syscall on arm.

6 years agoAdd support for the copy_file_range syscall
Alexandra Hajkova [Thu, 2 May 2019 12:24:02 +0000 (08:24 -0400)] 
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.

6 years agoMake the list of horrible filter_gdb sed expressions somewhat less horrible
Philippe Waroquiers [Sat, 27 Apr 2019 16:13:45 +0000 (18:13 +0200)] 
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.

6 years agomips: fix file permission of guest_mips_toIR.c
Petar Jovanovic [Mon, 22 Apr 2019 22:49:48 +0000 (22:49 +0000)] 
mips: fix file permission of guest_mips_toIR.c

Revert accidentally modified file permissions back to 0644.

6 years agomips: fix mips32r6 and mips64r6 compilation issue
Petar Jovanovic [Fri, 19 Apr 2019 14:04:26 +0000 (14:04 +0000)] 
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.

6 years agofilter_gdb: add regexp to filter out names which starts with a "."
Alexandra Hájková [Mon, 15 Apr 2019 13:34:12 +0000 (15:34 +0200)] 
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

6 years agoPrepare NEWS for 3.16.0
Philippe Waroquiers [Thu, 18 Apr 2019 19:08:43 +0000 (21:08 +0200)] 
Prepare NEWS for 3.16.0

So that the fixed bugs and changes can be documented directly.

6 years agoAdd missing outer argument when self-hosting valgrind.
Philippe Waroquiers [Thu, 18 Apr 2019 18:40:37 +0000 (20:40 +0200)] 
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.

6 years agoFix minor leaks in dhat.
Philippe Waroquiers [Thu, 18 Apr 2019 18:39:52 +0000 (20:39 +0200)] 
Fix minor leaks in dhat.

Only leaks in dh_fini, and only once.
But fixing these leaks is easier than maintain suppression entries.

6 years agoAdvance the head to 3.16.0.GIT.
Julian Seward [Thu, 18 Apr 2019 04:38:36 +0000 (06:38 +0200)] 
Advance the head to 3.16.0.GIT.

6 years agodrd/tests/tsan_unittest: Avoid that this test reads from uninitialized memory
Bart Van Assche [Sun, 14 Apr 2019 03:24:33 +0000 (20:24 -0700)] 
drd/tests/tsan_unittest: Avoid that this test reads from uninitialized memory

Reported-by: Philippe Waroquiers <philippe.waroquiers@skynet.be>
6 years agoSecond attempt at a 3.15.0 final version. VALGRIND_3_15_0
Julian Seward [Sat, 13 Apr 2019 10:37:42 +0000 (12:37 +0200)] 
Second attempt at a 3.15.0 final version.

6 years agoBug 406465 - arm64 instruction selector fails on "t0 = <expr>" where <expr> has type...
Julian Seward [Sat, 13 Apr 2019 10:34:06 +0000 (12:34 +0200)] 
Bug 406465 - arm64 instruction selector fails on "t0 = <expr>" where <expr> has type Ity_F16.

6 years ago-> 3.15.0 final
Julian Seward [Fri, 12 Apr 2019 05:35:34 +0000 (07:35 +0200)] 
-> 3.15.0 final

6 years agonone/tests/amd64-linux/map_32bits.vgtest fails too easily
Mark Wielaard [Thu, 11 Apr 2019 16:06:34 +0000 (18:06 +0200)] 
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

6 years agofilter_libc: remove the line holding the futex syscall error entirely
Mark Wielaard [Thu, 11 Apr 2019 16:01:24 +0000 (18:01 +0200)] 
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>
6 years ago-> 3.15.0.RC2
Julian Seward [Thu, 11 Apr 2019 07:16:40 +0000 (09:16 +0200)] 
-> 3.15.0.RC2

6 years agogdbserver_tests fails because of gdb output change.
Mark Wielaard [Tue, 9 Apr 2019 23:28:24 +0000 (01:28 +0200)] 
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>
6 years agogdbserver_tests: adjust filtering for the new gdb output
Alexandra Hájková [Tue, 9 Apr 2019 09:09:56 +0000 (11:09 +0200)] 
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

6 years agodhat is broken on x86 (32bit)
Mark Wielaard [Tue, 9 Apr 2019 23:22:37 +0000 (01:22 +0200)] 
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

6 years agoMore memcheck/tests/libstdc++.supp suppressions
Mark Wielaard [Tue, 9 Apr 2019 14:09:50 +0000 (16:09 +0200)] 
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

6 years agoAdd missing cachegrind/tests/a.c to EXTRA_DIST.
Mark Wielaard [Tue, 9 Apr 2019 12:47:05 +0000 (14:47 +0200)] 
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

6 years agoGET_STARTREGS for s390: fix register constraint (per comments from Andreas Arnez).
Julian Seward [Mon, 8 Apr 2019 12:16:48 +0000 (14:16 +0200)] 
GET_STARTREGS for s390: fix register constraint (per comments from Andreas Arnez).

6 years ago-> 3.15.0.RC1
Julian Seward [Mon, 8 Apr 2019 08:16:18 +0000 (10:16 +0200)] 
-> 3.15.0.RC1

6 years agoFix broken links in the Massif manual.
Julian Seward [Mon, 8 Apr 2019 07:29:03 +0000 (09:29 +0200)] 
Fix broken links in the Massif manual.

6 years agoMisc doc updates for upcoming 3.15.0 release.
Julian Seward [Mon, 8 Apr 2019 06:08:19 +0000 (08:08 +0200)] 
Misc doc updates for upcoming 3.15.0 release.

6 years agoUpdate __VALGRIND_MINOR__ for the upcoming 3.15 release.
Julian Seward [Mon, 8 Apr 2019 06:07:39 +0000 (08:07 +0200)] 
Update __VALGRIND_MINOR__ for the upcoming 3.15 release.

6 years agoFinalise bug-fix status notes.
Julian Seward [Mon, 8 Apr 2019 05:22:28 +0000 (07:22 +0200)] 
Finalise bug-fix status notes.

6 years agoFinalise wording w.r.t. the MPL.
Julian Seward [Mon, 8 Apr 2019 05:18:55 +0000 (07:18 +0200)] 
Finalise wording w.r.t. the MPL.

6 years agoMention --num-callers more in DHAT docs.
Nicholas Nethercote [Mon, 8 Apr 2019 00:18:38 +0000 (10:18 +1000)] 
Mention --num-callers more in DHAT docs.

6 years agoMention massif-visualizer in the Massif docs.
Nicholas Nethercote [Mon, 8 Apr 2019 00:14:18 +0000 (10:14 +1000)] 
Mention massif-visualizer in the Massif docs.

6 years agoInstall dhat viewer files in libexec.
Mark Wielaard [Sun, 7 Apr 2019 21:59:54 +0000 (23:59 +0200)] 
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.

6 years agoAdd arm64 do_syscall_WRK implementation to memcheck/tests/leak-segv-jmp.
Mark Wielaard [Sun, 7 Apr 2019 20:27:52 +0000 (22:27 +0200)] 
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.

6 years agoAdd (minimal) manual page for valgrind-di-server.
Mark Wielaard [Sun, 7 Apr 2019 16:28:40 +0000 (18:28 +0200)] 
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.

6 years agoPPC64, fix test_isa_3_0_other.c test
Carl Love [Fri, 5 Apr 2019 20:04:23 +0000 (15:04 -0500)] 
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>

6 years agoBug 404843 - s390x: backtrace sometimes ends prematurely.
Julian Seward [Fri, 5 Apr 2019 18:10:46 +0000 (20:10 +0200)] 
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.

6 years agoPPC64, patch to test case issues reported in bugzilla 401827 and 401828.
Carl Love [Thu, 4 Apr 2019 17:31:05 +0000 (12:31 -0500)] 
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>

6 years agoDHAT: when the run ends, print a how-to-view-the-profile hint message. n-i-bz.
Julian Seward [Thu, 4 Apr 2019 10:08:26 +0000 (12:08 +0200)] 
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.

6 years agomips32: pass correct syscall value to kernel in case of __NR_syscall
Petar Jovanovic [Wed, 3 Apr 2019 17:38:08 +0000 (17:38 +0000)] 
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.

6 years agoSupport arm64 core dump
Alexandra Hajkova [Wed, 20 Mar 2019 09:10:44 +0000 (10:10 +0100)] 
Support arm64 core dump

Fixes BZ #405722.
Implements coredump-elf.c fill_prstatus()
and fill_fpu () for VGP_arm64_linux.

6 years agoUpdate NEWS and docs/internals/3_14_BUGSTATUS.txt to reflect current bug-fix status.
Julian Seward [Mon, 1 Apr 2019 13:31:13 +0000 (15:31 +0200)] 
Update NEWS and docs/internals/3_14_BUGSTATUS.txt to reflect current bug-fix status.

6 years agoAnnounce fix 405782 "VEX temporary storage exhausted" when attempting to debug slic3r-pe
Philippe Waroquiers [Sat, 30 Mar 2019 18:09:31 +0000 (19:09 +0100)] 
Announce fix 405782  "VEX temporary storage exhausted" when attempting to debug slic3r-pe

This bug was fixed by various optimisations done by Julian.

6 years agomips: get rid of format and implicit-fallthrough warnings
Petar Jovanovic [Thu, 28 Mar 2019 17:33:31 +0000 (18:33 +0100)] 
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.

6 years agoupdate NEWS about fixed KDE #400975
Petar Jovanovic [Thu, 28 Mar 2019 10:20:47 +0000 (10:20 +0000)] 
update NEWS about fixed KDE #400975

KDE #400975 has been fixed with commit
e61d13087096139024788393218367572751b4b6

6 years agomips: code refactoring (NFC)
Petar Jovanovic [Wed, 27 Mar 2019 18:42:05 +0000 (18:42 +0000)] 
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.

6 years agoUse ULong instead of unsigned long in s390_irgen_EX_SS.
Mark Wielaard [Wed, 27 Mar 2019 14:51:34 +0000 (15:51 +0100)] 
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.

6 years agoUse gcc -Wimplicit-fallthrough=2 by default if available
Mark Wielaard [Tue, 12 Mar 2019 22:17:32 +0000 (23:17 +0100)] 
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

6 years agomips: use local labels for do_acasW()
Petar Jovanovic [Mon, 25 Mar 2019 18:53:21 +0000 (19:53 +0100)] 
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.

6 years agoupdate .gitignore with amd64 tests f16c and rdrand
Petar Jovanovic [Mon, 25 Mar 2019 17:45:04 +0000 (17:45 +0000)] 
update .gitignore with amd64 tests f16c and rdrand

Add
  /none/tests/amd64/f16c
  /none/tests/amd64/rdrand

to .gitignore.

6 years agomips: if revision is specified, use it for compilation
Petar Jovanovic [Mon, 25 Mar 2019 17:39:38 +0000 (17:39 +0000)] 
mips: if revision is specified, use it for compilation

If user has specified a particular MIPS revision in configure line,
do not interfere with this (i.e. skip setting FLAG_M32/FLAG_M64).

Related KDE issues #402123 and #400975.

Patch by Stefan Maksimovic.

6 years agomips: add a comment about decoding LX on Cavium
Petar Jovanovic [Mon, 25 Mar 2019 16:45:47 +0000 (16:45 +0000)] 
mips: add a comment about decoding LX on Cavium

Interpret LX as a Cavium instruction, otherwise try decoding it as a DSP
instruction.
The fallthrough is deliberate.

Related to KDE #405430.

6 years agoPPC64, fix for vrlwnm, vrlwmi, vrldrm, vrldmi instructions.
Carl Love [Fri, 22 Mar 2019 17:50:52 +0000 (12:50 -0500)] 
PPC64, fix for vrlwnm, vrlwmi, vrldrm, vrldmi instructions.

Fixes the case where the specified end bit is less then the start bit.

Valgrind bug 405734

6 years agoPPC64, fix output for xvcvdpsp instruction.
Carl Love [Fri, 22 Mar 2019 17:42:27 +0000 (12:42 -0500)] 
PPC64, fix output for xvcvdpsp instruction.

The instruction should write the output to the upper and lower 32-bit
halfs of the results.

Valgrind bugzilla 405733.

6 years agoPPC64, The function _get_maxmin_fp_NaN does not handle the case of QNaN, SNaN correctly.
Carl Love [Fri, 22 Mar 2019 17:32:29 +0000 (12:32 -0500)] 
PPC64, The function _get_maxmin_fp_NaN does not handle the case of QNaN, SNaN correctly.

This patch fixes Valgrind to handle the case of QNaN, SNaN input the same
as the HW handles it.

Valgrind bug 405365.

6 years agoPPC64, instructions xvcvdpsxws, xvcvdpuxws do not handle over/underflow, NaN correctly
Carl Love [Fri, 22 Mar 2019 17:26:00 +0000 (12:26 -0500)] 
PPC64, instructions xvcvdpsxws, xvcvdpuxws do not handle over/underflow, NaN correctly

The instructions are not checking for overflow, underflow, NaN and setting
the output correctly.

Valgrind bugzilla 405363

6 years agoPPC64, fix for vmsummbm instruction.
Carl Love [Fri, 22 Mar 2019 17:06:31 +0000 (12:06 -0500)] 
PPC64, fix for vmsummbm instruction.

The instruction needs to have the 32-bit "lane" values chopped to 32-bits.
The current lane implementation is not doing the chopping.  Need to
explicitly do the chop and add.

Valgrind bug 405362

6 years agoPPC64, fix implementation of xvcvsxdsp and xvcvuxddp instructions.
Carl Love [Fri, 22 Mar 2019 16:56:38 +0000 (11:56 -0500)] 
PPC64, fix implementation of xvcvsxdsp and xvcvuxddp instructions.

Instructions need to write result to upper and lower 32-bit half of the
64-bit result.

This is a fix for Valgrind bug 405356.

6 years agodrd: Fix an integer overflow in the stack margin calculation
Bart Van Assche [Fri, 22 Mar 2019 03:08:45 +0000 (20:08 -0700)] 
drd: Fix an integer overflow in the stack margin calculation

6 years agoupdate NEWS about the fix for KDE #405458
Petar Jovanovic [Mon, 18 Mar 2019 15:55:09 +0000 (15:55 +0000)] 
update NEWS about the fix for KDE #405458

KDE #405458 has been fixed in the previous commit

  commit 029f1196fcafb49183c87c53e3a7febc762a0dc8
  Author: Petar Jovanovic <mips32r2@gmail.com>
  Date:   Mon Mar 18 16:47:50 2019 +0100

  mips: correct order of function arguments for mkFormVEC

6 years agomips: correct order of function arguments for mkFormVEC
Petar Jovanovic [Mon, 18 Mar 2019 15:47:50 +0000 (16:47 +0100)] 
mips: correct order of function arguments for mkFormVEC

Vectors wt and ws were incorrectly received in mkFormVEC().
Issue spotted by Mark Wielaard and reported as KDE #405458.

6 years agoamd64: Implement RDRAND, VCVTPH2PS and VCVTPS2PH.
Julian Seward [Sun, 17 Mar 2019 20:41:42 +0000 (21:41 +0100)] 
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.

6 years agoFix Bug 404638 - Add VG_(replaceIndexXA)
Philippe Waroquiers [Sat, 16 Mar 2019 11:08:01 +0000 (12:08 +0100)] 
Fix Bug 404638 - Add VG_(replaceIndexXA)

Based on a patch from Łukasz Marek.

Note that this function differs from:
   *(T*)VG_(indexXA)(arr, index) = new_value;
as the function will mark the array as unsorted.

Note that this function is currently unused in the current valgrind code basis,
but it is useful for tools outside of valgrind tree.

6 years agoBug 405403 - s390x: Allow using disInstr_S390 on little-endian hosts
Ilya Leoshkevich [Tue, 12 Mar 2019 18:23:55 +0000 (19:23 +0100)] 
Bug 405403 - s390x: Allow using disInstr_S390 on little-endian hosts

Certain projects, e.g. https://angr.io, use VEX as an intermediate
representation for the binary code analysis. In order to make it
possible to use them to analyze S/390 code on Intel, this patch
resolves the following issues in the disassembler:

- Bit fields, which are used to describe instruction formats, map to
  different bits on different hosts. This patch replaces them with
  macros, e.g. SS.l bit field becomes SS_l macro. Most bit field usages
  are replaced using the following perl script:

    perl -p -i \
         -e 's/\(&ovl\.value\)/&ovl/g;' \
         -e 's/ovl\.value/ovl/g;' \
         -e 's/ovl\.fmt\.([a-zA-Z\d_]+)\.([a-z\d]+)/$1_$2(ovl)/g' \
         priv/guest_s390_toIR.c

  Since after that there are no more structs, #pragma pack is also
  removed.

- Instructions are loaded from memory as words, which behaves
  differently depending on host endianness. Such loads are replaced by
  assembly of words from separately loaded bytes. This affects regular
  disassembly functions, and also s390_irgen_EXRL(), which loads
  last_execute_target this way.

- disInstr_S390() explicitly prohibits little-endian hosts with an
  assert, which is removed in this patch.

Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
6 years agoFinetune arch_hwcaps() in none/tests/libvex_test.c
Petar Jovanovic [Thu, 14 Mar 2019 16:02:53 +0000 (16:02 +0000)] 
Finetune arch_hwcaps() in none/tests/libvex_test.c

The libvexmultiarch_test failed on s390, since VEX was configured for MIPS64
with 32bit FPUs. Modify arch_hwcaps() to a realist case with 64bit FPUs.

This fixes KDE #402351.

6 years agoDocument 403123 as fixed
Tom Hughes [Thu, 14 Mar 2019 15:22:44 +0000 (15:22 +0000)] 
Document 403123 as fixed

6 years agoSuppress FSGSBASE flag from cpuid results
Tom Hughes [Thu, 14 Mar 2019 15:15:41 +0000 (15:15 +0000)] 
Suppress FSGSBASE flag from cpuid results

We don't support {rd,wr}{fs,gs}base so we shouldn't say we do.

6 years agoBug 399287 - amd64 front end: Illegal Instruction vcmptrueps. Add test cases.
Julian Seward [Wed, 13 Mar 2019 13:24:46 +0000 (14:24 +0100)] 
Bug 399287 - amd64 front end: Illegal Instruction vcmptrueps.  Add test cases.

6 years agoBug 399287 - amd64 front end: Illegal Instruction vcmptrueps. Fix, but no test cases.
Julian Seward [Wed, 13 Mar 2019 13:22:52 +0000 (14:22 +0100)] 
Bug 399287 - amd64 front end: Illegal Instruction vcmptrueps.  Fix, but no test cases.

6 years agoRename gettid() to gettid_sys() in gdbserver_tests.
Mark Wielaard [Mon, 4 Mar 2019 18:47:59 +0000 (19:47 +0100)] 
Rename gettid() to gettid_sys() in gdbserver_tests.

glibc might defined gettid() itself through unistd.h:
https://sourceware.org/bugzilla/show_bug.cgi?id=6399

Rename to gettid_sys() so we don't clash with the glibc definition.

6 years agoVEX/auxprogs/genoffsets.c: Add cast to my_offsetof. n-i-bz.
Julian Seward [Tue, 12 Mar 2019 17:37:15 +0000 (18:37 +0100)] 
VEX/auxprogs/genoffsets.c: Add cast to my_offsetof.  n-i-bz.

Clang/LLVM trips over my_offsetof in VEX/auxprogs/genoffsets.c.  See LLVM
PR 40890 for details (https://bugs.llvm.org/show_bug.cgi?id=40890).

Now, it's a Clang bug that Clang exits on an assertion failure rather than
emits a diagnostic, but the previous my_offsetof expression is a pointer,
not an integer.  Add a cast as done in other definitions of offsetof in
the tree.  Patch from Ed Maste <emaste@freebsd.org>.

6 years agoAdd missing documentation file from EXTRA_DIST
Rhys Kidd [Fri, 1 Feb 2019 03:21:22 +0000 (22:21 -0500)] 
Add missing documentation file from EXTRA_DIST

Ensure this documentation file is included in tarball.

Fixes: 9f3d49a ("Create 3.10.0 section in NEWS, add (first draft of) README_DEVELOPERS_processes")
Signed-off-by: Rhys Kidd <rhyskidd@gmail.com>