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).
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.
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.
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.
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 actually was a regression from 3.6.1, but the patch
also improves on printed messages, and refactors common
code between cachegrind and callgrind.
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.
Tom Hughes [Tue, 23 Aug 2011 10:11:02 +0000 (10:11 +0000)]
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.
Julian Seward [Sat, 20 Aug 2011 15:55:07 +0000 (15:55 +0000)]
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!)
Julian Seward [Thu, 18 Aug 2011 15:08:20 +0000 (15:08 +0000)]
Add a new simulation hint, --sim-hints=fuse-compatible, which causes
a bunch of file-related syscalls to be handled on the might-block
syscall path rather than the fast syscall path. This fixes deadlocks
when running some FUSE-specific filesystem codes. Fixes #278057.
(Mike Shal, marfey@gmail.com)
Julian Seward [Thu, 18 Aug 2011 13:09:55 +0000 (13:09 +0000)]
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.
Julian Seward [Wed, 17 Aug 2011 21:25:50 +0000 (21:25 +0000)]
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)
Julian Seward [Tue, 16 Aug 2011 21:45:28 +0000 (21:45 +0000)]
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 ?
Julian Seward [Tue, 16 Aug 2011 09:54:00 +0000 (09:54 +0000)]
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.)
Julian Seward [Mon, 15 Aug 2011 09:42:34 +0000 (09:42 +0000)]
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.
Florian Krohm [Fri, 12 Aug 2011 15:07:10 +0000 (15:07 +0000)]
Check return code of pthread_create and bail out if
the function failed. This helps on systems which don't
have lots of memory.
Suggested by Christian Borntraeger.
Florian Krohm [Thu, 11 Aug 2011 02:23:54 +0000 (02:23 +0000)]
Due to a kernel bug the siginfo struct was not filled in correctly.
The si_code was incorrect not matching any of the VKI_ILL_....
cases checked in m_signals.c function default_action.
So let's have two expected output files for buggy kernels and otherwise.
Also, add op00 to the list of files to be ignored.
Florian Krohm [Mon, 8 Aug 2011 23:47:23 +0000 (23:47 +0000)]
Followup to VEX r2189 -- handling invalid opcode 00 specially.
Update golden log for testcase op_exception which no longer
complains about invalid opcode 00.
Add testcase op00.c
Fix a Massif bug: when realloc'ing a block, any values in the part of the
block beyond the original request weren't copied. They are now. This is
important because a program could use malloc_usable_size to gain legitimate
access to those extra bytes.
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.
drd: Make racing pthread_barrier_wait() calls trigger an error message instead
of an assertion failure. Also, make barrier tracing output more detailed.
drd: Fix a race condition in the barrier implementation that could result in false positives.
What could occur before this fix is:
- The pthread_barrier() call in a first thread finishes.
- Another thread invokes pthread_join() on that thread, causing the information
associated with that thread to be removed from the barrier object.
- The pthread_barrier() call in another thread finishes. Because some
thread information has already been removed from the barrier object, the
per-thread vector clock "last" won't be computed correctly by
DRD_(barrier_post_wait)().
- Because of the above false positives could be reported.
This resulted in sporadic failure of the drd/tests/matinv regression test, and
should now be fixed.