Bart Van Assche [Sat, 21 Feb 2009 15:27:04 +0000 (15:27 +0000)]
Changes:
- pthread_barrier_wait() intercept now passes the information to the DRD
tool whether or not this function returned
PTHREAD_BARRIER_SERIAL_THREAD. This information is now displayed when
the command-line option --trace-barrier=yes has been specified.
- Changed the cleanup functions for client objects that are called just
before a thread stops into callback functions.
- Added DRD_(clientobj_delete_thread)().
- Removed DRD_(clientobj_resetiter)(void) and DRD_(clientobj_next)().
- Added test for race conditions between pthread_barrier_wait() and
pthread_barrier_destroy() calls. An error message is now printed if
this condition has been detected.
- Bug fix: pthread_barrier_delete() calls on barriers being waited upon
are now reported.
- Removed DRD_() wrapper from around the name of some static variables and
functions.
- Add 'unit_libcbase', the beginnings of a unit test module for m_libcbase.
- Rename 'oset_test' as 'unit_oset' to make its meaning more clear.
- Remove VG_(atoll36), VG_(strtoll8)() and VG_(strtoll36)(); they're not
used and so untested, but easy to crib from similar functions if they need
to be added again later.
Various build system clean-ups and simplifications:
- Created Makefile.tool-tests.am, put standard AM_CFLAGS et al for tests in
it.
- A number of tests are shared between Helgrind and DRD. They used to be
built in both directories. Now they are only built in helgrind/tests/,
and the DRD .vgtest files just point to the executable in helgrind/tests/.
Most of these (about 30) had the source files in helgrind/tests/; I moved
the three that were in drd/tests/ into helgrind/tests/ for consistency.
- Fixed rwlock_test, which was failing to run due to a wrong name in the
.vgtest file.
- Removed remnants of unused 'hello' test for Memcheck.
- Avoided redundant flag specification in various places, esp.
memcheck/tests/Makefile.am.
- Removed unnecessary _AIX guards in some Linux-only tests.
For the fdleak_* tests, completely remove the stack traces showing where
file descriptors came into existence, because there's too much variation and
all the expected outputs are a pain. This allows 16 fdleak_*.exp[234] files
to be removed.
Also remove an unnecessary newline in a tmp filename in fdleak_creat.c.
In the core, include malloc_usable_size() as one of the functions that must
be replaced if malloc() et al are replaced by a tool. This is because
different tools implement the function in different ways.
Add an appropriate malloc_usable_size() replacement to each of Memcheck,
Helgrind, DRD, Ptrcheck, Massif.
Update memcheck/tests/malloc_usable and add massif/tests/malloc_usable.
Bart Van Assche [Mon, 16 Feb 2009 19:42:17 +0000 (19:42 +0000)]
Just as for the regression tests of other Valgrind tools, do not explicitly state that these are licensed under the GPLv2 license but leave this implicit.
Stack traces for Memcheck's syscall param errors are terribly unreliable, so
I changed it to just filter the entire stack trace out for these errors (both
normal and XML cases). The syscall name is still present in the error
string. This allows a one or more alternative expected output files to be
removed for several tests, which is A Very Good Thing.
Also, I killed filter_test_paths because it was weird and clumsy and the
above change obviated most of its use and the remaining effects could be
achieved in other ways.
Also, I fixed up the scalar* tests a little and they now pass on my machine,
(and hopefully at least some other machines) for the first time ever!
Bart Van Assche [Sun, 15 Feb 2009 10:40:44 +0000 (10:40 +0000)]
Restored the previous method for passing arguments from the creator thread to the created thread, since the new approach made some regression tests fail. It is not yet clear to me why.
Bart Van Assche [Sat, 14 Feb 2009 15:13:31 +0000 (15:13 +0000)]
- Moved several functions and variables from one source file to another.
- Created two new source files: drd_load_store.h and .c.
- Removed the header file drd_track.h.
Bart Van Assche [Sat, 14 Feb 2009 12:12:57 +0000 (12:12 +0000)]
- Performance improvement: eliminated busy waiting from thread creation.
- Applied DRD_() prefix to all names of functions that are not
intercepts of client code.
- Removed superfluous include directive, namely #include <inttypes.h>.
- Removed hack for suppressing false positive reports on stdio / stderr
because recently a suppression pattern was added for these races.
- Removed unused code and declarations.
- Added more comments.
- Updated copyright statement.
Filter out everything after "(below main)" in a line. This will help with
Darwin, for which such entries can occur within the executable, rather than
within libc.
Changed the way files are installed. Instead of going into
$INSTALL/<platform>/<filename>, they go to $INSTALL/<filename>-<platform>.
These filenames match those built in the build tree, and so simplifies the
build system signficantly and avoids the horrible sed renamings that were
previously required. This will also help greatly with the treatment of
.dSYM debug directories in the DARWIN branch.
Files affected include:
- preload libraries such as vgpreload_core-<platform>.so and
libmpiwrap-<platform>.so
- libraries such as libcoregrind_<platform>.a
- executables such as memcheck-<platform>
I updated the manual and added a note to the NEWS file about the change,
because it will affect a small number of users.
I did my best to update the AIX launcher/initimg correctly, but it hasn't
been tested.
Cleaned up the mess that was the treatment of "below main" functions such as
'__libc_start_main', in Massif, m_debuginfo and m_stacktrace. As part of
this, --show-below-main is now visible to tools, and Massif pays attention
to it.
Improved the description of --show-below-main=yes in the manual.
Replaced some instances of "__libc_start_main" in the test *.exp files with
"(below main)", which is what will actually be seen. Also updated
scalar.stderr.exp*, which should make it get closer to actually passing.
Fix a minor defect: only the first 14 chars of the 18 chars in the
--massif-out-file= option was being checked, which meant that if you did
--massif-out-filename=foo by mistake it would accept it and produce a file
called "ame=foo".
Bart Van Assche [Thu, 29 Jan 2009 09:57:22 +0000 (09:57 +0000)]
Suppress any error whose top frame is in libc.so. While not very elegant, this is an effective way to suppress data race reports triggered by glibc's stdio functions (which uses inlined locking functions).
Rechecking the diff of r9080 on the mailing list, I thought
I forgot to replace "|" with "+" in one spot. But that was part
of not-used code, so it actually does not matter.
So better get rid of this code part at all (no need to backport ;-).
Cachegrind/Callgrind: allow for cache sizes other than only powers of two
The number of sets, ie. number of cache lines divided by associativity,
and the cache line size still have to be powers of two.
This change is needed for default cache parameters used on some Intel
Core 2 and Atom processors.
Includes cachegrind manual update and explicit tests with 24KB D1/3MB L2
Reverts addition of 6MB warning to {cachegrind,callgrind}/tests/filter_stderr
Julian Seward [Mon, 26 Jan 2009 00:06:43 +0000 (00:06 +0000)]
Intercept and replace calls to calls to strnlen in glibc, for the
usual reasons. Also update an expected output (lines numbers in
h_intercepts.c should be removed by the regtest system, really).
Julian Seward [Sun, 25 Jan 2009 23:59:24 +0000 (23:59 +0000)]
Prior to this commit, exp-ptrcheck would assert if the DWARF3 data for
global or stack blocks described overlapping blocks (which are
nonsensical). Unfortunately it is naive to assume compilers will
always produce correct debug info. This commit makes exp-ptrcheck
much more robust against such (inevitable) anomalies: stack and global
blocks which overlap are simply ignored.
Julian Seward [Sun, 25 Jan 2009 23:50:32 +0000 (23:50 +0000)]
Handle a couple of artefacts produced by icc11: DW_TAG_reference_type
that doesn't have a size, and DW_FORM_ref_addr (assuming my
interpretation of the standard is correct.)
Julian Seward [Sat, 24 Jan 2009 00:07:53 +0000 (00:07 +0000)]
VG_(apply_StackTrace): following r8818, we should regard an entry of -1
as denoting the logical end of the stack. This change stops printing
of a lot of junk below the logical "-1" end mark. See added comments
for details.
Julian Seward [Sat, 24 Jan 2009 00:04:28 +0000 (00:04 +0000)]
Handle the case where a Compilation Unit (CU) (or, really, the CU and
its associated DIEs) occupies less space than stated in the CU's
header. icc9 appears to produce CUs with this anomaly. Not handling
the case causes the reader to lose sync at the start of the following
CU, since it hasn't skipped the junk bytes at the end of the current
CU, and it is basically hosed after that.
MERGE TO 3_4_BRANCH (?)
Move memcheck/tests/brk to the linux/ subdir, as it's Linux-specific (merged
from the DARWIN branch). Also filter the output more so the .stderr.exp2
isn't needed.