]> git.ipfire.org Git - thirdparty/valgrind.git/log
thirdparty/valgrind.git
8 years agoaarch64: enable clock_adjtime syscall (generic wrapper)
Mark Wielaard [Sat, 18 Feb 2017 21:16:01 +0000 (21:16 +0000)] 
aarch64: enable clock_adjtime syscall (generic wrapper)

Patch by Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16244

8 years agoaarch64: enable fanotify_mark syscall (generic wrapper)
Mark Wielaard [Sat, 18 Feb 2017 21:16:00 +0000 (21:16 +0000)] 
aarch64: enable fanotify_mark syscall (generic wrapper)

Patch by Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16243

8 years agoaarch64: enable fanotify_init syscall (generic wrapper)
Mark Wielaard [Sat, 18 Feb 2017 21:16:00 +0000 (21:16 +0000)] 
aarch64: enable fanotify_init syscall (generic wrapper)

Patch by Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16242

8 years agoaarch64: enable rt_tgsigqueueinfo syscall (generic wrapper)
Mark Wielaard [Sat, 18 Feb 2017 21:15:59 +0000 (21:15 +0000)] 
aarch64: enable rt_tgsigqueueinfo syscall (generic wrapper)

Patch by Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16241

8 years agoaarch64: enable move_pages syscall (generic wrapper)
Mark Wielaard [Sat, 18 Feb 2017 21:15:58 +0000 (21:15 +0000)] 
aarch64: enable move_pages syscall (generic wrapper)

Patch by Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16240

8 years agoaarch64: enable request_key syscall (generic wrapper)
Mark Wielaard [Sat, 18 Feb 2017 21:15:57 +0000 (21:15 +0000)] 
aarch64: enable request_key syscall (generic wrapper)

Patch by Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16239

8 years agoaarch64: enable tkill syscall (generic wrapper)
Mark Wielaard [Sat, 18 Feb 2017 21:15:56 +0000 (21:15 +0000)] 
aarch64: enable tkill syscall (generic wrapper)

Patch by Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16238

8 years agoaarch64: enable sched_rr_get_interval syscall (generic wrapper)
Mark Wielaard [Sat, 18 Feb 2017 21:15:55 +0000 (21:15 +0000)] 
aarch64: enable sched_rr_get_interval syscall (generic wrapper)

Patch by Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16237

8 years agoaarch64: enable delete_module syscall (generic wrapper)
Mark Wielaard [Sat, 18 Feb 2017 21:15:54 +0000 (21:15 +0000)] 
aarch64: enable delete_module syscall (generic wrapper)

Patch by Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16236

8 years agoaarch64: enable get_robust_list syscall (generic wrapper)
Mark Wielaard [Sat, 18 Feb 2017 21:15:53 +0000 (21:15 +0000)] 
aarch64: enable get_robust_list syscall (generic wrapper)

Patch by Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16235

8 years agoaarch64: enable unshare syscall (generic wrapper)
Mark Wielaard [Sat, 18 Feb 2017 21:15:53 +0000 (21:15 +0000)] 
aarch64: enable unshare syscall (generic wrapper)

Patch by Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16234

8 years agoaarch64: enable sync_file_range syscall (generic wrapper)
Mark Wielaard [Sat, 18 Feb 2017 21:15:52 +0000 (21:15 +0000)] 
aarch64: enable sync_file_range syscall (generic wrapper)

Patch by Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16233

8 years agoaarch64: enable pivot_root syscall (generic wrapper)
Mark Wielaard [Sat, 18 Feb 2017 21:15:51 +0000 (21:15 +0000)] 
aarch64: enable pivot_root syscall (generic wrapper)

Patch by Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16232

8 years agoaarch64: remove bogus syscall part
Mark Wielaard [Sat, 18 Feb 2017 21:15:50 +0000 (21:15 +0000)] 
aarch64: remove bogus syscall part

Patch by Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16231

8 years agoaarch64: add missing syscalls into table
Mark Wielaard [Sat, 18 Feb 2017 21:15:49 +0000 (21:15 +0000)] 
aarch64: add missing syscalls into table

All entries are added disabled - enabling them will be done later.

Patch by Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16230

8 years agofix order of timer_* syscalls on aarch64 - bug #371225
Mark Wielaard [Sat, 18 Feb 2017 21:15:48 +0000 (21:15 +0000)] 
fix order of timer_* syscalls on aarch64 - bug #371225

Signed-off-by: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16229

8 years agoBug 376611 - ppc64 and arm64 don't know about prlimit64 syscall.
Mark Wielaard [Sat, 18 Feb 2017 13:20:16 +0000 (13:20 +0000)] 
Bug 376611 - ppc64 and arm64 don't know about prlimit64 syscall.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16228

