10294 Commits

Author SHA1 Message Date
Philippe Waroquiers
3e5f78f04d pub_tool_oset.h and m_oset.c cleanup
* Remove dead code in m_oset.c VG_(OSetGen_ResetIterAt)
  The code at the end of VG_(OSetGen_ResetIterAt) was unreachable
  (detected by BEAM checker).
  Looking at SVN, the initial commit of VG_(OSetGen_ResetIterAt)
  already contained this deadcode.

* pub_tool_oset.h was wrongly indicating that signed words could
  be used for fast cmp oset.

* modified memcheck/tests/unit_oset.c to test VG_(OSetGen_ResetIterAt)

* modified memcheck/tests/unit_oset.c to not use signed words
  (it was previously using signed words, but only with positive values)





git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13622
2013-10-06 16:35:35 +00:00
Florian Krohm
9a2817af4a Update list of ignored files.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13621
2013-10-04 21:17:41 +00:00
Florian Krohm
799f480786 Disable drd/tests/std_thread.cpp for clang.
clang 3.3 produces an error message for /usr/include/c++/4.6/chrono
which happens to get included somewhere inside <thread>.
This happens with C++ headers from:
gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3. 


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13620
2013-10-04 21:13:16 +00:00
Florian Krohm
4f1758438b Adjust CFLAGS and CXXFLAGS for compilation with clang. The current
setting suppresses almost all warnings originating in source code
constructs. It does ot yet suppress warnings from unrecognised command
line flags as they may be the reason for regression test failures
which have not yet been investigated.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13619
2013-10-04 21:12:17 +00:00
Florian Krohm
f43cafa3f0 Add missing prereq.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13618
2013-10-04 20:45:25 +00:00
Florian Krohm
a913e218e0 Followup to r13615. Conditional testcases need a prereq line in the
.vgtest file. This has sucked before and I keep forgetting about it.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13617
2013-10-04 15:03:55 +00:00
Florian Krohm
9dd4979fd9 Followup to r13614. Forgot to update the .exp file. Now fixed.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13616
2013-10-04 12:00:51 +00:00
Florian Krohm
8435fc4dc3 Add a few feature tests to configure.ac because clang does not
understand the following:
- nested functions
- -gstabs option
- loopnel instruction
- addr32 in asm statements
- 'p' constraint in asm statements

Adapt Makefiles accordingly.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13615
2013-10-04 11:35:50 +00:00
Florian Krohm
9170b1642b Remove 4 tests of the pextrw instruction.
Those tests were rejected by clang and according to the
analysis below by Tom Hughes do not add anything new.

Analysis:

I'm not 100% sure that clang is right though - the Intel manual 
clearly describes that argument as "reg" rather than "r32" which 
is why I will have included the 64 bit version in the test. It also says:

  "The upper bits of r32 or r64 is zeroed."

and:

  "If the destination operand is a general-purpose register, the
   default operand size is 64-bits in 64-bit mode."

which basically means that REX.W is implied for this op and there is 
no way to encode a 32 bit version when running in 64 bit mode.

So in principle you could encode it as:

  44 0f c5 ce 00          pextrw $0x0,%mm6,%r9d

or:

  4c 0f c5 ce 00          pextrw $0x0,%mm6,%r9

but in fact gcc assembles both versions to the first form.

Equally you could argue that as REX.W is implied both versions 
should disassemble as %r9.

So I think clang is being overly picky, and if it was only going to 
accept one version I would argue it should be %r9 not %r9d!

In practical terms dropping the second set of tests doesn't lose us anything though.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13614
2013-10-04 11:29:26 +00:00
Bart Van Assche
0dabd6dfd3 drd: Update copyright notice
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13613
2013-10-04 05:55:30 +00:00
Philippe Waroquiers
dcb236bf83 Fix compilation problem of memcheck/tests/leak-segv-jmp on ppc32
With the change, the test compiles on ppc32.
However, the test fails miserably with
 Segmentation fault
while the whole purpose of the test was to see the leak search
would *not* segfault.

More investigations needed, but still committing as is to let
the tests compile and run.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13612
2013-10-03 22:36:54 +00:00
Carl Love
0a3fd151e3 Phase 4 support for IBM Power ISA 2.07
This patch adds testcases for the following instructions added 
in phase 4.  The instructions are for doing various arithmetic,
logic, and load/store VSX operations:

  xscvsxdsp xscvuxdsp xsaddsp xssubsp xsdivsp xsmaddasp xsmaddmsp
  xsmsubasp xsmsubmsp xsnmaddasp xsnmaddmsp xsnmsubasp xsnmsubmsp
  xsmulsp xssqrtsp xsresp xsrsqrtesp xsrsp xxlorc xxlnand xxleqv
  lxsiwzx lxsiwax lxsspx stxsiwx stxsspx

Signed-off-by: Maynard Johnson <maynardj@us.ibm.com>

