]> git.ipfire.org Git - thirdparty/valgrind.git/log
thirdparty/valgrind.git
10 years ago* Add in helgrind stats the nr of live/exit/joined/exit and joined threads
Philippe Waroquiers [Tue, 24 Mar 2015 14:02:44 +0000 (14:02 +0000)] 
* Add in helgrind stats the nr of live/exit/joined/exit and joined threads
* avoid division by 0 in m_transtab.c stats before anything was done

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

10 years agoThis patch further reduces the memory used by TT/TC (by about 15Mb
Philippe Waroquiers [Mon, 23 Mar 2015 21:49:32 +0000 (21:49 +0000)] 
This patch further reduces the memory used by TT/TC (by about 15Mb
on 32 bits memcheck default nr of sectors).

Memory is reduced by using UShort typedef-s for Sector no and TTE no.
Note that for TTE no, we had a mixture of UShort, UInt and Int used
depending on the place (a TTE no was in any case constrained to be an UShort).

The bss memory/startup space is also reduced by allocating the htt on demand
(like tt and tc), using mmap the first time a sector is initialised.

Changes:
* pub_core_transtab.h :
   * 2 typedef to identify a sector and a tt entry (these 2 types are UShort)
   * add 2 #define 'invalid values' for these types
   * change the interface to use these types rather than UInt
* m_transtab.c
   * use wherever relevant these 2 new types rather than UInt or UShort
   * replace the use of -1 by INV_SNO or INV_TTE
   * remove now useless typecast from Int/UInt to UShort for tte
* schedule.c: use the new types

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

10 years agoSimplify expression.
Florian Krohm [Mon, 23 Mar 2015 20:04:14 +0000 (20:04 +0000)] 
Simplify expression.

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

10 years agoAdd VG_(am_is_bogus_client_stack_pointer)(Addr).
Florian Krohm [Mon, 23 Mar 2015 17:13:04 +0000 (17:13 +0000)] 
Add VG_(am_is_bogus_client_stack_pointer)(Addr).
The function is used in VG_(client_syscall) to avoid extending the stack
when it is clear that the current value of the stack pointer does not
point into a segment that looks like a stack segment.
See the comments in the code there.
As a side effect of this we can now revert r15018 which increased
the stack size of the alternate stack in memcheck/tests/sigaltstack.c.
The reason is that the belief at the time: "alternate stack is too small"
was not correct. What instead happened was that VG_(client_syscall) called
VG_(extend_stack) without need (the syscall was tgkill) and the new stack
pointer happened to be in a file segment.
In other words: the current stack pointer was still within the alternate
stack, i.e. the alternate stack was (barely) large enough.

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

10 years agoInclude the platform name in the unhandled system call message
Tom Hughes [Sun, 22 Mar 2015 11:01:58 +0000 (11:01 +0000)] 
Include the platform name in the unhandled system call message

We often get bug reports for an unhandled system call which don't
make it clear what platform is in use, which makes it impossible
to know which system call it is.

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

10 years agoFix leak : only strdup in SectKind.objname if a SectKind address is returned
Philippe Waroquiers [Sat, 21 Mar 2015 20:55:36 +0000 (20:55 +0000)] 
Fix leak : only strdup in SectKind.objname if a SectKind address is returned

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

10 years ago343902 --vgdb=yes doesn't break when --xml=yes is used
Philippe Waroquiers [Sat, 21 Mar 2015 16:13:08 +0000 (16:13 +0000)] 
343902  --vgdb=yes doesn't break when --xml=yes is used

Changes ensures that gdbserver is called also when xml is yes.
When gdbserver is set to yes, we have to temporarily reset
xml output to no, as gdbserver output (e.g. print the last error)
has to be printed to gdb.

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

10 years agoFix memcheck/tests/strchr on OS X
Rhys Kidd [Sat, 21 Mar 2015 14:25:02 +0000 (14:25 +0000)] 
Fix memcheck/tests/strchr on OS X
bz#345394
- Support the required index and _platform_strchr alias

Before:

== 589 tests, 239 stderr failures, 22 stdout failures, 0 stderrB failures, 0 stdoutB failures, 31 post failures ==

After:

== 589 tests, 238 stderr failures, 22 stdout failures, 0 stderrB failures, 0 stdoutB failures, 31 post failures ==

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

10 years agoChange the GCC demangler to not use VLA. The rationale is that these VLAs
Florian Krohm [Sat, 21 Mar 2015 10:58:37 +0000 (10:58 +0000)] 
Change the GCC demangler to not use VLA. The rationale is that these VLAs
are allocated on the stack and they can become quite large - in particular
when the client is a C++ application using the Boost library.
In combination with the demanglers recursive nature this can quickly lead
to exhaustion of valgrind's per-thread stack (which cannot be dynamically
grown). Additionally, due to the large VLAs (I've seen a 32k array) we
could run out of stack space without issuing a prior warning and instead
just segfault.
Therefore this patch allocates these arrays on the heap and frees them
later. Basically this is a respin of Joseph's r10385.

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

10 years agoAddress darwin compile issue introduced in r15013, due to _IOC_NONE
Rhys Kidd [Sat, 21 Mar 2015 06:35:32 +0000 (06:35 +0000)] 
Address darwin compile issue introduced in r15013, due to _IOC_NONE

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

10 years agoFix parsing the %z format specifier. Need to advance to next character.
Florian Krohm [Fri, 20 Mar 2015 16:45:02 +0000 (16:45 +0000)] 
Fix parsing the %z format specifier. Need to advance to next character.

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

10 years agoAdd ecag.stdout.exp-z13.
Florian Krohm [Fri, 20 Mar 2015 09:40:23 +0000 (09:40 +0000)] 
Add ecag.stdout.exp-z13.

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

10 years agoDo not reuse Creg_IA_* for s390. Add dedicated entries Creg_S390_...
Florian Krohm [Fri, 20 Mar 2015 09:38:58 +0000 (09:38 +0000)] 
Do not reuse Creg_IA_* for s390. Add dedicated entries Creg_S390_...

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

10 years agoRemove config files for no-longer-existing s390 builds.
Florian Krohm [Fri, 20 Mar 2015 08:17:28 +0000 (08:17 +0000)] 
Remove config files for no-longer-existing s390 builds.

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

10 years agoChange TT/TC hashing data structure (decreases memory by 50MB for memcheck 32bits)
Philippe Waroquiers [Thu, 19 Mar 2015 22:17:08 +0000 (22:17 +0000)] 
Change TT/TC hashing data structure (decreases memory by 50MB for memcheck 32bits)

This patch changes the way the transtab entries hash table is done.
Currently, the hash table is an open hash table considered full at 65%.
This means that in average, 1 entry on 3 is unused.
(all the hash table memory will be 'active' for big applications,
as the active entries are normally reasonably distributed over the hash table).
The size of a transtab entry is significant (about 150 Bytes).

To avoid having 35% of the entries unused, the translation table
is split in 2:
An hash table, that will contain an index pointing at the transtab entries.
With this technique, we are adding a small hash table,
but we spare 35% of the translation table.

Performance measurements have shown no degradation,
and some platforms have better performance. Not too clear why,
probably this helps platforms with small caches ?).

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

