Commit Graph

11705 Commits

Author SHA1 Message Date
Florian Krohm
4dbe16f4cf Function is_plausible_guest_addr should also consider SkShmC
segments.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15222
2015-05-13 08:11:56 +00:00
Florian Krohm
463aa75635 In functions VG_(am_relocate_nooverlap_client) and VG_(am_extend_map_client)
need to allow SkShmC segments, too.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15221
2015-05-12 21:52:08 +00:00
Florian Krohm
ab0a9ba34a Get prototype from system header.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15220
2015-05-12 21:44:48 +00:00
Florian Krohm
c000459632 Fix bug in do_mremap. Also need to allow SkShmC segments.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15219
2015-05-12 21:19:25 +00:00
Rhys Kidd
f59e60b5b6 Allow suppression on OS X 10.10 in libSystem_initializer
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15217
2015-05-12 14:25:43 +00:00
Philippe Waroquiers
a13ea37999 Add back vg_assert(xa); that was removed by error in r15211
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15215
2015-05-11 21:02:00 +00:00
Philippe Waroquiers
1d5575986a VTS stats
* add the missing increment to the nr of gc done
* add vts pruning stat



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15214
2015-05-11 20:56:49 +00:00
Philippe Waroquiers
36dd38f551 Simplify shmem__invalidate_scache_range : it only has to handle
cacheline aligned ranges.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15213
2015-05-11 20:18:10 +00:00
Philippe Waroquiers
a182f73861 Small optimisations in libhb_core.c
* avoid indirection via function pointers to call SVal__rcinc and SVal__rcdec
* declare these functions inlined
* transform 2 asserts on hot path in conditionally compiled checks
  on CHECK_ZSM

This slightly optimises some perf tests with helgrind



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15212
2015-05-11 19:45:08 +00:00
Philippe Waroquiers
73266b0930 Micro-optimisation following helgrind secmap gc
Checking the range in indexXA can be done with one comparison.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15211
2015-05-11 19:41:43 +00:00
Rhys Kidd
6e3d1f9b0a Fix typo in task_policy_set() output. n-i-bz.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15210
2015-05-11 13:24:42 +00:00
Rhys Kidd
fc04f5d4c6 OS X task_info: UNKNOWN task message [id 3405, to mach_task_self(), reply 0x........]
bz#254164

Before:

== 593 tests, 234 stderr failures, 22 stdout failures, 0 stderrB failures, 0 stdoutB failures, 30 post failures ==

After:

== 593 tests, 233 stderr failures, 22 stdout failures, 0 stderrB failures, 0 stdoutB failures, 30 post failures ==


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15209
2015-05-11 13:19:48 +00:00
Philippe Waroquiers
4fd2651558 Improves the way arena statistics are shown
The mmap'd max/curr and max/curr nr of bytes will be shown e.g. as
   11,440,408/    4,508,968 
instead of
     11440656/ 4509200 

So, using more space, but more readable (in particular when the
nr exceeds the width, and so are not aligned anymore)



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15208
2015-05-10 22:40:38 +00:00
Philippe Waroquiers
4328dff7d1 This patch decreases the memory used by the helgrind SecMap,
by implementing a Garbage Collection for the SecMap.

The basic change is that freed memory is marked as noaccess
(while before, it kept the previous marking, on the basis that
non buggy applications are not accessing freed memory in any case).
Keeping the previous marking avoids the CPU/memory changes needed
to mark noaccess.

However, marking freed memory noaccess and GC the secmap reduces
the memory on big apps.
For example, a firefox test needs 220Mb less (on about 2.06 Gb).
Similar reduction for libreoffice batch (260 MB less on 1.09 Gb).
On such applications, the performance with the patch is similar to the trunk.

There is a performance decrease for applications that are doing
a lot of malloc/free repetitively: e.g. on some perf tests, an increase
in cpu of up to 15% has been observed.

Several performance optimisations can be done afterwards to not loose
too much performance. The decrease of memory is expected to produce
in any case significant benefit in memory constrained environments
(e.g. android phones).

So, after discussion with Julian, it was decided to commit as-is
and (re-)gain (part of) performance in follow-up commits.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15207
2015-05-10 22:19:31 +00:00
Philippe Waroquiers
ff2b7ff016 small refinement in the outer/inner doc
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15206
2015-05-10 18:17:38 +00:00
Rhys Kidd
2f3976feb9 Add (presently) failing test case for bz#254164.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15205
2015-05-10 13:34:22 +00:00
Florian Krohm
7548da2acb Simplify is_valid_for taking advantage of the fact that SegKinds
are one-hot encoded.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15201
2015-05-10 11:07:06 +00:00
Rhys Kidd
ca1131bf2d testsuite: properly svn:ignore output files in none/tests/amd64. n-i-bz.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15199
2015-05-10 01:33:16 +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
bd9e34096e Add some cfi directives in the code doing syscall (by Valgrind).
This allows to attach to Valgrind when VAlgrind is blocked in a syscall
and have GDB producing a stacktrace, rather than being unable
to unwind.
I.e. instead of having:
  (gdb) bt
  #0  0x380460f2 in do_syscall_WRK ()
  (gdb) 
