756 Commits

Author SHA1 Message Date
Julian Seward
fc16ea6412 Make {amd64,x86}-darwin use the direct implementations of
VG_MINIMAL_SETJMP and VG_MINIMAL_LONGJMP introduced in r12067.

With this commit, it should be possible to build a working 64 bit
Valgrind using the default gcc as supplied with Xcode 4.1 on OSX 10.7.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12070
2011-09-29 18:29:41 +00:00
Julian Seward
fee9cdc61e x86-linux, amd64-linux: Implement VG_MINIMAL_SETJMP and
VG_MINIMAL_LONGJMP directly, rather than using __builtin_setjmp
and __builtin_longjmp, since clang-2.9 miscompiles the latter
(by completely ignoring it.)

Also, add comment about the return type for VG_MINIMAL_SETJMP.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12067
2011-09-29 17:33:58 +00:00
Julian Seward
cea6601bf2 Android: add wrappers for ashmem and binder ioctls. From the AOSP
port of Valgrind.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12059
2011-09-27 10:26:52 +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
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
Julian Seward
be517f6178 Add more infrastructure to be used for fixing #275284 (Valgrind
memcpy/memmove redirection stopped working in glibc 2.14/x86_64), but
don't fix the problem yet.  Should be no end-user visible change.

* in m_redir.c, when processing redirection specifications, consider
  all the names associated with an address, not just the primary name.

* add plumbing to support the notion of "behavioural equivalence class
  tags" of redirect/wrap functions.  These can be used by m_redir to
  resolve some situations in which the available set of redirect
  specifications causes some address to get redirected to two
  different functions.  (Framework is in place, but such resolution is
  not implemented yet.)



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11984
2011-08-16 09:54:00 +00:00
Julian Seward
a043f0a060 Remove the assumption, in m_debuginfo, that each address is associated
with only one symbol.  Instead, allow an address to have arbitrarily
many names.  This reflects reality better, particularly for systemy
libraries such as glibc and ld.so, and is background work needed for
fixing #275284.  This is not in itself a fix for #275284.  A followup
commit to un-break compilation on OSX will follow shortly.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11981
2011-08-15 09:42:34 +00:00
Tom Hughes
d3a38c3b6a Add support for FBIOPUT_VSCREENINFO and FBIOPAN_DISPLAY ioctls.
Patch from Pauli Nieminen <ext-pauli.nieminen@nokia.com> on #263648.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11980
2011-08-15 08:47:29 +00:00
Tom Hughes
ea5e1b6a5e Fix VKI_FIOQSIZE definition on ppc platforms.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11973
2011-08-13 15:14:58 +00:00
Tom Hughes
4a7707d8be Add support for the FIOQSIZE ioctl. Fixes #270320.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11963
2011-08-10 14:25:06 +00:00
Bart Van Assche
167922d29b valgrind.h: Remove a superfluous cast. See also #278454.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11913
2011-07-25 08:45:45 +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
Tom Hughes
a7524aa184 Allow core dumps on 32 bit architectures to go over 2Gb in size. BZ#277610.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11893
2011-07-13 09:02:14 +00:00
Florian Krohm
bc494507f2 Synch s390x system call list with linux 2.6.39.2.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11845
2011-06-28 23:37:01 +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
b4e2ade329 Fix 'make dist' following recent gdbserver commits.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11841
2011-06-27 23:31:07 +00:00
Julian Seward
2acd297ebe Fix #undefs that are inconsistent with those further up the file,
as spotted by Michael Meeks.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11829
2011-06-24 18:26:11 +00:00
Julian Seward
3e9f7836c5 Merge the contents of the HGDEV2 branch into trunk:
* performance and scalability improvements
* show locks held by both threads in a race
* show all 4 locks involved in a lock order violation
* better delimited error messages



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11824
2011-06-24 10:09:41 +00:00
Julian Seward
46d08c579d Minor GDBserver source tidying. Also a small usability fix: if
--vgdb-error=N is specified, print a bit of text telling the user the
magic commands to give GDB in order to attach to the process.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11822
2011-06-18 08:28:04 +00:00
Julian Seward
a12e858c35 Try to handle LL caches which are of size 50% above a power of 2 (eg,
6MB, 12MB) and have a non-power-of-2 number of sets.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11812
2011-06-13 13:14:00 +00:00
Tom Hughes
c5931781bc Teach cachegrind/callgrind how to parse the cache description
in the CPUID data on recent Intel processors.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11810
2011-06-10 15:04:22 +00:00
Tom Hughes
42bc84e869 Add support for prlimit64 on x86 and amd64.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11806
2011-06-08 09:55:54 +00:00
Tom Hughes
8bc495c8d7 Update system call lists to match current kernel source.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11805
2011-06-08 09:12:07 +00:00
Tom Hughes
912fe51553 It seems that the perf_counter_open system call was renamed to
perf_event_open some time after we added it, so correct the name
wherever it appears to match the current kernel source.

