Bart Van Assche [Sun, 24 Feb 2008 18:37:08 +0000 (18:37 +0000)]
Corrected various comments. Removed commented out code. Added code for tracing thread context switches and danger set updating. Fixed memory leak. Danger set is now updated every time a new segment is created instead of only at every context switch, which fixes the bug that no data races were reported for the pth_barrier test program.
Bart Van Assche [Sun, 17 Feb 2008 09:21:05 +0000 (09:21 +0000)]
Fix exp-drd Fedora 8 tc18_semabuse regression test failure. It is okay to leave out the tl_assert(waited) statement because this statement is only triggered in case sem_post() fails, and sem_post() currently only fails when called on something that is not a semaphore.
Julian Seward [Fri, 15 Feb 2008 22:02:30 +0000 (22:02 +0000)]
Try to sort out signedness problems in hg_wordfm.[ch], and do a bunch
of other tidying too.
* All these word-based abstractions (WordFM, WordSet, WordBag) now
operate on unsigned words (UWord), whereas they previously operated
on signed words (Word). This became a problem, when using unboxed
comparisons, with the introduction of HG_(initIterAtFM), which
allows iteration over parts of mappings. Iterating over a mapping in
increasing order of signed Word keys is not what callers expect when
iterating through maps whose keys representing addresses (Addr) since
Addr is unsigned, and causes logical problems and assertion
failures.
* Change various size-of-things types from signed to unsigned, and
make them consistently word sized. For example the return type
of HG_(sizeFM) used to be an Int, which never made any sense
(the size can't be negative, and, on a 64-bit platform, the
map could have more than 2G elements, in which case an Int can't
represent the result). So make the return value a UWord instead.
This should generally help avoid obscure overflow problems on 64-bit
platforms.
A long time ago pthreads-functions were instrumented in the drd-patch
via modifications of coregrind/vg_preloaded.c. A.o. detached threads
were recognized by intercepting pthread_create(). This intercept was
active for all tools, so it made sense to add a unit test for it
(none/tests/pth_detached.c). This intercept has been moved from
coregrind/vg_preloaded.c to exp-drd/drd_preloaded.c, so this unit
test does no longer make sense for nulgrind. This test may be
removed.
Tom Hughes [Fri, 8 Feb 2008 15:17:07 +0000 (15:17 +0000)]
Make the clone system call wrappers call VG_(register_stack) to record
the new thread's stack, then make the stack unwinder use that information
to make a better guess at the stack bounds.
This helps avoid crashes trying to unwind the stack under wine when
the starting point is a routine without a proper stack frame.
Julian Seward [Mon, 21 Jan 2008 14:19:07 +0000 (14:19 +0000)]
drd changes (Bart Van Assche)
- The exp-drd regression tests now run without producing assertion
failures and without hanging on Red Hat 7.3. It doesn't make sense
however to run exp-drd on Red Hat 7.3 -- while exp-drd works fine with
the NPTL, more work would be required to make exp-drd work with
linuxthreads.
- Converted several tl_assert() calls into error messages.
- Added a regression test called pth_barrier, which tests whether data
races are detected in a program that uses barriers. The output exp-drd
produces for this test program is not yet correct however.
- Updated exp-drd/TODO.txt.
Julian Seward [Thu, 17 Jan 2008 23:19:54 +0000 (23:19 +0000)]
Allow a WordFM iterator to be initialised so as to exclude all key
values below a given value. This allows efficiently iterating over
small subsets of a mapping. Use this in Helgrind to avoid a
performance bad case. Patch from Konstantin Serebryany.
Julian Seward [Thu, 17 Jan 2008 14:37:24 +0000 (14:37 +0000)]
Fix inconsistent order of fields. I think this is purely aesthetic
since nothing depends on the actual layout of this struct, but anyway.
Noticed by Vinay Nallamothu.
Julian Seward [Mon, 14 Jan 2008 11:54:56 +0000 (11:54 +0000)]
DRD updates (Bart Van Assche):
- Updated copyright statement: replaced 2006-2007 by 2006-2008.
- Added copyright statement in the files where it was missing
(drd_track.h and drd_clientreq.c)
- Eliminated dependencies on core header files -- there are no more
#include "pub_core....h" directives in the exp-drd source code.
- Added semaphore support.
- Added barrier support.
- Added pthread_mutex_timedlock() support.
- Stack depth of stack traces printed by exp-drd can now be set via
--num-callers=...
- Added command-line option --trace-barrier=[yes|no].
- Added regression test for pthread_barrier() (matinv, a program that
performs matrix inversion).
- Added regression test sem_as_mutex, which tests whether race
detection works correctly when a semaphore is used to ensure mutual
exclusion of critical sections.
- Some of helgrind's regression tests are now used to test both
helgrind and exp-drd: tc17_sembar and tc18_semabuse.
- Cleaned up bitmap implementation code now that the const keyword has
been added to the declarations of the OSet functions.
- Cleaned up exp-drd/Makefile.am
- Updated exp-drd/TODO.txt
Julian Seward [Wed, 9 Jan 2008 21:03:43 +0000 (21:03 +0000)]
Make a new regtest target, "all-regtest", being the union of "make
regtest" and "make exp-regtest". Then change the nightly build system
to run all-regtest instead of exp-regtest.
Tom Hughes [Tue, 8 Jan 2008 17:44:04 +0000 (17:44 +0000)]
If we don't find the address in the segInfo list that ask the address
space manager for the name of the file it was mapped from as a fallback
solution.
This allows us to print the names of exe/dll files in the stack trace
when running programs under wine.
Tom Hughes [Tue, 8 Jan 2008 16:48:30 +0000 (16:48 +0000)]
Made the argument to VG_(am_get_filename) const as it doesn't need
to be modified and the routine to find the segment for an address now
returns a const pointer.
Tom Hughes [Wed, 2 Jan 2008 10:13:04 +0000 (10:13 +0000)]
Mark the main thread as running while the initial memory declarations
are made to the tool so that the tool can associate that memory with
the main thread if it wishes.
Also cleanup existing hacks in the drd tool which worked around the
fact that the core did not set the current thread while declaring the
initial memory.
Path from Bart Van Assche <bart.vanassche@gmail.com>.