8 years agoSolaris: Add syscall wrapper for fast trap getlgrp(6)
Ivo Raisr [Thu, 16 Feb 2017 18:29:46 +0000 (18:29 +0000)] 
Solaris: Add syscall wrapper for fast trap getlgrp(6)
Fixes BZ#376518.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16227

8 years agoSolaris: include <sys/lgrp_user_impl.h> only on newer Solaris.
Ivo Raisr [Wed, 15 Feb 2017 15:22:05 +0000 (15:22 +0000)] 
Solaris: include <sys/lgrp_user_impl.h> only on newer Solaris.
Follow up to SVN r16224 and r16225, BZ#376455.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16226

8 years agoSolaris: Add additional subcodes for lgrpsys(180) syscall
Ivo Raisr [Tue, 14 Feb 2017 12:38:06 +0000 (12:38 +0000)] 
Solaris: Add additional subcodes for lgrpsys(180) syscall
Fixes BZ#376455.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16225

8 years agoSolaris: Add syscall wrapper for lgrpsys(180)
Ivo Raisr [Tue, 14 Feb 2017 10:35:20 +0000 (10:35 +0000)] 
Solaris: Add syscall wrapper for lgrpsys(180)
Fixes BZ#376455.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16224

8 years agoadd none/tests/linux/clonev to svn:ignore list
Petar Jovanovic [Mon, 13 Feb 2017 18:06:10 +0000 (18:06 +0000)] 
add none/tests/linux/clonev to svn:ignore list

add clonev to the svn:ignore list, for the sake of tidiness.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16223

8 years agoDocument BZ#376279
Tom Hughes [Sat, 11 Feb 2017 10:46:02 +0000 (10:46 +0000)] 
Document BZ#376279

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16222

8 years agoam_munmap_both_wrk: safely initialise out-param for all return paths.
Julian Seward [Wed, 8 Feb 2017 08:27:34 +0000 (08:27 +0000)] 
am_munmap_both_wrk: safely initialise out-param for all return paths.
Silences what I think is a false complaint from gcc at -O3.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16221

8 years agofix leak-segv-jmp test for platforms with 64K pagesize
Petar Jovanovic [Fri, 3 Feb 2017 01:19:55 +0000 (01:19 +0000)] 
fix leak-segv-jmp test for platforms with 64K pagesize

Increase the size of allocated array, so mprotect call does not end up
protecting non-allocated areas. This enables the test to work on
platforms with pagesize=64K.

Issue discovered on MIPS XLP machine with 64K pagesize.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16220

8 years agoadd suppression for helgrind/tests/tc22_exit_w_lock
Petar Jovanovic [Fri, 3 Feb 2017 00:34:52 +0000 (00:34 +0000)] 
add suppression for helgrind/tests/tc22_exit_w_lock

Function pthread_create indirectly calls function memcpy. Helgrind
considers that memcpy is not thread safe function. For error reported
from pthread_create there is the suppression helgrind---_dl_allocate_tls
in the file glibc-2.34567-NPTL-helgrind.supp.
Since glibc version 2.23, memcpy is implemented by __mempcpy_inline.
This causes that call to memcpy from pthread_create is no longer
recognized by the suppression.
In test helgrind/tests/tc22_exit_w_lock, pthread_create is called twice,
and second call reports error, which causes failing of the test.
This patch adds suppression for glibc 2.23 and greater.

Patch by Tamara Vlahovic.

Related issue #375806.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16219

8 years agoAdd PROT_READ flag to mmap, as Valgrind needs to be able to read the
Petar Jovanovic [Thu, 2 Feb 2017 17:24:14 +0000 (17:24 +0000)] 
Add PROT_READ flag to mmap, as Valgrind needs to be able to read the
code before it executes it.

This fixes none/tests/bigcode on some MIPS platforms.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16218

8 years agoforce old implementation of std::string for leak_cpp_interior test
Petar Jovanovic [Tue, 31 Jan 2017 18:22:20 +0000 (18:22 +0000)] 
force old implementation of std::string for leak_cpp_interior test

This patch forces leak_cpp_interior to be compiled using old implementation
of std::string.

Related issue #373069

Patch by Aleksandar Rikalo.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16217

8 years agoFix +1 error in get_elf_symbol_info() when computing value of 'hi' address for ML_...
Ivo Raisr [Tue, 31 Jan 2017 12:33:54 +0000 (12:33 +0000)] 
Fix +1 error in get_elf_symbol_info() when computing value of 'hi' address for ML_(find_rx_mapping)()
Fixes BZ#375772

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16216

