1837 Commits

Author SHA1 Message Date
Mark Wielaard
10816c8683 Run memcheck/tests/demangle with -q.
The interesting part is the demangled backtrace in the error message.
Suppress the memory allocation/blocks summary which can differ slightly
depending on the underlying arch/libs.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15308
2015-06-03 09:52:00 +00:00
Rhys Kidd
793b9629dc Fix unhandled syscall: unix:410 (sigsuspend_nocancel) on OS X. bz#319274.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15249
2015-05-17 14:02:34 +00:00
Rhys Kidd
57d82d1527 Fix Warning: noted but unhandled ioctl 0x2000747b on Mac OS X. bz#208217.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15246
2015-05-17 07:31:20 +00:00
Florian Krohm
096bcbf059 Enable a few more compiler warnings.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15243
2015-05-16 16:17:52 +00:00
Rhys Kidd
0c10aa2460 Fix unhandled syscall: unix:132 (mkfifo) on OS X. bz#212291.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15242
2015-05-16 14:48:08 +00:00
Rhys Kidd
47679c86e7 Add (presently) failing test case for bz#212291.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15241
2015-05-16 14:18:36 +00:00
Carl Love
1a62d8a465 Patch 6 in a revised series of cleanup patches from Will Schmidt
Fix multipleinheritance heuristic for ppc64LE (leak_cpp_interior test).
    Adjust the PPC64 #ifdiffery to indicate that ppc64BE uses a thunk table,
    but ppc64LE (in particular, the ELF ABIV2) does not.  In this case, thunk
    table == function descriptors.
    
    Signed-off-by: Will Schmidt <will_schmidt@vnet.ibm.com>
    --
    
    This patch replaces the previously posted "[6/7] add leak_cpp_interior
    test .exp results ....."

This patch fixes Vagrind bugzilla 347686


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15238
2015-05-15 16:50:06 +00:00
Carl Love
603a6072ba Patch 4 in a revised series of cleanup patches from Will Schmidt
Add a suppression to handle a "Jump to the invalid address..." message
that gets generated on power.  This is a variation of the existing
suppressions.

While here, I also updated the "prog:" line in the vgtest file to reference
the supp_unknown executable, versus the badjump executable.  They share the
same source code, so I think this is effectively cosmetic.
 
This patch fixes Vagrind bugzilla 347686


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15233
2015-05-14 21:52:59 +00:00
Rhys Kidd
a32cff8baf bz#347233 - Fix memcheck/tests/strchr on OS X 10.10 (Haswell)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15229
2015-05-14 13:03:08 +00:00
Rhys Kidd
f57ad21fa9 Use fxsave64 and fxrstor64 mnemonics instead of old-school rex64 prefix
bz#339636

Before:

== 591 tests, 232 stderr failures, 22 stdout failures, 0 stderrB failures, 0 stdoutB failures, 30 post failures ==

After:

== 591 tests, 232 stderr failures, 22 stdout failures, 0 stderrB failures, 0 stdoutB failures, 30 post failures ==


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15198
2015-05-09 23:32:13 +00:00
Philippe Waroquiers
215b263765 Fix incorrect cleanup lines in 2 tests (spotted by Matthias Schwarzott)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15186
2015-05-06 20:16:34 +00:00
Carl Love
5b55e14b95 Patch 2 in a series of cleanup patches from Will Schmidt
Adjust the badjump2 test for ppc64le/ABIV2. Under the ABIV2 there
is no function descriptor, so the fn[] setup does not apply.
This fixes the badjump2 test failure as seen on ppc64le.
   
This patch fixes Vagrind bugzilla 347322.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15184
2015-05-06 19:44:14 +00:00
Philippe Waroquiers
4256a17920 This patch adds a function that allows to directly properly size an xarray
when the size is known in advance.

3 places identified where this function can be used trivially.