10 years agoAdd nightly script for wildebeest[32] (debian x86), lfedora1 (fedora s390x)
Mark Wielaard [Thu, 19 Mar 2015 11:27:46 +0000 (11:27 +0000)] 
Add nightly script for wildebeest[32] (debian x86), lfedora1 (fedora s390x)

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

10 years agoadd cache info for z13
Christian Borntraeger [Tue, 17 Mar 2015 15:48:11 +0000 (15:48 +0000)] 
add cache info for z13

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

10 years agoMinimal update to recognise z13 (s390).
Florian Krohm [Tue, 17 Mar 2015 13:45:29 +0000 (13:45 +0000)] 
Minimal update to recognise z13 (s390).

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

10 years agoMerge the contents of docs/internals/howto_build_documentation
Florian Krohm [Mon, 16 Mar 2015 22:42:13 +0000 (22:42 +0000)] 
Merge the contents of docs/internals/howto_build_documentation
into docs/README.
Remove the section about the XML Toolchain as it is outdated.

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

10 years agoIncrease the size of the alternate stack. It was too small.
Florian Krohm [Mon, 16 Mar 2015 22:03:42 +0000 (22:03 +0000)] 
Increase the size of the alternate stack. It was too small.
This was found by accident and there is no known way to detect
an overflow of an alternate stack in the general case.

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

10 years agoAdd a howto for building documentation.
Florian Krohm [Mon, 16 Mar 2015 12:22:35 +0000 (12:22 +0000)] 
Add a howto for building documentation.

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

10 years agoNew Option --avg-transtab-entry-size=<number> can be used to tune
Philippe Waroquiers [Sun, 15 Mar 2015 12:24:19 +0000 (12:24 +0000)] 
New Option --avg-transtab-entry-size=<number> can be used to tune
  the size of the translation table sectors, either to gain memory
  or to avoid too many retranslations.

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

10 years agoFix the following errors detected by makefile check
Philippe Waroquiers [Sun, 15 Mar 2015 12:22:43 +0000 (12:22 +0000)] 
Fix the following errors detected by makefile check
memcheck/tests/Makefile.am:1: error: wrap8.stderr.exp-ppc64 is missing in EXTRA_DIST
memcheck/tests/Makefile.am:1: error: wrap8.stdout.exp-ppc64 is missing in EXTRA_DIST
memcheck/tests/Makefile.am:1: error: wrap8.stdout.exp2 is in EXTRA_DIST but doesn't exist
memcheck/tests/Makefile.am:1: error: wrap8.stderr.exp2 is in EXTRA_DIST but doesn't exist

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

10 years agoAdd option --loop-till-fail to tests/vg_regtests
Philippe Waroquiers [Sat, 14 Mar 2015 18:29:35 +0000 (18:29 +0000)] 
Add option --loop-till-fail to tests/vg_regtests
to make it easier to obtain failing trace or unfiltered output for
tests that fail from time to time

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

