]> git.ipfire.org Git - thirdparty/valgrind.git/log
thirdparty/valgrind.git
8 years agoCleanup none/tests/nocwd.vgtest tmp dirs.
Mark Wielaard [Sat, 12 Nov 2016 19:51:51 +0000 (19:51 +0000)] 
Cleanup none/tests/nocwd.vgtest tmp dirs.

The none/tests/nocwd creates a really deep temporary directory structure
that is also inaccessible after the test. This causes issues with some
build wrappers like koji which fail to cleanup such deep subdirectories.
So explicitly cleanup the directory after the test.

https://bugzilla.redhat.com/show_bug.cgi?id=1390282

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

8 years agoOuter/inner setup : allow append to outer args, use a bigger --num-callers
Philippe Waroquiers [Sat, 12 Nov 2016 11:22:50 +0000 (11:22 +0000)] 
Outer/inner setup : allow append to outer args, use a bigger --num-callers
* Similarly to what was done in revision r16104 for vg_perf, have a way
  to append to predefined vg_regtest outer args, rather than only be able
  to replace them.
* increase the num callers for outer tool to 40.
  (This is in preparation of a future commit, that will allow outer tool
  to append the inner guest stack trace to reported errors in the inner)

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

8 years agoProvide a paragraph about Solaris agent thread in advanced concepts
Ivo Raisr [Sat, 12 Nov 2016 09:09:29 +0000 (09:09 +0000)] 
Provide a paragraph about Solaris agent thread in advanced concepts
n-i-bz

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

8 years agoUpdate documentation and NEWS for xtree concept.
Philippe Waroquiers [Fri, 11 Nov 2016 15:11:49 +0000 (15:11 +0000)] 
Update documentation and NEWS for xtree concept.

Final patch of the xtree serie, which provides the documentation.

The xtree concept was committed in the revisions
16120 : Support pool of unique string in pub_tool_deduppoolalloc.h
16121 : Implement a cache 'address -> symbol name' in m_debuginfo.c
16122 : Add VG_(strIsMemberXA) in pub_tool_xarray.h
16123 : Addition of the pub_tool_xtree.h and pub_tool_xtmemory.h modules, and of the --xtree-memory* options
16124 : Addition of the options --xtree-memory and --xtree-memory-file
16125 : Small changes in callgrind_annotate and callgrind manual
16126 : Locally define vgPlain_scrcmp in 2 unit tests
16127 : Support for xtree memory profiling and xtmemory gdbsrv monitor command in helgrind
16128 : Support for xtree memory profiling and xtmemory gdbsrv monitor command in memcheck
16129 : Update massif implementation to xtree

Some smaller follow-up patches to be expected to add some regtests,
and refine documentation.

Thanks to Ivo, Julian and Josef for the review comments.

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

8 years agoProvide Solaris specifics in coregrind/m_gdbserver/README_DEVELOPERS
Ivo Raisr [Fri, 11 Nov 2016 14:47:33 +0000 (14:47 +0000)] 
Provide Solaris specifics in coregrind/m_gdbserver/README_DEVELOPERS
n-i-bz

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

8 years agoUpdate massif implementation to xtree
Philippe Waroquiers [Fri, 11 Nov 2016 14:44:42 +0000 (14:44 +0000)] 
Update massif implementation to xtree
* update massif code so as to replace the massif specific XTree implementation
  by calls to pub_tool_xtree.h
  This improves the massif performance in CPU (a few percents to a factor
   2 gained, depending on the implementation). The memory use is also
   decreased.
  With this patch, massif behaves similarly to the previous implementation.
  The differences are:
     * some massif stats output have changed, as the new implementation
       differs completely from the previous one.
     * when 2 'branches' of the call tree have consumed the same amount
       of  heap, the order in which the branches are output in the massif
       output file can differ between the old and new implementation.
  No other functional difference is expected, waiting for new bugs to
  be discovered.

* Also add support for xtree memory profiling and xtmemory gdbsrv monitor
  command in massif :
  * massif will produce xtree memory profiling according to the options
    --xtree-memory.
  * addition of the xtmemory gdbserver monitor command.

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

8 years agoSupport for xtree memory profiling and xtmemory gdbsrv monitor command in memcheck
Philippe Waroquiers [Fri, 11 Nov 2016 14:36:36 +0000 (14:36 +0000)] 
Support for xtree memory profiling and xtmemory gdbsrv monitor command in memcheck
* memcheck will produce xtree memory profiling according to the options
  --xtree-memory.