Also fixup the PRE handler to do the check correctly, using the
size field of the structure to work out how much data there is.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11804
2011-06-08 09:10:40 +00:00
Julian Seward
b1a67076a2 Better checking for command line options that should be either 'yes'
or 'no'.  Fixes #269144.  (a125246@prtnx.com, Florian Krohm
<britzel@acm.org>)


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11767
2011-05-17 16:29:29 +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
Julian Seward
e22276cef0 Tidying up of branch-predict hint macros LIKELY/UNLIKELY. Fixes
#271504.  (Florian Krohm, britzel@acm.org)



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11736
2011-05-09 21:54:44 +00:00
Julian Seward
b113473e03 ppc{32,64}-linux: mark VG_MINIMAL_LONGJMP as noreturn, since it is,
and not doing so leads to compiler warnings for functions that tail
call this one, which themselves are marked "attribute noreturn".


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11732
2011-05-09 09:15:28 +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
Bart Van Assche
d077061870 Linux/syswrap: add support for USBDEVFS_RESET (patch contributed by Brad Hards <bradh@frogmouth.net>).
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11702
2011-04-18 10:37:56 +00:00
Julian Seward
e5a3e4f014 Add an alternative implementation of VG_MINIMAL_{SET,LONG}JMP
for ppc32-linux, that works for gcc >= 4.4.  Related to #259977.
(modified version of patch from Maynard Johnson <maynardj@us.ibm.com>)


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11689
2011-04-11 21:26:27 +00:00
Julian Seward
c2120cadde Add an alternative implementation of VG_MINIMAL_{SET,LONG}JMP
for ppc32-linux, that works for gcc >= 4.4.  Related to #259977.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11688
2011-04-11 18:36:34 +00:00
Julian Seward
b3827d6c33 Create new module m_libcsetjmp, which wraps up uses of
__builtin_setjmp and __builtin_longjmp so that they can be selectively
replaced, on a platform by platform basis.  Does not change any
functionality.  Related to #259977.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11687
2011-04-11 16:17:51 +00:00
Julian Seward
b8a03bdc8e Remove a bunch more warnings generated by gcc-4.6 about dead
assignments ("[-Wunused-but-set-variable]"), in the test suite.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11675
2011-03-28 21:19:00 +00:00
Bart Van Assche
9df672f236 Add VALGRIND_RESIZEINPLACE_BLOCK() and hence close #267819.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11666
2011-03-25 20:07:25 +00:00
Julian Seward
a17e55e5c2 Definitions relating to ptrace: replace bogus x86 versions with
arm specific versions.  Partial fix for #269079.
(Ulrich Weigand, uweigand@de.ibm.com)


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11663
2011-03-24 11:33:00 +00:00
Julian Seward
6107fd666c Add a port to IBM z/Architecture (s390x) running Linux -- Valgrind
side components. (Florian Krohm <britzel@acm.org> and Christian
Borntraeger <borntraeger@de.ibm.com>).  Fixes #243404.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11604
2011-03-07 16:05:35 +00:00
Bart Van Assche
c03eab7793 <valgrind/valgrind.h>: Made VALGRIND_PRINTF() and VALGRIND_PRINTF_BACKTRACE() definitions (with NVALGRIND defined) C89-compliant.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11580
2011-03-04 16:55:56 +00:00
Julian Seward
62134f346f Back out r11568 (Add a new constructor for empty XArrays,
VG_(newSizedXA)) since r11571 removes the only use of the
functionality that r11568 introduces.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11573
2011-02-27 23:53:32 +00:00
Julian Seward
0c2371837b Add a new constructor for empty XArrays, VG_(newSizedXA). This is
identical to VG_(newXA) but allows passing in a size hint.  In the
case where the likely final size of the XArray is known at creation
time, this allows avoiding the repeated (implicit) resizing and
copying of the array as elements are added, which can save a vast
amount of dynamic memory allocation turnover.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11568
2011-02-23 13:22:24 +00:00
Julian Seward
c797ab7f0c Preserve the stack's 16-alignment in x86 and amd64 wrappers.
Fixes #254646.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11461
2010-10-20 15:58:09 +00:00
Julian Seward
dfb2ce8d2e Define VG_CLREQ_SZB correctly on ARM, so Cachegrind and Callgrind
don't assert in their regtests on ARM.  (Value is the same in both
ARM and Thumb mode, fortunately.)


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11432
2010-10-12 10:13:17 +00:00
Julian Seward
1a7379bf89 Enable support for sys_ppoll on arm-linux (Rodrigo Belem, rodrigo.belem@openbossa.org).
See #253636.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11428
2010-10-11 19:09:53 +00:00
Julian Seward
a1ae66b03f More unwind fixes for the amd64-linux CALL_FN_*_* macros, as per
bug 243270 comments 47 and 48:
* use __builtin_dwarf_cfa(), not __builtin_frame_address(0), to get the CFA
* use correct register specifier in VALGRIND_CFI_PROLOGUE


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11416
2010-10-08 17:43:26 +00:00
Bart Van Assche
b8cadb97c9 Only enable CFI annotations when __GCC_HAVE_DWARF2_CFI_ASM is defined. This should work for all platforms, all gcc versions and with and without -fno-dwarf2-cfi-asm / -fno-asynchronous-unwind-tables. Thanks to Jakub Jelinek for the hint.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11415
2010-10-08 15:54:57 +00:00
Bart Van Assche
c72e780776 valgrind.h is again independent of config.h. Note: __builtin_frame_address()
is available since at least gcc 2.95.3.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11414
2010-10-08 06:58:25 +00:00
Julian Seward
321e034815 Fix build failure I introduced in r11408, duh.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11410
2010-10-07 10:46:15 +00:00
Julian Seward
5ecb22a89e Tidy up ifdeffery a bit. (non-functional change)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11408
2010-10-07 10:00:56 +00:00
Julian Seward
db5247b157 Fix build breakage on Darwin resulting from r11402 (see #243270),
by disabling creation of .cfi directives on Darwin, until such time
as someone can figure out how to do this.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11407
2010-10-07 10:00:04 +00:00
Julian Seward
78699f56cb Define VKI_SHMLBA on Darwin, so as to un-break build breakage caused by
r11399.  See #222545.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11405
2010-10-07 09:53:02 +00:00