Remove nanoleak.vgtest, it's a trivial test. nanoleak.c is used by
nanoleak_supp.vgtest, however, so rename it nanoleak_supp.c to make the
connection more obvious.
Made the Valgrind abort/crash message clearer about the fact that it can be
caused by heap corruption by the client. Also clarified the FAQ about this.
Also updated the FAQ about decoding failures a little.
Make sure that DRD does not complain about mutexes being held too long on systems where the clock can go backward. Apparently this happens frequently when Linux is running inside a virtual machine.
Bart Van Assche [Thu, 26 Mar 2009 19:07:15 +0000 (19:07 +0000)]
- Reindented code such that it uses three spaces for indentation instead
of two. The indentation of the DRD source code is now consistent with
the other Valgrind source files.
- Added emacs mode line with indentation settings.
Tom Hughes [Fri, 20 Mar 2009 10:32:37 +0000 (10:32 +0000)]
Check whether the symbol table is in the main object file or the debug
object file and use that information to decide which svma and bias
values to use when working out what section a symbol refers to.
- Turn exit_group() into exit() in the Memcheck filter, for greater
determinism and portability.
- Update the xml1 .exp files accordingly (getting rid of one which is no
longer necessary).
- Update origin4-many.stderr.exp accordingly.
- Update the handling of scalar_exit_group accordingly.
Added better filtering for Helgrind tests, removing all unreliable stack
traces, and a few other unreliable pieces. This allowed most of the tests
to be reduced to a single .stderr.exp file. It also means that all Helgrind
tests succeed on my AMD64/Linux box when configured with --enable-only32bit,
whereas previously 20 of them failed.
Also tweaked a couple non-Helgrind filters a tiny bit.
Remove Helgrind .exp files which are out-of-date, because Helgrind's output
has changed since they were generated. Also remove one
(tc23_bogus_condwait.stderr.exp-glibc25-x86) that was a duplicate.
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.