]> git.ipfire.org Git - thirdparty/valgrind.git/log
thirdparty/valgrind.git
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

8 years agoSolaris: Add syscall wrapper for sigsuspend(95)
Ivo Raisr [Sun, 20 Nov 2016 00:20:34 +0000 (00:20 +0000)] 
Solaris: Add syscall wrapper for sigsuspend(95)
n-i-bz

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

8 years agoDisable test none/tests/pth_2sig on Solaris for now until
Ivo Raisr [Sat, 19 Nov 2016 23:28:18 +0000 (23:28 +0000)] 
Disable test none/tests/pth_2sig on Solaris for now until
it is investigated why it messes so badly with the regression test suite.
n-i-bz

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

8 years agoFix the configure test for presense of __xpg[4,6] symbols
Ivo Raisr [Sat, 19 Nov 2016 15:15:10 +0000 (15:15 +0000)] 
Fix the configure test for presense of __xpg[4,6] symbols
on Solaris so that only shared library is considered.
Previously a binary was checked which now started to produce
incorrect results with regards to vg_preload.
n-i-bz

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

8 years agoFix 372504 Hanging on exit_group
Philippe Waroquiers [Sat, 19 Nov 2016 14:54:44 +0000 (14:54 +0000)] 
Fix 372504  Hanging on exit_group

Note that it is unclear if the PRE syscall for rt_sigsuspend
is properly setting up a temporary mask in the thread state
tmp_sig_mask:  if an handler is called while a thread is
calling sigsuspend, the mask during the handler run must be
the temporary mask set by sigsuspend.
It is not clear if/where the valgrind sigframe builder/handler
sets the tmp_sig_mask to the value as expected by the user
(i.e. the value of the temporary mask which was given to
the sigsuspend syscall)

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

8 years agoFix Bug 372600 - process loops forever when fatal signals are arriving quickly
Philippe Waroquiers [Sat, 19 Nov 2016 13:51:41 +0000 (13:51 +0000)] 
Fix Bug 372600 - process loops forever when fatal signals are arriving quickly

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

8 years agoImprove the outer/inner setup: have the outer reporting the inner guest stacktrace
Philippe Waroquiers [Sat, 19 Nov 2016 13:24:13 +0000 (13:24 +0000)] 
Improve the outer/inner setup: have the outer reporting the inner guest stacktrace

Note: the outer now unconditionally report the inner guest stacktrace.
If that would be a problem, we might add a sim-hint no-inner-guest-stacktrace
to optionally disable such outer behaviour.

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

8 years agoAdd typedef Alloc_Fn_t/Free_Fn_t in pub_tool_basics.h, use them everywhere
Philippe Waroquiers [Fri, 18 Nov 2016 21:54:09 +0000 (21:54 +0000)] 
Add typedef Alloc_Fn_t/Free_Fn_t in pub_tool_basics.h, use them everywhere

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

8 years agoActivate perf tests on arm64
Philippe Waroquiers [Sun, 13 Nov 2016 11:13:48 +0000 (11:13 +0000)] 
Activate perf tests on arm64

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

8 years agoFix sym name cache: handles the difference between text and data, + match in symbol
Philippe Waroquiers [Sat, 12 Nov 2016 22:55:35 +0000 (22:55 +0000)] 
Fix sym name cache: handles the difference between text and data, + match in symbol
* sym name cache to cache the 'isText' characteristic of the cached sym_name
* implement the match anywhere also in the cache
Not handling matchAnywhere has bad performance effect on callgrind, as almost many
IPs were considered as a fn entry, while they were not.
* use the same convention to name the findText argument

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

8 years agoWhen --show-below-main=no, search main from the outermost stackframe
Philippe Waroquiers [Sat, 12 Nov 2016 20:11:25 +0000 (20:11 +0000)] 
When --show-below-main=no, search main from the outermost stackframe

* main is more likely to be an outermost frame rather than an innermost
  frame. So, searching from the outermost frame will more quickly find it.

* Also, in case the stacktrace contains twice the main functionn, this
  ensures we only removes the functions below the outermost main.
  Having 2 mains in a stacktrace does not happen normally.
  However, this prepares for some future commit that improves
  the outer/inner setup: the outer will append the inner guest stack trace.
  The inner stack trace sometimes already contains main.
  Searching from outermost frame main allows to keep the interesting
  part of the stacktrace.

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

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