8816 Commits

Author SHA1 Message Date
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
ccaa4e370a Un-break Darwin build following r12041 (creation of struct _DebugInfoFSM)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12042
2011-09-20 22:36:26 +00:00
Julian Seward
042bb40c53 A refactoring change; no functional effect. struct _DebugInfo
contains a bunch of fields which are used as a very simple state
machine that observes mmap calls and decides when to read debuginfo
for the associated file.  This change moves these fields into their
own structure, struct _DebugInfoFSM, for cleanness, so as to make it
clear they have a common purpose.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12041
2011-09-20 21:59:50 +00:00
Julian Seward
2b97c829a0 Get rid of DebugInfo::memname, a hangover from the now-removed
AIX5 support.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12040
2011-09-20 16:10:59 +00:00
Florian Krohm
f9794ba92c Disable sending diffs for the z900 build for now.
They are too big to be posted to the mailing list without
moderator interaction.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12039
2011-09-19 02:33:35 +00:00
Florian Krohm
88a761ec9e Fix tc23_bogus_condwait.c testcase for s390x.
The testcase used to cause a SIGILL because the address of the bogus
mutex  1 + (char*)&mx[0]  denotes a memory location that will eventually
appear in a compare-and-swap instruction. That insn does not allow
memory operands that are not word-aligned. Hence, the SIGILL.
With this fix both incarnations of this testcase (in helgrind and drd)
pass.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12038
2011-09-18 00:11:12 +00:00
Florian Krohm
ed330ac726 Tweak s390x dispatcher. Using CG elminates two load insns.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12037
2011-09-17 22:18:01 +00:00
Florian Krohm
b1d64f9231 Dispatcher tweak. Saves ALU operation. Suggested by Julian Seward.
Implemented by Christian Borntraeger (borntraeger@de.ibm.com).
See bugzilla #274378


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12036
2011-09-17 15:46:59 +00:00
Bart Van Assche
83f6f0137f Make drd/drd_pthread_intercepts.c compile again on Linux systems without usable <linux/futex.h> header
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12035
2011-09-17 06:24:49 +00:00
Florian Krohm
1423416745 Add exp files for s390x. GCC's use of the MVC insn causes
duplicate errors and a different memory access pattern.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12034
2011-09-13 16:00:38 +00:00
Florian Krohm
58034de488 Fix the system call wrapper for the clone system call (s390x).
Fixes #281883. Patch by Christian Borntraeger (borntraeger@de.ibm.com).


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12033
2011-09-13 14:57:35 +00:00
Florian Krohm
e08c32e031 Add an .exp for s390x. Certain older kernels had a bug in providing
an invalid siginfo for SIGBUS. Hunted down and fixed by
Christian Borntraeger (borntraeger@de.ibm.com).


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12032
2011-09-12 20:22:38 +00:00
Florian Krohm
68ca6b20d4 This testcase is sensitive to some sleep period. On slower
machines we need to sleep longer. See bugzilla #268623 comment #2.
So let's sleep 500ms instead of 100ms, get rid of the load
barrier and enable the testcase for s390x again.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12031
2011-09-11 14:39:02 +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
12e47488ed Add config files for z900 nightly build
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12028
2011-09-10 18:59:10 +00:00
Florian Krohm
858ecdec54 Sensitivity fix. On slow machines (s390x z900) need to sleep longer.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12027
2011-09-10 18:28:57 +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
8d2974f5e5 Update build instructions.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12025
2011-09-10 11:28:51 +00:00
Julian Seward
7368cfb7d3 ML_(read_elf_debug_info): debug printing of program header entries: print file
offsets consistently in base 10, not 16.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12024
2011-09-10 11:21:59 +00:00
Julian Seward
fbfe39c975 ML_(read_elf_debug_info): if we exit from this routine via the BAD
macro, set di->soname back to NULL, so that if we later reenter with
the same 'di', we don't fall over the initial di->soname == NULL
assertion.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12023
2011-09-10 11:20:26 +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
Julian Seward
0f9ced90ec Properly preserve FP registers (and, more generally, the entire guest
state) across signal deliveries.  Fixes #281488.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12021
2011-09-10 09:10:03 +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
Florian Krohm
363df00d4b Disable testcase on s390x. Still hangs occasionally.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12019
2011-09-09 20:58:13 +00:00
Florian Krohm
83114a1eb5 Fix testcase for s390x. Provide implementation of XCHG_M_R.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12018
2011-09-09 18:37:55 +00:00
Florian Krohm
ef1b04d947 Add a prerequisite because drd/tests/annotate_smart_pointer is not always
built.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12017
2011-09-09 15:50:45 +00:00
Florian Krohm
3453b6f4f4 Add config files for nightly s390 builds.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12016
2011-09-09 02:56:00 +00:00
Florian Krohm
5c99f0796b Support CLCL and MVCL instructions. This is the non-VEX part.
Fixes #279027.  See VEX r2200.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12015
2011-09-08 15:39:10 +00:00
Josef Weidendorfer
5c36030d9f Make some vgdb interface to callgrind_control internal
The vgdb "status" monitor command is still available, but
used for pretty printing of status information now (acutally,
just some place holder for real information up to now: just
number of running threads). The internal interface used by
callgrind_control to provide stack traces and event counts
is using "status internal", and is not documented, as the
format is not for human consumption.

