1672 Commits

Author SHA1 Message Date
Tom Hughes
1cdbef5fd8 Fix typo in poll wrapper
Patch from Ivo Raisr via BZ#330941


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13795
2014-02-09 11:10:08 +00:00
Florian Krohm
5b0ce0cc5e Fix V-bit tester failures introduced by VEX r2812.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13790
2014-02-06 18:53:30 +00:00
Julian Seward
c2d3e03fbe Handle and instrument an extra rounding-mode argument as added by
vex r2809 to the following primops:

  Iop_Add32Fx4, Iop_Sub32Fx4, Iop_Mul32Fx4, Iop_Div32Fx4, 
  Iop_Add64Fx2, Iop_Sub64Fx2, Iop_Mul64Fx2, Iop_Div64Fx2, 
  Iop_Add64Fx4, Iop_Sub64Fx4, Iop_Mul64Fx4, Iop_Div64Fx4,
  Iop_Add32Fx8, Iop_Sub32Fx8, Iop_Mul32Fx8, Iop_Div32Fx8,



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13781
2014-01-26 18:36:52 +00:00
Julian Seward
3f6d211236 Add support for ARMv8 AArch64 (the 64 bit ARM instruction set).
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13770
2014-01-12 12:54:00 +00:00
Dejan Jevtic
4247ea70e0 mips32/64: Add extra suppression for mips32/64.
After the thread is detached not all thread memory is freed. This memory (dtv-dynamic thread vector)
can be used by the main thread. There are two types of run-time handling of TLS.
Difference is in the position of memory. It can be either before the thread pointer or
after the thread pointer.
Taken form the document http://www.akkadia.org/drepper/tls.pdf:
"Variant I for the thread-local storage data structures were developed
as part of the IA-64 ABI. Being brand-new, compatibility was no issue. The thread
register for thread t is denoted by tpt. It points to a Thread Control Block (TCB) which
contains at offset zero a pointer to the dynamic thread vector dtvt for the thread.

Variant II has a similar structure. The only difference is that the thread pointer
points to a Thread Control Block of unspecified size and content. Somewhere the TCB
contains a pointer to the dynamic thread vector but it is not specified where. This is
under control of the run-time environment and the pointer must not be assumed to be
directly accessible; compilers are not allowed to emit code which directly access the
dtvt."

Because of this we have two types of error when the program ends:
possibly lost, and definitely lost.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13761
2013-12-16 13:57:18 +00:00
Philippe Waroquiers
492a8ae2a2 Implement gdbsrv "v.info stats" command giving statistics for valgrind core + tools
* addition of VG_(needs_print_stats) in pub_tool_tooliface.h
* use the above in memcheck and helgrind
* output valgrind stats and calls print_stats in server.c



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13760
2013-12-15 20:24:43 +00:00
Philippe Waroquiers
7d40b140ac Following svn r13758 (bug 328711), some further similar fixes,
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13759
2013-12-12 23:19:13 +00:00
Mark Wielaard
546e8d2c5c Bug 328711 valgrind.1 manpage "memcheck options" section is badly generated
Add missing para tags inside listitems. (Miroslav Franc, mfranc@redhat.com)

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13758
2013-12-12 21:20:48 +00:00
Julian Seward
19f49b677b Select expensive add/sub/cmp interpretations for blocks containing
Iop_GetMSBs8x16, since the presence of those usually implies PMOVMSKB
instructions in the block, which can mean "inlined string operations".
Reduces the noise level a lot in some icc12 -O2 generated sequences.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13757
2013-12-11 16:49:46 +00:00
Julian Seward
e2bff1c182 Merge the following revisions from 3_9_BRANCH to trunk:
r13682  Initial cut at 3.9.0 release notes.
r13683  Remove duplicate NEWS entries for 3.9.0.
r13689  Minor docs/NEWS fixes
r13690  Documentation updates for 3.9.0.
r13691  More documentation updates, re leak-checker changes
r13692  NEWS: Note increased max mem size.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13724
2013-11-29 23:08:28 +00:00
Julian Seward
ee95729330 Merge r13704 from 3_9_BRANCH (Fix compile problem in
memcheck/tests/reach_thread_register.c)


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13723
2013-11-29 16:57:29 +00:00
Bart Van Assche
84a7cef749 memcheck/tests/origin5-bz2: Add a regression test output file variant
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13721
2013-11-25 07:25:51 +00:00
Bart Van Assche
083723080c memcheck/tests/strchr: Add a regression test output variant
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13720
2013-11-25 06:46:45 +00:00
Bart Van Assche
39c447e4a9 Merge mc_replace_strmem.c, hg_intercepts.c and drd_strmem_intercepts.c
Move memcheck/mc_replace_strmem.c to shared/vg_replace_strmem.c and
add several intercepts for SSE-variants. Include that source file from
drd/drd_strmem_intercepts.c, helgrind/hg_intercepts.c and
memcheck/mc_replace_strmem.c.

