1358 Commits

Author SHA1 Message Date
Florian Krohm
ad7a355b4a Improve filtering of backtrace noise in the memcheck bucket
and update exp files accordingly. This works well for x86
and all testcases pass on my machine.
New file filter_memcheck to do the work. 
There is a bit of a ripple here as filter_memcheck requires
command line arguments to be passed in. So all users of 
filter_memcheck (direct or indirect) were updated as well.
filter_stderr was simplified as was filter_libc.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12091
2011-10-03 23:39:54 +00:00
Florian Krohm
d13b1b34c8 Rename testcase from execve to execve1.
The reason is that the point of failure is in glibc
in a file named execve.c  The backtrace filtering
(which is filename based) cannot distinguish the
two execve.c file names. Renaming the testcsae does the
trick.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12090
2011-10-03 23:05:56 +00:00
Julian Seward
ef47922e1a Limit number of backtrace frames to 3 so as to avoid junk frames.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12087
2011-10-03 16:15:16 +00:00
Julian Seward
65f6c85aa8 Fix multiple problems with this test:
* when creating threads, just ask for a 256k stack size, since creating
  498 threads each with the default 8M stack size fails on 32 bit machines.

* limit number of callers to 3 so as to remove junk frames that cause
  different output on 32 vs 64 bit targets.

* add a proper self-check at the end, to verify the number of detected errors
  is as expected

* update output accordingly



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12086
2011-10-03 16:10:45 +00:00
Florian Krohm
ead612df79 Update for x86.
r8744 gave mainSort the "noinline" attribute, thereby changing
the backtrace. Nox fixed.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12080
2011-10-02 03:06:39 +00:00
Florian Krohm
ac33c6041e Use <sys/mman.h> instead of <linux/mman.h> to fix a compile problem
on SLES 10.  Patch by Rich Coe (rcoe@wi.rr.com). Fixes bugzilla #282238.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12072
2011-09-30 01:27:26 +00:00
Julian Seward
ef5296e445 arm_linux_android: intercept __dl_strcmp and __dl_strlen in
/system/bin/linker, for the usual reason.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12054
2011-09-26 20:20:19 +00:00
Julian Seward
8885c4e740 Add initial support for Mac OS X 10.7 (Lion). Tracked by bug #275168.
* configure.in support

* new supp file darwin11.supp

* comment out many intercepts in mc_replace_strmem.c and
  vg_replace_malloc.c that are apparently unnecessary for Darwin

* add minimal handling for the following new syscalls and mach traps:
    mach_port_set_context
    task_get_exception_ports
    getaudit_addr
    psynch_mutexwait
    psynch_mutexdrop
    psynch_cvbroad
    psynch_cvsignal
    psynch_cvwait
    psynch_rw_rdlock
    psynch_rw_wrlock
    psynch_rw_unlock
    psynch_cvclrprepost

* wqthread_hijack on amd64-darwin: deal with
  tst->os_state.pthread having an apparently different offset,
  which caused an assertion failure

* m_debuginfo: for 32 bit processes on Lion, use the DebugInfoFSM
  cleanup added in r12041/12042 to handle apparently new dyld
  behaviour, which is to map text areas r-- first and only
  vm_protect them later to r-x.



The following cleanups remain to be done

* remove apparently pointless, commented out wrapper macro
  invokations in mc_replace_strmem.c, eg

  //MEMMOVE(VG_Z_DYLD,        memmove)

  (or determine that they are still necessary, and uncomment)


* ditto in vg_replace_malloc.c, plus general VGO_darwin cleanups
  there


* write proper syscall wrappers for
    mach_port_set_context
    task_get_exception_ports
    getaudit_addr
    psynch_mutexwait
    psynch_mutexdrop
    psynch_cvbroad
    psynch_cvsignal
    psynch_cvwait
    psynch_rw_rdlock
    psynch_rw_wrlock
    psynch_rw_unlock
    psynch_cvclrprepost
  These are currently just no-ops and may be causing Memcheck to
  report false undef-value errors


