]> git.ipfire.org Git - thirdparty/valgrind.git/log
thirdparty/valgrind.git
8 years ago"You need libc6-dbg" help message could be more helpful. Fixes #359645.
Julian Seward [Wed, 19 Oct 2016 16:13:29 +0000 (16:13 +0000)] 
"You need libc6-dbg" help message could be more helpful.  Fixes #359645.
Patch from Sami Liedes (sami.liedes@iki.fi)

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

8 years agoAdd support for Linux perf-events ioctls. Fixes #368419.
Julian Seward [Wed, 19 Oct 2016 16:08:25 +0000 (16:08 +0000)] 
Add support for Linux perf-events ioctls.  Fixes #368419.
Patch from Keno Fischer (keno@juliacomputing.com).

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

8 years agoUpdate.
Julian Seward [Wed, 19 Oct 2016 15:19:16 +0000 (15:19 +0000)] 
Update.

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

8 years agoBug 368120 - x86_linux asm _start functions do not keep 16-byte
Julian Seward [Wed, 19 Oct 2016 06:00:32 +0000 (06:00 +0000)] 
Bug 368120 - x86_linux asm _start functions do not keep 16-byte
aligned stack pointer.  Patch from chh@google.com.

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

8 years agoFix run_a_thread_NORETURN assembly code typo for VGP_arm64_linux target.
Julian Seward [Tue, 18 Oct 2016 17:31:53 +0000 (17:31 +0000)] 
Fix run_a_thread_NORETURN assembly code typo for VGP_arm64_linux target.
Fixes #368823.  Patch from chh@google.com.

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

8 years agoAdd to Memcheck a flag --ignore-range-below-sp=<offset>-<offset>, for
Julian Seward [Tue, 18 Oct 2016 17:16:11 +0000 (17:16 +0000)] 
Add to Memcheck a flag --ignore-range-below-sp=<offset>-<offset>, for
ignoring accesses on the stack below SP.  Serves as a more modern
replacement for --workaround-gcc296-bugs, which is now deprecated.
Fixes #360571.

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

8 years ago Fix PPC BE in 32-bit mode.
Carl Love [Tue, 18 Oct 2016 15:56:55 +0000 (15:56 +0000)] 
 Fix PPC BE in 32-bit mode.

The 64-bit compares are not supported in 32-bit mode.  Change the 64-bit
compares to 32-bit compares when doing byte compares.  Add routine for
doing V128 GT compare using 32-bit compares.

The clean caller support was missing for 32-bit mode

Update the expected output file jm_vec_isa_2_07.stdout.exp

Bugzilla 371128      VEX commit 3271

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

8 years agoUpdate merge status info.
Julian Seward [Tue, 18 Oct 2016 05:39:28 +0000 (05:39 +0000)] 
Update merge status info.

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

8 years agoUpdate bug and merge status info.
Julian Seward [Mon, 17 Oct 2016 15:47:07 +0000 (15:47 +0000)] 
Update bug and merge status info.

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

8 years agoFollow up for r16044.
Ivo Raisr [Sun, 16 Oct 2016 21:09:40 +0000 (21:09 +0000)] 
Follow up for r16044.

Fix compilation problem on Solaris.

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

8 years agoFurther fixes following fix of leak in 16033
Philippe Waroquiers [Sun, 16 Oct 2016 17:20:53 +0000 (17:20 +0000)] 
Further fixes following fix of leak in 16033
Rerunning valgrind under valgrind shows that interp_name and interp_args
memory was freed twice.
=> reworked the way interp_name and interp_args are freed:
* free them in VG_(ii_create_image) (linux/darwin/solaris)
* everywhere else, when overriden, first free the current value
* everywhere where interp_name or interp_args are freed, set them to NULL

With this, re-selfhosting valgrind shows no leak and no corruption
for interp_name and interp_args.

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

8 years agoIntroduce leak-pool-3.* back into EXTRA_DIST as they are not related
Ivo Raisr [Sun, 16 Oct 2016 08:07:30 +0000 (08:07 +0000)] 
Introduce leak-pool-3.* back into EXTRA_DIST as they are not related
to leak-autofreepool tests.
This is a follow up fix for r16042.

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

8 years agoClarify name and description/manual for meta mempool
Philippe Waroquiers [Sat, 15 Oct 2016 12:59:04 +0000 (12:59 +0000)] 
Clarify name and description/manual for meta mempool

* rename macro VALGRIND_CREATE_META_MEMPOOL
     to VALGRIND_CREATE_MEMPOOL_EXT
* abort execution if a pool is marked as auto_free but is not a meta pool
  + removed test leak-autofreepool-3.vgtest, which now aborts.
* reword/clarify valgrind.h explanations for meta pool
* similarly reword/clarify the manual

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

