55 Commits

Author SHA1 Message Date
Bart Van Assche
83f6f0137f Make drd/drd_pthread_intercepts.c compile again on Linux systems without usable <linux/futex.h> header
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12035
2011-09-17 06:24:49 +00:00
Bart Van Assche
5547d1545e drd: Avoid reporting false positive race reports inside pthread_join().
Note: I haven't analyzed yet since which commit these false positives
started to appear but it's most likely a commit applied after the 3.6
release.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12003
2011-08-24 15:02:21 +00:00
Bart Van Assche
85a61a6c6f drd: Remove a too strict assert() statement
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11937
2011-07-29 06:30:23 +00:00
Bart Van Assche
08eecbf85d drd: Make drd_pthread_intercepts.c compile again on systems where
FUTEX_PRIVATE_FLAG has not been defined in <linux/futex.h>, e.g. older System z
systems.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11929
2011-07-28 15:04:08 +00:00
Bart Van Assche
6cf2bc2c34 drd: Delay deletion of memory access information of joined threads in order not
to miss any races caused by these threads.

To do: refine handling of pthread_once() again.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11926
2011-07-28 09:54:37 +00:00
Bart Van Assche
39b5365cd9 drd/Linux: eliminate busy waiting when starting a thread
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11920
2011-07-26 19:30:28 +00:00
Julian Seward
eea9337891 The pthread.h on Android has no definition for pthread_rwlock_t, which
makes the associated intercepts in Helgrind and DRD un-compilable.
Add a configure test for it, and use them to guard the aforementioned
intercepts.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11875
2011-07-11 22:11:58 +00:00
Bart Van Assche
9a36fe677e Get rid of the remaining "set but not used" warnings reported by gcc 4.6 by
swapping the roles of the VALGRIND_DO_CLIENT_REQUEST() and
VALGRIND_DO_CLIENT_REQUEST_EXPR() macros. Also, many __attribute__((unused))
declarations on variables have been eliminated. Closes #269778.