* figure out why it doesn't work properly unless built with gcc-4.2 on
  Lion.

  gcc-4.2 is the "normal" gcc (i686-apple-darwin11-gcc-4.2.1).  Plain
  gcc is the hybrid gcc-front-end clang-back-end thing
  (i686-apple-darwin11-llvm-gcc-4.2).  Whereas on Snow Leopard, plain
  gcc is the normal gcc.

  The symptoms of the failure are that wqthread_hijack in
  syswrap-amd64-linux.c hits this /*NOTREACHED*/ vg_assert(0); right
  at the end (you need a pretty complex threaded app to trigger this),
  which makes me think that either ML_(wqthread_continue_NORETURN) or
  call_on_new_stack_0_1 do return, which they are not expected to.


* figure out if some of the uninitialised value errors reported in
  system libraries on are caused by Memcheck being confused by LLVM
  generated code, as per bug #242137



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12043
2011-09-21 08:43:08 +00:00
Florian Krohm
d0813fd49f Add more .exp files for s390 due to GCC's use of the MVC insn.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12030
2011-09-10 21:46:08 +00:00
Florian Krohm
75ae8f601e Back out r12026; instead add a new .exp file for s390x.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12029
2011-09-10 20:54:17 +00:00
Florian Krohm
0edfee0a4d For s390x we also need to accept a reported size of 1.
This is due to older versions of GCC who use the MVC insn for
assignments and that creates a sequence of 1-byte memory accesses.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12026
2011-09-10 17:56:21 +00:00
Julian Seward
c0bb2b82c6 Avoid excessive fragmentation in m_mallocfree by munmapping unused
superblocks in some circumstances (second attempt).  Bug 250101
comment 15.  (Philippe Waroquiers, philippe.waroquiers@skynet.be).


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12022
2011-09-10 10:17:35 +00:00
Florian Krohm
05545a035c Additional .exp file for s390x.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12020
2011-09-10 03:28:11 +00:00
Julian Seward
0e8736e529 * whitespace changes
* move MEMCPY(NONE, ZuintelZufastZumemcpy) to the correct ifdef;
  it got put in the wrong place by r12009 a couple of hours ago.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12010
2011-09-05 22:18:13 +00:00
Julian Seward
4bc0e6e01e For intercepts in libc and the dynamic linker (ld.so or dyld), split
the Linux and Darwin definitions so they are in completely separate
ifdefs -- iow, remove any definitions that are common to both.  This
gives some duplication, but the upside is that it is now possible to
edit the Darwin intercepts without fear of breaking the Linux ones.
This will be important when it comes to supporting OSX 10.7.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12009
2011-09-05 20:39:57 +00:00
Julian Seward
4d412a3f6a Add support for new primops added in vex r2199.
See Bug 279994 comment 1.
(Maynard Johnson, maynardj@us.ibm.com)


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12006
2011-09-05 12:12:34 +00:00
Julian Seward
978b0c5bf2 Make sure this gets built with -fomit-frame-pointer, even on x86-linux,
where it otherwise wouldn be.  On x86-linux running Memcheck, gives a
6% instruction count reduction and a 10% reduction in memory traffic.
(Duh!)


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11998
2011-08-20 15:55:07 +00:00
Bart Van Assche
11ce1f16fa memcheck/tests/linux/timerfd-syscall: Avoid failure on heavily loaded systems
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11997
2011-08-20 11:08:48 +00:00
Julian Seward
a9fc7fe5c3 x86-linux: don't add redirections for strchr/index in ld.so since they
are already hardwiredly-redirected at startup, and so these are
redundant.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11992
2011-08-18 13:49:48 +00:00
Julian Seward
e1567da7c5 Extend the behavioural-equivalence-class mechanism for redirection
functions to include the ability to give a priority to each function,
as well as a tag indicating its behavioural class.  Add logic in
m_redir.c to resolve conflicting redirections with the same eclass but
different priorities by preferring the redirection with the higher
priority.  Use all of the above in mc_replace_strmem.c, to cause a
conflict between redirections for "memcpy" and "memcpy@GLIBC_2.2.5" to
be resolved in favour of the latter (the non-overlap-checking
version).

