Change 'nightly' to print "(unchanged)" at the start of the email subject
line if the results are unchanged from 24 hours ago. Makes it easier to see
(or filter) if results are unchanged.
Some tweaks to make more tests pass, or get closer to passing, on
--enable-only32bit builds on my Ubuntu box:
- For all tests, replace all operator new/new[]/delete/delete[] variants
with a common form, eg. "...operator new...". This makes
exp-ptrcheck/tests/ccc and memcheck/tests/mismatches pass.
- For Helgrind tests, replace all libpthread paths with "/...libpthread...",
as is done for libc paths. This avoids problems when /lib32/libpthread.so
is the path. No extra tests pass, but many of them get a lot closer to
passing.
This commit completely overhauls the leak checker. In particular:
- It heavily refactors the code: uses better names for things, splits up
complex functions that behaved very differently depending on how they were
called, removes some redundancies, and generally makes it much simpler and
easier to follow.
- It adds lots of comments, both inline, and also a big explanatory one at
the top which makes it clear exactly how the leak checker works and also
exactly what is meant by definite, possible, and indirect leaks. It also
has some ideas for future improvements.
- All tabs have been converted to spaces.
It also improves the functionality:
- Previously if you did --leak-check=summary, indirect and suppressed
blocks were counted as definite leaks. Now they are done properly, and so
the summary results from --leak-check=summary match those from
--leak-check=yes.
- Previously, some possibly reachable blocks were miscategorised as
definitely reachable, because only the pointer to the block itself was
considered, not any preceding pointers in the chain. This is now fixed.
- Added memcheck/tests/leak-cases, which fully tests all the possible
combinations of directly/indirectly reachable and possibly/definitely
reachable.
And it improves the manual quite a bit, and the FAQ a little bit.
This doesn't fix the leak checker to handle MALLOCLIKE_BLOCK works that have
been taken from within malloc'd blocks, but I think I know how to do it and
hope to do so in a subsequent commit.
It also changes all instances of "<constant>memcheck</constant>" in the
Memcheck manual to "Memcheck", for consistency and because "Memcheck" is
easier to write. There's one similar case for DRD but I didn't change that.
Tom Hughes [Mon, 9 Mar 2009 09:19:03 +0000 (09:19 +0000)]
Keep track of the svma and bias values for the debug data separately
as they may be different to those for other sections of the ELF file
if we have separated debug information and the main file has been
prelinked since they were split. Fixes bug #185816.
tests/arch_test is currently being used for two purposes:
- by vg_regtest for determining if a directory name matches an architecture;
- by various .vgtest files for detecting x86/AMD64 features.
This commit splits it in two for the two different purposes, which makes
things clearer.
Specific changes
- Moved the x86/AMD64 feature detection stuff out of arch_test.c, and
into the new x86_amd64_feature.c. Updated the relevant .vgtest files for
the change.
- In vg_regtest, now a prereq command must return 0 (prereq satisfied) or 1
(prereq not satisfied). Anything else makes vg_regtest abort. This
makes obvious any problems with prereq tests rather than just making the
tests skip innocuously. (We previously had exactly such a problem on the
DARWIN branch; the x86 feature detection tests caused segfaults so the
tests were incorrectly skipped. This change will catch any similar future
problem.)
- Changed os_test from a script to a C program, matching cpu_test.
- Removed some unintentional darwin stuff from platform_test.
Delete memcheck/tests/zeropage. The original purpose of the test is no
longer valid, as the comment indicates. Furthermore it mmaps arbitrary bits
of address space and so is horribly unportable, and doesn't work on Darwin.
atoll() is a terrible function -- you can't do any error checking with it.
Some of our option processing code uses it. This means that eg.
'--log-fd=9xxx' logs to fd 9, and '--log-fd=blahblahblah' logs to 0 (because
atoll() returns 0 if the string doesn't contain a number!)
It turns out that most of our option processing uses VG_(strtoll*) instead
of VG_(atoll). The reason that not all of it does is that the
option-processing macros are underpowered -- they currently work well if you
just want to assign the value to a variable, eg:
So this commit:
- Improves the *_CLO_* macros so that they can be used in all circumstances.
They're now just expressions (albeit ones with side-effects, setting the
named variable appropriately). Thus they can be used as if-conditions,
and any post-checking or processing can occur in the then-statement. And
malformed numeric arguments (eg. --log-fd=foo) aren't accepted. This also
means you don't have to specify the lengths of any option strings anywhere
(eg. the 9 in the --log-fd example above). The use of a wrong number
caused at least one bug, in Massif.
- Updates all places where the macros were used.
- Updates Helgrind to use the *_CLO_* macros (it didn't use them).
- Updates Callgrind to use the *_CLO_* macros (it didn't use them), except
for the more esoteric option names (those with numbers in the option
name). This allowed getUInt() and getUWord() to be removed.
- Improves the cache option parsing in Cachegrind and Callgrind -- now uses
VG_(strtoll10)(), detects overflow, and is shorter.
- Uses INT instead of NUM in the macro names, to distinguish better vs. the
DBL macro.
- Removes VG_(atoll*) and the few remaining uses -- they're wretched
functions and VG_(strtoll*) should be used instead.
- Adds the VG_STREQN macro.
- Changes VG_BINT_CLO and VG_BHEX_CLO to abort if the given value is outside
the range -- the current silent truncation is likely to cause confusion as
much as anything.
Test files were being passed multiple arch options (eg. "-m32 -m64") when
built. This worked fine on the x86/Linux and AMD64/Linux but broke
ppc*/Linux. This commit fixes the problem. Thanks to Bart for spotting it.
Bart Van Assche [Sat, 21 Feb 2009 16:17:50 +0000 (16:17 +0000)]
- Bug fix: swapped order of VG_(OSetGen_Remove)() and
(*p->any.cleanup)(p) such that the "first observed at" information is
now included in error messages.
- Performance optimization: started using VG_(OSetGen_ResetIterAt)().
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!