Merge memcheck/tests/filter_memcpy into tests/filter_stderr_basic.
    
Update tests/check_headers_and_includes.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13719
2013-11-24 17:48:13 +00:00
Bart Van Assche
04252a5172 memcheck/mc_replace_strmem.c: Remove trailing whitespace
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13717
2013-11-23 16:41:54 +00:00
Bart Van Assche
38c8815567 memcheck: Optimize the memcpy() intercept
This change reduces the time needed to run the memcheck regression tests
with 2% on my development system.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13716
2013-11-23 15:48:12 +00:00
Dejan Jevtic
8eec882079 mips32: Change the tests values so that the result is
the same on all mips32 platforms. Add extra cases in 
vbit-test for mips32.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13687
2013-10-23 14:07:15 +00:00
Philippe Waroquiers
cc83a01b30 fix attribution of memcheck/tests/reach_thread_register.c code
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13673
2013-10-22 17:26:06 +00:00
Julian Seward
e37bfc02f3 mc_LOADVn_slow: also allow --partial-loads-ok=yes to grant an
exemption for aligned 32 bit loads on 64 bit targets, since it appears
to be necessary.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13672
2013-10-22 15:36:59 +00:00
Philippe Waroquiers
81d7bfddde Fix 324227 memcheck false positive leak when a thread calls exit+block
only reachable via other thread live register

The exiting thread will have its registers considered as not reachable
anymore, registers of other threads will be considered reachable.

This is ensured by using a different exit reason for the
exiting thread and for the other threads.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13670
2013-10-21 19:57:08 +00:00
Julian Seward
dbf9b63605 Update copyright dates (20XY-2012 ==> 20XY-2013)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13658
2013-10-18 14:27:36 +00:00
Carl Love
30565b278a This commit adds testing support for the following instructions:
vaddcuq, vadduqm, vaddecuq, vaddeuqm,
  vsubcuq, vsubuqm, vsubecuq, vsubeuqm,
  vbpermq and vgbbd.

The completes adding the Power ISA 2.07 support.

Bugzilla 325816

VEX commit id 2790


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13653
2013-10-18 01:20:11 +00:00
Philippe Waroquiers
619be966db Allow tools to provide some statistics in suppression list produced at the end
Option -v outputs a list of used suppressions. This only gives
the nr of times a suppression was used.
For a leak search, this only gives the nr of loss records that
have been suppressed, but it does not give additional needed details
to understand more precisely what has been suppressed
(i.e. nr of blocks and nr of bytes).

=> Add in the tool interface update_extra_suppression_use and
print_extra_suppression_info functions to allow the tool to record
additioonal use statistics for a suppression. These statistics
can be done depending on the error (and its data) which is suppressed.

