Commit Graph

1498 Commits

Author SHA1 Message Date
Florian Krohm
7d59048401 This is the 2nd installment of the cache info reorganisation.
The host's VexArchInfo is passed to the tool instrumentation
functions. Purely mechanic patch.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13031
2012-10-07 21:59:42 +00:00
Florian Krohm
9e5f501978 Some older kernels on s390 do not provide AT_PLATFORM.
Add a prerequisite condition to make sure it's there.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13023
2012-10-05 23:29:38 +00:00
Tom Hughes
b387dedac0 Allow a null pointer as the second argument to capget.
Patch from Mark Wielaard to fix BZ#307101.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13021
2012-10-04 21:38:27 +00:00
Tom Hughes
c560f18eb7 Filter out memcpy symbol versions from test results.
Patch from Mark Wielaard to fix BZ#307290.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13020
2012-10-04 20:41:12 +00:00
Tom Hughes
f74befe896 Implement a fake /proc/self/auxv file for linux systems.
Patch from Mark Wielaard to fix BZ#253519.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13019
2012-10-04 20:27:38 +00:00
Philippe Waroquiers
76e93ca812 Unbreak build on Mac_OS where __NR_mprotect is not defined.
The test is not executed on Darwin but should compile.
(based on fix suggestion by Rich Coe)



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13014
2012-09-24 21:37:02 +00:00
Florian Krohm
a46b1219e1 Add missing header files. Building from tarball works again.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12990
2012-09-17 18:54:44 +00:00
Julian Seward
95866a7d77 Intercept __GI_memmove on Linux. Fixes #306612.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12982
2012-09-17 15:44:15 +00:00
Julian Seward
241f127a89 Handle Iop_QSub16Ux2, needed in fix for #304035.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12980
2012-09-17 15:28:46 +00:00
Philippe Waroquiers
0a51e37219 Add a test which checks the leak search recovery mechanism
The leak search must recover if unreadable pages are scanned.
This test creates such unreadable pages by doing non SIMD mprotect
syscall (not seen by the aspacemgr).



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12972
2012-09-14 21:10:15 +00:00
Florian Krohm
f9979eceb1 Adjust the vbit tester to deal with shift operations that require
an immediate constant as the shift amount. This is needed for
powerpc Iop_ShlD64 etc. What it basically means that we do not
iterate over the bits in the 2nd operand because there are no
V-bits to set. An immediate constant is always completely defined.
Fixes bugzilla #305948.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12969
2012-09-13 19:41:12 +00:00
Florian Krohm
26d4de4575 s390: Fix FOC width. It's 4 bytes not 8.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12965
2012-09-11 23:06:02 +00:00
Julian Seward
f0ef4bf583 Enable testing of primops on ARM platforms. (Florian Krohm)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12957
2012-09-03 21:59:28 +00:00
Florian Krohm
fd63ba5ee7 s390: Ensure proper size when calling get_otrack_shadow_offset_wrk.
Also handle EMNOTE.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12954
2012-09-03 17:34:22 +00:00
Florian Krohm
1229190124 s390: Valgrind-side changes to fixing bugzilla #274695:
Testcase, vbit tester update, memcheck support for the new IROps,
NEWS announcement and opcode list update.
Patch by Christian Borntraeger (borntraeger@de.ibm.com).
Vbit tester tweaks by myself.
Fixes bugzilla #274695.
See also companion patch VEX r2496.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12921
2012-09-01 00:15:45 +00:00
Florian Krohm
20c2f83060 Fix build on Darwin. Patch by Rich Coe (rcoe@wi.rr.com).
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12917
2012-08-30 15:12:59 +00:00
Florian Krohm
ecfd85ebe2 Enable V-bit testing on x86.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12916
2012-08-29 22:40:50 +00:00
Florian Krohm
89b8922886 Enable V-bit testing on ppc32.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12914
2012-08-29 17:45:13 +00:00
Florian Krohm
113df09b13 Fix printf formats for uint64_t values.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12913
2012-08-29 15:21:15 +00:00
Florian Krohm
a4d1060ccf vbit tester: Disable Iop_CmpLT64S and Iop_CmpLE64S for ppc because
they cause assertion failures.
Do not test Iop_CmpORDxyz on ppc because the vbit tester does not 
support them. This is just so we don't have to add another .exp file for ppc.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12910
2012-08-28 23:38:49 +00:00
Florian Krohm
0d0e6346db Add a tester for V-bit propagation through IROps.
The tester is located in memcheck/tests/vbit-test.
It needs the following support on the valgrind / VEX side:
(1) a new client request VG_USERREQ__VEX_INIT_FOR_IRI
(2) a new "special instruction" on all architectures inserted via
    VALGRIND_VEX_INJECT_IR