VEX commit for the instruction support r2781
Bugzilla 325477


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13611
2013-10-03 21:43:10 +00:00
Florian Krohm
dfb5c06054 Change some inline assembler so it is no longer rejected by clang
as suggested by John Reiser and Greg Parker.
It seems that GCC has a more relaxed attitude about what it accepts
as valid input.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13610
2013-10-03 20:54:52 +00:00
Philippe Waroquiers
fa45410976 Fix assert for who_points_at monitor cmd for an interiorly pointed block
* fix the assert
* some better comments
* update test to verify who_points_at behaviour with an interiorly pointed block



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13609
2013-10-02 20:59:05 +00:00
Carl Love
e9b1e99239 The test case for the Transaction Memory instructions failes with older
compilers as the -mhtm flag is not known.  The patch fixes the makefile
issue and addes #defines to the testcase code.

The testcase was added in valgrind commit 13607.

The bugzilla for adding the TM instruction support is 323803

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13608
2013-10-02 17:48:48 +00:00
Carl Love
c6765a43dc IBM POWER PC, Add the Transactional Memory test case
The test case for the transaction memory instructions executes the
failure path when run under valgrind.  This is since the initial
Transaction Memory implemnetation is to simply fail the TBEGIN instruction
forcing the execution flow to take the failure path.  When the
test case is executed on the real hardware, the success path will
be taken.  Only the TBEGIN instruction actually does anything.  All other
transactional memory instructions are NOPs since only failure path is executed
and it assumed to not have any transactional memory instructions on it.

Signed-off-by: Carl Love <cel@us.ibm.com>

VEX commit revision 2780
Bugzilla 323803

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13607
2013-10-02 16:28:57 +00:00
Bart Van Assche
625c6aa3df drd/tests/annotate_smart_pointer: Avoid non-POD variable length arrays
Non-POD variable length arrays are supported by g++ but not by clang.
Hence convert the variable length array in this test program into a vector.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13606
2013-10-02 16:22:23 +00:00
Florian Krohm
9de72049d5 Silence clang warnings for the none and exp-sgcheck tools.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13605
2013-10-02 15:37:03 +00:00
Florian Krohm
61e9282556 The configury bits for checking the annotatoin of smart pointers
were mixing up CFLAGS and CXXFLAGS. Now fixed.

Also, when modifying CFLAGS also modify CXXFLAGS unless there is a
good reason not to do so. This only affects compilation of testcases.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13604
2013-10-02 15:14:59 +00:00
Mark Wielaard
ac9fc56329 Add tests/check_isa-2_07_cap to dist_noinst_SCRIPTS.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13603
2013-10-02 13:41:57 +00:00
Mark Wielaard
b53af2e1f2 Add opcodes.h to EXTRA_DIST for none/tests/ppc[32|64].
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13602
2013-10-02 13:17:56 +00:00
Mark Wielaard
5961ceec8a Add post_regtest_checks check_headers_and_includes to dist_noinst_SCRIPTS.
Also allow a .git directory in check_headers_and_includes to help
people using a git mirror of valgrind/VEX svn.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13601
2013-10-02 11:39:41 +00:00
Florian Krohm
578a6e1e9f Eliminate a few GCC 4.8.1 warnings.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13600
2013-10-02 06:56:47 +00:00
Florian Krohm
3bd1597a41 Silence clang warnings about uninitialised and unused values in
memcheck testcases.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13599
2013-10-01 22:38:43 +00:00
Florian Krohm
5d5fefeb24 Fix exception specification for operator delete as spotted by clang 3.3
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13598
2013-10-01 22:18:14 +00:00
Florian Krohm
1975cc4fde Remove a duplicate const qualifier complained about by clang 3.3
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13597
2013-10-01 20:10:21 +00:00
Florian Krohm
a135d54dab Fix printf format. The 'L' modifier cannot be used with
the 'x' format specifier. Use 'll' instead.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13596
2013-10-01 18:39:55 +00:00
Bart Van Assche
91136a3fbd drd: Change VALGRIND_DO_CLIENT_REQUEST_EXPR() into VALGRIND_DO_CLIENT_REQUEST_STMT() where appropriate
This should silence a few clang warnings. This was reported by Florian.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13595
2013-10-01 16:55:58 +00:00
Carl Love
d568595cd1 Add tests for the phase 3 ISA 2.07 code patch
This patch adds testcases to an existing testcase
source file to test the new instructions which were
added to VEX support in the phase 3 ISA 2.07 code patch.
The patch also makes a small change to memcheck's
vbit tester code to allow successful execution.

Signed-off-by: Maynard Johnson <maynardj@us.ibm.com>        