The result is a reduction of 'realloc' operations in core
arena, and a small reduction in ttaux arena
(it is the nr of operations that decreases, the memory usage itself
stays the same (ignoring some 'rounding' effects).

E.g. for perf/bigcode 0, we change from
  core 1085742/ 216745904 totalloc-blocks/bytes,     1085733 searches
  ttaux 5348/   6732560 totalloc-blocks/bytes,        5326 searches
to
  core 712666/ 190998592 totalloc-blocks/bytes,      712657 searches
  ttaux 5319/   6731808 totalloc-blocks/bytes,        5296 searches

For bz2, we switch from
  core 50285/  32383664 totalloc-blocks/bytes,       50256 searches
  ttaux 670/    245160 totalloc-blocks/bytes,         669 searches
to
  core 32564/  29971984 totalloc-blocks/bytes,       32535 searches
  ttaux 605/    243280 totalloc-blocks/bytes,         604 searches

Performance wise, on amd64, this improves memcheck performance
on perf tests by 0.0, 0.1 or 0.2 seconds depending on the test.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15173
2015-05-01 16:46:38 +00:00
Florian Krohm
97b35b97f6 Issue an error message if then brk segment overflows.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15155
2015-04-29 12:59:16 +00:00
Florian Krohm
b1d6b96f07 Fix BZ #342683. Based on patch by Ivo Raisr.
What this does is to make sure that the initial client data segment
is marked as unaddressable. This is consistent with the behaviour of
brk when the data segment is shrunk. The "freed" memory is marked
as unaddressable.
Special tweaks were needed for s390 which was returning early from
the funtion to avoid sloppy register definedness initialisation.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15144
2015-04-25 18:23:21 +00:00
Florian Krohm
e0927ca1ea Fix the writev / readv wrappers. Do not read the array pointed to
by the 2nd argument, if the element count is negative.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15143
2015-04-25 18:14:17 +00:00
Carl Love
79808be79c Add support for the TEXASRU register. This register contains information on
transactional memory instruction summary information.  This register contains
the upper 32-bits of the transaction information.  Note, the valgrind
implementation of transactional memory instructions is limited.  Currently, the
contents of the TEXASRU register will always return 0.  The lower 64-bits of
the trasnaction information in the TEXASR register will contain the failure
information as setup by Valgrind.

The vex commit 3143 contains the changes needed to support the TEXASRU
register on PPC64.

The support requires changing the value of MAX_REG_WRITE_SIZE in
memcheck/mc_main.c from 1696 to 1712.  The change is made in this
valgrind commit.

This patch addresses Bugzilla 346474

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15134
2015-04-22 16:17:06 +00:00
Carl Love
0a9b6b47d8 Add support for the lbarx, lharx, stbcx and sthcs instructions.
One of the expect files was missing.  Also found that there 
was a bug in the stq, stqcx, lq and lqarx instructions for LE.
The VEX commit for the instruction fix was 3138.

This commit updates the expect files for the corrected instructions
and adds the missing expect files.

The bugzilla for the orginal issue of the missing instructions
is 346324.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15120
2015-04-20 23:38:33 +00:00
Carl Love
ec0778f110 Forgot to add the new files in memcheck/tests/ppc32 and memcheck/tests/ppc32.
They should have been part of the previous commit 15106.

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

Add support for the lbarx, lharx, stbcx and sthcs instructions.

The instructions are part of the ISA 2.06 but were not implemented
in all versions of hardware.  The four instructions are all supported
in ISA 2.07.  The instructions were put under the ISA 2.07 category
of supported instructions in this patch.

The VEX commit for this fix is r3137.

The bugzilla for this issue is 346324.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15107
2015-04-18 00:01:58 +00:00
Carl Love
eb5aced360 Add support for the lbarx, lharx, stbcx and sthcs instructions.
The instructions are part of the ISA 2.06 but were not implemented
in all versions of hardware.  The four instructions are all supported
in ISA 2.07.  The instructions were put under the ISA 2.07 category
of supported instructions in this patch.

The VEX commit for this fix is r3137.

The bugzilla for this issue is 346324.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15106
2015-04-17 23:43:36 +00:00
Zhi-Gang Liu
2e186aae13 To address memcheck/tests/leak-segv-jmp test failure for TILEGX
By: Zhi-Gang Liu       zhg.liu@gmail.com


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15097
2015-04-15 03:26:38 +00:00
Philippe Waroquiers
8707b88cbb Update expected result for leak-segv-jmp, following TileGX addition of
a few lines in leak-segv-jmp.c


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15081
2015-04-10 19:08:17 +00:00
Julian Seward
082f9298a1 Add a port to Linux/TileGx. Zhi-Gang Liu (zliu@tilera.com)
Valgrind aspects, to match vex r3124.

See bug 339778 - Linux/TileGx platform support to Valgrind



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15080
2015-04-10 12:30:09 +00:00
Julian Seward
e51ade1d11 Track vex r3120, that changed the type of Iop_Sqrt64x2 and Iop_Sqrt32x4.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15074
2015-04-07 09:08:42 +00:00
Julian Seward
2eca28d9d3 Memcheck: add support for recently added IROps:
Iop_F64toF16 
Iop_F32toF16 
Iop_F16toF64 
Iop_F16toF32 



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15070
2015-04-06 14:52:28 +00:00
Julian Seward
149f6c980d Un-break the build following vex r3110. Thanks to PetarJ for the fix.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15052
2015-03-30 19:14:35 +00:00
Florian Krohm
f39011b8b6 Add STATIC_ASSERT and use it.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15047
2015-03-28 18:36:01 +00:00
Philippe Waroquiers
275c1897dc Extensible main thread stack is tricky :(.
Revision 14976 causes a regression : stacktrace produced when the
stack has not yet been extended to cover SP will only contain one
element, as the stack limits are considered to be the limits of
the resvn segment.

This patch fixes that, by taking Resvn/SmUpper segment into
account to properly compute the limits.
It also contains a new regtest that fails with the trunk
(only one function in the stacktrace)
and succeeds with this patch (the 2 expected functions).



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15046
2015-03-28 12:52:23 +00:00
Rhys Kidd
d442b97795 Further fixes for bz#345394 specifically for OS X 10.10
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15038
2015-03-26 10:14:25 +00:00
Florian Krohm
e7674cfdbb 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
2015-03-23 17:13:04 +00:00
Tom Hughes
88e1a7587c 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
2015-03-22 11:01:58 +00:00
Rhys Kidd
4669a61228 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
2015-03-21 14:25:02 +00:00
Florian Krohm
8a9117b3d7 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
2015-03-16 22:03:42 +00:00
Philippe Waroquiers
83fefa7f05 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
2015-03-15 12:22:43 +00:00
Florian Krohm
d2b07b7178 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
2015-03-14 10:15:23 +00:00
Florian Krohm
74cbfc6f04 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
2015-03-14 09:44:04 +00:00
Florian Krohm
ac9506ad26 Disable testcase because the ptrace system call is not
supported on ppc64.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15010
2015-03-14 09:30:36 +00:00
Philippe Waroquiers
826502e89a 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
2015-03-12 20:43:46 +00:00
Florian Krohm
6dce653240 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
2015-03-10 16:13:59 +00:00
Rhys Kidd
a6edce5f4a 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
2015-03-07 08:36:20 +00:00
Rhys Kidd
cfa6844024 Tweak test case for bz#344560 from r14985, now includes line numbers
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14986
2015-03-07 06:11:08 +00:00
Rhys Kidd
2424a2d347 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
2015-03-07 05:22:12 +00:00
Florian Krohm
d485eed8e0 Fix a few compiler warnings issued by clang 3.6.0
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14969
2015-02-28 09:22:09 +00:00
Rhys Kidd
c31c62f916 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
2015-02-27 11:34:07 +00:00
Florian Krohm
f029054493 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
2015-02-24 17:17:19 +00:00
Julian Seward
fbf8cd3a46 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
2015-02-24 12:24:35 +00:00
Florian Krohm
3e53930ad0 Update a comment.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14950
2015-02-20 16:46:50 +00:00
Florian Krohm
00ffec50e5 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
2015-02-20 14:00:23 +00:00
Florian Krohm
75e739efc0 Revert accidental checkin for Makefile.am
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14914
2015-02-06 20:33:51 +00:00
Florian Krohm
c29515885b Fix undefined behaviours when shifting.
Found by libubsan.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14913
2015-02-06 20:32:15 +00:00