]> git.ipfire.org Git - thirdparty/valgrind.git/log
thirdparty/valgrind.git
9 years agoNo need to call VG_(am_find_nsegment) if the stack is found in the stack cache.
Philippe Waroquiers [Tue, 23 Feb 2016 21:09:59 +0000 (21:09 +0000)] 
No need to call VG_(am_find_nsegment) if the stack is found in the stack cache.

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

9 years agoAdd bug 359703 s390: wire up separate socketcalls system calls to NEWS.
Mark Wielaard [Tue, 23 Feb 2016 20:13:28 +0000 (20:13 +0000)] 
Add bug 359703 s390: wire up separate socketcalls system calls to NEWS.

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

9 years agomips32: minor modification to MoveIns test
Petar Jovanovic [Tue, 23 Feb 2016 17:39:04 +0000 (17:39 +0000)] 
mips32: minor modification to MoveIns test

While no issues have been reported with this test example, it was
misusing early-clobber constraints and missing some real constraints
on the other side. Fixing it now.

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

9 years agoAdd big_debuginfo_symbol to svn ignore list
Petar Jovanovic [Tue, 23 Feb 2016 16:04:35 +0000 (16:04 +0000)] 
Add big_debuginfo_symbol to svn ignore list

Update the svn ignore list in memcheck/tests.

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

9 years agomips32: add two missing exp files in EXTRA_DIST
Petar Jovanovic [Tue, 23 Feb 2016 15:41:38 +0000 (15:41 +0000)] 
mips32: add two missing exp files in EXTRA_DIST

MoveIns.stdout.exp-mips32r2-BE and MoveIns.stdout.exp-mips32r2-LE have not
been included in EXTRA_DIST. Adding it now.

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

9 years agoBug 359703 s390: wire up separate socketcalls system calls
Mark Wielaard [Tue, 23 Feb 2016 15:19:49 +0000 (15:19 +0000)] 
Bug 359703 s390: wire up separate socketcalls system calls

The linux 4.3 s390 kernel has separate system calls that were originally
hidden behind the socketcall multiplexer system call. Newer glibc versions
will use these direct system calls instead of socketcall when available.
Causing several regtest failures.

This fix simply wires up the split out system calls directly to the
existing syswrap handlers for s390.

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

9 years agomips32: add tests for mfhc1 and mthc1 instructions
Petar Jovanovic [Mon, 22 Feb 2016 16:29:40 +0000 (16:29 +0000)] 
mips32: add tests for mfhc1 and mthc1 instructions

Add tests for mfhc1 and mthc1 instructions and (two) new exp files.
Also, minor formatting changes throughout the test file.

This is related to VEX change r3211.

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

9 years agoFix typo in Makefile.am : remove the second _
Philippe Waroquiers [Thu, 18 Feb 2016 21:41:01 +0000 (21:41 +0000)] 
Fix typo in Makefile.am : remove the second _

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

9 years agoAdd a test for bug 359133 Assertion 'eltSzB <= ddpa->poolSzB' failed
Philippe Waroquiers [Thu, 18 Feb 2016 21:32:46 +0000 (21:32 +0000)] 
Add a test for bug 359133 Assertion 'eltSzB <= ddpa->poolSzB' failed
Test case provided by David Hallas

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

9 years agoFix compiler warning about using uninitialized variable 'arr'.
Ivo Raisr [Thu, 18 Feb 2016 18:10:05 +0000 (18:10 +0000)] 
Fix compiler warning about using uninitialized variable 'arr'.
Reported by gcc 5.3. The test outcome remains unchanged.
n-i-bz

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

9 years agoFix some compiler errors about accessing static variables
Ivo Raisr [Thu, 18 Feb 2016 17:15:45 +0000 (17:15 +0000)] 
Fix some compiler errors about accessing static variables
from non-static inline functions reported by gcc 5.3:
warning: "locf" is static but declared in inline function "fun_f" which is not static

While at it, silence also compiler warning about uninitialized
variable "result" when calling fun_a().

n-i-bz

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

9 years agoPower PPC 128bit modulo and carry instruction fix
Carl Love [Thu, 18 Feb 2016 16:31:55 +0000 (16:31 +0000)] 
Power PPC 128bit modulo and carry instruction fix

VEX commit 3209 fixed: an issue with caculating the carry to the next 32-bit
chunk for the Power PPC 128-bit add and subract instructions: vaddcuq, vadduqm,
vsubcuq, vsubuqm, vaddecuq, vaddeuqm, vsubecuq, vsubeuqm

The corresponding test case didn't catch the issue.  The valgrind commit
15790 adds data values to the test that verify the issue is fixed.

This commit is to update the NEWS file.

Valgrind Bugzilla 359472

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

9 years agoBug 359201 followup. futex skips argument 5 if op is FUTEX_WAIT_BITSET.
Mark Wielaard [Thu, 18 Feb 2016 11:14:47 +0000 (11:14 +0000)] 
Bug 359201 followup. futex skips argument 5 if op is FUTEX_WAIT_BITSET.

The original fix in svn r15793 read argument 6 separately by using PRA6
unconditionally. This is wrong. We need to first check whether a
track_pre_reg_read callback is registered (only memcheck does).
The PRE_REG_READX macro already had this check. Just add the same
before calling PRA6. Thanks to Tom Hughes for noticing. Without this
helgrind/tests/cond_timedwait_test and drd/tests/pth_inconsistent_cond_wait
regtests would fail.

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

9 years agoFix incorrect (or infinite loop) unwind on RHEL7 amd64 64 bits.
Philippe Waroquiers [Wed, 17 Feb 2016 22:41:14 +0000 (22:41 +0000)] 
Fix incorrect (or infinite loop) unwind on RHEL7 amd64 64 bits.

Same kind of problems as explained and fixed in revision 15720:
In some cases, unwinding always retrieves the same pc/sp/bp.

Fix for 64 bits is similar: stop unwinding if the previous sp is >= new sp

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

9 years agoBug 359201 futex syscall skips argument 5 if op is FUTEX_WAIT_BITSET
Mark Wielaard [Wed, 17 Feb 2016 20:53:34 +0000 (20:53 +0000)] 
Bug 359201 futex syscall skips argument 5 if op is FUTEX_WAIT_BITSET

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