(3) VEX changes to detect the special insn and insert IR (ir_inject.c)

The README file in vbit-test has some more information.
See also VEX r2490.  Fixes bugzilla #300102.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12906
2012-08-28 16:50:39 +00:00
Florian Krohm
cd528bd768 Followup patch to r12899, purely mechanical. Rename:
VexEmWarn -> VexEmNote
EmWarn_NUMBER -> EmNote_NUMBER
guest_EMWARN -> guest_EMNOTE
LibVEX_EmWarn_string -> LibVEX_EmNote_string
offB_EMWARN -> offB_EMNOTE
EmWarn_NONE -> EmNote_NONE
See also VEX r2484


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12900
2012-08-26 03:22:09 +00:00
Julian Seward
ec3a16088b Implement a wrapper for wcslen on Linux, assuming that
sizeof(wchar_t) == 4, which I believe to be true on both Linux
and MacOSX.  Fixes #298281.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12893
2012-08-24 14:44:27 +00:00
Florian Krohm
ddd6ac7a7d Fix propagation of undefinedness for Iop_DPBtoBCD and Iop_BCDtoDPB.
Any undefined input bit will cause all output bits to be undefined.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12885
2012-08-22 18:09:07 +00:00
Florian Krohm
7f4d41c4b9 Handle the following IRops as they may get generated:
Iop_Mul8, Iop_Sar8, Iop_CmpwNEZ32, and Iop_8HLto16.
With this change mc_translate now handles all IR ops which are architecture
independent, except Iop_LeftXYZ and Iop_Max32U.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12884
2012-08-20 16:51:39 +00:00
Florian Krohm
18a9544be9 Remove memcheck support for IR op Iop_I16StoF32 which is unused.
See also VEX r2471.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12877
2012-08-18 02:44:49 +00:00
Julian Seward
4a3633e266 Update copyright dates to include 2012.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12843
2012-08-05 15:46:46 +00:00
Philippe Waroquiers
ab7b338320 301265 - add x86 support to Android build
Patch by Dragos Tatulea.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12835
2012-08-05 00:08:25 +00:00
Julian Seward
07e9d64e18 Clang complains that "fist" is ambiguous (it's right, too); use
"fists" instead.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12834
2012-08-04 23:10:23 +00:00
Julian Seward
ea5434e0dd Add an intercept for memrchr. Needed for amd64 Ubuntu 12.04.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12833
2012-08-04 23:08:08 +00:00
Julian Seward
0591d4c8f0 Don't explicitly specify an ABI when building regtests on ARM. This
causes them to fail to be built on (eg) Ubuntu 12.04 ARM.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12831
2012-08-04 19:21:18 +00:00
Philippe Waroquiers
d8576fd3bc Add non matching suppressions for suppfree test (more testing for suppr matching)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12825
2012-08-04 00:26:26 +00:00
Philippe Waroquiers
08c619389b fix 284540 (optimise suppression matching)
Before this patch, matching an error stack trace with many suppression
patterns was implying to repeating the translation of the IPs of the
stack trace to the function name or object name for each suppr pattern.

This patch introduces a "lazy input completer" in the generic match
so that an IP is (in the worst case) translated once to its function
name and once to its object name.

It is a "lazy" completer in the sense that only the needed IP to fun or obj
name are done.

On a artificial test case, has given a factor 3 in performance.
On another big (real) application, gave a factor 2 to 3.
(there was less matching to do, but probably more debug info to search).

match-overrun.supp completed to have non matching suppr first to
better exercise the lazy completer.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12824
2012-08-03 23:11:39 +00:00
Philippe Waroquiers
d045b4236a Implement --redzone-size and --core-redzone-size
* For tools replacing the malloc library (e.g. Memcheck, Helgrind, ...),
  the option --redzone-size=<number> allows to control the padding 
  blocks (redzones) added before and after each client allocated block.
  Smaller redzones decrease the memory needed by Valgrind. Bigger
  redzones increase the chance to detect blocks overrun or underrun.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12807
2012-07-31 22:17:28 +00:00
Florian Krohm
3630d97fcf Testcases for CU42. Part of fixing bugzilla #289839.
Update opcode table.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12804
2012-07-28 22:20:03 +00:00
Florian Krohm
d073e8f615 Minor tweaks. A few comments were out of synch with source.
Add another test.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12802
2012-07-28 21:59:34 +00:00
Petar Jovanovic
0717c59552 MIPS specific expected output for memcheck/tests/sigkill.
MIPS has different signal values, so it has to have its own expected output for
the tests that deal with signal values.
This fixes (false) failure in memcheck/tests/sigkill.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12794
2012-07-27 22:35:35 +00:00
Philippe Waroquiers
7685c36a5e Have one test testing the ? suppr matching wildcard character.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12793
2012-07-27 21:56:08 +00:00
Florian Krohm
1709090cc8 Improve complaints. Enabled by VEX r2449.
Line numbers are still bad. But that is a GCC issue.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12785
2012-07-26 02:03:16 +00:00
Florian Krohm
21c67106a6 Add testcases for CU21. Update opcode table.
WRT the memcheck test: the good news is we get all the complaints
we want. The bad news is:
- the line numbers from within do_cu21 are off
- there are 2 complaints when attempting to convert from
  an uninitialised input buffer instead of one. One of them has a 
  completely bogus line number.

Possibly due to bad debug info?  Let's see what happens on machines
with more recent GCCs. 


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12765
2012-07-20 00:17:16 +00:00
Florian Krohm
b54d735e92 Observe guards on dirty helpers in memcheck.
This means, that any guest state and/or memory accesses of the helper (and
complaints about those) only occur if the guard expression is true at runtime.
Definedness of parameters that the helper might have is *always* checked,
as parameters are evaluated regardless of the guard expression.
New functions: expr2vbits_guarded_Load and gen_guarded_load_b.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12762
2012-07-19 17:23:42 +00:00
Philippe Waroquiers
67f15ef871 patch that improves the speed of the leak search by up to 40% (on amd64)
Scanning 1GB of random values made of 200_000 malloc-ed block is
(on amd64) changing from (about) 17 seconds to (about) 10 seconds.

On x86, it goes from 153 seconds to 129 seconds.

(this huge difference between x86 and amd64 leak search time
for this random test is because a random value has about one chance
on 4 to be in the addressable memory on x86 and so the dichotomic
search in the list of malloc-ed blocks is called for a lot more
values than on amd64).

Basically, there are 3 optimisations:
1. call MC_(is_within_valid_secondary) only at the beginning of a
   secondary map (and not for each Word).
2. call SETJMP only at the beginning of a page (and not for each Word)
3. Validate an aligned word using get_vabits8 rather than get_vabits2.

Each of the above optimisation more or less improves by 2 seconds.
(to go from 17 seconds to 10 seconds).



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12756
2012-07-18 22:26:51 +00:00
Julian Seward
7bf78edb21 Add another intercept for strncasecmp_l. Fixes #297701.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12738
2012-07-13 13:21:11 +00:00
Philippe Waroquiers
096ad47ee9 Fix bug in leak search when an ignore range is specified
The leak search verifies if an address scanned is in a fully
unaddressable secondary map (64 Kb).
However, the function checking that wrongly verifies
if the address is in an ignore range.
So, if the scan encounters one or more bytes in an ignore
range, the leak scan will erroneously skip the rest of 
the 64Kb chunk.

The solution is to not test for ignore range in the function
MC_(is_within_valid_secondary) :
The fact that the address is in an ignore range is in any case
verified in the call to MC_(is_valid_aligned_word), which
is called for every Word just after.

This bug can cause false positive leaks in case small
ignore ranges are specified.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12734
2012-07-11 23:06:07 +00:00
Julian Seward
e08776c783 RM: Implement QADD and QSUB (valgrind side fixes). Fixes #286917.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12727
2012-07-11 13:20:58 +00:00
Philippe Waroquiers
cb808f8353 Improve behaviour of mempool redzone checking if user does not follow the manual (297911)
User is supposed to mark the superblock(s) of a mempool as noaccess.
As Valgrind objective is to find bugs for users which are doing bugs, let's even
find (some) bugs if the user has a bug in the bug detection code.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12714
2012-07-05 21:11:12 +00:00
Florian Krohm
5dec28d4af Increase allowed size of a back-trace to 500 frames.
This limit is large enough for all practical purposes. It exists
only to sanity check the value specified with --num-callers.
Be frugal in record_ExeContext_wrk and only allocate on the stack 
as many frames as needed. 
Testcase included.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12685
2012-06-29 21:20:52 +00:00
Julian Seward
e55e352fc6 Generate type-correct IR (always a good thing :-) when instrumenting
256 bit stores with --undef-value-errors=no.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12684
2012-06-29 15:29:37 +00:00
Julian Seward
241b6776ba Fix inline assembly for the "lfiwax" insn test. #302536.
(Carl Love, carll@us.ibm.com)


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12681
2012-06-28 18:40:43 +00:00
Julian Seward
7ef42ab8c3 Add handling of 256-bit vector FP arithmetic ops, so as to support AVX.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12673
2012-06-25 07:52:15 +00:00