8 years agomips: implement calculation for static TLS
Petar Jovanovic [Mon, 30 Jan 2017 19:33:47 +0000 (19:33 +0000)] 
mips: implement calculation for static TLS

Extend valgrind_get_tls_addr() with static TLS calculation for MIPS.

Related issue #375514.

Patch by Aleksandar Rikalo.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16215

8 years agoSamll changes on xtree leak event short names
Philippe Waroquiers [Sun, 29 Jan 2017 16:11:19 +0000 (16:11 +0000)] 
Samll changes on xtree leak event short names

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16214

8 years agoAdding new filter to memcheck/tests/filter_stderr
Petar Jovanovic [Fri, 27 Jan 2017 18:20:50 +0000 (18:20 +0000)] 
Adding new filter to memcheck/tests/filter_stderr

This should fix issue with sendmsg test and glibc 2.22.

Glibc 2.22 introduced sysdeps/unix/sysv/linux/sendmsg.c that has
__libc_sendmsg function implementation (in comparison to earlier
implementation in syscall-template.S).
So, test suite needs to filter out this case, otherwise we get test
diffs such as:

 Syscall param sendmsg(msg) points to uninitialised byte(s)
-   at 0x........: sendmsg (in /...libc...)
+   at 0x........: sendmsg (sendmsg.c:28)

which are false positives.

This fixes memcheck/tests/sendmsg (stderr) on platforms with 2.22+ glibc.

Patch by Aleksandra Karadzic.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16213

8 years agomips: fix target_get_drv() function
Petar Jovanovic [Fri, 27 Jan 2017 17:55:13 +0000 (17:55 +0000)] 
mips: fix target_get_drv() function

Return correct Dtv location. Top of MIPS tcbhead structure is located
0x7000 bytes before the value of ULR. Dtv is the first of two pointers
in the tcbhead structure.

This fixes gdbserver_tests/hgtls on some MIPS platforms.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16212

8 years agomips32: add support for ptrace syscall
Petar Jovanovic [Fri, 27 Jan 2017 17:01:49 +0000 (17:01 +0000)] 
mips32: add support for ptrace syscall

Add wrapers for ptrace syscall for mips32.

Patch by Aleksandra Karadzic.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16211

8 years agoDocument limitation of --log-file when a program forks.
Ivo Raisr [Wed, 25 Jan 2017 07:22:18 +0000 (07:22 +0000)] 
Document limitation of --log-file when a program forks.
Follow up to r16200 and BZ#162848.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16210

8 years agoxtree: use "UnknownFile???" and "UnknownFn???" instead of "???"
Philippe Waroquiers [Sat, 21 Jan 2017 19:24:33 +0000 (19:24 +0000)] 
xtree: use  "UnknownFile???" and "UnknownFn???" instead of "???"
and "file ???"

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16209

8 years agoSimilar to xtree memory, give a user msg with the xtree leak filename
Philippe Waroquiers [Sat, 21 Jan 2017 15:46:44 +0000 (15:46 +0000)] 
Similar to xtree memory, give a user msg with the xtree leak filename

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16208

8 years agoFix --help for --xtree-leak-file
Philippe Waroquiers [Sat, 21 Jan 2017 13:22:06 +0000 (13:22 +0000)] 
Fix --help for --xtree-leak-file

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16207

8 years agoxtree leak.
Philippe Waroquiers [Sat, 21 Jan 2017 12:20:33 +0000 (12:20 +0000)] 
xtree leak.
As option --xtree-leak=yes is useless without a full leak report,
sets automatically full leak report if xtree leak report is requested.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16206

8 years agoAllow memcheck to output the leak results as a callgrind xtree file.
Philippe Waroquiers [Sat, 21 Jan 2017 11:00:39 +0000 (11:00 +0000)] 
Allow memcheck to output the leak results as a callgrind xtree file.

* New command line options --xtree-leak=no|yes and --xtree-leak-file=<file>
  to produce the end of execution leak report in a xtree callgrind format
  file.

* New option 'xtleak' in the memcheck leak_check monitor command, to
  produce the leak report in an xtree file.

* File name template arguments (such as --log-file, --xtree-memory-file, ...)
  have a new %n format letter that is replaced by a sequence number.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16205

8 years agox86-linux: Initialize x86 system GDT on first use. Bug 344139 comment 3.
Julian Seward [Fri, 20 Jan 2017 09:58:15 +0000 (09:58 +0000)] 
x86-linux: Initialize x86 system GDT on first use.  Bug 344139 comment 3.
Patch from Sebastian Lackner, sebastian@fds-team.de.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16204