This is all related to the massive swamp that is #275284.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11991
2011-08-18 13:09:55 +00:00
Tom Hughes
3cc26a2ef6 Don't compare src and dst to work out which direction to iterate
in for a memcpy/memmove if the length is zero. Fixes #268563.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11990
2011-08-18 08:10:20 +00:00
Julian Seward
1f13aa82f1 Redirect memcpy@@GLIBC_2.14 differently from memcpy@GLIBC_2.2.5, so as
to retain overlap checks for the former whilst skipping them for the
latter.  Pertains to #275284.  (Tom Hughes, tom@compton.nu)



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11988
2011-08-17 21:25:50 +00:00
Julian Seward
6c61d1be73 Fix for #275284 (initial fix, at least). Will break OSX; fix
to follow.

* add behavioural eclass tags for most functions in
  mc_replace_strmem.c and vg_replace_malloc.c.

* add a wrapper for strspn()  (see bug 270925)

* coregrind/m_redir.c: add logic to use eclass tags for
  resolving conflicting redirections.  Improve debug
  printing in that situation.

* mc_replace_strmem.c: add a wrapper for "__GI___strcasecmp_l".
  Gark.  Is this correct?  Does __GI___strcasecmp_l behave the
  same as __GI_strcasecmp_l and strcasecmp_l ?



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11985
2011-08-16 21:45:28 +00:00
Bart Van Assche
f3e331e777 memcheck/tests/sbfragment: Make this test pass on Darwin
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11976
2011-08-14 06:41:15 +00:00
Bart Van Assche
06e01f311e memcheck/tests/sbfragment.c: Only use mallinfo() if available.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11970
2011-08-13 05:32:53 +00:00
Florian Krohm
c9c6767b83 Fix prerequisite for memcheck/tests/linux/timerfd-syscall.
The testcase was executed despite uname -r being 2.6.9-42.EL
Extend tests/os_test.c to take an optional 2nd argument
which is a minimum version number. Use os_test in the
prerequisite expression.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11954
2011-07-31 03:22:45 +00:00
Bart Van Assche
e82cc4cbe0 Avoid that compiling memcheck on 32-bit systems triggers a compiler warning
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11948
2011-07-29 14:24:07 +00:00
Julian Seward
080c67f88d Avoid excessive fragmentation in m_mallocfree facility by munmapping
unused superblocks in some circumstances.  Bug 250101 (==269884,
==275852)
(Philippe Waroquiers, philippe.waroquiers@skynet.be)



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11911
2011-07-24 17:39:10 +00:00
Julian Seward
42ada29286 Add a new client request and pair of macros,
VALGRIND_{DISABLE,ENABLE}_ERROR_REPORTING, which allow a thread to
temporarily disable reporting of errors it makes.  This is useful for
making Memcheck behave sanely in the presence of some MPI
implementations.  Also mark up libmpiwrap.c accordingly.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11910
2011-07-24 16:02:33 +00:00
Julian Seward
b7ff107848 Add support for IBM Power ISA 2.06 -- stage 2 (handle new
primops in Memcheck).  Bug 276784.
(Maynard Johnson, maynardj@us.ibm.com)


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11907
2011-07-24 14:15:54 +00:00
Julian Seward
8941601fef Un-break the build on most platforms following r11888. Oops.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11889
2011-07-12 13:50:59 +00:00
Julian Seward
5eabf446b4 Fix up preload code so that on Android it doesn't try to call anything
else -- that seems to give a runtime link failure.  In particular,
avoid calling _exit, getpagesize or __libc_freeres.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11887
2011-07-12 13:33:00 +00:00
Julian Seward
ed80c32ae5 Add / fix up test cases for {LD,ST}REX{,B,H,D} on ARM. Works for both
ARM and Thumb encodings.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11865
2011-07-11 11:46:52 +00:00
Julian Seward
97c113e7e0 valgrind and tool mon. cmds prefixes changes + doc fixes + new vgdb option
--cmd-time-out

* changed prefixes of Valgrind core monitor commands from vg. to v.
* removed prefixes of Tool monitor commands
* memcheck leak_check 'leakpossible' arg renamed to 'possibleleak'
* memcheck make_memory 'ifaddressabledefined' arg renamed to
'Definedifaddressable'
    (with uppercase D to avoid confusion with 'defined' arg).
