* 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
* 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
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
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
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
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
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
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
on bug #256600 because the original version turned out to somewhat
fragile across different glibc versions.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11479
hyper-optimised versions which defeat valgrind in recent versions
of glibc.
Fixes#256600 based on patch from Dmitry Djachenko.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11478
word copies whenever possible. This drastically reduces the number of
memory references Memcheck has to process and speeds up a test program
that does repeated memcpys of large blocks by a factor of 4 or more.
Also add a vectorised version of memset.
The memcpy version is also constructed with a view to be used in
exp-ptrcheck, so it can copy areas of memory without losing
pointer-identity shadow data, as happens when doing all copies at a
byte granularity.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11288
glibc-2.11 when running on SSE4-enabled (virtual) CPUs, for the usual
reason: to avoid ultra-optimised routines using the SSE 4.2 PCMPxSTRx
instructions. I would not be surprised if it turned out that strspn
was required, but I haven't seen a need for it so far.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11268
type STT_GNU_IFUNC which, instead of pointing directly at the
function, point at a routine which will return the address of
the real function. Redirection of indirect functions is handled
by valgrind as follows:
- When a redirection specification matches an indirect
function symbol an active redirection is added in the
normal way, but with the isIFunc flag set.
- When a call is made to an address which matches an
active redirection with the isIFunc flag set the call
is redirected, but not to the target address of the
redirection - instead it is sent to a small wrapper
routine that is preloaded into the client.
- The wrapper routine calls the original client routine
and collects the result, which it reports to valgrind
using a client request, and then returns the result to
the caller.
- When valgrind gets the client request it looks up the
active redirection for the indirect function and then
adds a new active redirection which redirects from the
address returned by the indirection function to the
redirection target. This new redirection does not have
the isIFunc flag set so behaves as a normal redirection.
In addition to the above we also add a few new redirections to
memcheck to capture internal calls made by glibc to things like
strlen, as these internal calls do not go through the indirect
function and instead go direct to the chosen implementation.
Based on a patch from Dodji Seketeli and comments from Jakub
Jelinek, this commit closes bug 206013.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10920
VALGRIND_{PRINTF,PRINTF_BACKTRACE,INTERNAL_PRINTF} were no longer appending
newlines. This meant that --trace-malloc=yes spewed everything onto a
single line, among other things.
Rather than adding the newline back in, I chose to offically change their
behaviour to not add the newlines, as this is more flexible (and the reason
for the underlying VG_(message) change). I updated all the relevant places
I could find.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10694
I tried using 'svn merge' to do the merge but it did a terrible job and
there were bazillions of conflicts. So instead I just took the diff between
the branch and trunk at r10155, applied the diff to the trunk, 'svn add'ed
the added files (no files needed to be 'svn remove'd) and committed.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10156
* add a few more syscall wrappers, and fix a couple of buggy ones
* intercept strcmp et al in a few more libraries
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7249
* Don't intercept putenv/getenv/setenv. Causes a lot of whinging
about missing TOC pointers.
* Add 'strcmp' to the bundle of 4 functions intercepted in all
objects.
* xlc now seems to route calls through to malloc_common, free_common,
calloc_common, realloc_common, memalign_common in libc. Intercept
those names too.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7241
strings in 16-bit chunks, which can cause false errors in some cases
(sigh). So do the usual thing and replace it.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6640
reasons: it reads word-sized chunks from memory and so produces lots
of errors in SuSE 10.2 (amd64).
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6462
different error kinds were reusing the same struct for storing their
details. Each one used some but not all the fields, and the AddrInfo was
similar, and it was very confusing.
So I changed MC_Error and AddrInfo to be tagged unions, like Vex's IRExpr and
IRStmt types. The resulting code is a little more verbose but much easier
to understand. I also split up several error kinds, which also made things
simpler. The user-visible behaviour is identical except for a couple of
very minor things that I've documented in the NEWS file for the 3.3.0
release.
Ideally I'd get rid of the Addr and Char* fields in the core Error type,
which are not always used, and do them similarly within tools. But that
would require changing the core/tool interface, so I'm leaving it for the
moment.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6402