10 years agoFix the testcase so it works on platforms where _IOC_NONE != 0
Florian Krohm [Sat, 14 Mar 2015 15:54:05 +0000 (15:54 +0000)] 
Fix the testcase so it works on platforms where _IOC_NONE != 0
Filtering script and expected output file adapted.

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

10 years agoOrganise the expected output files for the wrap8 testcase.
Florian Krohm [Sat, 14 Mar 2015 10:15:23 +0000 (10:15 +0000)] 
Organise the expected output files for the wrap8 testcase.
There is special behaviout on ppc64 only. Let the filenames
reflect that. At the same time update the ppc specific
output to what it is. The important thing here is that the
stack overflow is detected. Everything else is effectively a
don't care. Should line numbers and such differ in the future
that should be filtered out.

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

10 years agoUpdate the ppc64 specific results to what they are.
Florian Krohm [Sat, 14 Mar 2015 09:44:04 +0000 (09:44 +0000)] 
Update the ppc64 specific results to what they are.
The difference of the expected results as compared to other
platforms is

- Location 0x........ is 2 bytes inside local var "budget"
- declared at varinfo6.c:3115, in frame #2 of thread 1
+ Address 0x........ is on thread 1's stack
+ in frame #2, created by BZ2_blockSort (varinfo6.c:3107)

Should the stderr output of this testcase in the future
match the generic output (varinfo6.stderr.exp) then this is
another incarnation of
https://bugs.kde.org/show_bug.cgi?id=345121

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

10 years agoDisable testcase because the ptrace system call is not
Florian Krohm [Sat, 14 Mar 2015 09:30:36 +0000 (09:30 +0000)] 
Disable testcase because the ptrace system call is not
supported on ppc64.

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

10 years agoSort locks by their guestaddr to make the error output independent
Florian Krohm [Fri, 13 Mar 2015 13:50:08 +0000 (13:50 +0000)] 
Sort locks by their guestaddr to make the error output independent
of the dynamically allocated Lock addresses.
This restores helgrind/tests/locked_vs_unlocked2.stderr.exp
from r14931.

While regtesting the patch I've observed intermittent failures
of helgrind/tests/hg05_race2 like so:

--- ../../helgrind/tests/hg05_race2.stderr.exp  (revision 15001)
+++ ../../helgrind/tests/hg05_race2.stderr.exp  (working copy)
@@ -26,8 +26,7 @@
    at 0x........: th (hg05_race2.c:17)
    by 0x........: mythread_wrapper (hg_intercepts.c:...)
    ...
- Location 0x........ is 0 bytes inside foo.poot[5].plop[11],
- declared at hg05_race2.c:24, in frame #x of thread x
+ Address 0x........ is on thread #x's stack

 ----------------------------------------------------------------

@@ -42,8 +41,7 @@
    at 0x........: th (hg05_race2.c:17)
    by 0x........: mythread_wrapper (hg_intercepts.c:...)
    ...
- Location 0x........ is 0 bytes inside foo.poot[5].plop[11],
- declared at hg05_race2.c:24, in frame #x of thread x
+ Address 0x........ is on thread #x's stack

Surely, that's something else.

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

10 years agoFix a warnings introduced by rev 15005
Philippe Waroquiers [Thu, 12 Mar 2015 23:09:28 +0000 (23:09 +0000)] 
Fix a warnings introduced by rev 15005

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

10 years agoAnnounce in NEWS the new option --valgrind-stacksize
Philippe Waroquiers [Thu, 12 Mar 2015 22:53:18 +0000 (22:53 +0000)] 
Announce in NEWS the new option --valgrind-stacksize

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

10 years agoFix non portability spotted by Florian:
Philippe Waroquiers [Thu, 12 Mar 2015 22:46:58 +0000 (22:46 +0000)] 
Fix non portability spotted by Florian:
An array must have at least 1 element.
0 element is accepted by gcc but is not portable.

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

10 years agom_transtab.c statistic/tracing
Philippe Waroquiers [Thu, 12 Mar 2015 22:36:22 +0000 (22:36 +0000)] 
m_transtab.c statistic/tracing
* common up the identical debug and clo_stat traces
* add in the stats the nr of sectors recycled
* add the avg translation size in each sector recycled
  and in the final statistics
(no functional change)

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

10 years agoImplement command line option --valgrind-stacksize=<number>
Philippe Waroquiers [Thu, 12 Mar 2015 20:43:46 +0000 (20:43 +0000)] 
Implement command line option --valgrind-stacksize=<number>

This allows to decrease memory usage when using many threads,
if no big stacksize is needed by Valgrind.
If needed (e.g. for demangling big c++ symbols), the V stacksize
can be increased.

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

10 years agoFix two bugs:
Florian Krohm [Thu, 12 Mar 2015 18:56:21 +0000 (18:56 +0000)] 
Fix two bugs:
(1) In r14664 VG_(get_fnname_if_entry) was changed to always
    return a function name, even if that function was *not* an
    entry. That broke callgrind and was also confusing because
    it contradicts what "get_fnname_if_entry" suggests.
