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.
* rename many functions to do with shadow memory handling, to
more clearly differentiate reads and writes directly of the
shadow state from client reads and writes, each of which
generate both a read and a write of the client state. It was
getting confusing (== hard to verify) in there.
* use idempotency of memory state machine transition rules to
speed up long sequential sections, speedups in range 0% to 28%
* remove 4-way Pord (EQ, LT, GT, UN) and associated machinery,
and replace it with something that merely computes LEQ in the
partial ordering, since that's all that is necessary, and
this simplifies some fast-case paths.
* add optional approx history mechanism a la DRD (start/end stack
of conflicting segment), much faster if you don't need exact
conflicting-access details
* libhb_so_recv: tick the VTS in the receiving thread; don't just
join with the VC in the SO. It's probably correct without this
modification, but that correctness is fragile and depends on
complex properties of how SOs are used/created. Much better to
be completely safe. (Needs cache-isation).
* get rid of unnecessary shadow memory state "SVal_NOACCESS"
and simplify associated fast-case paths in msmc{read,write}
Replaced code for suppressing the stack memory in use at the time a
thread is being created by code for suppressing the memory allocated
from inside the pthread_create() call. The new implementation should be
a more portable solution for suppressing data races triggered by the
thread-local-storage implementation of a Pthreads library.
* lookupXA_UNSAFE -- binary search in array without being forced
to sortXA it first -- dangerous because if the array isn't in order
then the lookup can loop forever
* dropHeadXA -- drop the first N elements (kinda like dropTailXA, but
unfortunately O(N) not O(1)), so that xarrays can be used to
implement FIFOs, after a fashion.
A fix for bug 186796: suppression symbol names were being truncated if they
were longer than 200 chars. Now dynamic memory is used and so they can be
arbitrarily long in theory, although in practice it bombs out at 100,000 for
sanity purposes. This required adjusting the core/tool interface for
read_extra_suppression_info().
mremap2 is a totally unreliable test; it's the only test that fails on a
number of Linux machines. This change makes it more reliable, at the cost
of being less specific.
In r10465 --time-stamp=yes got slightly broken -- the space between the time
and the PID was removed. This commit adds it back in. It also adds a basic
test that would have detected this regression, and also the breakage in bug
200990.
The pc-file output from the exp-bbv tool is mildly implementation dependent.
This causes the regression test to fail with the "million" benchmark
on a Fedora 9 system. For now, remove the pc-file part of the test,
and later I'll come up with a better way of testing this feature.
Reverted r10523 and r10540: since sem_init() is not yet supported on Darwin, revert the attempts to compensate for the different return values on Darwin.