10265 Commits

Author SHA1 Message Date
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
Julian Seward
f306d747e9 More bug triage.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13572
2013-09-19 23:04:03 +00:00
Florian Krohm
c8b316f434 Fix two issues found by check_headers_and_includes.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13571
2013-09-19 14:55:27 +00:00
Florian Krohm
e9e22a3a00 Add a script 'check_headers_and_includes' to check that #include directives
are not against the grain.
Wrap this script together with 'check_makefile_consistency' into
'post_regtest_checks' and invoke that from the toplevel Makefile. So we can
easily add new checkers in the future.

Add a new make target 'post-regtest-checks' to just run those checks
and nothing else.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13570
2013-09-19 14:55:09 +00:00
Dejan Jevtic
72825d3c36 mips32/64: add extra test cases in vbit-test for mips32/64.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13569
2013-09-19 13:36:12 +00:00
Julian Seward
7c65d636da Double the size of the (already huge) translation cache on all
non-phone/tablet targets.  The previous apparently-huge sizing is
evidently not huge enough for recent apps, eg, recent Firefox requires
circa 350k translations to get started and almost fills an 8-sector
cache merely starting up and then idling.

On Android targets, fall back to 6 sectors; space is critical.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13568
2013-09-19 10:15:22 +00:00
Julian Seward
ba1687c934 Increase VG_N_SEGMENTS and VG_N_SEGNAMES by a factor of 6 on all
non-{phone/tablet} platforms.  Possibly fixes #164485.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13567
2013-09-19 10:04:59 +00:00
Julian Seward
5142c4c33b Comment-only change.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13566
2013-09-19 09:27:05 +00:00
Julian Seward
82b31476a3 Recent libxul.so on ARM has more than 5000 CIEs. Increase N_CIEs,
therefore.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13565
2013-09-19 09:14:56 +00:00
Julian Seward
8e3ee671db Move some now-closed bugs into NEWS.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13564
2013-09-19 08:55:36 +00:00
Carl Love
04d9c5c5c7 Oops, commit 13562 said the patch was done by Amodra. It should have
said the patch was from Paralkar Anmol.

This is the fix for Bugzilla 324765.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13563
2013-09-18 17:45:54 +00:00
Carl Love
960e2c2b3f The patch fixes the assembly of the Power dcbtst and dcbt instructions.
The assembly of these instructions is not alwasy being done correctly as
described in the following email reply.

  Re: Assembling Power instructions: dcbtst/dcbt.

      From: Peter Bergner <bergner at vnet dot ibm dot com>
      To: Paralkar Anmol-B07584 <B07584 at freescale dot com>
      Cc: "amodra at bigpond dot net dot au" <amodra at bigpond dot net dot au>, "binutils at sourceware dot org" <binutils at sourceware dot org>
      Date: Fri, 13 Sep 2013 15:22:35 -0500
      Subject: Re: Assembling Power instructions: dcbtst/dcbt.
      Authentication-results: sourceware.org; auth=none
      References: <DC6D7B34688246489A6578981A5ADEB9302A07 at 039-SN2MPN1-012 dot 039d dot mgd dot msft dot net>

  On Fri, 2013-09-13 at 18:32 +0000, Paralkar Anmol-B07584 wrote:
  > Hello,
  >
  >  Per Power ISA Version 2.07 (May 3, 2013) "4.3.2 Data Cache Instructions",
  >  the assembly language syntax for the dcbtst instruction (pp. 771) is:
  >
  >  dcbtst RA,RB,TH [Category: Server]
  >  dcbtst TH,RA,RB [Category: Embedded]
  >
  >  and it's layout in the object code is:
  >
  >   +------+------+------+------+------------+---+
  >   |  31  |  TH  |  RA  |   RB |  246(0xF6) | / |
  >   |0     |6     |11    |16    |21          |31 |
  >   +------+------+------+------+------------+---+
  >
  >  (Analogously: dcbt pp. 770)
  >
  >  However, GAS (as of version 2.23.52.20130912) decides on the syntax to use based on
  >  processor/architecture dialect (not Power ISA Category), using the Server syntax in
  >  the case of POWER4 and the Embedded syntax for generic PPC or VLE.

  That was a bug fixed here:

      https://sourceware.org/ml/binutils/2012-11/msg00352.html

  >  Consequently (e.g.),
  >
  >  dcbtst 17, 14, 6
  >
  >  in the assembly file gets "misassembled" under -many for a user-space program on Linux:

  When you only specify -many (and not one of -mpower4, -mpower5, etc.),
  the assembler/disassembler will choose a default -m<CPU> value for
  you.  That has changed over time, but is generally one of the newer
  server cpus.  For example, for binutils trunk, the default is now
  -mpower8 and for your 2.23.x binutils, it is -mpower7.
  That should force the assembler and disassembler to assemble
  the instruction using the server operand order you want, but the bug
  above (which is in 2.23) basically resets it to an old cpu, so it
  chooses to use the embedded/old cpu setting.

The patch from Amodra fixes the issue by manually generating the correct
hex value for the instruction rather then leaving it to the assembler to
generate the hex value from the symbolic assembly instruction name.

This is the fix for Bugzilla 324765.  

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13562
2013-09-18 16:06:46 +00:00
Florian Krohm
0ac9cb1d0c Fix memory leak when reallocating a thread name.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13561
2013-09-18 14:00:10 +00:00
Dejan Jevtic
91d5bb2015 mips32/mips64: tests for FCSR.
Change the existing tests to print the value of the FCSR
register after the mips fpu instruction is executed.
Add tests that are testing the value of FCSR register.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13560
2013-09-18 10:08:23 +00:00
Florian Krohm
b9016099c5 Tweak filter_xml_frames. Suppress frames containing neither a
function name nor any source code reference.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13559
2013-09-18 09:15:23 +00:00
Petar Jovanovic
c818bd5ff8 mips64: add tests for MIPS64 Octeon Instructions
Follow up to VEX r2765.