This also adds some documentation.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12014
2011-09-06 19:08:35 +00:00
Josef Weidendorfer
7617408d27 Allow overriding not-supported auto-detected cache configs
Patch by Philippe Waroquiers, slightly changed.

This actually was a regression from 3.6.1, but the patch
also improves on printed messages, and refactors common
code between cachegrind and callgrind.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12013
2011-09-06 19:08:31 +00:00
Florian Krohm
7bd8240fd3 Change get_svn_revision to also work with older subversion releases
that do not allow specifying a revision with svn info.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12012
2011-09-06 17:17:41 +00:00
Julian Seward
22e6a57bac Print the (pseudo-)soname when doing debug printing for Mach-O
debuginfo reading.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12011
2011-09-06 11:26:31 +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
Florian Krohm
05ee2cb5c9 Avoid hanging on older s390x systems.
See also bugzilla #268623 comment 3.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12008
2011-09-05 15:32:39 +00:00
Julian Seward
f297abe29d Add support for IBM Power ISA 2.06 -- stage 3 -- Test cases.
Bug 279994 comment 2).
(Maynard Johnson, maynardj@us.ibm.com)


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12007
2011-09-05 12:15:16 +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
Florian Krohm
e70a5000eb Add support for s390x model z114. See also VEX r2198
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12005
2011-09-02 22:20:41 +00:00
Bart Van Assche
0213090306 drd: Yet another regression test reliability improvement.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12004
2011-08-30 15:09:37 +00:00
Bart Van Assche
5547d1545e drd: Avoid reporting false positive race reports inside pthread_join().
Note: I haven't analyzed yet since which commit these false positives
started to appear but it's most likely a commit applied after the 3.6
release.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12003
2011-08-24 15:02:21 +00:00
Dirk Mueller
2127da0770 fix the suppressions to also match libc-2.XX.y.so
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12002
2011-08-23 20:29:10 +00:00
Tom Hughes
5e5fe809d0 Make a copy of any environment string we are going to modify when
we are cleaning up the environment before an exec, otherwise we
will seg fault if the string is read only. Fixes #270326.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12001
2011-08-23 10:11:02 +00:00
Julian Seward
325dd5e5fe Fix link error for 32-bit build on OSX 10.7 (Lion). This is the
failure referred to in #275168 comment 0.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12000
2011-08-23 07:35:42 +00:00
Bart Van Assche
7f6fd2519e Remove the svn:executable property from a source file
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11999
2011-08-22 14:35:04 +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
Florian Krohm
0ef00056eb Add more info about cache sizes.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11996
2011-08-19 19:41:57 +00:00
Tom Hughes
d4552238d5 Make callgrind report the detected cache configuration as well.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11995
2011-08-19 09:05:13 +00:00
Tom Hughes
f1d216c8d7 Report the detected cache configuration with "-v -v" before we
validate it to make validation failures easier to diagnose.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11994
2011-08-19 09:01:22 +00:00