Commit Graph

202 Commits

Author SHA1 Message Date
Bart Van Assche
32df44aaa2 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.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9521
2009-04-13 08:05:18 +00:00
Bart Van Assche
aa883e4ba4 Made pth_detached2 regression test more reliable.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9511
2009-04-02 07:19:25 +00:00
Bart Van Assche
a25afd442e Another test plan update.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9504
2009-03-31 10:46:37 +00:00
Bart Van Assche
3173e3cafa Updated test plan.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9500
2009-03-30 18:16:30 +00:00
Bart Van Assche
219e77b9bc - 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.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9496
2009-03-26 19:07:15 +00:00
Bart Van Assche
262decb4ee Updated to do list.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9493
2009-03-24 20:14:53 +00:00
Bart Van Assche
1fd6fd4606 Updated expected output.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9407
2009-03-14 08:28:56 +00:00
Bart Van Assche
019903a6cd Updated tc20_verifywrap expected output files.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9400
2009-03-13 18:19:05 +00:00
Bart Van Assche
740d45422c Made DRD_(mutex_type) ignore mutex attribute flags.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9399
2009-03-13 17:32:52 +00:00
Bart Van Assche
22b77e39d7 Added pth_process_shared_mutex regression test.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9398
2009-03-13 17:32:07 +00:00
Bart Van Assche
cc744ab1c6 Added comment block that explains why the creator thread waits until the creator thread has copied the vector clock of the creator thread.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9387
2009-03-12 18:39:31 +00:00
Bart Van Assche
04a8b22f01 Corrected a few comments.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9386
2009-03-12 18:38:26 +00:00
Bart Van Assche
49bbf55371 Removed DRD_() wrapper from static variables. Corrected datatypes of DRD_(sg_new)().
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9385
2009-03-12 18:38:00 +00:00
Bart Van Assche
fa675bb534 Cleanup.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9384
2009-03-12 18:35:44 +00:00
Bart Van Assche
0f7984644a Removed obsolete function declaration.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9383
2009-03-12 17:47:23 +00:00
Bart Van Assche
89566c0694 Force thread scheduling order.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9382
2009-03-12 17:28:44 +00:00
Bart Van Assche
84b640cfd3 Force the order in which threads run.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9363
2009-03-11 19:13:34 +00:00
Bart Van Assche
085b0e7336 Added a comment that explains the purpose of the test program.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9362
2009-03-11 19:12:06 +00:00
Bart Van Assche
35dcaa5dbd Removed cross-tool dependency on helgrind/helgrind.h.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9361
2009-03-11 18:51:22 +00:00
Bart Van Assche
ffad988a95 Reduced two expected output files to one for the test called atomic_var.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9359
2009-03-11 18:29:00 +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
Bart Van Assche
d9d43c3032 Added support for the VG_USERREQ__HG_CLEAN_MEMORY client request.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9340
2009-03-10 09:26:07 +00:00
Bart Van Assche
2f4734b795 Added DRD_(clean_memory)().
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9339
2009-03-10 09:25:32 +00:00
Bart Van Assche
9ab0d4001f Added DRD_(thread_address_on_any_stack)().
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9338
2009-03-10 09:22:13 +00:00
Bart Van Assche
5db5c21a04 Made sure that the tc19_shadowmem and tc24_nonzero_sem tests do something meaningful. Thanks to Nicholas for reporting this.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9337
2009-03-10 09:21:32 +00:00
Bart Van Assche
66a0470529 Added script filter_stderr_and_thread_no.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9336
2009-03-10 09:19:26 +00:00
Bart Van Assche
705d96dac4 Reverted last commit (r9326) -- its commit message did not make sense.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9328
2009-03-08 19:18:21 +00:00
Bart Van Assche
7e85b98bcc Added vgopts: --var-info=yes.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9327
2009-03-08 19:03:24 +00:00
Bart Van Assche
f21ce13492 Fixed another unintended data race.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9326
2009-03-08 19:02:59 +00:00
Bart Van Assche
2e2af4c91c - Added more comments.
- Removed DRD_() wrapper from around local functions and variables.
- Removed some obsolete code.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9320
2009-03-04 19:26:47 +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
Bart Van Assche
bfb33dbe91 Minor performance optimization: reduced the number of client objects that are inspected during memory deallocation.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9246
2009-02-23 19:15:32 +00:00
Bart Van Assche
eeff5a2b8e Updated expected output files.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9242
2009-02-23 08:46:42 +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
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
54c522f31e Updated documentation.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9216
2009-02-22 09:29:07 +00:00
Bart Van Assche
9078874b5c Added regression test for detection of unsynchronized pthread_barrier_wait() and pthread_barrier_delete() calls.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9215
2009-02-22 09:26:22 +00:00
Bart Van Assche
0a290f86cb - 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)().


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9214
2009-02-21 16:17:50 +00:00
Bart Van Assche
a93bb715dd Updated test plan.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9213
2009-02-21 16:13:50 +00:00
Bart Van Assche
aaef6d016e 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.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9211
2009-02-21 15:27:04 +00:00
Bart Van Assche
2d732560b7 Documentation updates.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9208
2009-02-21 09:39:09 +00:00
Bart Van Assche
840f16dda7 Moved drd/tests/pth_barrier.c, drd/tests/rwlock_race.c and
drd/tests/rwlock_test.c back to their original location.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9206
2009-02-20 19:00:18 +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
41aab1bfa5 Remove unused filter scripts from DRD.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9187
2009-02-17 00:32:58 +00:00
Bart Van Assche
b71a8e5966 - Updated copyright statements.
- Improved consistency of source file headers.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9182
2009-02-16 19:43:56 +00:00
Bart Van Assche
21242b42b2 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.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9181
2009-02-16 19:42:17 +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
Bart Van Assche
e8278d92ac drd_bitmap_test compiles again.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9173
2009-02-15 16:18:03 +00:00