Patch by Zahid Anwar.

Bugzilla issue 322150


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13558
2013-09-18 02:19:45 +00:00
Florian Krohm
abe71bded5 Followup to r13553 which caused some build failures.
(1) Detect availability of pthread_setname_np. Ignore testcases
    memcheck/tests/threadname[_xml] if not available.
(2) Enable _GNU_SOURCE to avold compiler warnings.
(3) In threadname_xml filter out stackframes referring to system
    libraries. Added tests/filter_xml_frames to do that.
(4) Adjust .exp files as needed
(5) Do not ship stdout.exp for memcheck/tests/threadname[_xml].


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13557
2013-09-17 20:15:36 +00:00
Florian Krohm
2ffd73f178 VG_(memset) cannot handle NULL pointers and needs to be guarded.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13556
2013-09-16 21:46:31 +00:00
Florian Krohm
6d15b5deb4 Include pub_core/tool_clreq.h instead of valgrind.h where apropriate.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13555
2013-09-16 20:56:35 +00:00
Petar Jovanovic
7c1b5af87d mips: clean-up in hardware detection
Follow up to VEX r2764.
Add detection of Cavium in /proc/cpuinfo, and test for DSP ASEs only for
platforms with Company ID == MIPS.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13554
2013-09-16 18:16:13 +00:00
Florian Krohm
dbc0ecfa9f Intercept prctl(PR_SET_NAME, name) and store the thread name so it
can be used in error messages. That should be helpful when debugging
multithreaded applications.
Patch by Matthias Schwarzott <zzam@gentoo.org> with some minor
modifications. Fixes BZ 322254.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13553
2013-09-16 17:08:50 +00:00
Dejan Jevtic
f569a8ac2c mips32: typo error fix.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13552
2013-09-16 10:48:25 +00:00
Petar Jovanovic
567ed9419a mips32/mips64: rename mips32_features to mips_features
As this file is now detecting mips64/Cavium boards, we are renaming it to
reflect that. The functional change is that mips_features now can detect
Cavium board and allow Cavium-specific tests to be run.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13551
2013-09-15 22:49:01 +00:00
Petar Jovanovic
6303a18f51 mips: flush the cache in perf/bigcode.c
MIPS needs to flush the cache after memcpy in perf/bigcode.c.
Otherwise, the executed code will likely be wrong.

This fixes issues with bigcode test on some MIPS platforms.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13550
2013-09-15 22:16:38 +00:00
Florian Krohm
a6c7a2893c Fix coregrind header files such that they can be included without
having to worry what other header files may have to be included
beforehand.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13549
2013-09-15 13:54:34 +00:00
Florian Krohm
5c4ba95a27 Fix inclusion of header files in coregrind. No pub_tool_*.h should be
included here.
Added pub_core_poolalloc.h and renamed pub_tool_inner.h to pub_core_inner.h.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13548
2013-09-15 10:42:26 +00:00
Florian Krohm
de4c6ffc54 Fix include guard.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13547
2013-09-15 09:56:18 +00:00
Florian Krohm
e4c80fed1e Move a function and its prototype VG_(malloc_effective_client_redzone_size)
to a conceptually better place.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13546
2013-09-15 09:18:03 +00:00
Philippe Waroquiers
14c1c10305 clarify that vg-in-place cannot be used as an outer in outer/inner setup
If you use a vg-in-place outer, then you obtain errors such as:
valgrind: mmap(0x38000000, 3293184) failed in UME with error 22 (Invalid argument).
valgrind: this can be caused by executables with very large text, data or bss segments.

What must be used is the "make install"-ed valgrind



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13545
2013-09-12 21:12:24 +00:00
Carl Love
6f2f615e04 The Power ISA 2.07 document includes a correction to the description for the
behavior of the xscvspdp instruction, indicating that if the source argument
is a SNaN, it is first changed to a QNaN before being converted from
single-precision to double-precision. This updated information about the
xscvspdp instruction exposed a bug in the VEX implementation for that
instruction and also a bug in the testing for all instructions having
special behavior for single-precision SNaN arguments.

The VEX code fix for this issue is r2760.

This patch fixes the test cases for the ISA 2.07.

Testing bug: In several ppc[64] test cases, an array of special
double-precision floating point values is set up, and then all elements of
that array are copied via assignment to a single-precision array ('float'
type). Assignment from a double to a float works fine for all cases, except for
SNaN values. In the case of a SNaN, the source is changed to a QNaN and then
converted to single-precision. So the end result was that our array of floats
did not have an actual SNaN value, and, therefore, any instructions that had
special behavior for a single-precision SNaN input argument was never being
properly tested. This patch makes some functional changes in the following
testcases: 

  none/tests/ppc[32|64]/test_isa_2_06_part2.c
  none/tests/ppc[32|64]/test_isa_2_06_part3.c
  none/tests/ppc[32|64]/test_isa_2_07_part2.c

These changes impacted the associated *.stdout.exp files, so the patch also
updates those files. Additionally, there were several errors in testcase
source comments that misidentified QNaN and SNaN bit patterns which this patch
corrects.
 
See bugzilla 324816.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13544
2013-09-12 17:38:13 +00:00