8 years agoConnect the v8 FP and SIMD tests to the build system.
Julian Seward [Thu, 19 Jan 2017 06:53:13 +0000 (06:53 +0000)] 
Connect the v8 FP and SIMD tests to the build system.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16203

8 years agoAdd support for Iop_MaxNumF64, Iop_MinNumF64, Iop_MaxNumF32 and
Julian Seward [Fri, 13 Jan 2017 18:02:38 +0000 (18:02 +0000)] 
Add support for Iop_MaxNumF64, Iop_MinNumF64, Iop_MaxNumF32 and
Iop_MinNumF32, as introduced in vex r3293.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16202

8 years agomips64: update exp file for test_math
Petar Jovanovic [Fri, 13 Jan 2017 16:29:15 +0000 (16:29 +0000)] 
mips64: update exp file for test_math

Leave the old exp file that covers cases in which __addtf3 and __subtf3
did not take into account rounding modes. New exp file is the same file
that already exists in mips32 folder, so we just create a symbolic link
to it.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16201

8 years agoFix a bug when --log-file output isn't split when a program forks.
Ivo Raisr [Thu, 12 Jan 2017 11:28:20 +0000 (11:28 +0000)] 
Fix a bug when --log-file output isn't split when a program forks.
Patch loosely based on idea by Timur Iskhodzhanov <timurrrr@google.com>.
Fixes BZ#162848

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16200

8 years agoDo not capture the free stacktrace in memcheck, unless we have
Philippe Waroquiers [Wed, 11 Jan 2017 22:13:52 +0000 (22:13 +0000)] 
Do not capture the free stacktrace in memcheck, unless we have
either to keep the free stacktrace and/or to compute full xtree memory.

Also, properly compute avg nr of IP per execontext: the avg must
be computed using the real nr of execontext stored, not the hash
table size.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16199

8 years agoMake this compile for both ARM and Thumb encodings,
Julian Seward [Wed, 11 Jan 2017 21:49:40 +0000 (21:49 +0000)] 
Make this compile for both ARM and Thumb encodings,
and make it produce identical results for both encodings.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16198

8 years agoFix comments in m_trampoline.S for amd64/Solaris redirs.
Ivo Raisr [Wed, 11 Jan 2017 21:17:42 +0000 (21:17 +0000)] 
Fix comments in m_trampoline.S for amd64/Solaris redirs.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16197

8 years agoAdd a format marker to callgrind files
Josef Weidendorfer [Tue, 10 Jan 2017 20:21:21 +0000 (20:21 +0000)] 
Add a format marker to callgrind files

KCachegrind currently uses a quick format detection before
actually loading a file, and checks for a line starting with
"events:" in the first 2kB for that. This obviously is fragile,
as shown by an internal bug report by Philippe: before the
"events" line, Callgrind puts a "cmd:" line with the command
line. If this is very long, the detection fails and the file
does not get loaded at all.

While KCachegrind would not need to have this quick format
check at all, it is useful if multiple input format filters
get supported at some point, to automatically select the
correct filter.

Further, for the "file" command, for file managers and
desktop environments, having an unique way to detect a
file format is important.

It is not too late to fix this issue for the callgrind format.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16196

8 years agoxtree: CALLED_FLF must be called only up to ips[0] + minor doc update
Philippe Waroquiers [Tue, 10 Jan 2017 18:07:07 +0000 (18:07 +0000)] 
xtree: CALLED_FLF must be called only up to ips[0] + minor doc update

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16195

8 years agoAdd test cases for 32-bit v8 FP and SIMD insns.
Julian Seward [Tue, 10 Jan 2017 16:09:53 +0000 (16:09 +0000)] 
Add test cases for 32-bit v8 FP and SIMD insns.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16194

8 years agoxtree: minor updates to documentation, comments and indentation, no functional change.
Philippe Waroquiers [Fri, 6 Jan 2017 18:38:27 +0000 (18:38 +0000)] 
xtree: minor updates to documentation, comments and indentation, no functional change.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16193

8 years agoAdd Solaris specific notes on running regression tests
Ivo Raisr [Tue, 3 Jan 2017 22:03:43 +0000 (22:03 +0000)] 
Add Solaris specific notes on running regression tests
Reported by: Paul Floyd <paulf@free.fr>
n-i-bz

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16192

8 years agoUpdate NEWS for recent VEX commit r3288.
Ivo Raisr [Fri, 23 Dec 2016 12:40:33 +0000 (12:40 +0000)] 
Update NEWS for recent VEX commit r3288.
Fixes BZ#373938.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16191

8 years agomips: fix "cast-equal" warnings in coredump-elf.c
Petar Jovanovic [Wed, 21 Dec 2016 17:45:28 +0000 (17:45 +0000)] 
mips: fix "cast-equal" warnings in coredump-elf.c

