11803 Commits

Author SHA1 Message Date
Philippe Waroquiers
d6438d2c05 Fix 348949 Bogus "ERROR: --ignore-ranges: suspiciously large range"
Patch from Mark Harris 



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15333
2015-06-11 19:57:42 +00:00
Florian Krohm
d771b5cb1d Stick in -Werror when attempting to detect whether a compiler
option is available. This is needed for clang. See also r15323.
Fixes BZ #348890


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15332
2015-06-09 21:53:48 +00:00
Florian Krohm
0ef5cbd9af Followup to r15323. Cannot use AC_GCC_WARNING_SUBST to detect
whether -Wformat-security is supported. Special handling is needed.

gcc (Ubuntu 4.8.2-19ubuntu1) 4.8.2  accepts -Wformat-security
without -Wformat being present on the command line. Other GCC
versions will issue a warning if -Wformat is missing. r15323
adds -Werror to AC_GCC_WARNING_SUBST and therefore turns that
warning into an error.  With the consequence that
-Wformat-security appears to be unsupported -- a false conclusion.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15331
2015-06-09 21:44:58 +00:00
Julian Seward
337e580745 Fix up a few not-in-alphabetical-order file names in file lists.
No functional change.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15330
2015-06-08 11:20:22 +00:00
Rhys Kidd
0f1f6e7bdc Memcheck on multithreaded program fails with Assertion 'sizeof(UWord) == sizeof(UInt)' failed in m_syscall.c
bz#302630
== bz#326797

On OS X 10.7 and OS X 10.8

Before:

== 598 tests, 201 stderr failures, 12 stdout failures, 0 stderrB failures, 0 stdoutB failures, 30 post failures ==

After:

== 598 tests, 200 stderr failures, 12 stdout failures, 0 stderrB failures, 0 stdoutB failures, 30 post failures ==


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15329
2015-06-08 11:07:48 +00:00
Rhys Kidd
8c4149b404 Fix undefined symbols for architecture x86_64: _global, referenced from: _test_so_global in tls_so-tls_so.o. bz#347982.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15328
2015-06-08 08:56:33 +00:00
Philippe Waroquiers
8f30180df2 Inline ensure_valid. This improves reading the debug info of big executables
by 1 to 2%



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15327
2015-06-07 10:38:39 +00:00
Philippe Waroquiers
4f10542405 Announce fix for 345928 (amd64: callstack only contains current function for
small stacks)
(was fixed by rev 15309)



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15326
2015-06-06 08:11:37 +00:00
Rhys Kidd
e4d96677ef Resolve remaining clang warning on OS X. Should be possible to build Valgrind on modern OS X without any warnings (note: does not hold for regression test suite).
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15325
2015-06-06 04:18:49 +00:00
Rhys Kidd
d2e68860c9 Resolve clang warning on OS X: m_stacktrace.c:542:7: warning: implicit declaration of function 'vgPlain_is_in_syscall' is invalid in C99 [-Wimplicit-function-declaration]
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15324
2015-06-06 03:57:34 +00:00
Florian Krohm
b6c5130bdc clang, as opposed to gcc, does not terminate with a non-zero return code
in case an unrecognised command line option is encountered. configure.ac
however was assuming just that which led to compile time warnings later on.
Add -Werror to the configure bits to make clang behave like gcc in this
regard. Fixes BZ #348565.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15323
2015-06-05 21:19:06 +00:00
Florian Krohm
a424add6e9 Fix a condition that was always true. Found by cppcheck.
See BZ #348565.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15322
2015-06-05 19:34:59 +00:00
Florian Krohm
6009f4d5f9 Remove configure bits for -Wno-format-zero-length. The option is
not used.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15321
2015-06-05 17:40:53 +00:00
Florian Krohm
4880368c8d Simplify configury and eliminate AC_GCC_WARNING_COND which was only used
in one place and can be replaced with AC_GCC_WARNING_SUBST_NEW. Adjust
perf/Makefile.am.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15320
2015-06-05 17:09:57 +00:00
Florian Krohm
2de98199b0 Add -Wempty-body to the list of compile flags.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15319
2015-06-05 16:26:14 +00:00
Florian Krohm
a727bec9cb Remove configury bits for -Wno-empty-body. It is not needed.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15318
2015-06-05 16:03:31 +00:00
Julian Seward
91ca5a0233 arm32-linux only: add handwritten assembly helpers for
MC_(helperc_LOADV32le), MC_(helperc_LOADV16le) and
MC_(helperc_LOADV8).  This improves performance by around 5% to 7% in
the best case, for run-of-the-mill integer code.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15317
2015-06-05 13:33:46 +00:00
Julian Seward
d99ae1b60f Update.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15316
2015-06-05 12:08:10 +00:00
Julian Seward
eccf4508a8 Update.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15315
2015-06-05 11:27:27 +00:00
Julian Seward
a4d69434b8 Bug 348728 - Fix broken check for VIDIOC_G_ENC_INDEX
Patch from Hans Verkuil (hverkuil@xs4all.nl)


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15314
2015-06-05 11:25:32 +00:00
Julian Seward
eed8fbcd80 Bug 348102 - Patch updating v4l2 API support (edit)
Patch from Hans Verkuil (hverkuil@xs4all.nl) 


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15313
2015-06-05 11:23:35 +00:00
Julian Seward
5058294f3e Fix format string mismatch.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15312
2015-06-05 10:03:56 +00:00
Rhys Kidd
85ba237ee9 Silence some system library leaks on OS X 10.7. These same leaks silenced on later OS X already. n-i-bz.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15311
2015-06-05 09:58:27 +00:00
Rhys Kidd
54eabad535 Fix r15302 for early gcc compilers on OS X. Cannot declare variable in for loop pre C99. n-i-bz.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15310
2015-06-05 09:57:03 +00:00
Philippe Waroquiers
ef0067c5bc On platforms that have an accessible redzone below the SP, the unwind logic
should be able to access the redzone.
So, when computing fp_min, substract the redzone.
Currently, only amd64 and ppc64 have a non 0 redzone.