* addition of the xtmemory gdbserver monitor command.

(this is the second real xtree functional difference)

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

8 years agoSupport for xtree memory profiling and xtmemory gdbsrv monitor command in helgrind
Philippe Waroquiers [Fri, 11 Nov 2016 14:33:27 +0000 (14:33 +0000)] 
Support for xtree memory profiling and xtmemory gdbsrv monitor command in helgrind
* helgrind will produce xtree memory profiling according to the options
  --xtree-memory.
* addition of the xtmemory gdbserver monitor command.

(this is the first real xtree functional difference)

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

8 years agoLocally define vgPlain_scrcmp in 2 unit tests
Philippe Waroquiers [Fri, 11 Nov 2016 14:26:54 +0000 (14:26 +0000)] 
Locally define vgPlain_scrcmp in 2 unit tests
Humph, this should have been part of :
   16122 Add VG_(strIsMemberXA) in pub_tool_xarray.h
which means that between 16122 and this revision, these 2 unit tests
will (very probably) not compile.
That will make bissect not easy :(

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

8 years agoSmall changes in callgrind_annotate and callgrind manual
Philippe Waroquiers [Fri, 11 Nov 2016 14:22:34 +0000 (14:22 +0000)] 
Small changes in callgrind_annotate and callgrind manual
* callgrind_annotate: ignore the lines giving the long names of the
  events: such lines are used by kcachegrind for the GUI, so are better
  accepted (and ignored) by callgrind_annotate
* Document in callgrind_annotate manual that thresholds can be given
  per event kind.
* Avoid a division by zero in callgrind_annotate, for 'special data'
  such as produced by (some) xtrees.

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

8 years agoAddition of the options --xtree-memory and --xtree-memory-file
Philippe Waroquiers [Fri, 11 Nov 2016 14:15:45 +0000 (14:15 +0000)] 
Addition of the options --xtree-memory and --xtree-memory-file
Option is added, parsed, explained in --help
but is not used yet by any other code.
So, apart of the --help, no functional effect.

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

8 years agoAddition of the pub_tool_xtree.h and pub_tool_xtmemory.h modules, and of the --xtree...
Philippe Waroquiers [Fri, 11 Nov 2016 14:07:03 +0000 (14:07 +0000)] 
Addition of the pub_tool_xtree.h and pub_tool_xtmemory.h modules, and of the --xtree-memory* options
This commit is the bulk of the new code.
There is however no functional impact yet : the new modules are not used by anybody.

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

8 years agoAdd VG_(strIsMemberXA) in pub_tool_xarray.h
Philippe Waroquiers [Fri, 11 Nov 2016 13:55:07 +0000 (13:55 +0000)] 
Add VG_(strIsMemberXA) in pub_tool_xarray.h
This allows to search more efficiently a string in an xarray of string.
(support work for xtree)

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

8 years agoImplement a cache 'address -> symbol name' in m_debuginfo.c
Philippe Waroquiers [Fri, 11 Nov 2016 13:38:18 +0000 (13:38 +0000)] 
Implement a cache 'address -> symbol name' in m_debuginfo.c
Support work for xtree: as xtree implementation makes a high
nr of calls to get_sym_name, this cache improves the performance
as usually, stacktraces are repeatitively querying the same
addresses.
The cache follows the same principle as the cfsi_m_cache.
In particular, cache is cleared together with the cfsi_m cache.

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

8 years agoSupport pool of unique string in pub_tool_deduppoolalloc.h
Philippe Waroquiers [Fri, 11 Nov 2016 13:30:08 +0000 (13:30 +0000)] 
Support pool of unique string in pub_tool_deduppoolalloc.h
This is support code for the xtree implementation.

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

8 years agoFix xxsel parsing error
Carl Love [Mon, 7 Nov 2016 20:01:47 +0000 (20:01 +0000)] 
Fix xxsel parsing error

VEX commit 3284 listed Bugzilla 148000 which is incorrect.

Tweeked comments so the file VEX/priv/guest_ppc_toIR.c can be committed again.
VEX commit 3285.

Bugzilla is 372185.

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

8 years agoBug #372120 - c++ demangler demangles symbols which are not c++.
Mark Wielaard [Mon, 7 Nov 2016 14:24:26 +0000 (14:24 +0000)] 
Bug #372120 - c++ demangler demangles symbols which are not c++.

Explicitly check that the symbol starts with "_Z" to only demangle
modern style (gnu_v3) mangled C++ (and Rust) symbols.

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

8 years agomips: Add redir for index function in ld.so.1
Petar Jovanovic [Fri, 4 Nov 2016 18:21:22 +0000 (18:21 +0000)] 
mips: Add redir for index function in ld.so.1

Redirect index function in ld.so.1.
Optimize the existing strlen function implementations.
This removes warnings coming from optimized index and strlen functions
in ld.so.1.

Patch by Aleksandar Rikalo.

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

8 years agoFix compile error on macOS introduced in r16111. n-i-bz.
Rhys Kidd [Fri, 4 Nov 2016 03:43:28 +0000 (03:43 +0000)] 
Fix compile error on macOS introduced in r16111. n-i-bz.

m_syswrap/syswrap-generic.c:4148:26: error: use of undeclared identifier 'PID_EXEPATH'
      VG_(sprintf)(name, PID_EXEPATH, VG_(getpid)());
                         ^
m_syswrap/syswrap-generic.c:4150:56: error: use of undeclared identifier 'SELF_EXEPATH'
          && (VG_STREQ(arg1s, name) || VG_STREQ(arg1s, SELF_EXEPATH))) {
                                                       ^
m_syswrap/syswrap-generic.c:4150:56: error: use of undeclared identifier 'SELF_EXEPATH'
m_syswrap/syswrap-generic.c:4151:29: error: use of undeclared identifier 'SELF_EXEFD'
         VG_(sprintf)(name, SELF_EXEFD, VG_(cl_exec_fd));
                            ^

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

8 years agoAdd demangling support for Rust symbols. Derived from a patch by
Julian Seward [Thu, 3 Nov 2016 10:50:42 +0000 (10:50 +0000)] 
Add demangling support for Rust symbols.  Derived from a patch by
David Tolnay <dtolnay@gmail.com>.  n-i-bz.

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

8 years agoMove scalar test of lwp_private syscall to platform specific directories
Ivo Raisr [Wed, 2 Nov 2016 22:33:16 +0000 (22:33 +0000)] 
Move scalar test of lwp_private syscall to platform specific directories
n-i-bz

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

8 years agoFix compiler warning about unused function on Solaris
Ivo Raisr [Wed, 2 Nov 2016 22:07:11 +0000 (22:07 +0000)] 
Fix compiler warning about unused function on Solaris

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

8 years agoSupport '%' in symbol Z-encoding.
Ivo Raisr [Wed, 2 Nov 2016 21:50:19 +0000 (21:50 +0000)] 
Support '%' in symbol Z-encoding.
Fixes BZ #371869.

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

8 years agoSome small optimisation+some code reformatting
Philippe Waroquiers [Wed, 2 Nov 2016 20:59:51 +0000 (20:59 +0000)] 
Some small optimisation+some code reformatting
* Use stack arrays instead of malloc/free
* ensure  msghdr_foreachfield does one single call to foreach_func
  for consecutive fields
* some small code reformatting or factorisation

Tested on linux, hoping it also works on solaris

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

8 years agomips: add POST function to sys_prctl
Petar Jovanovic [Tue, 1 Nov 2016 18:28:26 +0000 (18:28 +0000)] 
mips: add POST function to sys_prctl

Add missing POST wrapper for sys_prctl.
This fixes regressions from r15934 (on MIPS32 platforms) and r16003
(on MIPS64 platforms).

Related test: memcheck/tests/threadname

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

8 years ago371412 Rename wrap_sys_shmat to sys_shmat like other wrappers
Philippe Waroquiers [Tue, 1 Nov 2016 15:00:45 +0000 (15:00 +0000)] 
371412 Rename wrap_sys_shmat to sys_shmat like other wrappers

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

8 years agoNow that 3.12 is out, update version under development to 3.13.0.SVN
Philippe Waroquiers [Sat, 29 Oct 2016 13:27:51 +0000 (13:27 +0000)] 
Now that 3.12 is out, update version under development to 3.13.0.SVN

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

8 years agoFollow up to SVN r16105.
Ivo Raisr [Wed, 26 Oct 2016 09:44:39 +0000 (09:44 +0000)] 
Follow up to SVN r16105.
Forgot to include scalar.stderr.exp changes in the commit.

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

8 years agoAdd some more comments in pub_tool_debuginfo.h about memory persistence/ownership
Philippe Waroquiers [Tue, 25 Oct 2016 20:46:00 +0000 (20:46 +0000)] 
Add some more comments in pub_tool_debuginfo.h about memory persistence/ownership
and have m_debuginfo.c referencing these comments.

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

8 years agoSolaris: Add wrapper for fcntl(F_DUPFD_CLOEXEC)
Ivo Raisr [Tue, 25 Oct 2016 04:55:35 +0000 (04:55 +0000)] 
Solaris: Add wrapper for fcntl(F_DUPFD_CLOEXEC)
n-i-bz

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

8 years agoperf/vg_perf --outer-args: either replace the predefined outer args, or append to it.
Philippe Waroquiers [Mon, 24 Oct 2016 13:42:37 +0000 (13:42 +0000)] 
perf/vg_perf --outer-args:  either replace the predefined outer args, or append to it.
Currently, vg_perf predefines a set of standard outer tool args according to the tool.
These predefined args can be replaced by another set using "--outer-args=xxx yyy zzzz".
But often, we want to add (or override) only a few args.
So, modify vg_perf so that if the first letter of --outer-args is a + character, then
the provided args are appended to the predefined args

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

8 years agobzero is non-POSIX (deprecated), accordingly __bzero template required for all macOS...
Rhys Kidd [Sun, 23 Oct 2016 21:31:16 +0000 (21:31 +0000)] 
bzero is non-POSIX (deprecated), accordingly __bzero template required for all macOS versions. n-i-bz.

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

8 years agoResync with the version in 3_12_BRANCH.
Julian Seward [Sun, 23 Oct 2016 07:38:52 +0000 (07:38 +0000)] 
Resync with the version in 3_12_BRANCH.

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

8 years agoMerge from branches/VALGRIND_3_12_BRANCH:
Julian Seward [Sun, 23 Oct 2016 05:56:27 +0000 (05:56 +0000)] 
Merge from branches/VALGRIND_3_12_BRANCH:
  16095 Build fixes for MacOS X 10.10.5.

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

8 years agoAdd libc_test to workaround pth_cond_destroy_busy test hangs.
Mark Wielaard [Fri, 21 Oct 2016 00:02:10 +0000 (00:02 +0000)] 
Add libc_test to workaround pth_cond_destroy_busy test hangs.

This is a workaround for bug #371396. It adds a new test program
that can be used skip tests given a specific libc implementation
and optionally a specific minimum version. Currently only glibc
is recognized. This is used for the drd and helgrind tests
pth_cond_destroy_busy to be skipped on glibc 2.24.90+.

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

8 years agoUpdate.
Julian Seward [Thu, 20 Oct 2016 08:27:08 +0000 (08:27 +0000)] 
Update.

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

8 years agoInitial finalisation for 3.12.0.
Julian Seward [Thu, 20 Oct 2016 08:23:32 +0000 (08:23 +0000)] 
Initial finalisation for 3.12.0.

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

8 years agoAdd another incompatibility between illumos and Solaris kernels.
Ivo Raisr [Wed, 19 Oct 2016 21:58:35 +0000 (21:58 +0000)] 
Add another incompatibility between illumos and Solaris kernels.
n-i-bz

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

8 years agomips: fix coredump creation in Valgrind
Petar Jovanovic [Wed, 19 Oct 2016 17:49:06 +0000 (17:49 +0000)] 
mips: fix coredump creation in Valgrind

Coredumps created for MIPS are not valid today. Update the list of
registers that have to be saved, and use the structure defined in
kernel.

Patch by Aleksandar Rikalo.
It fixes BZ#351692.

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

8 years agoUpdate memcheck/tests/ppc64/power_ISA2_05.vgtest
Carl Love [Wed, 19 Oct 2016 17:23:19 +0000 (17:23 +0000)] 
Update memcheck/tests/ppc64/power_ISA2_05.vgtest

The option   --workaround-gcc296-bugs=yes has been depricated and
replaced with the option --ignore-range-below-sp=1024-1

Updated the vgtest file with this change.

No associated bugzilla.

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

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