Remove the following warnings from the build:
m_coredump/coredump-elf.c:521:31: warning: cast discards 'const'
qualifier from pointer target type [-Wcast-qual]

Related BZ#370028

Patch by Aleksandar Rikalo.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16190

8 years agoRename BBPTR to GSPTR as it denotes guest state pointer only
Ivo Raisr [Fri, 16 Dec 2016 21:21:05 +0000 (21:21 +0000)] 
Rename BBPTR to GSPTR as it denotes guest state pointer only
Fixes BZ#373555.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16189

8 years agomips: remove some old cruft from clone functions
Petar Jovanovic [Fri, 16 Dec 2016 18:31:57 +0000 (18:31 +0000)] 
mips: remove some old cruft from clone functions

Follow up to r16186 when this cruft was noticed.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16188

8 years agoAdd missing EXTRA_DIST clonev.stdout.exp
Philippe Waroquiers [Sun, 11 Dec 2016 22:18:07 +0000 (22:18 +0000)] 
Add missing EXTRA_DIST clonev.stdout.exp

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16187

8 years agoFix 342040 Valgrind mishandles clone with CLONE_VFORK | CLONE_VM that clones to a...
Philippe Waroquiers [Sun, 11 Dec 2016 21:39:23 +0000 (21:39 +0000)] 
Fix 342040 Valgrind mishandles clone with CLONE_VFORK | CLONE_VM that clones to a different stack
Fix 373192 Calling posix_spawn in glibc 2.24 completely broken

Functionally, this patch just does the following 2 changes to the
fork clone handling:
* It does not mask anymore CLONE_VFORK :
  The only effect of this flag is to suspend the parent, waiting for
  the child to either exit or execve.
  If some applications depends on this synchronisation, better keep it,
  as it will not harm to suspend the parent valgrind waiting for the
  child valgrind to exit or execve.
* In case the guest calls the clone syscall providing a non zero client stack,
  set the child guest SP after the syscall, before executing guest instructions.
  Not setting the guest stack ptr was the source of the problem reported
  in the bugs.

This also adds a test case  none/tests/linux/clonev.
Before this patch, test gives a SEGV, which is fixed by the patch.

The patch is however a lot bigger : this fix was touching some (mostly
identical/duplicated) code in all the linux platforms.
So, the clone/fork code has been factorised as much as possible.
This removes about 1700 lines of code.

This has been tested on:
* amd64
* x86
* ppc64 be and le
* ppc32
* arm64

This has been compiled on but *not really tested* on:
* mips64 (not too clear how to properly build and run valgrind on gcc22)

It has *not* been compiled and *not* tested on:
* arm
* mips32
* tilegx
* darwin   (normally, no impact)
* solaris  (normally, no impact)

The changes are relatively mechanical, so it is not impossible that
it will compile and work out of the box on these platforms.
Otherwise, questions welcome.

A few points of interest:
* Some platforms did have a typedef void vki_modify_ldt_t,
  and some platforms had no definition for this type at all.
  To make it easier to factorise, for such platforms, the following has
  been used:
     typedef char vki_modify_ldt_t;
    When the sizeof vki_modify_ldt_t is > 1, then the arg syscall is checked.
  This is somewhat a hack, but was simplifying the factorisation.

* for mips32/mips64 and tilegx, there is a strange unconditional assignment
  of 0 to a register (guest_r2 on mips, guest_r0 on tilegx).
  Unclear what this is, in particular because this is assigned whatever
  the result of the syscall (success or not).

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16186

8 years agoAdd placeholders for all new OS X 10.11 syscalls. Related to bz#348909.
Rhys Kidd [Sun, 11 Dec 2016 08:07:21 +0000 (08:07 +0000)] 
Add placeholders for all new OS X 10.11 syscalls. Related to bz#348909.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16185

8 years agoAdd placeholders for all new macOS 10.12 syscalls. Related to bz#365327.
Rhys Kidd [Sun, 11 Dec 2016 07:17:43 +0000 (07:17 +0000)] 
Add placeholders for all new macOS 10.12 syscalls. Related to bz#365327.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16184

8 years agomips64: add cvm_atomic.stdout.exp-BE
Petar Jovanovic [Sat, 10 Dec 2016 00:29:58 +0000 (00:29 +0000)] 
mips64: add cvm_atomic.stdout.exp-BE

Add BE variant of exp file for cvm_atomic test.
This fixes none/tests/mips64/cvm_atomic for Cavium MIPS64 BE systems.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16183

8 years agomips32: minor style change to r16181
Petar Jovanovic [Fri, 9 Dec 2016 18:51:58 +0000 (18:51 +0000)] 
mips32: minor style change to r16181