9 years agos390: Fix BZ #359289, adding support for popcnt insn.
Florian Krohm [Wed, 17 Feb 2016 20:00:59 +0000 (20:00 +0000)] 
s390: Fix BZ #359289, adding support for popcnt insn.
Companion patch is VEX r3210.
Patch by Andreas Arnez (arnez@linux.vnet.ibm.com).

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

9 years agoSolaris syscall: commands A_GETSTAT and A_SETSTAT
Ivo Raisr [Wed, 17 Feb 2016 18:11:32 +0000 (18:11 +0000)] 
Solaris syscall: commands A_GETSTAT and A_SETSTAT
for auditon(2) subcode of the auditsys() syscall
were removed in Solaris 12.
However they stay for Solaris 11 and illumos.
n-i-bz

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

9 years agoPower PPC 128bit modulo and carry instruction fix
Carl Love [Tue, 16 Feb 2016 21:23:52 +0000 (21:23 +0000)] 
Power PPC 128bit modulo and carry instruction fix

VEX commit 3209 fixed: an issue with caculating the carry to the next 32-bit
chunk for the Power PPC 128-bit add and subract instructions: vaddcuq, vadduqm,
vsubcuq, vsubuqm, vaddecuq, vaddeuqm, vsubecuq, vsubeuqm

The corresponding test case didn't catch the issue.  This commit adds data
values to the test that verify the issue is fixed.

Valgrind Bugzilla 359472

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

9 years agos390: Recognise machine model z13s (2965).
Florian Krohm [Tue, 16 Feb 2016 21:15:32 +0000 (21:15 +0000)] 
s390: Recognise machine model z13s (2965).

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

9 years agoSpeed up vgdb in standalone mode by using noack mode
Philippe Waroquiers [Mon, 15 Feb 2016 22:53:45 +0000 (22:53 +0000)] 
Speed up vgdb in standalone mode by using noack mode

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

9 years agoFix Bug 359133 - m_deduppoolalloc.c:258 (vgPlain_allocEltDedupPA): Assertion 'eltSzB...
Philippe Waroquiers [Sun, 14 Feb 2016 22:14:19 +0000 (22:14 +0000)] 
Fix Bug 359133 - m_deduppoolalloc.c:258 (vgPlain_allocEltDedupPA): Assertion 'eltSzB <= ddpa->poolSzB' failed.

When the elt to allocate is bigger than the pool size, allocate
a specific pool only for this element.

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

9 years agoFix scalar test case for llseek on x86/Solaris.
Ivo Raisr [Fri, 12 Feb 2016 13:57:50 +0000 (13:57 +0000)] 
Fix scalar test case for llseek on x86/Solaris.
n-i-bz

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

9 years agoNew gcc versions (4.9, 5.3) provided by Solaris enable
Ivo Raisr [Fri, 12 Feb 2016 13:43:59 +0000 (13:43 +0000)] 
New gcc versions (4.9, 5.3) provided by Solaris enable
largefile support by default. This gets in the way what
Valgrind core expects (vki, various m_libc modules).
Therefore disable largefile support if it is enabled.
Anyway, support for 32-bit applications is going away in Solaris 12.

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

9 years agoExclude 'threading model' information from Solaris coredump_many_threads test as...
Ivo Raisr [Mon, 8 Feb 2016 08:26:17 +0000 (08:26 +0000)] 
Exclude 'threading model' information from Solaris coredump_many_threads test as well
See previous SVN r15783 for details.
n-i-bz

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

9 years agoExclude 'threading model' information from Solaris coredump tests
Ivo Raisr [Sun, 7 Feb 2016 23:59:41 +0000 (23:59 +0000)] 
Exclude 'threading model' information from Solaris coredump tests

Solaris 12 transitioned to public libproc and mdb now prints
'raw lwps' instead of 'native threads' for the threading model.
This information is irrelevant for coredump generation and analysis;
therefore leave it out.
n-i-bz

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

9 years agoSolaris syscall: Add support for getrandom(143).
Ivo Raisr [Fri, 5 Feb 2016 22:57:42 +0000 (22:57 +0000)] 
Solaris syscall: Add support for getrandom(143).
n-i-bz

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

9 years agoExplicitly test command -v host output before trying host command.
Mark Wielaard [Thu, 4 Feb 2016 22:38:06 +0000 (22:38 +0000)] 
Explicitly test command -v host output before trying host command.

We have to explicitly test command -v host worked otherwise on systems
that do not have 'host' installed will return error code 127 and stop
testing. This is because vg_regtest uses '/bin/sh -c' to execute the
prereq command. Found by Petar Jovanovic.

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

9 years agoSome more fixes for Bug 348345 - Assertion fails for negative lineno
Philippe Waroquiers [Wed, 3 Feb 2016 22:12:56 +0000 (22:12 +0000)] 
Some more fixes for Bug 348345 - Assertion fails for negative lineno

* Complain instead of asserting when negative line nr in inline info
* use a macro to factorise the complain once logic about lineno limits

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

9 years agoAdd tests for FCOM/FCOMP instructions. BZ#212352.
Tom Hughes [Wed, 3 Feb 2016 10:15:56 +0000 (10:15 +0000)] 
Add tests for FCOM/FCOMP instructions. BZ#212352.

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

9 years agomips64: use getdents() if getdents64() is not available
Petar Jovanovic [Fri, 29 Jan 2016 17:47:43 +0000 (17:47 +0000)] 
mips64: use getdents() if getdents64() is not available

The MIPS64 getdents64() system call is only present in 3.10+ kernels.
If the getdents64() system call is not available fall back to using
getdents() and modify the result to be compatible with getdents64().
This matters only when --track-fds=yes is set.

This change fixes none/tests/fdleak* failures on MIPS64 platforms with
kernel versions older than 3.10.

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

9 years agoUpdate list of bugs.
Julian Seward [Thu, 28 Jan 2016 12:20:42 +0000 (12:20 +0000)] 
Update list of bugs.

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

9 years agoFix misplaced closing parenthesis in various VG_(....) calls
Philippe Waroquiers [Wed, 27 Jan 2016 22:35:14 +0000 (22:35 +0000)] 
Fix misplaced closing parenthesis in various VG_(....) calls
At many places, we have:
   VG_(fun(a,b,c))