with the directives, we obtain:
   (gdb) bt
   #0  vgPlain_mk_SysRes_x86_linux (val=1) at m_syscall.c:65
   #1  vgPlain_do_syscall (sysno=168, a1=944907996, a2=1, a3=4294967295, a4=0, a5=0, a6=0, a7=0, a8=0) at m_syscall.c:791
   #2  0x38031986 in vgPlain_poll (fds=0x385226dc <remote_desc_pollfdread_activity>, nfds=1, timeout=-1) at m_libcfile.c:535
   #3  0x3807479f in vgPlain_poll_no_eintr (fds=0x385226dc <remote_desc_pollfdread_activity>, nfds=1, timeout=-1)
       at m_gdbserver/remote-utils.c:86
   #4  0x380752f0 in readchar (single=4096) at m_gdbserver/remote-utils.c:938
   #5  0x38075ae3 in getpkt (buf=0x61f35020 "") at m_gdbserver/remote-utils.c:997
   #6  0x38076fcb in server_main () at m_gdbserver/server.c:1048
   #7  0x38072af2 in call_gdbserver (tid=1, reason=init_reason) at m_gdbserver/m_gdbserver.c:721
   #8  0x380735ba in vgPlain_gdbserver (tid=1) at m_gdbserver/m_gdbserver.c:788
   #9  0x3802c6ef in do_actions_on_error (allow_db_attach=<optimized out>, err=<optimized out>) at m_errormgr.c:532
   #10 pp_Error (err=0x61f580e0, allow_db_attach=1 '\001', xml=1 '\001') at m_errormgr.c:644
   #11 0x3802cc34 in vgPlain_maybe_record_error (tid=1643479264, ekind=8, a=2271560481, s=0x0, extra=0x62937f1c)
       at m_errormgr.c:851
   #12 0x38028821 in vgMemCheck_record_free_error (tid=1, a=2271560481) at mc_errors.c:836
   #13 0x38007b65 in vgMemCheck_free (tid=1, p=0x87654321) at mc_malloc_wrappers.c:496
   #14 0x3807e261 in do_client_request (tid=1) at m_scheduler/scheduler.c:1840
   #15 vgPlain_scheduler (tid=1) at m_scheduler/scheduler.c:1406
   #16 0x3808b6b2 in thread_wrapper (tidW=<optimized out>) at m_syswrap/syswrap-linux.c:102
   #17 run_a_thread_NORETURN (tidW=1) at m_syswrap/syswrap-linux.c:155
   #18 0x00000000 in ?? ()
   (gdb) 




git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15194
2015-05-08 21:37:18 +00:00
Julian Seward
f08c405714 Update.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15193
2015-05-08 09:52:42 +00:00
Tom Hughes
df0b387c95 Document fix for BZ#347389.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15192
2015-05-07 18:54:51 +00:00
Tom Hughes
2799d8f88a Add support for the syncfs system call.
Based on patch from j@eckel.me on BZ#347389.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15191
2015-05-07 18:54:31 +00:00
Rhys Kidd
f61b92edba valgrind --leak-check=full memleak errors from system libraries on OS X 10.8
bz#347379
== bz#217236

Before:

== 591 tests, 237 stderr failures, 23 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@15190
2015-05-07 13:17:50 +00:00
Philippe Waroquiers
7878c9cd59 Compute total size with unsigned long long
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15189
2015-05-06 21:24:23 +00:00
Carl Love
3131343865 Patch 8 in a series of cleanup patches from Will Schmidt
Add a helper script to determine if the platform is ppc64le.
This is specifically used to help exclude the 32-bit tests from being
run on a ppc64LE (ABIV2)  platform.  The 32-bit targets, specifically ppc32/*
is not built on LE.
   
This patch fixes Vagrind bugzilla 347322.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15188
2015-05-06 21:11:35 +00:00
Philippe Waroquiers
4adab743dd Fix also the rm vgcore of a disabled test (also spotted by Matthias Schwarzott)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15187
2015-05-06 20:50:17 +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
48814f20f1 Patch 3 in a series of cleanup patches from Will Schmidt
Update the pth_create_chain vgtest prereq to handle the ppc64le architecture
in the same way as ppc64 (BE).
   
This patch fixes Vagrind bugzilla 347322.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15185
2015-05-06 20:16:04 +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
Carl Love
8933335653 Patch 1 in a series of cleanup patches from Will Schmidt
Update ifdefs around the bogus-LR-value-handling code to allow ppc64le to
behave as ppc64 (BE) does.

This fixes the overlap test case, where the stack unwinding code was
otherwise coming up with bad instruction pointers.
    
This patch fixes Vagrind bugzilla 347322.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15183
2015-05-06 19:18:28 +00:00
Florian Krohm
fa0d7aa5c6 Simplify. The condition on line 1223 is always true.
Here's why:

The condition

 if (VG_(brk_limit) > VG_(brk_base))   line 1223

is reachable iff 

  newbrk < VG_(brk_base)  on line 1201  is false  AND
  newbrk < VG_(brk_limit) on line 1205  is true

Rewrite as

  newbrk >= VG_(brk_base)    is true  AND
  newbrk <  VG_(brk_limit)   is true

Rewrite as

  newbrk >= VG_(brk_base)        is true  AND
  newbrk <= VG_(brk_limit) - 1   is true

Combine

  VG_(brk_base) <= newbrk <= VG_(brk_limit) - 1

Therefore

  VG_(brk_base) <= VG_(brk_limit) - 1

Or

  VG_(brk_base) < VG_(brk_limit)

Which is the same as

  VG_(brk_limit) > VG_(brk_base)

qed.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15181
2015-05-05 06:14:10 +00:00
Philippe Waroquiers
d31115a1d4 One more msg to use 'mmap-ed ANONYMOUS' wording
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15180
2015-05-04 20:00:49 +00:00
Rhys Kidd
5c8938f1ca Fix suppression for pthread_rwlock_init on OS X 10.8
bz#347151

Before:

== 593 tests, 238 stderr failures, 23 stdout failures, 0 stderrB failures, 0 stdoutB failures, 30 post failures ==

After:

== 593 tests, 237 stderr failures, 23 stdout failures, 0 stderrB failures, 0 stdoutB failures, 30 post failures ==


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15179
2015-05-04 12:46:44 +00:00
Julian Seward
fda6609964 Add a new howto for running mips64-linux on QEMU.
Rename the aarch64-linux howto accordingly.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15178
2015-05-04 08:40:11 +00:00
Philippe Waroquiers
109b2f9417 * Out of memory message was using 'bytes have already been allocated.'
while this nr is in fact the total anonymously mmap-ed.
  Change the message so as to reflect the shown number.
* Show also the total anonymous mmaped in non OOM memory statistics



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15177
2015-05-03 21:48:13 +00:00
Philippe Waroquiers
9655203ffb Reduce nr of lines produced by laog gc --stats=yes
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15176
2015-05-03 10:56:16 +00:00
Rhys Kidd
7f0c6f5ef6 Properly guard exp-bbv/tests/x86/ on OS X. Partial fix for BZ#344416 (at least reduces required hacks).
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15175
2015-05-02 04:23:46 +00:00
Philippe Waroquiers
22988c423a This patch reduces the memory needed for a VtsTE by 25% (one word)
on 32 bits platforms. No memory reduction on 64 bits platforms,
due to alignment.
The patch also shows the vts stats when showing the helgrind stats.

The perf/memrw.c perf test gets also some new additional features
allowing e.g. to control the size of the read or written blocks.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15174
2015-05-01 17:12:00 +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
Rhys Kidd
d92ece08a3 Properly guard drd/tests/thread_name with HAVE_PTHREAD_BARRIER. Partial fix for BZ#344416 (at least reduces required hacks).
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15172
2015-05-01 10:19:22 +00:00
Rhys Kidd
9fe1f89425 Fix aspacem segment mismatch: seen with none/tests/bigcode
bz#345824

Tested on OS X 10.9 and OS X 10.10.

Before:

== 595 tests, 237 stderr failures, 23 stdout failures, 0 stderrB failures, 0 stdoutB failures, 31 post failures ==

After:

== 595 tests, 236 stderr failures, 22 stdout failures, 0 stderrB failures, 0 stdoutB failures, 31 post failures ==


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15171
2015-05-01 06:29:51 +00:00
Rhys Kidd
719dc599ed Fix regression test compile issue on OS X platform, introduced in r15113. n-i-bz
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15170
2015-04-30 23:39:10 +00:00
Florian Krohm
b6251821a1 Remove a few embarassing comments.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15169
2015-04-30 20:44:17 +00:00
Philippe Waroquiers
9f9c5c6947 Rename write variable to avoid a warning:
memrw.c:37: warning: declaration of ‘write’ shadows a global declaration
/usr/include/unistd.h:333: warning: shadowed declaration is here



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15167
2015-04-30 20:30:12 +00:00
Florian Krohm
307f73e22b Fix the namespace of the functions dealing with segment names.
As those are private to the address space manager they should
be ML_ not VG_ prefixed.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15165
2015-04-30 17:34:04 +00:00
Julian Seward
47f7612998 DW_CFA_def_cfa_expression: don't push the CFA on the stack before
evaluation starts.  For DW_CFA_val_expression and DW_CFA_expression
doing so is correct, but not for DW_CFA_def_cfa_expression.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15160
2015-04-30 11:45:13 +00:00
Julian Seward
e6e2211dc8 Add a HOWTO on how to build and install aarch64-linux on QEMU,
primarily for testing convenience.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15159
2015-04-30 11:06:00 +00:00
Julian Seward
a9b9383bcc Fix intermittent build error on aarch64-linux caused by inadequate
alignment for some data symbols.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15157
2015-04-29 20:48:48 +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