Divide one line into two lines that fit "80 columns" rule.
Non-functional change.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16182

8 years agomips32: allow execution of round_fpu64 test for fpxx
Petar Jovanovic [Fri, 9 Dec 2016 18:35:37 +0000 (18:35 +0000)] 
mips32: allow execution of round_fpu64 test for fpxx

Allow execution of none/tests/mips32/round_fpu64 test if it is built with
-mfpxx. It gets us more coverage eventually.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16181

8 years agomips: fix VG_(gdbserver_report_signal) arguments
Petar Jovanovic [Thu, 8 Dec 2016 14:52:02 +0000 (14:52 +0000)] 
mips: fix VG_(gdbserver_report_signal) arguments

When definition of VG_(gdbserver_report_signal) was changed in r15248,
the function VG_(synth_sigfpe) was omitted from the update.

This change fixes:

gdbserver_tests/mcsignopass              (stderr)
gdbserver_tests/mcsignopass              (stdoutB)
gdbserver_tests/mcsigpass                (stderr)
gdbserver_tests/mcsigpass                (stdoutB)

on MIPS platforms.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16180

8 years agoUpdate memcheck/tests/amd64-linux ignore list
Petar Jovanovic [Tue, 6 Dec 2016 14:07:30 +0000 (14:07 +0000)] 
Update memcheck/tests/amd64-linux ignore list

Add access_below_sp file to the ignore list.
Non-functional change.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16179

8 years agomips: add fadvise64 to svn ignore list
Petar Jovanovic [Tue, 6 Dec 2016 13:47:33 +0000 (13:47 +0000)] 
mips: add fadvise64 to svn ignore list

More housekeeping after r16175.
Add fadvise64 executable to the ignore list.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16178

8 years agoAdjust line number in mcblocklistsearch.stderrB.exp.
Mark Wielaard [Tue, 6 Dec 2016 09:50:47 +0000 (09:50 +0000)] 
Adjust line number in mcblocklistsearch.stderrB.exp.

valgrind svn r16173 "Add CLEAR_CALLER_SAVED_REGS in leak-tree test"
added one extra line to memcheck/tests/leak-tree.c which is used in
gdbserver_tests/mcblocklistsearch.vgtest. Adjust the line numbers in
the exp file to match.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16177

8 years agoSome housekeeping related to recent r16175.
Ivo Raisr [Tue, 6 Dec 2016 08:47:30 +0000 (08:47 +0000)] 
Some housekeeping related to recent r16175.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16176

8 years agomips: add regression test for fadvise64
Petar Jovanovic [Mon, 5 Dec 2016 18:00:01 +0000 (18:00 +0000)] 
mips: add regression test for fadvise64

Add regression tests for fadvise64.

Change by A Rikalo.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16175

8 years agoRemove second definition of typedef ‘Time’
Petar Jovanovic [Mon, 5 Dec 2016 16:54:06 +0000 (16:54 +0000)] 
Remove second definition of typedef ‘Time’

Remove redefinition of typedef ‘Time’ already defined in pub_tool_xtree.h

This fixes warning/error:

ms_main.c:633:14: warning: redefinition of typedef ‘Time’ [-Wpedantic]
 typedef Long Time;

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16174

8 years agoAdd CLEAR_CALLER_SAVED_REGS in leak-tree test
Petar Jovanovic [Mon, 5 Dec 2016 16:29:24 +0000 (16:29 +0000)] 
Add CLEAR_CALLER_SAVED_REGS in leak-tree test

Motivation for this change is similar to what has already been done in other
leak-* tests. That is, call CLEAR_CALLER_SAVED_REGS (currently used only on
PPC and MIPS arches) to clear temporary registers that might be holding
pointers lost in a previously called function.

This fixes memcheck/tests/leak-tree failure on some MIPS platforms.

Patch by Aleksandar Rikalo.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16173

8 years agomips: implement CLEAR_CALLER_SAVED_REGS for memcheck tests
Petar Jovanovic [Mon, 5 Dec 2016 16:03:21 +0000 (16:03 +0000)] 
mips: implement CLEAR_CALLER_SAVED_REGS for memcheck tests

Implement CLEAR_CALLER_SAVED_REGS macro that is used for some memcheck
tests. This is done in order to clear temporary registers that still
might be holding pointers to lost memory regions.
Similar change has been made for PPC.

This fixes the following tests:

memcheck/tests/leak-cases-full           (stderr)
memcheck/tests/leak-cases-summary        (stderr)
memcheck/tests/leak-cycle                (stderr)
memcheck/tests/lks                       (stderr)