(2) In r14189 a function call was removed because it was considered
    redundant which it was not.

Both bugs were hunted down by Joseph Weidendorfer.

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

10 years agoAnnounce fix for BZ #345079.
Florian Krohm [Thu, 12 Mar 2015 11:02:11 +0000 (11:02 +0000)] 
Announce fix for BZ #345079.

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

10 years agoRemove assertion. Unlikely as it may be, len may be huge
Florian Krohm [Wed, 11 Mar 2015 22:16:22 +0000 (22:16 +0000)] 
Remove assertion. Unlikely as it may be, len may be huge
and therefore we cannot assert otherwise.

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

10 years agoUpdate a comment.
Florian Krohm [Wed, 11 Mar 2015 13:46:14 +0000 (13:46 +0000)] 
Update a comment.

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

10 years agoUpdate release notes with ICC contact.
Florian Krohm [Tue, 10 Mar 2015 21:31:06 +0000 (21:31 +0000)] 
Update release notes with ICC contact.

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

10 years agoAnnounce support for Intel's ICC compiler. Fixes BZ #339542.
Florian Krohm [Tue, 10 Mar 2015 20:48:07 +0000 (20:48 +0000)] 
Announce support for Intel's ICC compiler. Fixes BZ #339542.

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

10 years agoIssue a warning if a function has more than 5 million bytes of
Florian Krohm [Tue, 10 Mar 2015 20:46:58 +0000 (20:46 +0000)] 
Issue a warning if a function has more than 5 million bytes of
code. Previously functions exceeding that size were observed in the
field. Assert for 100x that amount.

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

10 years agoUpdated the NEWS file
Carl Love [Tue, 10 Mar 2015 18:53:15 +0000 (18:53 +0000)] 
Updated the NEWS file
   bugzilla  343597 - ppc64le: incorrect use of offseof macro  fixed 3/10/2015

Issue found by Florian Krohm who also suggested the fix.  The fix was
made and tested by Carl Love.

VEX commit number 3100

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

10 years agoAdd support for building with -fsanitize=undefined.
Florian Krohm [Tue, 10 Mar 2015 16:13:59 +0000 (16:13 +0000)] 
Add support for building with -fsanitize=undefined.
- add configure option --enable-ubsan
- add __ubsan helpers (by Julian)

This requires gcc 4.9.2 or later. Not all platforms are supported, though.
With this change and VEX r3099 regression tests pass on amd64
with a valgrind compiled with -fsanitize=undefined.

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

10 years agoPRE(sys_prctl): handle PR_SET_SECCOMP.
Julian Seward [Tue, 10 Mar 2015 11:05:10 +0000 (11:05 +0000)] 
PRE(sys_prctl): handle PR_SET_SECCOMP.

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

10 years agoNew function VG_(am_mmap_client_heap) which swallows
Florian Krohm [Sat, 7 Mar 2015 23:01:14 +0000 (23:01 +0000)] 
New function VG_(am_mmap_client_heap) which swallows
VG_(am_set_segment_isCH_if_SkAnonC).
Rename VG_(am_set_segment_hasT_if_client_segment) to
VG_(am_set_segment_hasT) passing in an address (because that function
cannot possible take a pointer to a *const* segment). Also assert that
the segment containing the address is a client segment. Everything else
is a bug.

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

10 years ago342353 - Allow dumping full massif output while valgrind is still running
Philippe Waroquiers [Sat, 7 Mar 2015 19:20:12 +0000 (19:20 +0000)] 
342353 - Allow dumping full massif output while valgrind is still running

Patch from Andre Goddard Rosa

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

10 years agoupdate NEWS to indicate that
Philippe Waroquiers [Sat, 7 Mar 2015 17:31:04 +0000 (17:31 +0000)] 
update NEWS to indicate that
  335907  segfault when running wine's ddrawex/tests/surface.c under valgrind
is assumed to be fixed either by a previous change in 3.10
and/or by the commit for 343173

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

10 years agon-i-bz: Replace non-POSIX bzero with proper memset. At least for internal-only, Darwi...
Rhys Kidd [Sat, 7 Mar 2015 14:57:39 +0000 (14:57 +0000)] 
n-i-bz: Replace non-POSIX bzero with proper memset. At least for internal-only, Darwin functionality. Picked up by cppcheck. No regressions within test suite.

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

10 years agoFix memcheck/tests/xml1 on OS X 10.10
Rhys Kidd [Sat, 7 Mar 2015 13:34:02 +0000 (13:34 +0000)] 
Fix memcheck/tests/xml1 on OS X 10.10
bz#344939

Before

== 588 tests, 240 stderr failures, 22 stdout failures, 0 stderrB failures, 0 stdoutB failures, 31 post failures ==

After

== 588 tests, 239 stderr failures, 22 stdout failures, 0 stderrB failures, 0 stdoutB failures, 31 post failures ==

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

10 years agoRewritten to use a single line instead of line splicing
Florian Krohm [Sat, 7 Mar 2015 12:49:32 +0000 (12:49 +0000)] 
Rewritten to use a single line instead of line splicing
to avoid line number differences in the reported error.

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

