Commit Graph

544 Commits

Author SHA1 Message Date
Nicholas Nethercote
13e765c304 Merged r9546..r9548 (moved blockfault, and filtering fixes) from the DARWIN
branch.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9549
2009-04-15 07:11:36 +00:00
Nicholas Nethercote
1d78658d98 Merged r9543 (make xor-undef-x86 work on Darwin) from the DARWIN branch.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9545
2009-04-15 05:38:42 +00:00
Nicholas Nethercote
f3f801ed48 Merge r9533..9536 (add tests/{asm.h,sys_mman.h,malloc.h} from the DARWIN
branch.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9537
2009-04-15 03:12:43 +00:00
Nicholas Nethercote
f3630f66e8 This should have gone in with the last commit.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9422
2009-03-16 01:00:35 +00:00
Nicholas Nethercote
c78a4f9c30 - 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.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9421
2009-03-16 00:59:17 +00:00
Nicholas Nethercote
02c66cc57f Merge r9419 (make describe-block portable) from the DARWIN branch.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9420
2009-03-15 23:59:13 +00:00
Nicholas Nethercote
44301100b5 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.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9389
2009-03-13 01:41:03 +00:00
Nicholas Nethercote
e39c78cb35 Another filter_xml update.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9376
2009-03-12 05:50:51 +00:00
Nicholas Nethercote
190ad4143e - Removed leakotron. It was not a very useful test, and hard to make
portable.
- Rewrote leak-tree to be deterministic and clearer.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9372
2009-03-12 03:00:05 +00:00
Bart Van Assche
f8080bd125 Un-break 'make dist'.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9360
2009-03-11 18:30:59 +00:00
Nicholas Nethercote
1215cfe0d1 Another regtest fix for machines with debug info installed for libc.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9356
2009-03-11 06:12:59 +00:00
Nicholas Nethercote
39785f4f5d Make the leak-cases tests more robust.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9351
2009-03-10 23:08:02 +00:00
Nicholas Nethercote
47cc4b1a98 Fix an expected output for the recent large leak-checker rewrite.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9347
2009-03-10 22:30:44 +00:00
Nicholas Nethercote
1d75b1ac58 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.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9333
2009-03-10 03:34:00 +00:00
Nicholas Nethercote
bafed25ae9 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.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9330
2009-03-09 22:52:24 +00:00
Nicholas Nethercote
344a003c5c Remove .exp64 files that are identical to their corresponding .exp files and
thus unnecessary.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9322
2009-03-06 02:58:12 +00:00
Nicholas Nethercote
4c23a0b3e9 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.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9316
2009-03-04 04:15:16 +00:00
Nicholas Nethercote
70150c5884 Use "status" as the argname for 'exit' and 'exit_group'.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9311
2009-03-03 05:39:23 +00:00
Nicholas Nethercote
e97076e0f3 Merge r9299..r9303 (various leak-check test fixes) from the DARWIN branch.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9304
2009-03-02 05:11:06 +00:00
Nicholas Nethercote
b0d94067d7 Merge r9285 (match-overrun fixes) from the DARWIN branch.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9286
2009-02-26 22:38:42 +00:00
Nicholas Nethercote
9850e78e48 Make this pass on AIX (untested).
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9281
2009-02-26 22:09:53 +00:00
Nicholas Nethercote
3bd63f485c Make the VKI_PAGE_SIZE conditional match that in m_vki.c.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9276
2009-02-26 21:17:39 +00:00
Bart Van Assche
f0f7230433 Builds again on powerpc.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9274
2009-02-26 13:21:50 +00:00
Nicholas Nethercote
8699ace5ae rename a function
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9272
2009-02-26 04:02:03 +00:00
Nicholas Nethercote
8e58e8f934 Avoid a warning.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9271
2009-02-26 03:56:48 +00:00
Nicholas Nethercote
3a36379dcf Add more testing to memcheck/tests/unit_libcbase.c.
Remove VG_(strcmp_ws) and VG_(strncmp_ws);  they're no longer needed by CLO
handling, and they're not much use elsewhere.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9270
2009-02-26 03:52:35 +00:00
Nicholas Nethercote
e67c3fc54e Remove toobig-allocs.c -- it was unreliable and didn't test any
functionality of note.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9261
2009-02-25 04:34:44 +00:00
Nicholas Nethercote
23f6e50aac Move memcheck/tests/x86/bug133694 into memcheck/tests/x86-linux -- it uses
MAP_FIXED and so is highly unportable, and doesn't work on x86/Darwin.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9259
2009-02-25 04:20:54 +00:00
Nicholas Nethercote
380078f688 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.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9257
2009-02-25 04:04:29 +00:00
Nicholas Nethercote
94ed569cdc Fix some more 'make check' warnings, ones that appear on non-Linux
platforms.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9238
2009-02-23 07:17:08 +00:00
Nicholas Nethercote
2ae89cee5d Get rid of all "make check" compile warnings, except for the ones from
fxtract.c.

Also, gets rid of some of the warnings that -Wextra finds in Massif.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9237
2009-02-23 06:44:51 +00:00
Nicholas Nethercote
6ddf479d41 Merged part of r9234 (unit_libcbase improvements) from the DARWIN branch.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9235
2009-02-23 04:16:56 +00:00
Nicholas Nethercote
de920a14ce A few more test/build changes.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9228
2009-02-23 01:33:40 +00:00
Nicholas Nethercote
a6448a3006 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.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9222
2009-02-22 23:38:10 +00:00
Bart Van Assche
511b7fc48d Finished renaming of 'oset_test' into 'unit_oset'.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9207
2009-02-20 19:53:50 +00:00
Nicholas Nethercote
f6b278a3fc Forgot to add this file in the last commit.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9205
2009-02-20 06:37:52 +00:00
Nicholas Nethercote
13c8106f4f - 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.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9204
2009-02-20 06:10:44 +00:00
Nicholas Nethercote
c8d150dbaa 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.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9202
2009-02-19 09:52:05 +00:00
Nicholas Nethercote
3ed4532cde 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.

Merged from the DARWIN branch.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9193
2009-02-17 04:31:18 +00:00
Nicholas Nethercote
b327b8dd60 Remove unnecessary Memcheck test filters.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9188
2009-02-17 00:47:10 +00:00
Nicholas Nethercote
cf6cd2bb31 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!


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9178
2009-02-16 05:11:49 +00:00
Nicholas Nethercote
108768ee98 Merge r9175 (don't run inappropriate OS- and platform-specific tests) from
the DARWIN branch.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9176
2009-02-16 00:42:10 +00:00
Nicholas Nethercote
6031d626c1 Moved 3 Linux-specific tests into linux/ directories.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9144
2009-02-13 06:23:46 +00:00
Nicholas Nethercote
f3240d6950 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.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9142
2009-02-12 00:51:50 +00:00
Nicholas Nethercote
f0f8b48fcf Merge the non-Darwin parts of r9140 (install vgpreload .dSYMs), just to keep
the trunk and DARWIN branch in sync.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9141
2009-02-12 00:30:02 +00:00
Nicholas Nethercote
a8c9970a34 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.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9131
2009-02-10 06:48:00 +00:00
Nicholas Nethercote
dbcc3e99d6 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.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9038
2009-01-23 00:57:31 +00:00
Nicholas Nethercote
4372b47de8 Merge some minor regtest updates from the DARWIN branch:
- avoid using <malloc.h> where it's not necessary, because on DARWIN it's
  called <malloc/malloc.h>
- filter the output of brk2 more, which allows the .stderr.exp2 file to be
  removed.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9037
2009-01-23 00:02:07 +00:00
Nicholas Nethercote
ed322feb84 Rename all the arch/OS/platform-related variables in configure.in to make it
clearer what they mean:
- They all have VGCONF_ prefixes now, to indicate they come out of
  configure.in (and are clearly distinguished from the VGA_/VGO_/VGP_
  #defines passed in to C files).
- The ones that refer to the primary *or* secondary platform have _INCLUDES_
  in them.
- The ones that are in all-caps have a _CAPS suffix.

So, for example, what was VGP_X86_LINUX is now
VGCONF_PLATFORMS_INCLUDE_X86_LINUX, which is more verbose but also a lot
clearer.  The names of the #defines used in the C files (VGA_x86, VGO_linux,
etc) are unchanged.

cputest.c: changed to reflect the Valgrind installation's capabilities,
rather than the machine's capabilities.  In particular, if
--enable-only32bit is used on a 64-bit machine, then this program will claim
to only support 32-bits.  Also use the VGA/VGO/VGP macros which are clearer
than the __i386__ ones.  (This is partially merged from the DARWIN branch.)

configure.in: clean up the comments, distinguish different sections more
clearly, and generally make it more readable.

valgrind.pc.in: try to make this more accurate.  I doubt anyone's using it.
It doesn't appear to be set up to handle dual-architecture builds.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9031
2009-01-22 21:56:32 +00:00
Julian Seward
d5b38a2b94 Don't hardwire @FLAG_M32@ in here, since this directory isn't arch
specific (and so the build fails eg on a 64 bit machine that does
not have a 32-bit toolchain installed).  Use $(AM_FLAG_M3264_PRI)
instead.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9018
2009-01-22 01:36:51 +00:00