Julian Seward [Sun, 2 Aug 2009 12:21:31 +0000 (12:21 +0000)]
Reinstating a heavily modified version of r10402. This is to do
with #190429.
This patch (originally from Jakub Jelinek) makes the redir of strlen
in ld.so on amd64-linux ld.so mandatory, but only for glibc 2.10 and
above. For glibc-2.2 (our earliest supported version) to glibc-2.9
it is still optional.
Also, makes more verbose, the message that is printed if a mandatory
ld.so redirection on Linux cannot be set up.
Bart Van Assche [Sun, 2 Aug 2009 07:46:43 +0000 (07:46 +0000)]
Cleaned up DRD's Linux suppression patterns:
- Grouped the three suppression patterns for ld into a single suppression
pattern.
- Assigned more descriptive names to the suppression patterns.
- Improved suppression pattern documentation.
- Removed suppression patterns that were added before VEX supported atomic
instructions and that are no longer necessary with the current version
of VEX.
Added an output variant for the pth_cancel_locked regression test.
Apparently when canceling a thread waiting inside pthread_cond_wait()
on Linux the specified mutex is left unlocked while on Darwin the
mutex specified in the pthread_cond_wait() call is reacquired before
the thread is terminated.
Implemented a more systematic approach for intercepting POSIX threads
functions: for each function name to intercept, intercept the function
name itself, the function name with @* appended (versioned symbols on
Linux) and the function name with $* appended (versioned symbols on
Darwin). Updated filter_stderr such that symbol versions are removed.
Updated the expected output files that contain names of intercepted
functions.
* VG_(find_seginfo): incrementally rearrange the DebugInfo list, like
most of the other list-searching functions do.
* rename all VG_(*seginfo*) functions exported from m_debuginfo to
VG_(*DebugInfo*). "seginfo" was a historical name which was mostly
but not completely, done away with some time back.
Don't instrument any code in ld.so. Doing so merely generates a large
number of races which have to be expensively suppressed, so it's
better not to do so.
Only consider two error contexts as equivalent if the contexts have another
type than "data race error" or if both data race error contexts refer to the
same access type and the same access size.
We currently use a mix of <option> and <computeroutput> tags for command
line options. This commit changes them to all <option>.
Also make consistent how options with multiple names (eg. -h --help) are
shown.
Also, remove section describing --help and --version in Callgrind's chapter;
these aren't necessary and are presumably a hangover from when Callgrind was
a separate tool.
Tom Hughes [Wed, 29 Jul 2009 11:09:01 +0000 (11:09 +0000)]
Improve futex system call support. Patch from BZ#201757 which I have
attempted to cross check against current kernel code. Reading the
futex system call code mostly just made my head hurt however...
Don't include "how to write a tool" in the user manual -- it's in the tech
docs, and the chapter/section numbering doesn't match the rest of the
numbering in the user manual.
Also change some of the names of the links in that file to match the
filename.
Started overhauling the documentation:
- There were detailed descriptions of all the tools in the Quick Start
Guide, the Manual introduction, and the start of each tool chapter. To
avoid duplication/overlap, I removed these altogether from the Quick Start
Guide, and shortened them in the intro.
- Improved the description of what errors Memcheck can find.
- Made all tool chapters start with "Overview" section, for consistency.
- Made the "run with --tool=XXX" bit consistent in each tool chapter.
- Made all tool chapter titles match the description given when running them.
- Added BBV to the User Manual intro.
- Generally clarified, updated, and future-proofed various bits of text in
the Quick Start Guide and User Manual introduction.
Also:
- Changed Nulgrind's start-up description to "the minimal Valgrind tool".
Improve checking for pthread_mutex_cond operations: implement a check
for consistent binding between the CV and the mutex, as specified by
POSIX. Add commented out code for some other checks that could be
done but aren't, as they'd give false positives.
Tom Hughes [Mon, 27 Jul 2009 23:09:42 +0000 (23:09 +0000)]
Make sure the x86 direction flag is cleared again if we set it as part
of a test, as the x86 requires it to be clear when any function is called
and gcc 4.3.0 and later rely on that. Fixes #201708.
Implemented type checking for reader-writer synchronization
objects: complain upon attempts to use a POSIX rwlock where a
user-defined rwlock is expected and vice versa.
- Moved printing the thread number to the function that prints the
preamble.
- Matching suppression types with error contexts does now work properly.
- Cleanup: added more comments, renamed some functions, removed an unused
function argument.
Made the error reporting behavior of DRD similar to that of other
Valgrind tools: if the same kind of error has been detected a second
time with an identical call stack, count it as an error but do not print
it a second time. The total number of detected errors remains unchanged
but the number of error contexts is now reported correctly.
Fixed a bug in the code for reading suppression files: the line numbers
reported in error messages were not correct. As an example, the following
output was produced before this patch (not correct):
$ ./vg-in-place --tool=helgrind --num-callers=1 /bin/true
...
FATAL: in suppressions file ".in_place/default.supp" near line 893:
suppression must contain at least one location line which is not "..."
exiting now.
$ ./vg-in-place --tool=drd --num-callers=1 /bin/true
FATAL: in suppressions file ".in_place/default.supp" near line 475:
suppression must contain at least one location line which is not "..."
exiting now.
After having applied this patch the above commands display line numbers
1104 and 619, referring to the first suppression pattern containing
three dots for the topmost stack frame, as expected.
Add a new output file for tc12_rwl_trivial. It unfortunately can't be
the same as the glibc one, because glibc is broken in the sense that
it doesn't return an error code for an attempt to unlock a not-locked
rwlock, and the returned error code affects Helgrind's output.
Re-check the symbol names for all pthread intercepts, to find all Linux
and Darwin versions. Add versions for Darwin names that are not so far
supported. Add support for sem_open and sem_close.
- Changed the names of several existing suppression patterns.
- Replaced the three suppression patterns for objc_msgSend by one.
- Added more suppression patterns, a.o. for the string manipulation
and text encoding functions in WebCore.
Updated drd/tests/omp_printf:
- Added command-line options -i and -t to the omp_printf test program.
- Modified the OpenMP directive such that this test program no longer
triggers a data race on the loop variable 'i'.
- Increased number of iterations and number of threads used during the
test.
- Changed error filtering from filter_error_summary to filter_stderr.
Fixed bug in DRD's rwlock implementation that caused the regression test called rwlock_test to fail sometimes on Darwin. The fact that this test only failed on Darwin and not on Linux implies that on Linux after unlocking an rwlock that was locked for writing there always happens a context switch to another thread waiting for acquiring the rwlock, and that this is not the case on Darwin.
Add a note about our suspect handling of brk(). And disable the brk() part
of origin1-yes.c, because it's a pain, giving different results on different
systems. This allowed origin1-yes.stderr.exp-darwin to be removed.