10 years agoFix unhandled syscall: unix:348 (__pthread_chdir) and unhandled syscall: unix:349...
Rhys Kidd [Sat, 7 Mar 2015 08:36:20 +0000 (08:36 +0000)] 
Fix unhandled syscall: unix:348 (__pthread_chdir) and unhandled syscall: unix:349 (__pthread_fchdir) on OS X
bz#344512
- Support these two undocumented syscalls.
- New regression test case added.

Before:

== 588 tests, 239 stderr failures, 22 stdout failures, 0 stderrB failures, 0 stdoutB failures, 31 post failures ==

After:

== 589 tests, 239 stderr failures, 22 stdout failures, 0 stderrB failures, 0 stdoutB failures, 31 post failures ==

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

10 years agoTweak test case for bz#344560 from r14985, now includes line numbers
Rhys Kidd [Sat, 7 Mar 2015 06:11:08 +0000 (06:11 +0000)] 
Tweak test case for bz#344560 from r14985, now includes line numbers

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

10 years agoFix stack traces missing penultimate frame
Rhys Kidd [Sat, 7 Mar 2015 05:22:12 +0000 (05:22 +0000)] 
Fix stack traces missing penultimate frame
bz#344560
- Also fixes memcheck/tests/badpoll test on OS X
- Problem occurs because the guest stack seen in a system call pre or post
  function happens to not have a correct topmost stack frame, as Darwin system
  call stubs do not start with the usual function prolog.
- New regression test case added.
- Thanks to Greg Banks for research, patch and test case.

Before:

== 587 tests, 240 stderr failures, 22 stdout failures, 0 stderrB failures, 0 stdoutB failures, 31 post failures ==

After:

== 588 tests, 239 stderr failures, 22 stdout failures, 0 stderrB failures, 0 stdoutB failures, 31 post failures ==

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