on some MIPS platforms.

Patch by Aleksandar Rikalo.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16172

8 years agoUpdate SVN ignore propset for tests/libc_test. n-i-bz. Refer r16097.
Rhys Kidd [Sun, 4 Dec 2016 04:06:25 +0000 (04:06 +0000)] 
Update SVN ignore propset for tests/libc_test. n-i-bz. Refer r16097.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16171

8 years agoUpdate SVN ignore propset for include/vgversion.h. n-i-bz.
Rhys Kidd [Sun, 4 Dec 2016 04:00:11 +0000 (04:00 +0000)] 
Update SVN ignore propset for include/vgversion.h. n-i-bz.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16170

8 years agoFix typo in syswrap-darwin log output. n-i-bz.
Rhys Kidd [Sun, 4 Dec 2016 03:50:33 +0000 (03:50 +0000)] 
Fix typo in syswrap-darwin log output. n-i-bz.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16169

8 years agoFix 373046 - Stacks registered by core are never deregistered (macOS-specific follow...
Rhys Kidd [Sun, 4 Dec 2016 03:43:29 +0000 (03:43 +0000)] 
Fix 373046 - Stacks registered by core are never deregistered (macOS-specific follow-up). Refer r16159.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16168

8 years agoSmall optimisation: no need to have a syscall wrapper unless collect systime is yes
Philippe Waroquiers [Sat, 3 Dec 2016 17:09:20 +0000 (17:09 +0000)] 
Small optimisation: no need to have a syscall wrapper unless collect systime is yes

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16167

8 years agomips: fix call_on_new_stack_0_1 code
Petar Jovanovic [Thu, 1 Dec 2016 16:01:45 +0000 (16:01 +0000)] 
mips: fix call_on_new_stack_0_1 code

MIPS32 implementation missed to set up a correct (zero) return address.
This led to incorrect execution of get_StackTrace_wrk as it was not
able to unwind stack correctly.
This change fixes memcheck/tests/leak-autofreepool-5.

MIPS64 implementation missed clearing all integer registers before
entering the function.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16166

8 years agoUpdate NEWS for the fixing of 358213 helgrind/drd bar_bad testcase hangs or
Philippe Waroquiers [Tue, 29 Nov 2016 22:54:05 +0000 (22:54 +0000)] 
Update NEWS for the fixing of 358213 helgrind/drd bar_bad testcase hangs or
crashes with new glibc pthread barrier implementation

(this was fixed in revision 16154)

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16165

8 years ago352395 - Please provide SVN revision info in --version -v
Philippe Waroquiers [Tue, 29 Nov 2016 22:32:27 +0000 (22:32 +0000)] 
352395 - Please provide SVN revision info in --version -v

Finally committed ... :)

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16164

8 years agomips64: fix fadvise64 syscall wrappers
Petar Jovanovic [Tue, 29 Nov 2016 14:57:51 +0000 (14:57 +0000)] 
mips64: fix fadvise64 syscall wrappers

Use platform specific pre-wrapper for fadvise64 system call and respect
size of parameters, instead of using generic wrapper written for 32bit
architectures.

Issue reported by Marcin Juszkiewicz.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16163

8 years agomips32: fix fadvise64 system call
Petar Jovanovic [Tue, 29 Nov 2016 14:27:25 +0000 (14:27 +0000)] 
mips32: fix fadvise64 system call

For fadvise64 system call, 7th 32-bit argument slot (third on the stack)
will also be used due to MIPS O32 calling convention in passing 64-bit
values.

sys_fadvise64(int fd, loff_t offset, loff_t len, int advice);

NR_fadvise64 -> v0               (sysno)
fd           -> a0               (ARG1)
offset       -> a2, a3           (ARG3, ARG4)
len          -> SP + 16, SP + 20 (ARG5, ARG6)
advise       -> SP + 24          (ARG7)

Change the code according to it.

Patch by Aleksandar Rikalo.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16162

8 years agoFix compiler warning on Solaris.
Ivo Raisr [Mon, 28 Nov 2016 22:14:58 +0000 (22:14 +0000)] 
Fix compiler warning on Solaris.
n-i-bz

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16161

8 years agoUse NULL_STK_ID consistently throughout whole Valgrind.
Ivo Raisr [Mon, 28 Nov 2016 21:41:28 +0000 (21:41 +0000)] 
Use NULL_STK_ID consistently throughout whole Valgrind.
Follow up to SVN r16159, BZ#373046.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16160

8 years agoFix 373046 - Stacks registered by core are never deregistered
Philippe Waroquiers [Mon, 28 Nov 2016 19:34:06 +0000 (19:34 +0000)] 
Fix 373046 - Stacks registered by core are never deregistered

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16159

