Commit Graph

1090 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
Julian Seward
e1eec7ec8d Handle new pseudo-register IP_AT_SYSCALL when origin-tracking is
enabled.  Fixes #188161.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9497
2009-03-30 02:27:29 +00:00
Julian Seward
563511a64e Track renaming of guest_CIA_AT_SC to guest_IP_AT_SYSCALL (vex r1886).
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9468
2009-03-20 00:28:50 +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
b15e3d9a45 Fix all the non-VEX problems identified with the Clang Static Analyzer.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9416
2009-03-15 23:25:38 +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
2001629c3f Updated copyright years.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9344
2009-03-10 22:02:09 +00:00
Nicholas Nethercote
28084aaff9 Tweak the Memcheck manual, fixing bug #157154 in the process.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9341
2009-03-10 21:40:46 +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
da695aa41a 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:

        VG_BOOL_CLO(arg, "--heap",   clo_heap)
   else VG_BOOL_CLO(arg, "--stacks", clo_stacks)

   else VG_NUM_CLO(arg, "--heap-admin", clo_heap_admin)
   else VG_NUM_CLO(arg, "--depth",      clo_depth)

(This works because they are actually an if-statement, but it looks odd.)

VG_NUM_CLO uses VG_(stroll10).  But if you want to do any checking or
processing, you can't use those macros, leading to code like this:

      else if (VG_CLO_STREQN(9,  arg, "--log-fd=")) {
         log_to            = VgLogTo_Fd;
         VG_(clo_log_name) = NULL;
         tmp_log_fd        = (Int)VG_(atoll)(&arg[9]);
      }

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.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9255
2009-02-25 01:01:05 +00:00
Nicholas Nethercote
5aac956e64 Remove a number of unused parameters, found with -Wunused-parameter.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9248
2009-02-24 03:07:37 +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
Julian Seward
6a1bca2e35 get_otrack_shadow_offset_wrk(ppc32): handle a missing case that caused
an assertion failure (Chris Wilson).



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9154
2009-02-14 15:28:46 +00:00