10 years agon-i-bz: Small fixes to r14976 (bz#343173) to add stackteardown to svn:ignore and...
Rhys Kidd [Sat, 7 Mar 2015 01:21:28 +0000 (01:21 +0000)] 
n-i-bz: Small fixes to r14976 (bz#343173) to add stackteardown to svn:ignore and fix compilation on OS X

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

10 years agoUpdate.
Julian Seward [Fri, 6 Mar 2015 09:20:51 +0000 (09:20 +0000)] 
Update.

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

10 years agoUpdate comment about range checks with observations from Florian.
Julian Seward [Fri, 6 Mar 2015 09:19:38 +0000 (09:19 +0000)] 
Update comment about range checks with observations from Florian.
No functional change.

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

10 years agoMake printing of transtab: debug-log messages slightly prettier.
Julian Seward [Thu, 5 Mar 2015 11:28:57 +0000 (11:28 +0000)] 
Make printing of transtab: debug-log messages slightly prettier.
No functional change.

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

10 years agoUpdate.
Julian Seward [Thu, 5 Mar 2015 11:25:52 +0000 (11:25 +0000)] 
Update.

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

10 years agoMarginally improve debug printing. No functional change.
Julian Seward [Thu, 5 Mar 2015 11:24:05 +0000 (11:24 +0000)] 
Marginally improve debug printing.  No functional change.

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

10 years agoPOST(sys_ioctl): identify kernel variant "Qualcomm Adreno 3xx" correctly.
Julian Seward [Thu, 5 Mar 2015 11:22:41 +0000 (11:22 +0000)] 
POST(sys_ioctl): identify kernel variant "Qualcomm Adreno 3xx" correctly.

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

10 years agoMinor changes in an attempt to improve performance and reduce
Julian Seward [Thu, 5 Mar 2015 00:52:07 +0000 (00:52 +0000)] 
Minor changes in an attempt to improve performance and reduce
the amount of file-reading resulting from DiImage-cache misses.

CACHE_N_ENTRIES:
Increase the DiImage cache size from 256KB to 8MB to deal with
drastically worse locality when reading inline info.  The 256KB
setting dates from befre inline-info-reading days.

is_in_CEnt: remove a conditional branch from the hot path (of |get|,
effectively)

set_CEnt: marginally improve debug printing

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

10 years agoFix 343173 - helgrind crash during stack unwind
Philippe Waroquiers [Tue, 3 Mar 2015 22:00:06 +0000 (22:00 +0000)] 
Fix 343173 - helgrind crash during stack unwind

This fixes a helgrind crash detected on android.
Android bionic pthread lib unmaps the stack for detached threads
before exiting.
Helgrind tries to unwind the stack to record a 'read' after
the stack unmap, just before the exit syscall.
The unwind then causes a SEGV.

The solution consists in tightening the calculation of
the stack limits, so as to stop unwinding when no valid stack
can be found.
Regression test reproduces the same problem by simulating the
bionic behaviour on linux, using asm similar to bionic lib.

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

10 years agoUpdate list of ignored files.
Florian Krohm [Tue, 3 Mar 2015 14:58:29 +0000 (14:58 +0000)] 
Update list of ignored files.

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

10 years agoProduce a user message in case of stack overflow.
Florian Krohm [Tue, 3 Mar 2015 14:56:17 +0000 (14:56 +0000)] 
Produce a user message in case of stack overflow.
Change VG_(extend_stack) and VG_(am_extend_into_adjacent_reservation_client)
accordingly.
Remove some redundant checking.
Add testcase.

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

10 years agoUpdate a comment. Apparently the code was refactored at some point...
Florian Krohm [Mon, 2 Mar 2015 21:10:46 +0000 (21:10 +0000)] 
Update a comment. Apparently the code was refactored at some point...

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

10 years agoFix missing libobjc suppressions on OS X 10.10
Rhys Kidd [Sun, 1 Mar 2015 13:22:21 +0000 (13:22 +0000)] 
Fix missing libobjc suppressions on OS X 10.10
bz#344702
- Update darwin14.supp suppressions
- Includes malloc_zone_malloc and malloc related issues in system libraries

Before

== 585 tests, 256 stderr failures, 22 stdout failures, 0 stderrB failures, 0 stdoutB failures, 31 post failures ==

After

== 585 tests, 240 stderr failures, 22 stdout failures, 0 stderrB failures, 0 stdoutB failures, 31 post failures ==

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

10 years agoChange the testcase such that the output matches the intended output.
Florian Krohm [Sun, 1 Mar 2015 09:36:54 +0000 (09:36 +0000)] 
Change the testcase such that the output matches the intended output.

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

10 years agoFix suppression for pthread_rwlock_init on OS X 10.10
Rhys Kidd [Sun, 1 Mar 2015 01:35:59 +0000 (01:35 +0000)] 
Fix suppression for pthread_rwlock_init on OS X 10.10
bz#344686
- Update darwin14.supp to match prior OS X versions

Before

== 585 tests, 257 stderr failures, 23 stdout failures, 0 stderrB failures, 0 stdoutB failures, 31 post failures ==

After

== 585 tests, 256 stderr failures, 22 stdout failures, 0 stderrB failures, 0 stdoutB failures, 31 post failures ==

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

10 years agoFix a few compiler warnings issued by clang 3.6.0
Florian Krohm [Sat, 28 Feb 2015 09:22:09 +0000 (09:22 +0000)] 
Fix a few compiler warnings issued by clang 3.6.0

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

10 years agoFix memcheck/tests/err_disable4 test on OS X
Rhys Kidd [Fri, 27 Feb 2015 11:34:07 +0000 (11:34 +0000)] 
Fix memcheck/tests/err_disable4 test on OS X
bz#344621
- Unnamed semaphores are not supported on OS X, must use named semaphores.
- To use named semaphores sem_open() instead of sem_init() utilised.
- Test case updated accordingly across all platforms.

Before:

== 586 tests, 240 stderr failures, 22 stdout failures, 0 stderrB failures, 0 stdoutB failures, 31 post failures ==

After:

== 586 tests, 239 stderr failures, 22 stdout failures, 0 stderrB failures, 0 stdoutB failures, 31 post failures ==

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

10 years agoSimplify do_brk
Florian Krohm [Thu, 26 Feb 2015 21:48:19 +0000 (21:48 +0000)] 
Simplify do_brk
- remove redundant asserts
- let VG_(am_extend_into_adjacent_reservation_client) worry about
  - whether delta is too large
  - whether the segment abutting this one exists and is a reservation
    segment
  The function already checks these things. No need to do it again here.
- do_brk does not need to know that a reservation segment must not
  shrink beyond a single page. That detail ought to be hidden in
  the address space manager.
Also, turn a few conditions into asserts.

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

10 years agoInclude pub_core_aspacemgr.h only where needed.
Florian Krohm [Thu, 26 Feb 2015 17:48:07 +0000 (17:48 +0000)] 
Include pub_core_aspacemgr.h only where needed.
Also fixes BZ #344235.

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

10 years agoChange the prototype of VG_(am_extend_into_adjacent_reservation_client)
Florian Krohm [Thu, 26 Feb 2015 16:07:12 +0000 (16:07 +0000)] 
Change the prototype of VG_(am_extend_into_adjacent_reservation_client)
to match VG_(am_extend_map_client) for consistency.

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

10 years agoBug #344318 socketcall should wrap recvmmsg and sendmmsg
Mark Wielaard [Wed, 25 Feb 2015 14:00:14 +0000 (14:00 +0000)] 
Bug #344318 socketcall should wrap recvmmsg and sendmmsg

Some architectures, e.g. s390, don't have dedicated recvmmsg and sendmmsg
system calls, but use the socketcall multiplexing system call with
SYS_RECVMMSG or SYS_SENDMMSG (just like the accept4 systemcall can also
be called through socketcall). Create separate helpers for recvmmsg and
sendmmsg helpers that can be used by either the direct syscall or the
socket call.

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

10 years agoChange VG_(am_extend_map_client) as follows:
Florian Krohm [Wed, 25 Feb 2015 10:06:06 +0000 (10:06 +0000)] 
Change VG_(am_extend_map_client) as follows:
- Tighten up on asserts
- Simplify; as the function grows memory into a free segment, there
  cannot possibly be any translations to be discarded. Free segments
  do not have translations. sane_NSegment will make sure.
- Change the prototype to take in the start address of the mapping and
  return a pointer to the resized segment. Previously, the code

   ok = VG_(am_extend_map_client)( &d, old_seg, needL );
   if (!ok)
      goto eNOMEM;
   VG_TRACK( new_mem_mmap, needA, needL,
                           old_seg->hasR, old_seg->hasW, old_seg->hasX,

  was examining old_seg->hasR etc even though VG_(am_extend_map_client)
  stated that *old_seg was invalid after the function returned.
  That wasn't exactly a problem, but clearly looked wrong.

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

10 years agoAdd a comment explaining why there are only 3 emulation warnings
Florian Krohm [Tue, 24 Feb 2015 18:11:01 +0000 (18:11 +0000)] 
Add a comment explaining why there are only 3 emulation warnings
and not 4 as one would expect.
Update the .exp file to show correct line numbers.

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

10 years agoUpdate opcode list following VEX r3092.
Florian Krohm [Tue, 24 Feb 2015 17:17:19 +0000 (17:17 +0000)] 
Update opcode list following VEX r3092.
Add an assertion to trigger a compile time error in case this
happens again.

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

10 years agoarm64: enable test cases for conversion instructions which are
Julian Seward [Tue, 24 Feb 2015 13:24:52 +0000 (13:24 +0000)] 
arm64: enable test cases for conversion instructions which are
in fact implemented at this point.

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

10 years agoHandle new IROps added in vex r3092:
Julian Seward [Tue, 24 Feb 2015 12:24:35 +0000 (12:24 +0000)] 
Handle new IROps added in vex r3092:
Iop_RecipStep64Fx2, Iop_RSqrtStep64Fx2
Iop_RSqrtEst64Fx2,  Iop_RecipEst64Fx2
Iop_RecpExpF64,     Iop_RecpExpF32
 --This line, and those below, will be ignored--

M    memcheck/mc_translate.c

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

10 years agoarm64: enable test cases for
Julian Seward [Tue, 24 Feb 2015 12:21:26 +0000 (12:21 +0000)] 
arm64: enable test cases for
FRECPS  d_d_d, s_s_s
FRSQRTS d_d_d, s_s_s
FRECPE  d_d, s_s
FRSQRTE d_d, s_s
FRECPX  d_d, s_s
FRECPS  2d_2d_2d, 4s_4s_4s, 2s_2s_2s
FRSQRTS 2d_2d_2d, 4s_4s_4s, 2s_2s_2s
FRECPE  2d_2d, 4s_4s, 2s_2s
FRSQRTE 2d_2d, 4s_4s, 2s_2s
 --This line, and those below, will be ignored--

M    none/tests/arm64/fp_and_simd.c
M    none/tests/arm64/fp_and_simd.stdout.exp

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

10 years agoFix an off-by-one error - this time, do it right.
Florian Krohm [Tue, 24 Feb 2015 11:23:51 +0000 (11:23 +0000)] 
Fix an off-by-one error - this time, do it right.
A segment with start == end is not empty.

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

10 years agoRevert r14954. If the end of a segment is 0xfffff.....fffff
Florian Krohm [Mon, 23 Feb 2015 21:56:16 +0000 (21:56 +0000)] 
Revert r14954. If the end of a segment is 0xfffff.....fffff
then end + 1 == 0 and any start address will be >= end.
Think some more.....

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

10 years agoFix configure for Linux kernel >= 4.0-rc1
Christian Borntraeger [Mon, 23 Feb 2015 20:19:03 +0000 (20:19 +0000)] 
Fix configure for Linux kernel >= 4.0-rc1
In addition raise the minimal Linux version to 2.6 as there is almost
no test coverage for 2.4 and 2.6 was released in 2003.

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

10 years agoFix an off-by-one error. A segment with start == end is not
Florian Krohm [Mon, 23 Feb 2015 19:57:12 +0000 (19:57 +0000)] 
Fix an off-by-one error. A segment with start == end is not
empty.

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

10 years agoStop gcc -Og complaining (incorrectly) about filessize being used
Julian Seward [Mon, 23 Feb 2015 13:58:55 +0000 (13:58 +0000)] 
Stop gcc -Og complaining (incorrectly) about filessize being used
uninitialised.  No functional change.

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

10 years agoFix bz#343523, OS X mach_ports_register: UNKNOWN task message [id 3403, to mach_task_...
Rhys Kidd [Sun, 22 Feb 2015 00:42:52 +0000 (00:42 +0000)] 
Fix bz#343523, OS X mach_ports_register: UNKNOWN task message [id 3403, to mach_task_self(), reply 0x30f]

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

10 years agoFix OS X 10.10 (Yosemite) - missing system calls and fcntl code, courtesy of Bill...
Rhys Kidd [Sat, 21 Feb 2015 12:24:18 +0000 (12:24 +0000)] 
Fix OS X 10.10 (Yosemite) - missing system calls and fcntl code, courtesy of Bill Zissimopoulos

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

10 years agoUpdate a comment.
Florian Krohm [Fri, 20 Feb 2015 16:46:50 +0000 (16:46 +0000)] 
Update a comment.

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

10 years agoPass in a mask of segment kinds to VG_(get_segment_starts)
Florian Krohm [Fri, 20 Feb 2015 14:00:23 +0000 (14:00 +0000)] 
Pass in a mask of segment kinds to VG_(get_segment_starts)
and VG_(am_get_segment_starts) to indicate which segments
should be collected. That should solve the following problem:
in m_main.c we used to:

      seg_starts = VG_(get_segment_starts)( &n_seg_starts );

      for (i = 0; i < n_seg_starts; i++) {
         Word j, n;
         NSegment const* seg
            = VG_(am_find_nsegment)( seg_starts[i] );
         vg_assert(seg);
         if (seg->kind == SkFileC || seg->kind == SkAnonC) {

         ...
         // ... dynamic memory allocation for valgrind
         ...
      }

This caused the vassert(seg) to fire because the dynamic memory
allocation further down the loop changed segments such that a
valgrind segment which used to be non-SkFree suddenly became
SkFree and hence VG_(am_find_nsegment) returned NULL. Whoom.

With this revision we only collect the segments we're really
interested in. For the example above that is all client segments.
So if V allocates memory -- fine. That will not change the layout
of client segments.

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

10 years agocanonicaliseSymtab: fix silly logic that could cause the function to
Julian Seward [Fri, 20 Feb 2015 12:29:59 +0000 (12:29 +0000)] 
canonicaliseSymtab: fix silly logic that could cause the function to
loop forever.  In particular, it will do that when two symbols have
exactly the same address range but differ in their .isText attribute.
Fixes #342117.

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

10 years agoFix Bug #344314 callgrind_annotate ... commands containing newlines
Josef Weidendorfer [Wed, 18 Feb 2015 16:28:58 +0000 (16:28 +0000)] 
Fix Bug #344314  callgrind_annotate ... commands containing newlines

Escape newlines in command arguments for "cmd:" header field in dumps
We could do unescaping in callgrind_annotate, but a escaped command
even seems better there.

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

10 years agoCorrectly handle prctl(VKI_PR_SET_PTRACER, ..) so as to avoid false
Julian Seward [Wed, 18 Feb 2015 15:46:19 +0000 (15:46 +0000)] 
Correctly handle prctl(VKI_PR_SET_PTRACER, ..) so as to avoid false
positives (eg when running Wine).

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

10 years agoMessaging cleanup for the PDB reader. No functional change.
Julian Seward [Wed, 18 Feb 2015 15:38:25 +0000 (15:38 +0000)] 
Messaging cleanup for the PDB reader.  No functional change.

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

10 years agoBug #344307 2 unhandled syscalls on aarch64/arm64: umount2(39), mount (40)
Mark Wielaard [Wed, 18 Feb 2015 14:23:17 +0000 (14:23 +0000)] 
Bug #344307 2 unhandled syscalls on aarch64/arm64: umount2(39), mount (40)

Reporter: Branislav Blaskovic, bblaskov@redhat.com
Patch: Robin Hack, rhack@redhat.com
Test: Miloš Prchlík, mprchlik@redhat.com

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

10 years agoFor PDB stats printing, don't print the number of inl-info records,
Julian Seward [Wed, 18 Feb 2015 12:58:56 +0000 (12:58 +0000)] 
For PDB stats printing, don't print the number of inl-info records,
since it's always zero.

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

10 years agoImprove string table reading for MSVC2010 compiled code. Also seems
Julian Seward [Wed, 18 Feb 2015 12:57:06 +0000 (12:57 +0000)] 
Improve string table reading for MSVC2010 compiled code.  Also seems
to help with MSVC2013 compiled code.  Variant of a patch from
Mark Browning (mabrowningrr@gmail.com).  Fixes #211529.

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

10 years agoUpdate a comment.
Florian Krohm [Tue, 17 Feb 2015 21:51:53 +0000 (21:51 +0000)] 
Update a comment.

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

10 years agoBug #344295 syscall recvmmsg on arm64 (243) and ppc32/64 (343) unhandled
Mark Wielaard [Tue, 17 Feb 2015 19:50:45 +0000 (19:50 +0000)] 
Bug #344295 syscall recvmmsg on arm64 (243) and ppc32/64 (343) unhandled

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

10 years agoBug #344279 syscall sendmmsg on arm64 (269) and ppc32/64 (349) unhandled.
Mark Wielaard [Tue, 17 Feb 2015 16:04:09 +0000 (16:04 +0000)] 
Bug #344279 syscall sendmmsg on arm64 (269) and ppc32/64 (349) unhandled.

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

10 years agoML_(find_name_of_pdb_file): bit a bit more careful when grepping the
Julian Seward [Tue, 17 Feb 2015 13:46:26 +0000 (13:46 +0000)] 
ML_(find_name_of_pdb_file): bit a bit more careful when grepping the
output from /usr/bin/strings, so as to not get confused by substrings
".pdb" and ".PDB" when they don't appear at the end of a line.

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