Note: so far this patch has been tested on x86/Linux, amd64/Linux and
ppc64/Linux but not yet on any other supported CPU/OS combination.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11755
2011-05-15 07:04:03 +00:00
Julian Seward
9c6d0dc9c9 Fix up most but not all warnings generated by gcc-4.6 about
dead assignments ("[-Wunused-but-set-variable]").



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11673
2011-03-28 16:26:42 +00:00
Bart Van Assche
e53eb1ec0c Updated modeline and copyright statement in DRD source files.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11642
2011-03-13 12:02:44 +00:00
Bart Van Assche
ad2f458136 DRD: Allocate thread arguments again on the stack.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11630
2011-03-12 11:01:06 +00:00
Bart Van Assche
8c2ede1182 DRD: Report an error if an invalid argument is passed to pthread_detach(). Do not assume that pthread_detach() returns an error code if its argument is invalid. Should fix #267968.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11614
2011-03-09 17:53:28 +00:00
Bart Van Assche
942bd034c8 DRD: Fixed a race condition triggered by invoking pthread_detach() with an argument not equal to pthread_self(). Potential fix for #267968.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11612
2011-03-08 18:34:44 +00:00
Bart Van Assche
3eeee78bed DRD: Removed an obsolete comment.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11611
2011-03-08 18:32:36 +00:00
Bart Van Assche
218571c462 DRD: Source code cleanup.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11610
2011-03-08 17:53:45 +00:00
Bart Van Assche
bcd0bc2155 DRD, Darwin: avoid triggering misaligned stack errors. Fixes #267552.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11591
2011-03-05 14:51:24 +00:00
Bart Van Assche
626fe3372c Reverted r11536 because it didn't have the desired effect - changing the behavior of DRD on Darwin.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11539
2011-02-13 07:55:36 +00:00
Bart Van Assche
b640febb3e DRD: don't inline pthread intercepts because in combination with the current fragile implementation of the CALL_FN_* macros inlining intercepts can easily trigger stack alignment errors on Darwin.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11536
2011-02-10 21:03:47 +00:00
Bart Van Assche
ad86d78a6c E-mail address update.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11420
2010-10-10 18:07:31 +00:00
Bart Van Assche
ecb0c51747 DRD: avoid unaligned reads.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11365
2010-09-19 11:14:31 +00:00
Bart Van Assche
b0c39b2f5f Replaced dynamic initialization of DRD_(pthread_cond_initializer) by static initialization.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11145
2010-06-02 19:32:51 +00:00
Bart Van Assche
ebc0c2cb88 Handle statically initialized condition variables properly.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11139
2010-05-29 18:43:21 +00:00
Julian Seward
9b0574dff8 Update copyright dates to 2010.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11121
2010-05-03 21:37:12 +00:00
Bart Van Assche
d0bb010178 Removed trailing whitespace in C source and header files.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11052
2010-02-21 14:52:59 +00:00
Bart Van Assche
dd123bf150 Builds again on Darwin.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10680
2009-07-31 17:59:28 +00:00
Bart Van Assche
22baa8bb07 Implemented a more systematic approach for intercepting POSIX threads
functions: for each function name to intercept, intercept the function
name itself, the function name with @* appended (versioned symbols on
Linux) and the function name with $* appended (versioned symbols on
Darwin). Updated filter_stderr such that symbol versions are removed.
Updated the expected output files that contain names of intercepted
functions.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10679
2009-07-31 17:31:44 +00:00
Bart Van Assche
fd574c0b25 Report an error message instead of triggering an assertion failure when a non-existing thread ID is passed to pthread_join() or pthread_cancel().
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10674
2009-07-31 08:26:17 +00:00
Bart Van Assche
6073c6f851 Fixed typo.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10618
2009-07-26 16:21:00 +00:00
Bart Van Assche
8235a379dd Suppress data race reports for the data race triggered by Darwin's pthread_once() implementation such that the pth_once test also passes on Darwin.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10616
2009-07-26 15:55:48 +00:00
Bart Van Assche
a0f1a0b56f Removed code that has been commented out recently.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10606
2009-07-26 08:48:49 +00:00
Bart Van Assche
6529f12189 Replaced code for suppressing the stack memory in use at the time a
thread is being created by code for suppressing the memory allocated
from inside the pthread_create() call. The new implementation should be
a more portable solution for suppressing data races triggered by the
thread-local-storage implementation of a Pthreads library.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10584
2009-07-24 08:20:10 +00:00
Bart Van Assche
e2f8abc15d Added support for sem_open() and sem_close().
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10560
2009-07-23 16:31:39 +00:00
Bart Van Assche
41d1681616 Make the regression tests pass again on Linux.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10535
2009-07-22 19:33:26 +00:00
Bart Van Assche
f72049d88d More tweaking for Darwin.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10534
2009-07-22 19:17:05 +00:00
Bart Van Assche
28ac4a3761 Tweaks for Darwin.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10515
2009-07-21 17:47:30 +00:00
Bart Van Assche
8af98b77e3 Made sure that DRD does something meaningful when using another threading library than LinuxThreads or the NPTL.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10503
2009-07-21 12:39:25 +00:00
Nicholas Nethercote
07045477ca Merge the DARWIN branch onto the trunk.
I tried using 'svn merge' to do the merge but it did a terrible job and
there were bazillions of conflicts.  So instead I just took the diff between
the branch and trunk  at r10155, applied the diff to the trunk, 'svn add'ed
the added files (no files needed to be 'svn remove'd) and committed.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10156
2009-05-28 01:53:07 +00:00
Nicholas Nethercote
a3dfa6672b Factor out the name of the libpthread library. Also fix a minor stack trace
bogon.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9832
2009-05-11 08:01:09 +00:00
Bart Van Assche
5eccd4ef74 Fixed #189763.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9578
2009-04-22 18:59:50 +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
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
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
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
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
2cadc31ad0 Restored the previous method for passing arguments from the creator thread to the created thread, since the new approach made some regression tests fail. It is not yet clear to me why.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9164
2009-02-15 10:40:44 +00:00
Bart Van Assche
0a804bd7c6 - Performance improvement: eliminated busy waiting from thread creation.
- Applied DRD_() prefix to all names of functions that are not
  intercepts of client code.
- Removed superfluous include directive, namely #include <inttypes.h>.
- Removed hack for suppressing false positive reports on stdio / stderr
  because recently a suppression pattern was added for these races.
- Removed unused code and declarations.
- Added more comments.
- Updated copyright statement.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9149
2009-02-14 12:12:57 +00:00
Bart Van Assche
99249d56d6 Renamed vg_thread_wrapper() into DRD_(thread_wrapper)().
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9148
2009-02-14 11:54:42 +00:00
Bart Van Assche
0a25936ab6 Replaced test for FILE::_lock by a more direct test.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8670
2008-10-13 19:22:35 +00:00
Bart Van Assche
49456aef12 Removed #define _IO_MTSAFE_IO again.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8662
2008-10-11 19:25:18 +00:00
Bart Van Assche
4842d4beaf Removed inclusion of <bits/libc-lock.h>.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8661
2008-10-11 19:04:40 +00:00