Regtested on amd64 and ppc64le, no regression.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15309
2015-06-04 19:44:47 +00:00
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
Philippe Waroquiers
8e6d249a36 Default is 1 for the unwind length range, not 0
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15307
2015-06-02 22:17:51 +00:00
Philippe Waroquiers
a833d76cd9 Add a gdbxrv monitor command to print the CFI unwind info for an address+len
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15306
2015-06-02 22:09:42 +00:00
Mark Wielaard
d2b96ae95b GCC 5.1 is too smart. Disable Identical Code Folding for preload libs.
We want to disabled Identical Code Folding for the tools preload shared
objects to get better backraces. For GCC 5.1 -fipa-icf is enabled by
default at -O2.

    The optimization reduces code size and may disturb
    unwind stacks by replacing a function by equivalent
    one with a different name.

Add a configure check to see if GCC supports -fno-ipa-icf.
If it does then add the flag to AM_CFLAGS_PSO_BASE.

Without this GCC will notice some of the preload replacement functions
in vg_replace_strmem are identical and fold them all into one picking
a random (existing) function name. This causes backtraces showing
completely unexpected function names.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15305
2015-06-02 20:23:06 +00:00
Mark Wielaard
9c0019f28a Enable process_vm_readv/writev syscall on arm32.
This makes none/tests/process_vm_readv_writev.vgtest pass on arm32.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15304
2015-06-02 18:17:44 +00:00
Rhys Kidd
c17ba15f61 Darwin11.supp should include suppression for known uninitialised read in pthread_rwlock_init() as required to pass the memcheck/tests/darwin/pth-supp test. bz#196528.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15303
2015-06-02 10:30:15 +00:00
Rhys Kidd
e6b0c3b899 Add regression test for bz#228343.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15302
2015-06-02 09:21:28 +00:00
Philippe Waroquiers
20b64d7378 unwind amd64 trace: improve also the fp chain unwind trace
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15301
2015-05-31 15:26:51 +00:00
Philippe Waroquiers
552b9735bb Improve tracing in amd64 unwind
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15300
2015-05-31 15:18:36 +00:00
Rhys Kidd
d289179fd2 Fix OS X host_create_mach_voucher: UNKNOWN host message [id 222, to mach_host_self(), reply 0x........]
bz#343649

Before:

== 591 tests, 220 stderr failures, 14 stdout failures, 0 stderrB failures, 0 stdoutB failures, 30 post failures ==

After:

== 591 tests, 220 stderr failures, 14 stdout failures, 0 stderrB failures, 0 stdoutB failures, 30 post failures ==


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15299
2015-05-31 03:17:53 +00:00
Rhys Kidd
c8440021c5 Fix OS X host_get_special_port: UNKNOWN host message [id 412, to mach_host_self(), reply 0x........]
bz#343525

Before:

== 591 tests, 220 stderr failures, 14 stdout failures, 0 stderrB failures, 0 stdoutB failures, 30 post failures ==

After:

== 591 tests, 220 stderr failures, 14 stdout failures, 0 stderrB failures, 0 stdoutB failures, 30 post failures ==


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15298
2015-05-31 01:58:57 +00:00
Rhys Kidd
11f675de8b Fix unhandled syscall: mach:41 (_kernelrpc_mach_port_guard_trap)
bz#344337

Before:

== 591 tests, 220 stderr failures, 14 stdout failures, 0 stderrB failures, 0 stdoutB failures, 30 post failures ==

After:

== 591 tests, 220 stderr failures, 14 stdout failures, 0 stderrB failures, 0 stdoutB failures, 30 post failures ==


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15297
2015-05-30 08:59:46 +00:00
Rhys Kidd
9351332329 Signal handler ucontext_t not filled out correctly on OS X
bz#341419

Before:

== 589 tests, 220 stderr failures, 15 stdout failures, 0 stderrB failures, 0 stdoutB failures, 30 post failures ==

After:

== 591 tests, 220 stderr failures, 15 stdout failures, 0 stderrB failures, 0 stdoutB failures, 30 post failures ==


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15296
2015-05-28 12:49:00 +00:00
Mark Wielaard
4198e8ed5a Bug #348247 jno jumps wrongly when overflow is not set.
Mention bug fixed in VEX r3147 in NEWS.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15295
2015-05-27 12:37:39 +00:00
Philippe Waroquiers
cc8f7a352f Make some numbers in helgrind stats use , separators, as the numbers can be big
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15294
2015-05-26 21:27:36 +00:00
Philippe Waroquiers
85a86af96d Slightly improve x86 unwind intensive workload.
e.g. perf/memrw is improved by 2% to 3% with this patch.

The unwinding code on x86 is trying to unwind using
either the %ebp-chain or CFI unwinding.
If these 2 techniques fail, then it tries to unwind
using FPO (PDB) debug info.
However, unless running wine or similar, there will never be
such FPO/PDB info.
The function VG_(use_FPO_info) is thus called for nothing
for each 'end of stack'. This function scans all the loaded di
to find a debug info that has some FP, to not find anything.

With this patch, the unwind code on x86 will only call VG_(use_FPO_info) if
some FPO/PDB info was loaded.

The fact that FPO/PDB info was loaded is cached and updated similarly to
cfi cache : each time new debug info is loaded, the cache value is refreshed
using the debuginfo generation.

The patch also changes the name of VG_(CF_info_generation)
to VG_(debuginfo_generation), as this generation is changed for
any kind of load or unload of debug info, not only for CFI based debug
info



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15293
2015-05-26 21:26:39 +00:00
Florian Krohm
b5ae4edaaf Wraparounds are never allowed -- not evern for MAny requests.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15292
2015-05-26 17:59:50 +00:00
Florian Krohm
d655852d69 Remove dependency on bash. Fixes BZ #347978.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15291
2015-05-26 11:52:45 +00:00
Philippe Waroquiers
5f5fa8adf2 Some platforms such as x86 and amd64 have efficient unaligned access.
On these platforms, implement read_/write_<type> by doing a direct
access, rather than calling a function that will read or write
'byte per byte'.

For platforms that do not have efficient unaligned access,
or that do not support at all unaligned access, call function
  readUAS_/writeUAS_<type> that works as before.

Currently, direct acecss is activated only for x86 and amd64.
Unclear what other platforms support (efficiently) unaligned access.

On unwind intensive code (such as perf/memrw on amd64), this patch
gives up to 5% improvement.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15290
2015-05-25 20:15:25 +00:00
Philippe Waroquiers
f4dde903ab This patch decreases significantly the memory needed for OldRef and
slightly increases the performance. It also moderately improves
the nr of cases where helgrind can provide the stack trace of the old
access (when using the same amount of memory for the OldRef entries).
The patch also provides a new helgrind monitor command to show
the recorded accesses for an address+len, and adds an optional argument
lock_address to the monitor command 'info locks', to show the info
about just this lock.