Use this in memcheck for the leak suppressions, to maintain and output
the nr of blocks and bytes suppressed by a suppression during
the last leak search.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13651
2013-10-17 22:10:41 +00:00
Philippe Waroquiers
9f4120fb63 SIGSEGV/SIGBUS specific handling on s390, to cope with kernel peculiarity
On s390, the linux kernel does not deliver the exact address that
caused a SEGV but rather this address rounded down to a page boundary.
Also, old kernels do not deliver the address that caused a SIGBUS,
but deliver 0.
So, on s390, handle SIGSEGV and SIGBUG by always skipping one page
starting from the current value of the ptr scanning position.
As we need a correct value of ptr on this platform in the longjmp-ed
code, ptr is marked as volatile.
 


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13648
2013-10-15 21:04:56 +00:00
Carl Love
d143dd1f43 Power 8 support, phase 5
This commit adds the testcases for the following instructions:

  vpmsumb, vpmsumh, vpmsumw, vpmsumd, vpermxor, vcipher, vcipherlast,
  vncipher, vncipherlast, vsbox,
  vclzb, vclzw, vclzh, vclzd,
  vpopcntb, vpopcnth, vpopcntw, vpopcntd,
  vnand, vorc, veqv,
  vshasigmaw, vshasigmad,
  bcdadd, bcdsub

The VEX commit that added the support for the above instructions was 
commit 2789.

The patch is for Bugzilla 325628


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13646
2013-10-15 18:13:21 +00:00
Philippe Waroquiers
39c780284b Add definedness checking when dereferencing ptr during heuristic reachedness
Patch ensures that no heuristic reachedness is obtained with undefined data.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13635
2013-10-13 18:38:30 +00:00
Philippe Waroquiers
90902aaf13 Fix use of uninit heuristic set for monitor command
* initialise leak_check heuristic parameter in the leak_check monitor command
* show the default value (none heuristic) in the monitor help command
  (none value chosen as default as this gives a backward compatible
   behaviour).
* document the heuristic leak check parameter in memcheck manual
  monitor command section



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13631
2013-10-09 20:12:39 +00:00
Dejan Jevtic
f0b787e8bf mips32: Don't test Iops that aren't supported in VEX.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13629
2013-10-09 08:33:18 +00:00
Dejan Jevtic
961e487650 mips64: add extra Iop cases in VEX and fix compiler
warning.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13624
2013-10-07 10:27:31 +00:00
Philippe Waroquiers
f5e2186ca7 Fix leak scan SEGV catcher when ptr starts in unreadable page (readable for aspacemgr)
The fault catcher installed during leak scan to catter e.g. for
possible desynchronisation between real protection and aspacemgr
was not activated when the scanned ptr was directly pointing in
a desynchronised page.
This was (initially only) visible on ppc32 (gcc110) as the page size of
gcc110 is big (64 K).

=> modified the leak-segv-jmp test so as to produce the problem also 
on systems with smaller pages.

The fix consists in calling the setjmp before the scan loop,
and skip the bad address which has been recorded by the fault
catcher.
Also, deemed better to just skip one single Addr rather than a full page
(e.g. to skip less data in case some addresses are unreadable e.g.
on strange hardware).

Performance of the leak scan has been measured, seems slightly
faster on x86,amd64 and ppc32. Slightly slower on ppc64.

Also if verbose argument is given, outputs the nr of bytes skipped
due to fault.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13623
2013-10-06 21:23:04 +00:00
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
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
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
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
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
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
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
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
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
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
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
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
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
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
72bf3648cb mips64: add extra test cases in vbit-test for mips64.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13540
2013-09-11 15:35:33 +00:00
Philippe Waroquiers
6e3bb2af58 Fix 324514 gdbserver monitor cmd output behaviour consistency + allow user
to put a "marker" msg in process log output

* v.info n_errs_found accepts optional msg, added in the output of
   the monitor command.

* use VG_(printf) rather than VG_(gdb_printf) when output of command
  should be redirected according to v.set gdb_output|log_output|mixed_output

* also avoid calling gdb_printf in output sink processing
  to output zero bytes, as gdb_printf expects to have a null terminated
  string, which is not ensured when 0 bytes have to be output.

* some minor reformatting (replace char* xxx by char *xxx).




git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13532
2013-09-04 21:42:43 +00:00
Dejan Jevtic
6fa3517d39 mips64: Add some test cases for mips64 in vbit-test.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13517
2013-08-28 10:03:45 +00:00
Florian Krohm
089f1ef803 When XML mode is selected messages from VALGRIND_PRINTF and friends
should go to the XML stream not stderr.  Fixes BZ 322807.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13516
2013-08-27 15:17:53 +00:00