Bugzilla 324894.   Corresponding VEX commit 2779

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13594
2013-10-01 15:50:09 +00:00
Dejan Jevtic
5944b58df7 mips32: Fix the align problem with mmap.
Valgrind is doing mmap always with MAP_FIXED. On mips32 we need to check arg4.
If the arg4 is MAP_SHARED we need to align the address to SHMLBA.
If the program tries to do mmap with VKI_FIXED Valgrind doesn't need to align
the address to SHMLBA.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13593
2013-10-01 10:34:54 +00:00
Florian Krohm
512044b6e9 Fix typo
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13592
2013-10-01 07:01:08 +00:00
Philippe Waroquiers
0925d04c4e Use global vars to point at possibly leaked
Depending on the compiler or optimisation level, the blocks that
are supposed to be possibly leaked are still reachable.
=> change the pointers to be global variables,
and do the allocation in a function, not in main.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13591
2013-09-30 21:17:09 +00:00
Florian Krohm
665798c26e Update list of ignored files.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13590
2013-09-30 19:01:54 +00:00
Florian Krohm
fb52f2212d Robustise the find_client function. Also fix a memory leak spotted by
IBM's BEAM checker.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13589
2013-09-30 18:36:31 +00:00
Florian Krohm
e6e402ceed Updated.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13588
2013-09-30 16:41:56 +00:00
Florian Krohm
392c321bb4 Check whether binutils supports TSX instructions.
Guard none/tests/amd64/tm1 accordingly.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13587
2013-09-30 16:32:53 +00:00
Julian Seward
6fa2a5249b Enable sys_fanotify_init and sys_fanotify_mark on arm-linux.
Fixes #324421.  (Heinrich Schuchardt, xypron.glpk@gmx.de)


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13586
2013-09-29 20:01:22 +00:00
Julian Seward
94c1e6d109 Update bug status.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13585
2013-09-29 19:54:39 +00:00
Julian Seward
9b7f6eeab0 Add test cases for SMMLS, SMLALD, SMLSLD (ARM and Thumb). Pertains to
323036, 323175, 323177.  (vasily.golubev@gmail.com)


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13584
2013-09-29 19:49:43 +00:00
Julian Seward
b7081fc1bd Add test cases for LDRHT (Thumb), LDRSHT (Thumb), [LDR,ST]{S}[B,H]T (ARM).
Pertains to 321891, 323035, 324047.  (vasily.golubev@gmail.com)


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13583
2013-09-29 18:25:29 +00:00
Philippe Waroquiers
e2ba2f3671 add heuristics decreasing false possible "possible leaks" in c++ code.
The option --leak-check-heuristics=heur1,heur2,... can activate
various heuristics to decrease the number of false positive
"possible leaks" for C++ code. The available heuristics are
detecting valid interior pointers to std::stdstring, to new[] allocated
arrays with elements having destructors and to interior pointers pointing
to an inner part of a C++ object using multiple inheritance.

This fixes 280271 Valgrind reports possible memory leaks on still-reachable
std::string 

This has been tested on x86/amd64/ppc32/ppc64.

First performance measurements seems to show a neglectible impact on
the leak search.

More feedback welcome both on performance and functional aspects
(false positive 'possibly leaked' rate decrease and/or 
false negative 'possibly leaked' rate increase).

Note that the heuristic is not checking that the memory has been
allocated with "new" or "new[]", as it is expected that in some cases,
specific alloc fn are used for c++ objects instead of the standard new/new[].
If needed, we might add an option to check the alloc functions
to be new/new[].



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13582
2013-09-29 13:47:32 +00:00
Julian Seward
8e32b20d45 Update bug status.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13581
2013-09-29 09:59:50 +00:00
Philippe Waroquiers
6a9976ee6c ensure nightly regression tests can (optionally) run perf tests
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13580
2013-09-27 18:10:29 +00:00
Julian Seward
2a8d194303 Add a test program of sorts, for XBEGIN and XTEST.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13579
2013-09-27 15:22:50 +00:00
Julian Seward
b84c467aad Annotate some bug reports with comments about priority.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13578
2013-09-26 08:18:47 +00:00
Dejan Jevtic
8eda9d604e mips32: Add two syscall wrappers:
4345 __NR_process_vm_readv
4346 __NR_process_vm_writev
Code style, no functional changes.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13577
2013-09-24 14:21:50 +00:00
Dejan Jevtic
ea9cf28a1f mips32: Change the input values for round test.
Change the input values so that the binary value
is representing exactly the same float value.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13576
2013-09-24 07:00:46 +00:00
Florian Krohm
521a1c8ec4 In an attempt to fix the accounting for dynamic memory allocation
it turned out that coregrind freely allocates memory on the tool
arena (which it should not, conceptually) and tools rely on coregrind
doing so (by VG_(free)'ing memory allocated by coregrind).
Entangling this mess is risky and provides little benefit except
architectural cleanliness. 
Thinking more about it... It isn't really all that interesting how
much memory is allocated by tool code in and by itself.  What is
interesting is the total memory impact a tool has, e.g. as compared
to running "none".
So in this patch the number of memory arenas is consolidated by
subsuming VG_AR_TOOL/ERRORS/EXECCTXT into VG_AR_CORE.
VG_(malloc) and friends have been modified to operate on VG_AR_CORE.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13575
2013-09-20 21:34:40 +00:00
Carl Love
f7d200127b Add test-cases for Power ISA 2.06 insns: divdo/divdo. and divduo/divduo.
The patch was supplied by Anmol P. Paralkar.

Valgrind Bugzilla 325110


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13574
2013-09-20 17:32:06 +00:00
Florian Krohm
b85b4fc560 Add the install directory that gets created by the nightly script.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13573
2013-09-20 12:12:52 +00:00