instead of
   VG_(fun)(a,b,c)
So, fix these cases, found using:
grep -n -i -e 'VG_([a-z][a-z0-9_]*[^a-z0-9_)]' *.c */*.c */*/*.c

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

9 years agoFix expected output of test memcheck/tests/leak_cpp_interior on Solaris 12.
Ivo Raisr [Tue, 26 Jan 2016 10:34:16 +0000 (10:34 +0000)] 
Fix expected output of test memcheck/tests/leak_cpp_interior on Solaris 12.
C++ allocator from Solaris Studio allocates for std::string
57 bytes instead of former 40 bytes on 64-bit, and 45 bytes instead of 28 on 32-bit.
Confirmed with truss and --trace-alloc=yes.
n-i-bz

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

9 years agoFix compilation error on Solaris.
Ivo Raisr [Tue, 26 Jan 2016 04:31:04 +0000 (04:31 +0000)] 
Fix compilation error on Solaris.
Include <sys/segments.h> only on x86/amd64 architecture.
n-i-bz

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

9 years agoconfigure.ac: Port to gcc 5
Bart Van Assche [Mon, 25 Jan 2016 04:27:25 +0000 (04:27 +0000)] 
configure.ac: Port to gcc 5

Apparently gcc 5 behaves as follows:
$ gcc -dumpversion
5

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

9 years agoFix tinycc.c misleading indentation as pointed out by GCC6.
Mark Wielaard [Sun, 24 Jan 2016 13:39:10 +0000 (13:39 +0000)] 
Fix tinycc.c misleading indentation as pointed out by GCC6.

tinycc.c: In function ‘expr_eq’:
tinycc.c:13368:21: warning: statement is indented as if it were guarded by... [-Wmisleading-indentation]
                     gv(rc);
                     ^~

tinycc.c:13366:17: note: ...this ‘else’ clause, but it is not
                 else
                 ^~~~

Two statements are indeed misleadingly indented. Fixed by unindenting them.

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

9 years agoChange tests using --fullpath-after so as to work with ccache caching compiler
Philippe Waroquiers [Fri, 22 Jan 2016 22:06:02 +0000 (22:06 +0000)] 
Change tests using --fullpath-after so as to work with ccache caching compiler

ccache sometimes causes the source file absolute name to be another
full path (not $PWD).
This means that the badfree3 and varinfo5 tests can fail due to
the full path after not being match on $PWD.
So, rather ask full path after a part of the path that is stable
even when ccache decides to reuse a already compiled object from
another directory.

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

9 years agoImplement support for 'catch syscall' in gdbserver.
Philippe Waroquiers [Fri, 22 Jan 2016 21:06:23 +0000 (21:06 +0000)] 
Implement support for 'catch syscall' in gdbserver.
Note that catch syscall implies to use the soon to be released
gdb 7.11 version.

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

9 years agoSquash GCC warning in none/tests/arm/v6media.c
Mark Wielaard [Fri, 22 Jan 2016 15:14:16 +0000 (15:14 +0000)] 
Squash GCC warning in none/tests/arm/v6media.c

v6media.c: In function ‘gen_cin’:
v6media.c:10:12: warning: type of ‘cin’ defaults to ‘int’ [-Wimplicit-int]
 static int gen_cin(cin)

Just make the argument an int.

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

9 years agoSquash glibc warning about _BSD_SOURCE being deprecated tests.
Mark Wielaard [Fri, 22 Jan 2016 13:49:22 +0000 (13:49 +0000)] 
Squash glibc warning about _BSD_SOURCE being deprecated tests.

glibc 2.20 deprecated _BSD_SOURCE and _SVID_SOURCE and now requires
_DEFAULT_SOURCE to be defined instead. Add _DEFAULT_SOURCE define to
prevent warnings like:

In file included from /usr/include/stdio.h:27:0,
                 from stack_switch.c:5:
/usr/include/features.h:148:3: warning: #warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE" [-Wcpp]
 # warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE"
   ^

See https://sourceware.org/glibc/wiki/Release/2.20#Packaging_Changes

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

9 years agoSquash deprecation warnings from GCC in mpi wrapper code.
Mark Wielaard [Fri, 22 Jan 2016 13:42:47 +0000 (13:42 +0000)] 
Squash deprecation warnings from GCC in mpi wrapper code.

We wrap some deprecated things in libmpiwrap. Since we do want to keep
wrapping those add -Wno-deprecated-declarations to squash warnings like:

libmpiwrap.c:281:4: warning: ‘ompi_mpi_ub’ is deprecated: MPI_UB is deprecated in MPI-2.0 [-Wdeprecated-declarations]

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

9 years agoBug #357833 Setting RLIMIT_DATA to zero breaks with linux 4.5+
Mark Wielaard [Thu, 21 Jan 2016 11:37:43 +0000 (11:37 +0000)] 
Bug #357833 Setting RLIMIT_DATA to zero breaks with linux 4.5+

We used to set the process datasize rlimit to zero to prevent
any internal use of brk() from having any effect. But later
linux kernels redefine RLIMIT_DATA as the size of any data
areas, including some dynamic mmap memory allocations.

See bug #357833 for the commit that went into linux 4.5
changing the definition of RLIMIT_DATA. So don't mess with
RLIMIT_DATA anymore. Just remember it for use in the syscall
wrappers.

This also cleans up some hacks around the execv and spawn wrappers.

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

9 years agoUse command -v instead of which in res_search.vgtest prereq.
Mark Wielaard [Wed, 20 Jan 2016 23:15:04 +0000 (23:15 +0000)] 
Use command -v instead of which in res_search.vgtest prereq.

"command -v" is a (POSIX) shell builtin that should work everywhere.
"which" might be an external command that might not be installed in
which case the shell might just error out.

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

9 years agoBug #358030 Support direct socket calls on x86 32bit (new in linux 4.3)
Mark Wielaard [Wed, 20 Jan 2016 22:24:43 +0000 (22:24 +0000)] 
Bug #358030 Support direct socket calls on x86 32bit (new in linux 4.3)

Patch by ronald.wahl@raritan.com.

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

9 years agoFollowup to r15762. Add missing type in cast expression.
Florian Krohm [Sun, 17 Jan 2016 20:34:53 +0000 (20:34 +0000)] 
Followup to r15762. Add missing type in cast expression.
Do not use C++ comments. They are not allowed in this file.

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

9 years agoAvoid an MSVC compiler warning about an unused function parameter.
Florian Krohm [Sun, 17 Jan 2016 16:20:14 +0000 (16:20 +0000)] 
Avoid an MSVC compiler warning about an unused function parameter.
Fixes BZ #356817

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

9 years agoIn ML_(am_allocate_segname) do not set the reference count of the
Florian Krohm [Sat, 16 Jan 2016 21:44:31 +0000 (21:44 +0000)] 
In ML_(am_allocate_segname) do not set the reference count of the
slot to 1. Rather do that in add_segment which is where the segment
refering to that name actually comes into existence.
Properly handle the case in add_segment where the to-be-added segment
and one (or more) of the segments it replaces have the same name
This may occur when doing a mremap.

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

9 years agoRemove code that has no effect. Looks like a leftover from early
Florian Krohm [Sat, 16 Jan 2016 21:12:57 +0000 (21:12 +0000)] 
Remove code that has no effect. Looks like a leftover from early
debugging days.

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

9 years agofix n-i-bz false positive leaks due to aspacemgr merging non heap segments with heap...
Philippe Waroquiers [Thu, 14 Jan 2016 20:23:11 +0000 (20:23 +0000)] 
fix n-i-bz false positive leaks due to aspacemgr merging non heap segments with heap segments.

aspace mgr provides VG_(am_mmap_client_heap) that mmaps memory and
marks it as being client heap memory. Marking superblock segments used
for malloc/free as heap is critical for correct leak search: segments
mmap-ed for malloc/free cannot be considered as part of the root set.
On the other hand, other mmap-ed segments cannot be marked as client
heap, otherwise these segments will not be part of the root set, and
will not be scanned.

aspacemgr merges adjacent segments when they have the same characteristics
e.g. kind, RWX and isCH (is client heap) must be the same (see function
maybe_merge_nsegments).

However, VG_(am_mmap_client_heap) has a bug:
  * it first mmaps a normal segment (not marked as heap) using
     VG_(am_mmap_anon_float_client)
  * it then searches the segment that contains the just mmap-ed address and
    marks it as heap.

The problem is that VG_(am_mmap_anon_float_client) has already
possibly merged the new segment with a neighbour segment, without
taking the to be marked isCH into account, as the newly allocated memory
has not yet been marked as Client Heap.  So, this results in some memory being
marked as client heap, while it in fact is not client heap. This
memory will then not be scanned by the leak search.

The fix consists in having VG_(am_mmap_anon_float_client) and
VG_(am_mmap_client_heap) calling a new function
am_mmap_anon_float_client, which will mark (or not) the new segment as
client heap *before* trying to merge it with neighbouring segments.
Then the new (heap) segment will only be merged with neighbours that are also
client heap segments.

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

9 years agoFix expected output of helgrind/tests/tc20_verifywrap on Solaris.
Ivo Raisr [Wed, 13 Jan 2016 05:37:36 +0000 (05:37 +0000)] 
Fix expected output of helgrind/tests/tc20_verifywrap on Solaris.
n-i-bz

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

9 years agoAnnounce properly fix of:
Ivo Raisr [Tue, 12 Jan 2016 20:32:31 +0000 (20:32 +0000)] 
Announce properly fix of:
357871 - pthread_spin_destroy not properly wrapped

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

9 years agoFix typo in Helgrind's wrapper of pthread_spin_destroy().
Ivo Raisr [Tue, 12 Jan 2016 20:31:15 +0000 (20:31 +0000)] 
Fix typo in Helgrind's wrapper of pthread_spin_destroy().
Patch provided by: Jason Dillaman <dillaman@redhat.com>.
Fixes BZ #357871.

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

9 years agoVG_(fclose) ought to close the file, you silly. Fixes BZ #357887.
Florian Krohm [Tue, 12 Jan 2016 14:32:05 +0000 (14:32 +0000)] 
VG_(fclose) ought to close the file, you silly. Fixes BZ #357887.

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

9 years agomips: remove link script exception for MIPS arch
Petar Jovanovic [Tue, 29 Dec 2015 19:14:37 +0000 (19:14 +0000)] 
mips: remove link script exception for MIPS arch

Current toolchains on MIPS targets that we care about are reasonably
modern and we do not need this link script exception for MIPS anymore.

This should fix issues with newer toolchain versions and .MIPS.abiflags
section.

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

9 years agoFix 353660 XML in auxwhat tag not escaping reserved symbols properly
Philippe Waroquiers [Mon, 28 Dec 2015 22:02:18 +0000 (22:02 +0000)] 
Fix 353660  XML in auxwhat tag not escaping reserved symbols properly

Changed a few %s or %pS into %ps in m_addrinfo.c
(based on code reading matching the pattern given in the bug report,
as there was no reproducer).

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

9 years agomips: update exp files for helgrind/tests/tc20_verifywrap
Petar Jovanovic [Wed, 23 Dec 2015 18:48:18 +0000 (18:48 +0000)] 
mips: update exp files for helgrind/tests/tc20_verifywrap

Some recent changes, starting from r15426, have modified the test and
its expected output. The exp files have been only partially updated for
MIPS. We complete that with this change.

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

9 years agomips: update expected output for helgrind/tests/tc18_semabuse
Petar Jovanovic [Tue, 22 Dec 2015 16:06:07 +0000 (16:06 +0000)] 
mips: update expected output for helgrind/tests/tc18_semabuse

r15620 changed the test and the expected output for tc18_semabuse,
r15630 fixed the expected output file for other architectures but not
for mips.
Now we update it for mips as well.

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

9 years agoFix expected stderr on Solaris for memcheck/tests/gone_abrt_xml.
Ivo Raisr [Tue, 15 Dec 2015 10:43:25 +0000 (10:43 +0000)] 
Fix expected stderr on Solaris for memcheck/tests/gone_abrt_xml.
On Solaris, the stack frame looks like:
  <stack>
    <frame>
      <ip>0x........</ip>
      <obj>/lib/amd64/libc.so.1</obj>
      <fn>kill</fn>
    </frame>
    <frame>
      <ip>0x........</ip>
      <obj>.../gdbserver_tests/gone</obj>
      <fn>(below main)</fn>
    </frame>
  </stack>

because Solaris libc does not currently contain DWARF CFI and
stack unwinder gets only return address from _start().

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

9 years agoFix expected output of massif/tests/mmapunmap on Solaris.
Ivo Raisr [Mon, 14 Dec 2015 20:14:44 +0000 (20:14 +0000)] 
Fix expected output of massif/tests/mmapunmap on Solaris.

On Solaris and Linux, mmap() is an optimized function without
prologue and epilogue. However, Solaris libc does not currently
bear any DWARF CFI. Therefore stack chain unwinder grabs only
two entries: IP inside mmap() and return address from the previous
frame which points inside _start(), right after where main()
is invoked. By introducing an intermediate function f(), main()
is now visible in the stack trace even on Solaris.
n-i-bz

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

9 years agoFix the bug description in NEWS
Philippe Waroquiers [Sun, 13 Dec 2015 16:54:34 +0000 (16:54 +0000)] 
Fix the bug description in NEWS

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

9 years agoFix 191069 Exiting due to signal not reported in XML output
Philippe Waroquiers [Sun, 13 Dec 2015 16:53:46 +0000 (16:53 +0000)] 
Fix 191069   Exiting due to signal not reported in XML output

Patch from  Matthias Schwarzott (slightly modified)

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

9 years agoRemove a temporary file after massif/tests/mmapunmap test run.
Ivo Raisr [Sat, 12 Dec 2015 19:58:40 +0000 (19:58 +0000)] 
Remove a temporary file after massif/tests/mmapunmap test run.
n-i-bz

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

9 years agoFix massif --pages-as-heap=yes does not report peak caused by mmap+munmap
Philippe Waroquiers [Thu, 10 Dec 2015 22:37:59 +0000 (22:37 +0000)] 
Fix massif --pages-as-heap=yes does not report peak caused by mmap+munmap

ms_unrecord_page_mem was wrongly taking the (possible) peak snapshot
when unrecording the last block.
But the peak snapshot will be detected when unrecording the first block
of an munmap, not when unrecording the last block.

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

9 years agoaddLoc: only merge the new entry with the previous one if the resulting
Philippe Waroquiers [Sun, 6 Dec 2015 22:11:21 +0000 (22:11 +0000)] 
addLoc: only merge the new entry with the previous one if the resulting
size does not exceed the max allowed.

Also improve the tracing.

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

9 years agosupport qC packet in gdbserver
Philippe Waroquiers [Sat, 5 Dec 2015 21:57:59 +0000 (21:57 +0000)] 
support qC packet in gdbserver
Patch from Daniel Trebbien (slightly modified)
(qC packet needed for lldb support)

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

9 years agoAdd support for repository cache protocol version 27.
Ivo Raisr [Fri, 4 Dec 2015 17:37:41 +0000 (17:37 +0000)] 
Add support for repository cache protocol version 27.
n-i-bz

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

9 years agoDwarf line info reader now correctly interprets 'is_stmt' register
Ivo Raisr [Fri, 4 Dec 2015 13:14:10 +0000 (13:14 +0000)] 
Dwarf line info reader now correctly interprets 'is_stmt' register

Line numbers should correctly reflect all instructions belonging to a source line,
regardless of is_stmt value. Previously only instructions covered by
'is_stmt = 1' were attributed to a source line.

Fixes BZ#356044

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

9 years agomips: add missing "memory" to the clobber list
Petar Jovanovic [Fri, 27 Nov 2015 14:51:33 +0000 (14:51 +0000)] 
mips: add missing "memory" to the clobber list

Add "memory" to the clobber arguments of VALGRIND_DO_CLIENT_REQUEST_EXPR.

This fixes memcheck/tests/vbit-test/vbit-test.

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

9 years agomips: get isa level information from /proc/cpuinfo
Petar Jovanovic [Thu, 26 Nov 2015 18:20:44 +0000 (18:20 +0000)] 
mips: get isa level information from /proc/cpuinfo

Rewrite parts of VG_(parse_cpuinfo) (previously VG_(get_machine_model))
function to extract information on supported ISAs. These values are then
packed in hwcaps. This will help Valgrind better distinguish different MIPS
CPUs and raise illegal instructions when required.

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

9 years agoThis is a fix to Bug 354797 which added the vbit test support for the
Carl Love [Wed, 25 Nov 2015 17:48:25 +0000 (17:48 +0000)] 
This is a fix to Bug 354797 which added the vbit test support for the
Power 8 instructions.

The patch for bug 354797 moved the declaration for rc outside of the
architecture #ifdef.  This results in an message about rc being unused
on architectures other then s390 and powerpc.  This commit eliminates
the issue by:

powerpc: move rc declaration into #ifdef for powerpc.
      Remove tab, put in missing break.

s390: remove rc declaration from inside case statement.  Put rc declaration
      before the switch statement but within the #ifdef for s390 so it will
      be declared for use in both case clauses.

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

9 years agoFix a typo in the clobber list.
Florian Krohm [Tue, 24 Nov 2015 19:38:16 +0000 (19:38 +0000)] 
Fix a typo in the clobber list.
Spotted by Michael Daniels <mdaniels@qnx.com>

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

9 years agomips: improve recognition of different MIPS processors
Petar Jovanovic [Mon, 23 Nov 2015 15:35:54 +0000 (15:35 +0000)] 
mips: improve recognition of different MIPS processors

Recognize correctly MIPS processors. Previously, for some of the cpu models,
Valgrind would incorrectly assume it is a regular MIPS model, as it would
find word MIPS in /proc/cpuinfo that came from "BogoMIPS" label.

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

9 years agoMake libvexmulti_arch work on ppc64 BE with host mips
Philippe Waroquiers [Sun, 22 Nov 2015 16:08:56 +0000 (16:08 +0000)] 
Make libvexmulti_arch work on ppc64 BE with host mips
Mips needs at least some hwcaps (see host_mips_isel.c:4174)

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

9 years agoImplement properly setjmp/longjmp on Solaris x86/amd64.
Ivo Raisr [Sat, 21 Nov 2015 21:35:34 +0000 (21:35 +0000)] 
Implement properly setjmp/longjmp on Solaris x86/amd64.
The default implementation provided by __builtin functions
does very weird things.
Uncovered by Philippe's commit r15716.

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

9 years agoResolve build error on OS X, from r15728. n-i-bz.
Rhys Kidd [Sat, 21 Nov 2015 00:37:33 +0000 (00:37 +0000)] 
Resolve build error on OS X, from r15728. n-i-bz.

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

9 years agoSolaris syscall: Fix pset(getloadavg).
Ivo Raisr [Thu, 19 Nov 2015 09:34:29 +0000 (09:34 +0000)] 
Solaris syscall: Fix pset(getloadavg).
The buffer holds integers, not doubles.
n-i-bz

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

9 years agoFix a bug in the debug code of find_chunk_for.
Philippe Waroquiers [Wed, 18 Nov 2015 23:07:27 +0000 (23:07 +0000)] 
Fix a bug in the debug code of find_chunk_for.

find_chunk_for has a special case for zero size block.
The special case was missing in the find_chunk_for_OLD.
So, when enabling the leak check debug, the following assert
is raised with ./vg-in-place ./memcheck/tests/leak-0
if you comment the lines (in find_chunk_for_OLD)
      if (a_lo == a_hi)
         a_hi++; // Special case for szB 0. See find_chunk_for.
and define VG_DEBUG_FIND_CHUNK

Memcheck: mc_leakcheck.c:327 (find_chunk_for): Assertion 'retVal == find_chunk_for_OLD ( ptr, chunks, n_chunks )' failed.

host stacktrace:
==7868==    at 0x38031535: show_sched_status_wrk (m_libcassert.c:343)
==7868==    by 0x38031641: report_and_quit (m_libcassert.c:415)
==7868==    by 0x38031723: vgPlain_assert_fail (m_libcassert.c:481)
==7868==    by 0x38004AA6: find_chunk_for (mc_leakcheck.c:327)
==7868==    by 0x38005236: lc_is_a_chunk_ptr (mc_leakcheck.c:538)
==7868==    by 0x3800556D: lc_push_without_clique_if_a_chunk_ptr (mc_leakcheck.c:893)
==7868==    by 0x38035234: apply_to_GPs_of_tid (m_machine.c:199)
==7868==    by 0x38035234: vgPlain_apply_to_GP_regs (m_machine.c:425)
==7868==    by 0x38006406: vgMemCheck_detect_memory_leaks (mc_leakcheck.c:1913)
==7868==    by 0x38015872: mc_handle_client_request (mc_main.c:6628)
==7868==    by 0x38047AB8: wrap_tool_handle_client_request (m_tooliface.c:280)
==7868==    by 0x3807C5C4: do_client_request (scheduler.c:2101)
==7868==    by 0x3807C5C4: vgPlain_scheduler (scheduler.c:1425)
==7868==    by 0x38089973: thread_wrapper (syswrap-linux.c:102)
==7868==    by 0x38089973: run_a_thread_NORETURN (syswrap-linux.c:155)

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

9 years agoAnnounce fix for (not in bugzilla) unwind problems on RHEL7 32 bits
Philippe Waroquiers [Wed, 18 Nov 2015 20:59:34 +0000 (20:59 +0000)] 
Announce fix for (not in bugzilla) unwind problems on RHEL7 32 bits

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

9 years agoFix incorrect (or infinite loop) unwind on RHEL7 x86 32 bits.
Philippe Waroquiers [Wed, 18 Nov 2015 20:56:55 +0000 (20:56 +0000)] 
Fix incorrect (or infinite loop) unwind on RHEL7 x86 32 bits.

On RHEL7 x86 32 bits, Valgrind unwinder cannot properly unwind
the stack just after a thread creation : the unwinder always retrieves
the same pc/sp/bp.
See below for an example.
This has as consequences that some stack traces are bigger than
needed (i.e. they always fill up the ips array). If
--merge-recursive-frames is given, then the unwinder enters in an
infinite loop (as identical frames will be merged, and the ips array
will never be filled in).
Thi patch adds an additional exit condition : after unwinding
a frame, if the previous sp is >= new sp, then unwinding stops.
Patch has been tested on debian 8/x86, RHEL7/x86.

   0x0417db67 <+55>:    mov    0x18(%esp),%ebx
   0x0417db6b <+59>:    mov    0x28(%esp),%edi
   0x0417db6f <+63>:    mov    $0x78,%eax
   0x0417db74 <+68>:    mov    %ebx,(%ecx)
   0x0417db76 <+70>:    int    $0x80
=> 0x0417db78 <+72>:    pop    %edi
   0x0417db79 <+73>:    pop    %esi
   0x0417db7a <+74>:    pop    %ebx
   0x0417db7b <+75>:    test   %eax,%eax

Valgrind stacktrace gives:
==21261==    at 0x417DB78: clone (clone.S:110)
==21261==    by 0x424702F: ???
==21261==    by 0x424702F: ???
==21261==    by 0x424702F: ???
==21261==    by 0x424702F: ???
==21261==    by 0x424702F: ???
==21261==    by 0x424702F: ???
==21261==    by 0x424702F: ???
...
(till the array of ips is full)

while gdb stacktrace gives:
(gdb) bt
#0  clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:110
#1  0x00000000 in ?? ()
(gdb) p $pc
$2 = (void (*)()) 0x417db78 <clone+72>
(gdb)

With the fix, valgrind gives:
==21261==    at 0x417DB78: clone (clone.S:110)
==21261==    by 0x424702F: ???
which looks more reasonable.

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

9 years agoWhen searching for global public symbols (like for the somalloc
Ivo Raisr [Wed, 18 Nov 2015 20:38:37 +0000 (20:38 +0000)] 
When searching for global public symbols (like for the somalloc
synonym symbols), exclude the dynamic (runtime) linker as it is very
special.
Fixes BZ#355454

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

9 years agoExpected stderr of test cases wrapmalloc and wrapmallocstatic are overconstrained.
Ivo Raisr [Wed, 18 Nov 2015 04:13:12 +0000 (04:13 +0000)] 
Expected stderr of test cases wrapmalloc and wrapmallocstatic are overconstrained.
Fixes BZ#355455.

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

9 years agoBZ#355188 valgrind should intercept all malloc related global functions.
Mark Wielaard [Sun, 15 Nov 2015 16:50:43 +0000 (16:50 +0000)] 
BZ#355188 valgrind should intercept all malloc related global functions.

This implements the interception of all globally public allocation
functions by default. It works by adding a flag to the spec to say the
interception only applies to global functions. Which is set for the
somalloc spec. The librarypath to match is set to "*" unless the user
overrides it. Then each DiSym keeps track of whether the symbol is local
or global. For a spec which has isGlobal set only isGlobal symbols will
match.

Note that because of padding to keep the addresses in DiSym aligned the
addition of the extra bool isGlobal doesn't actually grow the struct.
The comments explain how the struct could be made more compact on 32bit
systems, but this isn't as easy on 64bit systems. So I didn't try to do
that in this patch.

For ELF symbols keeping track of which are global is trivial. For pdb I
had to guess and made only the "Public" symbols global. I don't know
how/if macho keeps track of global symbols or not. For now I just mark
all of them local (which just means things work as previously on platforms
that use machos, no non-system symbols are matches by default for somalloc
unless the user explicitly tells which library name to match).

Included are two testcases for shared libraries (wrapmalloc) and staticly
linked (wrapmallocstatic) malloc/free overrides that depend on the new
default. One existing testcase (new_override) was adjusted to explicitly
not use the new somalloc default because it depends on a user defined
new implementation that has side-effects and should explicitly not be
intercepted.

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

9 years agoInitial add of new bugs since 3.11.0.
Julian Seward [Mon, 9 Nov 2015 20:58:01 +0000 (20:58 +0000)] 
Initial add of new bugs since 3.11.0.

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

9 years agoCreate 3_11_BUGSTATUS.txt.
Julian Seward [Mon, 9 Nov 2015 20:35:51 +0000 (20:35 +0000)] 
Create 3_11_BUGSTATUS.txt.

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

9 years agoIf --history-level=full was not provided at startup, report an error in
Philippe Waroquiers [Sun, 8 Nov 2015 10:42:06 +0000 (10:42 +0000)] 
If --history-level=full was not provided at startup, report an error in
helgrind accesshistory monitor command

As accesshistory will never show anything unless this option is given.

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

9 years agoFix documentation of command line flag
Florian Krohm [Fri, 6 Nov 2015 22:08:46 +0000 (22:08 +0000)] 
Fix documentation of command line flag
BZ #354933

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

9 years agoAdd ISA 2.07 vbit test support
Carl Love [Tue, 3 Nov 2015 17:52:08 +0000 (17:52 +0000)] 
Add ISA 2.07 vbit test support

Updated the NEWS file for this fix in VEX commit 3202 and valgrind commit
15720.

Bugzilla 354797 was created for this issue.

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

9 years agoAdd ISA 2.07 vbit test support
Carl Love [Tue, 3 Nov 2015 17:48:04 +0000 (17:48 +0000)] 
Add ISA 2.07 vbit test support

The ISA 2.07 support adds new Iops as well as support for some existing
Iops.  None of these Iops have been enabled in the vbit tester.  This commit
adds the needed support to the files in memcheck/tests/vbit-test.
These changes add support for additional immediate operands and additional
undefined bit checking functions.

There are additional changes to files VEX/priv/ir_inject.c and VEX/pub/libvex.h
that are in VEX commit 3202

Bugzilla 354797 was created for this issue.

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

9 years agoELF debug info reader was confused with multiple .rodata sections on Solaris
Ivo Raisr [Thu, 29 Oct 2015 07:28:58 +0000 (07:28 +0000)] 
ELF debug info reader was confused with multiple .rodata sections on Solaris

The ELF debug info reader on Solaris now performs a quick pre-scan of section
headers for .rodata sections. If there are multiple .rodata sections
present then symbols from .symtab are scanned which section they point to.
The "true" .rodata section is thus determined.
Fixes BZ#353802.

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

9 years agoSolaris syscall: Add support for lwp_cond_signal(171).
Ivo Raisr [Mon, 26 Oct 2015 16:13:05 +0000 (16:13 +0000)] 
Solaris syscall: Add support for lwp_cond_signal(171).
Fixes BZ#354392.

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

9 years agoDisable none/tests/bug234814 test for TileGx.
Zhi-Gang Liu [Fri, 23 Oct 2015 02:36:09 +0000 (02:36 +0000)] 
Disable none/tests/bug234814 test for TileGx.
Add "bool on_altstack" parameter to VG_(sigframe_create)(..)
in sigframe-tilegx-linux.c

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

9 years agoFix 353891 Assert 'bad_scanned_addr < VG_ROUNDDN(start+len, sizeof(Addr))' failed
Philippe Waroquiers [Thu, 22 Oct 2015 19:14:30 +0000 (19:14 +0000)] 
Fix 353891  Assert 'bad_scanned_addr < VG_ROUNDDN(start+len, sizeof(Addr))' failed

All memory dereferences during leak search are checked either with
aspacemgr or using the VA-bits.
So, in theory, no memory fault should occur.
However, the leak search is done so as to resist to e.g.
- desynchronisation between the real pages mapped and the aspacemgr state.
- client pages mprotected against reading
- any other reason why dereferencing a client address would fail.

So, the function lc_scan_memory installs a fault catcher that
is called if a memory fault signal is raised during memory scan.
However, memory dereference is also done in the function heuristic_reachedness.
So, this function must also resist to memory fault.

This patch also installs a fault catcher for the function heuristic_reachedness.

More in details, the following changes are done:
* pub_tool_signal.h and m_signals.c :
  VG_(set_fault_catcher) now returns the previously set fault catcher.
  This is needed so that heuristic_reachedness/lc_scan_memory can save
  and restore the previous fault catcher.

* mc_leakcheck.c:
  Addition of leak_search_fault_catcher that contains the common
  code for the (currently 2) fault catchers used during leak search.

* Modification of heuristic_reachedness and lc_scan_memory:
  Add 2 (small) specific fault catcher that are calling the common
  leak_search_fault_catcher.

* The way sigprocmask is handled has been changed:
  Before this patch, lc_scan_memory was saving/restoring the procsigmask
  for each scanned block (and was restoring it when the fault catcher
  was longjmp-ing back to lc_scan_memory in case of SEGV or BUS.
  This was causing 2 system calls for each block scanned.

  Now, lc_scan_memory and  heuristic_reachedness are not saving/restoring
  the procmask: the work to reset the sigprocmask is only done
  in leak_search_fault_catcher. This is more efficient as no syscall
  anymore is done during leak search, except for (normally) unfrequent
  SIGSEGV/BUS. It is also simpler as signal handling is now done at
  a single place.

  It is ok to reset the procmask (in fact, just remove the caught signal
  from the process sigmask) as during leak search, no other activity than
  the leak search is on-going, and so no other SEGV/BUS can be received
  while the handler runs.

This gives moderate speed improvements for applications allocating a lot of
blocks (about 10% improvement when leak searching in 1 million small blocks).

Test case (slightly modified) by Matthias Schwarzott.

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

9 years agoAdd helgrind tool to the Solaris IPS packaging manifest.
Ivo Raisr [Thu, 22 Oct 2015 13:36:07 +0000 (13:36 +0000)] 
Add helgrind tool to the Solaris IPS packaging manifest.
Somehow it slipped through the cracks...
n-i-bz

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

9 years agoClarification for some of the Solaris requirements.
Ivo Raisr [Wed, 21 Oct 2015 12:02:04 +0000 (12:02 +0000)] 
Clarification for some of the Solaris requirements.
Reported by: Matthew Wozniczka <mattheww@simba.com>

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

9 years agoFix inconsistent use of vki_ prefixes for struct vki_ifreq.
Julian Seward [Mon, 19 Oct 2015 11:21:33 +0000 (11:21 +0000)] 
Fix inconsistent use of vki_ prefixes for struct vki_ifreq.
No functional change.

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

9 years agoSilence -Wincompatible-pointer-types-discards-qualifiers warning. n-i-bz.
Rhys Kidd [Mon, 19 Oct 2015 10:20:17 +0000 (10:20 +0000)] 
Silence -Wincompatible-pointer-types-discards-qualifiers warning. n-i-bz.

m_replacemalloc/vg_replace_malloc.c:1286:1: warning: returning 'const char *' from a function with result type 'char *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
ZONE_GET_NAME(VG_Z_LIBC_SONAME, malloc_get_zone_name);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
m_replacemalloc/vg_replace_malloc.c:1283:14: note: expanded from macro 'ZONE_GET_NAME'
      return vg_default_zone.zone_name; \
             ^~~~~~~~~~~~~~~~~~~~~~~~~
m_replacemalloc/vg_replace_malloc.c:1287:1: warning: returning 'const char *' from a function with result type 'char *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
ZONE_GET_NAME(SO_SYN_MALLOC,    malloc_get_zone_name);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
m_replacemalloc/vg_replace_malloc.c:1283:14: note: expanded from macro 'ZONE_GET_NAME'
      return vg_default_zone.zone_name; \
             ^~~~~~~~~~~~~~~~~~~~~~~~~
m_replacemalloc/vg_replace_malloc.c:1286:1: warning: returning 'const char *' from a function with result type 'char *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
ZONE_GET_NAME(VG_Z_LIBC_SONAME, malloc_get_zone_name);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
m_replacemalloc/vg_replace_malloc.c:1283:14: note: expanded from macro 'ZONE_GET_NAME'
      return vg_default_zone.zone_name; \
             ^~~~~~~~~~~~~~~~~~~~~~~~~
m_replacemalloc/vg_replace_malloc.c:1287:1: warning: returning 'const char *' from a function with result type 'char *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
ZONE_GET_NAME(SO_SYN_MALLOC,    malloc_get_zone_name);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
m_replacemalloc/vg_replace_malloc.c:1283:14: note: expanded from macro 'ZONE_GET_NAME'
      return vg_default_zone.zone_name; \
             ^~~~~~~~~~~~~~~~~~~~~~~~~

No regressions on OS X 10.10

Before:

== 596 tests, 219 stderr failures, 10 stdout failures, 0 stderrB failures, 0 stdoutB failures, 30 post failures ==

After:

== 596 tests, 219 stderr failures, 10 stdout failures, 0 stderrB failures, 0 stdoutB failures, 30 post failures ==

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

9 years agoSilence -Wcast-qual const qualifier warning. n-i-bz.
Rhys Kidd [Mon, 19 Oct 2015 10:18:28 +0000 (10:18 +0000)] 
Silence -Wcast-qual const qualifier warning. n-i-bz.

m_debuginfo/readmacho.c:395:30: warning: cast from 'const void *' to 'DiSym *' drops const qualifier [-Wcast-qual]
   const DiSym* s1 = (DiSym*)v1;
                             ^
m_debuginfo/readmacho.c:396:30: warning: cast from 'const void *' to 'DiSym *' drops const qualifier [-Wcast-qual]
   const DiSym* s2 = (DiSym*)v2;
                             ^
m_libcsignal.c:481:49: warning: cast from 'const vki_sigset_t *' to 'vki_sigset_t *' drops const qualifier [-Wcast-qual]
  VG_(sigintersectset)(&pending, (vki_sigset_t*)set);
                                                ^

No regressions on OS X 10.10

Before:

== 596 tests, 219 stderr failures, 10 stdout failures, 0 stderrB failures, 0 stdoutB failures, 30 post failures ==

After:

== 596 tests, 219 stderr failures, 10 stdout failures, 0 stderrB failures, 0 stdoutB failures, 30 post failures ==

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

9 years agoFix a bug passing immediate values to ir_inject.c
Florian Krohm [Sat, 17 Oct 2015 11:18:50 +0000 (11:18 +0000)] 
Fix a bug passing immediate values to ir_inject.c

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

9 years agoLink the vbit tester against libvex-<arch>-<os>.a
Florian Krohm [Fri, 16 Oct 2015 17:29:54 +0000 (17:29 +0000)] 
Link the vbit tester against libvex-<arch>-<os>.a
This allows to remove local copies of certain VEX functions.
VEX r3200 enables this.

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

9 years agoSolaris syscall: Add support for lwp_cond_wait(170).
Ivo Raisr [Fri, 16 Oct 2015 12:20:20 +0000 (12:20 +0000)] 
Solaris syscall: Add support for lwp_cond_wait(170).
Provide scalar test as well.
Fixes BZ #353920.

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