8 years agoAddition of helgrind client request VALGRIND_HG_GNAT_DEPENDENT_MASTER_JOIN
Philippe Waroquiers [Mon, 28 Nov 2016 18:16:27 +0000 (18:16 +0000)] 
Addition of helgrind client request  VALGRIND_HG_GNAT_DEPENDENT_MASTER_JOIN
See helgrind.h for description

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16158

8 years agoEnsure the 'too early msg to use vgdb stop at valgrind abnormal exit' is produced
Philippe Waroquiers [Sun, 27 Nov 2016 10:25:15 +0000 (10:25 +0000)] 
Ensure the 'too early msg to use vgdb stop at valgrind abnormal exit' is produced

For this, we must directly check the command line option, as
the VG_(gdbserver_stop_at) function returns False if the gdbserver
is not yet initialised

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16157

8 years agoinclude/valgrind.h: Fix spelling in a source code comment
Bart Van Assche [Sat, 26 Nov 2016 02:42:11 +0000 (02:42 +0000)] 
include/valgrind.h: Fix spelling in a source code comment

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16156

8 years agoUpdate.
Julian Seward [Fri, 25 Nov 2016 10:18:04 +0000 (10:18 +0000)] 
Update.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16155

8 years agomake bar_bad tests more deterministic
Petar Jovanovic [Wed, 23 Nov 2016 17:38:29 +0000 (17:38 +0000)] 
make bar_bad tests more deterministic

Canceling the thread slp2 before the case 5 makes behaviour of this test
more deterministic.
Also, as Philippe W. pointed out, adding --fair-sched=try seems to avoid
variable and sometimes very long run time for these tests.

Related BZ #358213

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16154

8 years agoBug 348616 - Wine/valgrind: Warning: noted but unhandled ioctl 0x5390
Julian Seward [Wed, 23 Nov 2016 13:26:23 +0000 (13:26 +0000)] 
Bug 348616 - Wine/valgrind: Warning: noted but unhandled ioctl 0x5390
with no size/direction hints. (DVD_READ_STRUCT)

Patch from Austin English (austinenglish@gmail.com).

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16153

8 years agoBug 352767 - Wine/valgrind: Warning: noted but unhandled ioctl 0x5307
Julian Seward [Wed, 23 Nov 2016 13:15:22 +0000 (13:15 +0000)] 
Bug 352767 - Wine/valgrind: Warning: noted but unhandled ioctl 0x5307
with no size/direction hints. (CDROMSTOP).

Patch from Austin English (austinenglish@gmail.com).

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16152

8 years agoComments change only: add the profile of the hook called by the gnat runtime
Philippe Waroquiers [Tue, 22 Nov 2016 21:16:37 +0000 (21:16 +0000)] 
Comments change only: add the profile of the hook called by the gnat runtime

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16151

8 years agoAdd a tracking file for bugs in 3.12.
Julian Seward [Mon, 21 Nov 2016 12:18:29 +0000 (12:18 +0000)] 
Add a tracking file for bugs in 3.12.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16150

8 years agoUpdate.
Julian Seward [Mon, 21 Nov 2016 12:18:08 +0000 (12:18 +0000)] 
Update.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16149

8 years agoFix none/tests/pth_2sig.c build with (default) -std=gnu90.
Mark Wielaard [Mon, 21 Nov 2016 08:28:07 +0000 (08:28 +0000)] 
Fix none/tests/pth_2sig.c build with (default) -std=gnu90.

error: ‘for’ loop initial declarations are only allowed in C99 mode

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16148

8 years agoFix test none/tests/pth_2sig on Solaris.
Ivo Raisr [Sun, 20 Nov 2016 15:06:08 +0000 (15:06 +0000)] 
Fix test none/tests/pth_2sig on Solaris.
When signal SIGINT was used, it got propagated to the parent shell
and therefore the regression test suite was terminated.
With SIGTERM only the parent exits, as is supposed.
Verified that this changed test case still reproduces the original problem
on Linux and Solaris, when r16140 is temporarily undone.
Follow up to r16140 and r16143 and BZ#372600.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16147

8 years agoxtree: some documentation and --help-debug fine tuning
Philippe Waroquiers [Sun, 20 Nov 2016 11:41:25 +0000 (11:41 +0000)] 
xtree: some documentation and --help-debug fine tuning

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16146

8 years agoSolaris: Add syscall wrapper for sigsendsys(108)
Ivo Raisr [Sun, 20 Nov 2016 05:19:02 +0000 (05:19 +0000)] 
Solaris: Add syscall wrapper for sigsendsys(108)
n-i-bz

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16145