* vgdb options
  - Some doc updates : more logical option order documentation,
       specify 'standalone' for options aimed at standalone usage.
  - added option --cmd-time-out for standalone vgdb
     (comment of Josef Weindendorfer, needed to interface with a callgrind GUI)
* updated tests according to the above.
* updated documentation according to the above.
* some additional minor doc fixes/clarifications

(Philippe Waroquiers, philippe.waroquiers@skynet.be).  Bug 214909
comment 111.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11844
2011-06-28 08:20:39 +00:00
Julian Seward
ad7de5b336 Delete the AIX5 port. The last release this worked for is 3.4.1,
and then only on AIX 5.2 and 5.3.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11842
2011-06-28 07:25:29 +00:00
Julian Seward
5c1e65aa42 Memcheck:
* add delta leak checking functionality
* some editing of related manual sections
(Philippe Waroquiers, philippe.waroquiers@skynet.be).  Bug 214909
comment 105.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11838
2011-06-26 12:41:33 +00:00
Julian Seward
e5bd8ec4c8 Minor documentation fixes for the GDB server. (Philippe Waroquiers,
philippe.waroquiers@skynet.be).  Bug 214909 comment 106.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11834
2011-06-25 10:05:28 +00:00
Julian Seward
48d69a241a Move the GDBserver documentation from the "Valgrind core" chapter
to the "Valgrind core: advanced topics" chapter.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11821
2011-06-17 08:31:22 +00:00
Julian Seward
25eb1856eb Track vex r2163 (en-mass renaming of vector narrowing and widening primops)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11819
2011-06-16 11:37:21 +00:00
Julian Seward
15107e7bdb Unbreak Altivec code following vex r2159 (renaming of
vector saturating narrowing primops)


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11817
2011-06-15 19:07:26 +00:00
Julian Seward
0ff7a2f47e Valgrind-side fixes and tests for PACKUSDW, to track r2160.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11816
2011-06-15 16:07:15 +00:00
Julian Seward
e3cebf5b92 Track renaming of vector saturating narrowing primops in r2159.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11814
2011-06-15 15:11:07 +00:00
Tom Hughes
af8ec0a591 Define _GNU_SOURCE for access to CLONE_XXX flags with gibc 2.14 headers.
Based on patch from Dmitry Djachenko <dimhen@gmail.com>.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11802
2011-06-07 22:53:21 +00:00
Bart Van Assche
64a2d66bdf Silence compiler warnings triggered by certain regression tests programs and that we are not interested in.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11758
2011-05-15 17:06:33 +00:00
Bart Van Assche
9a36fe677e Get rid of the remaining "set but not used" warnings reported by gcc 4.6 by
swapping the roles of the VALGRIND_DO_CLIENT_REQUEST() and
VALGRIND_DO_CLIENT_REQUEST_EXPR() macros. Also, many __attribute__((unused))
declarations on variables have been eliminated. Closes #269778.

Note: so far this patch has been tested on x86/Linux, amd64/Linux and
ppc64/Linux but not yet on any other supported CPU/OS combination.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11755
2011-05-15 07:04:03 +00:00
Bart Van Assche
1a1c896c7b memcheck: Fixed a bug in the address ranges reported in an error message. Closes #272615.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11734
2011-05-09 10:46:55 +00:00
Julian Seward
2ee9e90486 Implement a GDB server in Valgrind. See #214909.
(Philippe Waroquiers, philippe.waroquiers@skynet.be)



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11727
2011-05-06 21:02:55 +00:00
Julian Seward
ed9d566463 mkLazyN: fix incorrect type decl for 'mergeTy64', as spotted by IBM's
BEAM checker.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11726
2011-05-04 09:09:31 +00:00
Julian Seward
8dd8315914 Add support for IBM Power ISA 2.06 -- stage 1. Valgrind-side changes
and test cases. Bug #267630 and followup fix #270794.
(Maynard Johnson, maynardj@us.ibm.com)



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11697
2011-04-15 11:57:05 +00:00
Bart Van Assche
bd7dbb42d3 timerfd-syscall regression test: Allow even more scheduler variation.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11692
2011-04-12 10:28:31 +00:00