8 years agofix 369468 Remove quadratic metapool alg. using VG_(HT_remove_at_Iter)(VgHashTable...
Philippe Waroquiers [Sat, 15 Oct 2016 09:30:39 +0000 (09:30 +0000)] 
fix 369468 Remove quadratic metapool alg. using VG_(HT_remove_at_Iter)(VgHashTable *table)

Based on a patch from Ruurd Beerstra
but reworked VG_(HT_remove_at_Iter) so that
the function is implemented without touching the rest of m_hashtable.c
to ensure no performance impact on other hash table usages.

Testing with
for f in 1 2 3 4 5 6 7 8 9; do echo $f;  time ./vg-in-place -q ./memcheck/tests/leak-autofreepool 2 $(expr $f \* 100000); done|&grep user

With the patch :
user 0m0.524s
user 0m0.660s
user 0m0.784s
user 0m0.916s
user 0m1.064s
user 0m1.192s
user 0m1.316s
user 0m1.496s
user 0m1.632s

Without the patch, the same gives:
user 0m4.464s
user 0m16.776s
user 0m24.472s
user 1m5.544s
user 1m21.168s
user 1m40.500s
user 1m54.884s
user 4m58.308s
user 5m34.060s

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

8 years agomips32: add the test cases for luxc1/suxc1 instructions
Petar Jovanovic [Wed, 12 Oct 2016 18:58:36 +0000 (18:58 +0000)] 
mips32: add the test cases for luxc1/suxc1 instructions

Add the tests cases (in none/tests/mips32/vfp.c) that expose the error
with luxc1/suxc1 that was fixed by VEX r3262.

Patch by Aleksandra Karadzic.

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

8 years agomips: allow Valgrind to be compiled for soft-float
Petar Jovanovic [Wed, 12 Oct 2016 15:13:27 +0000 (15:13 +0000)] 
mips: allow Valgrind to be compiled for soft-float

Force "hardfloat" mode for inline assembly that uses FPU instructions,
but pop original mode at the end of the assembly. Unhandled FPU
instructions will be handled by the signal handler (env_unsup_insn).

Skip MIPS specific tests for FPU if the code gets compiled for soft-
float.

This should allow Valgrind to be compiled as a soft-float binary, but
that executable should be used for soft-float systems only.

Related VEX change - r3261.
Related issue - BZ#351282.

Patch by Aleksandar Rikalo.

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

8 years agomips: clear fcc bits in fcsr after calling printf()
Petar Jovanovic [Wed, 12 Oct 2016 14:16:08 +0000 (14:16 +0000)] 
mips: clear fcc bits in fcsr after calling printf()

Clear floating point condition codes in the test after calling external
function (in this case printf), as it might have clobbered fcc bits in
fcsr.

This resolves  none/tests/mips64/round.c failure on some systems.

Patch by Aleksandra Karadzic.

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

8 years agoFix for missing ISA changes in HW cap stuff needs updating patch
Carl Love [Tue, 11 Oct 2016 17:01:42 +0000 (17:01 +0000)] 
Fix for missing ISA changes in HW cap stuff needs updating patch

A couple things got missed in the previous HW cap stuff needs updating patch
that cause the vbit tester to fail.  The fixes are based on the patch
submitted by Mark Weilaard.

The changes were missed in Valgrind commit 16034

bugzilla 370265

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

8 years agoFix corruption introduced by revision 16033
Philippe Waroquiers [Mon, 10 Oct 2016 19:33:38 +0000 (19:33 +0000)] 
Fix corruption introduced by revision 16033

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

8 years agoUpdate NEWS file for bugzillas 369175 and 370265
Carl Love [Mon, 10 Oct 2016 18:14:27 +0000 (18:14 +0000)] 
Update NEWS file for bugzillas 369175 and 370265

Oops previous commit for the Power configure fixes said the configure fix was for
369175 should have been 370265.

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

8 years agoPower configure fixes.
Carl Love [Mon, 10 Oct 2016 18:09:01 +0000 (18:09 +0000)] 
Power configure fixes.

This patch makes the following updates:
  - Update the configure scripts to fix a configure/build issue seen on Power 7
  - Update the ISA 3.0 hwcaps string.
  - Update the ISA 3.0 ifdef value to be consistent with the hwcaps string

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

Bugzilla 369175

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

8 years agoFix some (small) leaks found by self-hosting valgrind
Philippe Waroquiers [Sun, 9 Oct 2016 20:27:48 +0000 (20:27 +0000)] 
Fix some (small) leaks found by self-hosting valgrind

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

8 years agoISA 3.0 BE testsuite fixes
Carl Love [Fri, 7 Oct 2016 23:08:02 +0000 (23:08 +0000)] 
ISA 3.0 BE testsuite fixes

In testing issues with the new ISA 3.0 instructions in BE mode, it was
found that we needed some more unique values in the operands to catch
various errors.  The issue is a sigle 32-bit value was replicated four
times for a V128 operand.  The result is testing loads and stores where
the word or half word order was swizzled couln't be detected because
they were the same.  By making the 32-bit chunks unique we were able
to catch additional errors.

The VEX instruction fixes was committed in VEX commit 3260.

Bugzilla 369175

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

8 years agomips32: add pselect6 to the list of supported syscalls
Petar Jovanovic [Fri, 7 Oct 2016 17:04:33 +0000 (17:04 +0000)] 
mips32: add pselect6 to the list of supported syscalls

Add pselect6 to the list of supported syscalls on MIPS32.
It fixes:

none/tests/pselect_alarm                 (stderr)
none/tests/pselect_sigmask_null          (stderr)

on mips32 platforms.

Patch by Aleksandra Karadzic.

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

8 years agofix building the dfp testcase
Christian Borntraeger [Fri, 7 Oct 2016 07:58:00 +0000 (07:58 +0000)] 
fix building the dfp testcase

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

8 years agoactually test high-word by providing the plumbing...
Christian Borntraeger [Fri, 7 Oct 2016 07:20:08 +0000 (07:20 +0000)] 
actually test high-word by providing the plumbing...

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

8 years agos390/highword fix compile warning with some compilers
Christian Borntraeger [Fri, 7 Oct 2016 07:13:24 +0000 (07:13 +0000)] 
s390/highword fix compile warning with some compilers

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

8 years agos390: support RISBLG/RISBHG, MVCIN, LDE/LDER
Christian Borntraeger [Fri, 7 Oct 2016 07:09:40 +0000 (07:09 +0000)] 
s390: support RISBLG/RISBHG, MVCIN, LDE/LDER

patch by Andreas Arnez <arnez@linux.vnet.ibm.com>

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

8 years agomips32: fix the wrong offset for mmap2()
Petar Jovanovic [Thu, 6 Oct 2016 17:46:14 +0000 (17:46 +0000)] 
mips32: fix the wrong offset for mmap2()

The offset for mmap2 is specified in 4096-byte units, not page size
units.

Patch by Duncan Palmer <dpalmer@digisoft.tv>.

It fixes BZ#352197.

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

8 years agoAdd a warning to the get/set_thread_area wrapper for bad info pointers.
Mark Wielaard [Wed, 5 Oct 2016 19:51:53 +0000 (19:51 +0000)] 
Add a warning to the get/set_thread_area wrapper for bad info pointers.

Also adjust the scalar.stderr.exp to catch the new warnings.

Patch by Julian Seward <jseward@acm.org>

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

8 years agoFix n-i-bz bug in auto free pool: a block using the last byte of the meta
Philippe Waroquiers [Wed, 5 Oct 2016 19:27:47 +0000 (19:27 +0000)] 
Fix n-i-bz bug in auto free pool: a block using the last byte of the meta
pool was not auto-freed.

This was shown by:
./vg-in-place --leak-check=full ./memcheck/tests/leak-autofreepool 2 100

Without the patch, it reports 101 blocks leaked, with one block
being from the auto-free meta pool.

With the fix, there is (as expected) 100 leaked blocks.

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

8 years agoUpdate, primarily to record merge status info.
Julian Seward [Wed, 5 Oct 2016 15:19:59 +0000 (15:19 +0000)] 
Update, primarily to record merge status info.

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

8 years agomips: replace use of (d)addi with (d)addiu
Petar Jovanovic [Wed, 5 Oct 2016 14:16:25 +0000 (14:16 +0000)] 
mips: replace use of (d)addi with (d)addiu

Replace use of daddi/addi with daddiu/addiu.
This is more R6-friendly and we actually want to use the instructions
that do not cause integer overflow exception.

Patch by Vicente Olivert Riera.

Related issue - BZ#356112.

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

8 years agoDHAT currently has "max-bytes-live", "max-blocks-live", and
Julian Seward [Wed, 5 Oct 2016 04:32:44 +0000 (04:32 +0000)] 
DHAT currently has "max-bytes-live", "max-blocks-live", and
"tot-bytes-allocd" orderings.  This adds "tot-blocks-allocd", which
completes the 2x2 matrix and is useful too.  n-i-bz.
From n.nethercote@gmail.com.

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

8 years agomips: update svn:ignore list
Petar Jovanovic [Tue, 4 Oct 2016 18:02:58 +0000 (18:02 +0000)] 
mips: update svn:ignore list

Add the following files to svn:ignore lists:

none/tests/mips32/change_fp_mode
none/tests/mips64/change_fp_mode

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

8 years agomips64: support for prctl(GET/SET_FP_MODE) syscalls
Petar Jovanovic [Tue, 4 Oct 2016 15:25:27 +0000 (15:25 +0000)] 
mips64: support for prctl(GET/SET_FP_MODE) syscalls

Adding a program (change_fp_mode) to test correct fpu emulation and
fp mode switch using prctl syscalls.

Patch by Aleksandar Rikalo.
Related bug - BZ #366079.

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

8 years agomips64: support for prctl(GET/SET_FP_MODE) syscalls
Petar Jovanovic [Tue, 4 Oct 2016 15:19:10 +0000 (15:19 +0000)] 
mips64: support for prctl(GET/SET_FP_MODE) syscalls

Add MIPS specific wrapper for prctl(GET/SET_FP_MODE) syscalls to
support FP32/FP64 mode switch.

Patch by Aleksandar Rikalo.

Related VEX change r3253.

Related bug - BZ #366079.

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

8 years agoUpdate svn:ignore list
Petar Jovanovic [Tue, 4 Oct 2016 13:21:48 +0000 (13:21 +0000)] 
Update svn:ignore list

Add the following files to svn:ignore lists:

/none/tests/amd64/fma4
/none/tests/nocwd
/none/tests/pth_term_signal

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

8 years agomips32: test for syscalls prctl(GET/SET_FP_MODE)
Petar Jovanovic [Tue, 4 Oct 2016 13:07:36 +0000 (13:07 +0000)] 
mips32: test for syscalls prctl(GET/SET_FP_MODE)

MIPS32 test for syscalls prctl(GET/SET_FP_MODE).
Patch by Aleksandar Rikalo.

Related Bugzilla issue #366079.

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

8 years agoWell, 5 seconds is too short for me to type a attach pid command
Philippe Waroquiers [Sat, 1 Oct 2016 14:10:59 +0000 (14:10 +0000)] 
Well, 5 seconds is too short for me to type a attach pid command
so increase to 8 seconds.

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

8 years agoReplace --wait-for-gdb=yes memory loop by a call to VG_(poll) (5000 milliseconds)
Philippe Waroquiers [Sat, 1 Oct 2016 13:46:53 +0000 (13:46 +0000)] 
Replace --wait-for-gdb=yes memory loop by a call to VG_(poll) (5000 milliseconds)

Depending on the cpu speed, this loop was way too fast or too slow.
=> replace by a syscall that will always give the same waiting time.

A few notes:
  A VG_(poll) is available on all supported OS
  B no signals are supposed to interrupt the syscall, as at that place, nothing works yet.
  C gdb can attach to a process blocked in a syscall.

If ever B or C would not be true on some setups, then we could instead do a loop
of e.g. 50 * VG_(poll) (100 milli-seconds)

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

8 years agoDon't crash, but warn and return EINVAL on unknown fcntl command.
Mark Wielaard [Sat, 1 Oct 2016 11:54:52 +0000 (11:54 +0000)] 
Don't crash, but warn and return EINVAL on unknown fcntl command.

Bug #369446
LTP: testcases/kernel/syscalls/fcntl/fcntl13

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

8 years agoDon't check bad iovec array in process_vm_readv/writev. Bug #369441.
Mark Wielaard [Sat, 1 Oct 2016 11:54:51 +0000 (11:54 +0000)] 
Don't check bad iovec array in process_vm_readv/writev. Bug #369441.

Found by LTP testcases/kernel/syscalls/cma/process_vm01.

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

8 years agolinux-x86 check get/set_thread_area pointer before use. Bug #369402.
Mark Wielaard [Sat, 1 Oct 2016 11:54:50 +0000 (11:54 +0000)] 
linux-x86 check get/set_thread_area pointer before use. Bug #369402.

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

8 years agoFix crash in sys_modify_ldt wrapper on bad ptr. Bug #369383.
Mark Wielaard [Sat, 1 Oct 2016 11:54:50 +0000 (11:54 +0000)] 
Fix crash in sys_modify_ldt wrapper on bad ptr. Bug #369383.

Make sure ptr is safe_to_deref if not NULL.
Also fixup some corner case error return codes.
We have to do that ourselves since we never actually call into the kernel.

Found by LTP testcases/kernel/syscalls/modify_ldt/modify_ldt01.

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

8 years agoFix crash in linux [rt_]sigaction wrapper with bad old/new sigaction handler.
Mark Wielaard [Sat, 1 Oct 2016 11:54:49 +0000 (11:54 +0000)] 
Fix crash in linux [rt_]sigaction wrapper with bad old/new sigaction handler.

Since we try to modify the old/new sigaction handler before passing it
to the kernel we must make sure that (if they aren't NULL) it is safe
to use. If not we should bail out early with EFAULT.

Bug #369362
Found by LTP testcases/kernel/syscalls/rt_sigaction/rt_sigaction02.

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

8 years agoFix crash in vmsplice linux kernel wrapper when iovec is bad. Bug #369361.
Mark Wielaard [Sat, 1 Oct 2016 11:54:48 +0000 (11:54 +0000)] 
Fix crash in vmsplice linux kernel wrapper when iovec is bad. Bug #369361.

Found by LTP testcases/kernel/syscalls/vmsplice/vmsplice02.

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

8 years agoFix crash when old/new sigprocmask isn't safe to dereference. Bug #369360.
Mark Wielaard [Sat, 1 Oct 2016 11:54:47 +0000 (11:54 +0000)] 
Fix crash when old/new sigprocmask isn't safe to dereference. Bug #369360.

Since we want to use the set and oldset for bookkeeping we also want
to make sure they are addressable otherwise, like the kernel, we EFAULT.
Also use EINVAL instead of EMFILE as failure when sigset size is wrong.

Found by LTP testcases/kernel/syscalls/rt_sigprocmask/rt_sigprocmask02.

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

8 years agoFix crash in msghdr_foreachfield when iov_len isn't safe to dereference.
Mark Wielaard [Sat, 1 Oct 2016 11:54:41 +0000 (11:54 +0000)] 
Fix crash in msghdr_foreachfield when iov_len isn't safe to dereference.

Also stop checking when max length of bytes have been reached.

Bug #369359
Found by LTP testcases/kernel/syscalls/recvmsg/recvmsg01.

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

8 years agoFix pre_mem_read_sockaddr crash on invalid syscall arguments. Bug #369356.
Mark Wielaard [Sat, 1 Oct 2016 11:54:40 +0000 (11:54 +0000)] 
Fix pre_mem_read_sockaddr crash on invalid syscall arguments. Bug #369356.

Don't do any more checks if it isn't safe to inspect the address family.
Likewise, don't check sun_path if the string address isn't safe.

Found by LTP testcases/kernel/syscalls/bind/bind01.

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

8 years agoDon't require the current working directory to exist. Bug #369209.
Mark Wielaard [Sat, 1 Oct 2016 11:54:38 +0000 (11:54 +0000)] 
Don't require the current working directory to exist. Bug #369209.

At startup valgrind fetches the current working directory and stashes
it away to be used later (in debug messages, read config files or create
log files). But if the current working directory didn't exist (or there
was some other error getting its path) then valgrind would go in an
endless loop. This was caused by assuming that any error meant a larger
buffer needed to be created to store the cwd path (ERANGE). However
there could be other reasons calling getcwd failed.

Fix this by only looping and resizing the buffer when the error is
ERANGE. Any other error just means we cannot fetch and store the current
working directory. Fix all callers to check get_startup_wd() returns
NULL. Only abort startup if a relative path needs to be used for
user supplied relative log files. Debug messages will just show
"<NO CWD>". And skip reading any config files from the startup_wd
if it doesn't exist.

Also add a new testcase that tests executing valgrind in a deep,
inaccessible and/or non-existing directory (none/tests/nocwd.vgtest).

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

8 years agoUse AM_LDFLAGS instead of LDFLAGS in exp-bbv/tests Makefiles.
Mark Wielaard [Sat, 1 Oct 2016 10:12:31 +0000 (10:12 +0000)] 
Use AM_LDFLAGS instead of LDFLAGS in exp-bbv/tests Makefiles.

That makes it possible to add to LDFLAGS instead of overriding
when doing make. Useful if you want to have different LD_FLAGS
added for the main and check makes.

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

8 years agomc-manual.xml: Fix some mismatched open/close tags.
Mark Wielaard [Fri, 30 Sep 2016 22:32:24 +0000 (22:32 +0000)] 
mc-manual.xml: Fix some mismatched open/close tags.

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

8 years agoAdd an optional 2nd arg to leak-autofreepool to test performance
Philippe Waroquiers [Thu, 29 Sep 2016 20:04:43 +0000 (20:04 +0000)] 
Add an optional 2nd arg to leak-autofreepool to test performance
e.g. using the beloz
for f in 1 2 3 4 5 6 7 8 9; do echo $f;  time ./vg-in-place -q ./memcheck/tests/leak-autofreepool 2 $(expr $f \* 100000); done

This shows that freeing a mempool with significant nr of elements
has a bad effect on performance

Note that no effort has been spent to avoid leaks in this
optional perf test. This is just to analyse the time taken to
free the pool.

The above loop shows that a medium size pool (e.g. < 1000000 elts)
can already take significant time, probably due to the quadratic
algorithm to clear the pool.
Note that the increase can vary a lot, probably depending on the
way the blocks are spread in the hash table: when lucky, the quadratic
algorithm probably somewhat becomes more linear if the elements
are 'properly' ordered in the hash table by deletion order.

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

8 years agoFix test so that leaked bytes is the same in 32 and 64 bits
Philippe Waroquiers [Sun, 25 Sep 2016 18:38:19 +0000 (18:38 +0000)] 
Fix test so that leaked bytes is the same in 32 and 64 bits

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

8 years agoAdded meta mempool support into memcheck for describing a custom allocator which:
Ivo Raisr [Sat, 24 Sep 2016 21:15:44 +0000 (21:15 +0000)] 
Added meta mempool support into memcheck for describing a custom allocator which:
- Auto-frees all chunks assuming that destroying a pool destroys all
  objects in the pool
- Uses itself to allocate other memory blocks
Unit tests included.
Fixes BZ#367995
Patch by: Ruurd Beerstra <ruurd.beerstra@infor.com>

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

8 years agoFix warning introduced by revision 15982
Philippe Waroquiers [Sat, 24 Sep 2016 12:58:29 +0000 (12:58 +0000)] 
Fix warning introduced by revision 15982

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

8 years agoFix 361615 - Inconsistent termination for multithreaded process terminated by signal
Philippe Waroquiers [Sat, 24 Sep 2016 12:06:34 +0000 (12:06 +0000)] 
Fix 361615 - Inconsistent termination for multithreaded process terminated by signal

Test program by earl_chew

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

8 years agoSolaris: Add ioctl wrapper for MNTIOC_GETEXTMNTENT.
Ivo Raisr [Fri, 23 Sep 2016 23:00:21 +0000 (23:00 +0000)] 
Solaris: Add ioctl wrapper for MNTIOC_GETEXTMNTENT.
n-i-bz

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

8 years agoFix none/tests/amd64/Makefile.am typo s/AM_CFKAGS/AM_CFLAGS/
Mark Wielaard [Fri, 23 Sep 2016 20:52:30 +0000 (20:52 +0000)] 
Fix none/tests/amd64/Makefile.am typo s/AM_CFKAGS/AM_CFLAGS/

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

8 years agoFix expected error output of drd/tests/bar_bad* on Solaris.
Ivo Raisr [Fri, 23 Sep 2016 17:23:47 +0000 (17:23 +0000)] 
Fix expected error output of drd/tests/bar_bad* on Solaris.
On Solaris, we still do get error reports about destroying
a barrier which was never initialized even after SVN r15962.
We also get an error report about destroying barrier bar3
which is still waited upon by a thread.
n-i-bz

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

8 years agoUse proper compiler flags on Solaris for fma4 test.
Ivo Raisr [Fri, 23 Sep 2016 14:10:55 +0000 (14:10 +0000)] 
Use proper compiler flags on Solaris for fma4 test.
n-i-bz

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

8 years agoPowerpc big endian, fix the expected output file for
Carl Love [Thu, 22 Sep 2016 15:37:57 +0000 (15:37 +0000)] 
Powerpc big endian, fix the expected output file for
none/tests/ppc64/jm_int_isa_2_07.stdout.exp

By convention the file jm_int_isa_2_07.stdout.exp is the big endian reuslts.
If the little endian results differ, the file has -LE appended to it.
This patch replaces the little endian results that are currenttly in
none/tests/ppc64/jm_int_isa_2_07.stdout.exp with the correct the big
endian results.

Bugzilla 369169

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

8 years agoPreliminary support for macOS Sierra (10.12). Does not fully resolve bz#365327.
Rhys Kidd [Thu, 22 Sep 2016 02:55:24 +0000 (02:55 +0000)] 
Preliminary support for macOS Sierra (10.12). Does not fully resolve bz#365327.

No regressions on OS X 10.11.

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

8 years agoAvoid unused variable warning.
Philippe Waroquiers [Wed, 21 Sep 2016 21:06:04 +0000 (21:06 +0000)] 
Avoid unused variable warning.

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

8 years agoUpdate.
Julian Seward [Wed, 21 Sep 2016 13:48:20 +0000 (13:48 +0000)] 
Update.

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

8 years agoAdd a feature check for tests that use -march=armv8-a+crc.
Mark Wielaard [Tue, 20 Sep 2016 17:57:00 +0000 (17:57 +0000)] 
Add a feature check for tests that use -march=armv8-a+crc.

Older gcc versions for arm64 don't support the crc arch feature.

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

8 years agofix for bugzilla 361253 [s390x] ex_clone.c:42: undefined reference to `pthread_create'
Christian Borntraeger [Tue, 20 Sep 2016 12:31:49 +0000 (12:31 +0000)] 
fix for bugzilla 361253  [s390x] ex_clone.c:42: undefined reference to `pthread_create'

Fix provides by Dann Frazier

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

8 years agoAdd none/tests/ppc64/ppc64_helpers.h to noinst_HEADERS.
Mark Wielaard [Mon, 19 Sep 2016 22:03:34 +0000 (22:03 +0000)] 
Add none/tests/ppc64/ppc64_helpers.h to noinst_HEADERS.

Makes sure that the header file will be included in the dist tar.

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

8 years agoAdd missing file for bug #358213 workaround.
Mark Wielaard [Mon, 19 Sep 2016 19:25:33 +0000 (19:25 +0000)] 
Add missing file for bug #358213 workaround.

svn commit r15962 missed adding bar_bad.stderr.exp-destroy-hang.

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

8 years agoWorkaround bar_bad testcase hanging with newer glibc in helgrind/drd tests.
Mark Wielaard [Mon, 19 Sep 2016 14:16:35 +0000 (14:16 +0000)] 
Workaround bar_bad testcase hanging with newer glibc in helgrind/drd tests.

This is a workaround for bug #358213 helgrind/drd pthread_barrier tests
hangs with new glibc pthread barrier implementation. This makes sure that
the tests don't hang anymore. It does this by creating new threads that
sleep and kill the other threads after some time. But this introduces
some non-determinism that might cause the tests to occassionally fail
(both against old and new glibc implementations).

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

8 years agoTestcases for fma4 instructions. Bug #369000.
Mark Wielaard [Mon, 19 Sep 2016 12:41:38 +0000 (12:41 +0000)] 
Testcases for fma4 instructions. Bug #369000.

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

8 years agoFix bad gdbserver_tests heap usage tests stderr output.
Mark Wielaard [Mon, 19 Sep 2016 08:08:51 +0000 (08:08 +0000)] 
Fix bad gdbserver_tests heap usage tests stderr output.

When doing inferior function calls from gdb (in mcmain_pic) there might
be extra heap usage from gdb that we aren't interested in tracking.

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

8 years agoUpdate bug lists.
Julian Seward [Fri, 16 Sep 2016 13:38:02 +0000 (13:38 +0000)] 
Update bug lists.

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

8 years agoUpdate bug list.
Julian Seward [Thu, 15 Sep 2016 10:56:00 +0000 (10:56 +0000)] 
Update bug list.

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

8 years agoupdated the NEWS file for bugzillas that have been closed:
Carl Love [Wed, 14 Sep 2016 17:16:52 +0000 (17:16 +0000)] 
updated the NEWS file for bugzillas that have been closed:

   Bugzilla 368412 commit15952
   Bugzilla 368416 commit15956

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

8 years agoAdd tc06_two_races_xml.exp output for ppc64
Carl Love [Wed, 14 Sep 2016 16:43:27 +0000 (16:43 +0000)] 
Add tc06_two_races_xml.exp output for ppc64

Update xml filter to suppress pthread_create_WRK frame.  Update the filter_xml
filter to suppress the frame containing the pthread_create_WRK function.  This
allows the tc06_two_races_xml test to complete reliably on power.

This change also adds the ability to suppress the printf that generates a
"pthread_create_WRK...pthread_create" entry to replace the suppressed frame.

This is conceptually a follow-up from r13983, which suppresses the
pthread_create_WRK entry from non-xml outputs.

Patch submitted by Will Schmidt  <will_schmidt@vnet.ibm.com>

Bugzilla 368416

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

8 years agoAdapt massif mmapunmap test to handle ppc64 backtrace
Carl Love [Wed, 14 Sep 2016 15:50:48 +0000 (15:50 +0000)] 
Adapt massif mmapunmap test to handle ppc64 backtrace

The reported backtrace on ppc64 platform reports "generic_start_main.isra.0"
in the backtrace, where other platforms typically see "main".  Adjust the
vgtest file to handle this variation.  This is similar to existing changes
as seen in deep-D.post.exp

FORGOT to add the file massif/tests/mmapunmap.post.exp-ppc64 before doing
commit 15950.

Bugzilla 368461

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

8 years agoUpdate.
Julian Seward [Wed, 14 Sep 2016 13:15:28 +0000 (13:15 +0000)] 
Update.

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

8 years agoBug #359503 continued. adjtimex syscall missing on arm64.
Mark Wielaard [Wed, 14 Sep 2016 11:47:26 +0000 (11:47 +0000)] 
Bug #359503 continued. adjtimex syscall missing on arm64.

Enable adjtimex syscall on arm64 and fix bug if argument is a bad pointer.

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

8 years agoCorrect an Altivec configure think-o.
Mark Wielaard [Tue, 13 Sep 2016 19:18:36 +0000 (19:18 +0000)] 
Correct an Altivec configure think-o.

An earlier change introduced a think-o in the altivec capability
check, allowing a false positive if the compiler supported altivec
but the hardware did not.

Resolves bug #368412 - False positive result for altivec capability check
Patch by Will Schmidt <will_schmidt@vnet.ibm.com>

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

8 years agoUpdate libiberty demangler.
Mark Wielaard [Tue, 13 Sep 2016 19:06:23 +0000 (19:06 +0000)] 
Update libiberty demangler.

Update the libiberty demangler using the auxprogs/update-demangler
script. There were various extensions and bug fixes since our last
import. Add new D language demangler file d-demangle.c and update
the vg_libciface.h header with some new constructs used (strtol,
xmalloc_failed, xmemdup, XDELETEVEC, XDUPVEC).

Resolves bug #359181 - Buffer Overflow during Demangling.

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

8 years agoAdapt massif mmapunmap test to handle ppc64 backtrace
Carl Love [Tue, 13 Sep 2016 15:54:33 +0000 (15:54 +0000)] 
Adapt massif mmapunmap test to handle ppc64 backtrace

The reported backtrace on ppc64 platform reports "generic_start_main.isra.0"
in the backtrace, where other platforms typically see "main".  Adjust the
vgtest file to handle this variation.  This is similar to existing changes
as seen in deep-D.post.exp

Bugzilla 368461

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

8 years agoSupport clang compiler shipped with Apple’s Xcode 8. bz#366138.
Rhys Kidd [Sun, 11 Sep 2016 13:54:04 +0000 (13:54 +0000)] 
Support clang compiler shipped with Apple’s Xcode 8. bz#366138.

This applies to both OS X 10.11 and macOS 10.12.

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

8 years agoImprove configure output error message, when compiler version not supported. n-i-bz.
Rhys Kidd [Sun, 11 Sep 2016 13:42:50 +0000 (13:42 +0000)] 
Improve configure output error message, when compiler version not supported. n-i-bz.

Based on a patch by Jeremy Hu <jeremyhu@uclink4.berkeley.edu>. Refer bz#366138.

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

8 years agoMAXSYSCALL for OS X 10.11.6 (xnu 3248.60.10) was indeed 500. n-i-bz.
Rhys Kidd [Sun, 11 Sep 2016 05:28:59 +0000 (05:28 +0000)] 
MAXSYSCALL for OS X 10.11.6 (xnu 3248.60.10) was indeed 500. n-i-bz.

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

8 years agoFollow up to r15905, properly guard memcheck/tests/amd64/shr_edx on clang. n-i-bz.
Rhys Kidd [Sun, 11 Sep 2016 04:33:20 +0000 (04:33 +0000)] 
Follow up to r15905, properly guard memcheck/tests/amd64/shr_edx on clang. n-i-bz.

“error in backend: 32-bit absolute addressing is not supported in 64-bit mode”

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

8 years agoFix 199468 - Suppressions: stack size limited to 25 while --num-callers allows more...
Philippe Waroquiers [Wed, 7 Sep 2016 20:12:30 +0000 (20:12 +0000)] 
Fix 199468 - Suppressions: stack size limited to 25 while --num-callers allows more frames

Nr of callers in a suppression entry had a smaller limit than the max
for --num-callers.
This means it was not possible to precisely suppress an error with a big
stack trace.
Also, --gen-suppressions was not providing the full stack trace of
the error in the generated suppressions.

Now, a suppression entry can have the same nr of callers as a backtrace.
Generated suppressions are generated with up to --num-callers callers.

This change has neglectible impact :
* memory: stack array of 500*2 words is declared, instead of 24*2 words
  This array is declared on the interim stack (startup stack), which is
  largely big enough.
* cpu : neglectible more cpu needed to read suppression entries
        (to initialise the bigger stack array when reading a supp entry),
Apart of the above, no impact on performance (unless of course bigger
supp entries are really used).

Note that this does not impact the behaviour for existing suppression files.

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

8 years agoUse -std=c++0x for big_debuginfo_symbol to appease older compilers.
Mark Wielaard [Mon, 5 Sep 2016 13:13:12 +0000 (13:13 +0000)] 
Use -std=c++0x for big_debuginfo_symbol to appease older compilers.

gcc 4.4 doesn't know -std=c++11, but does recognize -std=c++0x.

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

8 years agoConnect up the v8 memory insn tests to the build system, and arrange
Julian Seward [Thu, 1 Sep 2016 15:19:07 +0000 (15:19 +0000)] 
Connect up the v8 memory insn tests to the build system, and arrange
for both ARM and Thumb encodings to be tested.

Modify the existing v8 crypto tests so that both ARM and Thumb encodings
are tested.

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

8 years agoEnable test cases for arm32 v8 insns: LDAEX{,B,H,D}, STLEX{,B,H,D}
Julian Seward [Thu, 1 Sep 2016 13:10:55 +0000 (13:10 +0000)] 
Enable test cases for arm32 v8 insns: LDAEX{,B,H,D}, STLEX{,B,H,D}
(load-acquire exclusive, store-release exclusive)

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

8 years agoAdd test cases for ARMv8 insns: LDA, LDAB, LDAH, STL, STLB, STLH.
Julian Seward [Sun, 28 Aug 2016 16:17:12 +0000 (16:17 +0000)] 
Add test cases for ARMv8 insns: LDA, LDAB, LDAH, STL, STLB, STLH.
Not connected to the build system yet.

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

8 years agoAllow building vbit_test when srdir != builddir.
Mark Wielaard [Fri, 26 Aug 2016 13:10:14 +0000 (13:10 +0000)] 
Allow building vbit_test when srdir != builddir.

Link against libvex-<arch>-<os>.a in top_builddir.

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

8 years agoFollow up to SVN commit r15936.
Ivo Raisr [Wed, 17 Aug 2016 18:05:13 +0000 (18:05 +0000)] 
Follow up to SVN commit r15936.
Fix the sloppy check I introduced.
n-i-bz

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

8 years agoPower PC test suite for ISA 3.0, part 5 of 5
Carl Love [Mon, 15 Aug 2016 21:54:04 +0000 (21:54 +0000)] 
Power PC test suite for ISA 3.0, part 5 of 5

The test suite support for the Power PC ISA 3.0 instructions added in
VEX commit 3244 is added in this commit.

bugzilla 364948

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

8 years agoFollow up to r15936.
Ivo Raisr [Mon, 15 Aug 2016 02:31:27 +0000 (02:31 +0000)] 
Follow up to r15936.
Kernel allocates another page after fork and we have to
keep aspacemgr's point of view consistent.
n-i-bz

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

8 years agoFollow recent Solaris development with respect to
Ivo Raisr [Fri, 12 Aug 2016 22:28:50 +0000 (22:28 +0000)] 
Follow recent Solaris development with respect to
SUNWDTRACE program header. Newer Solaris no longer utilizes
this program header as a scratchspace for DTrace fasttrap
provider, before libc is loaded.
For the time being, it serves as a space for initial thread
pointer.
n-i-bz

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

8 years agoConnect the v8crypto test to the build system, at least somewhat, so
Julian Seward [Wed, 10 Aug 2016 22:22:20 +0000 (22:22 +0000)] 
Connect the v8crypto test to the build system, at least somewhat, so
as to make the post-regtest-tests happy.  Still needs configure.ac
checking for "-mfpu=crypto-neon-fp-armv8" gcc flag support.

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

8 years agomips32: add support for FPXX mode
Petar Jovanovic [Wed, 10 Aug 2016 14:38:10 +0000 (14:38 +0000)] 
mips32: add support for FPXX mode

With this patch, MIPS32 Valgrind compiled with -mfpxx can handle all types
(regarding FP_ABI flag) of MIPS32 ELFs.

- Functions arch_elf_pt_proc() and arch_check_elf() are added to elf reader
  according to linux/fs/binfmt_elf.c from Linux 4.1;
- Processing .MIPS.abiflags section and initializing appropriate FPU mode
  for MIPS32 are added;
- Emulation of prctl(GET/SET_FP_MODE) sys-calls are implemented for MIPS32.

Patch by Aleksandar Rikalo <Aleksandar.Rikalo@imgtec.com>

Related VEX change: r3243.

This implements BZ#366079.

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

9 years agonone/tests/arm/v8crypto:
Julian Seward [Sun, 7 Aug 2016 23:36:10 +0000 (23:36 +0000)] 
none/tests/arm/v8crypto:
* enable all tests in this file
* add an expected output (stderr.exp) file

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