Currently, oldref are maintained in a sparse WA, that points to N
entries, as specified by --conflict-cache-size=N.
For each entry (associated to an address), we have the last 5 accesses.

Old entries are recycled in an exact LRU order.
But inside an entry, we could have a recent access, and 4 very
old accesses that are kept 'alive' by a single thread accessing
repetitively the address shared with the 4 other old entries.


The attached patch replaces the sparse WA that maintains the OldREf
by an hash table.
Each OldRef now also only maintains one single access for an address.
As an OldRef now maintains only one access, all the entries are now
strictly in LRU mode.

Memory used for OldRef
-----------------------
For the trunk, an OldRef has a size of 72 bytes (on 32 bits archs)
maintaining up to 5 accesses to the same address.
On 64 bits arch, an OldRef is 104 bytes.

With the patch, an OldRef has a size of 32 bytes (on 32 bits archs)
or 56 bytes (on 64 bits archs).

So, for one single access, the new code needs (on 32 bits)
32 bytes, while the trunk needs only 14.4 bytes.
However, that is the worst case, assuming that the 5 entries in the
accs array are all used.
Looking on 2 big apps (one of them being firefox), we see that
we have very few OldRef entries that have the 5 entries occupied.
On a firefox startup, of the 5x1,000,000 accesses, we only have
1,406,939 accesses that are used.
So, in average, the trunk uses in reality around 52 bytes per access.

The default value for --conflict-cache-size has been doubled to 2000000.
This ensures that the memory used for the OldRef is more or less the
same as the trunk (104Mb for OldRef entries).

Memory used for sparseWA versus hashtable
-----------------------------------------
Looking on 2 big apps (one of them being firefox), we see that
there are big variations on the size of the WA : it can go in a few
seconds from 10MB to 250MB, or can decrease back to 10 MB.
This all depends where the last N accesses were done: if well localised,
the WA will be small.
If the last N accesses were distributed over a big address space,
then the WA will be big: the last level of WA (the biggest memory consumer)
uses slightly more than 1KB (2KB on 64 bits) for each '256 bytes' memory
zone where there is an oldref. So, in the worst case, on 32 bits, we
need > 1_000_000_000 sparseWA memory to keep 1_000_000 OldRef.

The hash table has between 1 to 2 Word overhead per OldRef
(as the chain array is +- doubled each time the hash table is full).
So, unless the OldRef are extremely localised, the overhead of the
hash table will be significantly less.

With the patch, the core arena total alloc is:
  5299535/1201448632 totalloc-blocks/bytes
The trunk is
  6693111/3959050280 totalloc-blocks/bytes
(so, around 1.20Gb versus 3.95Gb).
This big difference is due to the fact that the sparseWA repetitively
allocates then frees Level0 or LevelN when OldRef in the region covered
by the Level0/N have all been recycled.

In terms of CPU
---------------
With the patch, on amd64, a firefox startup seems slightly faster (around 1%).
The peak memory mmaped/used decreases by 200Mb.
For a libreoffice test, the memory decreases by 230Mb. CPU also decreases
slightly (1%).


In terms of correctness:
-----------------------
The trunk could potentially show not the most recent access
to the memory of a race : the first OldRef entry matching the raced upon
address was used, while we could have a more recent access in a following
OldRef entry. In other words, the trunk only guaranteed to find the
most recent access in an OldRef, but not between the several OldRef that
could cover the raced upon address.
So, assuming it is important to show the most recent access, this patch
ensures we really show the most recent access, even in presence of overlapping
accesses.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15289
2015-05-25 17:24:27 +00:00
Rhys Kidd
11a09e916d Address clang compiler warnings on OS X.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15288
2015-05-25 14:43:47 +00:00
Rhys Kidd
2180224424 Fix regression test added in r15282.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15287
2015-05-25 13:53:55 +00:00
Philippe Waroquiers
50f5deb159 helgrind stats: show the total nr of thr_n_rcec
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15285
2015-05-23 15:47:35 +00:00
Philippe Waroquiers
2550bcbf3e helgrind stats: give the memory occupied by the OldRef
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15284
2015-05-23 15:35:29 +00:00
Philippe Waroquiers
5ae8b759d4 Add stats in helgrind for oldref history found versus not found
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15283
2015-05-23 12:25:22 +00:00