You can subscribe to this list here.
| 2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
(122) |
Nov
(152) |
Dec
(69) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2003 |
Jan
(6) |
Feb
(25) |
Mar
(73) |
Apr
(82) |
May
(24) |
Jun
(25) |
Jul
(10) |
Aug
(11) |
Sep
(10) |
Oct
(54) |
Nov
(203) |
Dec
(182) |
| 2004 |
Jan
(307) |
Feb
(305) |
Mar
(430) |
Apr
(312) |
May
(187) |
Jun
(342) |
Jul
(487) |
Aug
(637) |
Sep
(336) |
Oct
(373) |
Nov
(441) |
Dec
(210) |
| 2005 |
Jan
(385) |
Feb
(480) |
Mar
(636) |
Apr
(544) |
May
(679) |
Jun
(625) |
Jul
(810) |
Aug
(838) |
Sep
(634) |
Oct
(521) |
Nov
(965) |
Dec
(543) |
| 2006 |
Jan
(494) |
Feb
(431) |
Mar
(546) |
Apr
(411) |
May
(406) |
Jun
(322) |
Jul
(256) |
Aug
(401) |
Sep
(345) |
Oct
(542) |
Nov
(308) |
Dec
(481) |
| 2007 |
Jan
(427) |
Feb
(326) |
Mar
(367) |
Apr
(255) |
May
(244) |
Jun
(204) |
Jul
(223) |
Aug
(231) |
Sep
(354) |
Oct
(374) |
Nov
(497) |
Dec
(362) |
| 2008 |
Jan
(322) |
Feb
(482) |
Mar
(658) |
Apr
(422) |
May
(476) |
Jun
(396) |
Jul
(455) |
Aug
(267) |
Sep
(280) |
Oct
(253) |
Nov
(232) |
Dec
(304) |
| 2009 |
Jan
(486) |
Feb
(470) |
Mar
(458) |
Apr
(423) |
May
(696) |
Jun
(461) |
Jul
(551) |
Aug
(575) |
Sep
(134) |
Oct
(110) |
Nov
(157) |
Dec
(102) |
| 2010 |
Jan
(226) |
Feb
(86) |
Mar
(147) |
Apr
(117) |
May
(107) |
Jun
(203) |
Jul
(193) |
Aug
(238) |
Sep
(300) |
Oct
(246) |
Nov
(23) |
Dec
(75) |
| 2011 |
Jan
(133) |
Feb
(195) |
Mar
(315) |
Apr
(200) |
May
(267) |
Jun
(293) |
Jul
(353) |
Aug
(237) |
Sep
(278) |
Oct
(611) |
Nov
(274) |
Dec
(260) |
| 2012 |
Jan
(303) |
Feb
(391) |
Mar
(417) |
Apr
(441) |
May
(488) |
Jun
(655) |
Jul
(590) |
Aug
(610) |
Sep
(526) |
Oct
(478) |
Nov
(359) |
Dec
(372) |
| 2013 |
Jan
(467) |
Feb
(226) |
Mar
(391) |
Apr
(281) |
May
(299) |
Jun
(252) |
Jul
(311) |
Aug
(352) |
Sep
(481) |
Oct
(571) |
Nov
(222) |
Dec
(231) |
| 2014 |
Jan
(185) |
Feb
(329) |
Mar
(245) |
Apr
(238) |
May
(281) |
Jun
(399) |
Jul
(382) |
Aug
(500) |
Sep
(579) |
Oct
(435) |
Nov
(487) |
Dec
(256) |
| 2015 |
Jan
(338) |
Feb
(357) |
Mar
(330) |
Apr
(294) |
May
(191) |
Jun
(108) |
Jul
(142) |
Aug
(261) |
Sep
(190) |
Oct
(54) |
Nov
(83) |
Dec
(22) |
| 2016 |
Jan
(49) |
Feb
(89) |
Mar
(33) |
Apr
(50) |
May
(27) |
Jun
(34) |
Jul
(53) |
Aug
(53) |
Sep
(98) |
Oct
(206) |
Nov
(93) |
Dec
(53) |
| 2017 |
Jan
(65) |
Feb
(82) |
Mar
(102) |
Apr
(86) |
May
(187) |
Jun
(67) |
Jul
(23) |
Aug
(93) |
Sep
(65) |
Oct
(45) |
Nov
(35) |
Dec
(17) |
| 2018 |
Jan
(26) |
Feb
(35) |
Mar
(38) |
Apr
(32) |
May
(8) |
Jun
(43) |
Jul
(27) |
Aug
(30) |
Sep
(43) |
Oct
(42) |
Nov
(38) |
Dec
(67) |
| 2019 |
Jan
(32) |
Feb
(37) |
Mar
(53) |
Apr
(64) |
May
(49) |
Jun
(18) |
Jul
(14) |
Aug
(53) |
Sep
(25) |
Oct
(30) |
Nov
(49) |
Dec
(31) |
| 2020 |
Jan
(87) |
Feb
(45) |
Mar
(37) |
Apr
(51) |
May
(99) |
Jun
(36) |
Jul
(11) |
Aug
(14) |
Sep
(20) |
Oct
(24) |
Nov
(40) |
Dec
(23) |
| 2021 |
Jan
(14) |
Feb
(53) |
Mar
(85) |
Apr
(15) |
May
(19) |
Jun
(3) |
Jul
(14) |
Aug
(1) |
Sep
(57) |
Oct
(73) |
Nov
(56) |
Dec
(22) |
| 2022 |
Jan
(3) |
Feb
(22) |
Mar
(6) |
Apr
(55) |
May
(46) |
Jun
(39) |
Jul
(15) |
Aug
(9) |
Sep
(11) |
Oct
(34) |
Nov
(20) |
Dec
(36) |
| 2023 |
Jan
(79) |
Feb
(41) |
Mar
(99) |
Apr
(169) |
May
(48) |
Jun
(16) |
Jul
(16) |
Aug
(57) |
Sep
(32) |
Oct
|
Nov
|
Dec
|
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
|
|
|
|
|
|
1
(6) |
2
(7) |
|
3
(12) |
4
(9) |
5
(12) |
6
(9) |
7
(18) |
8
(10) |
9
(17) |
|
10
(15) |
11
(22) |
12
(16) |
13
(18) |
14
(9) |
15
(14) |
16
(18) |
|
17
(24) |
18
(11) |
19
(15) |
20
(29) |
21
(19) |
22
(20) |
23
(9) |
|
24
(25) |
25
(25) |
26
(38) |
27
(22) |
28
(16) |
29
(17) |
|
|
From: <sv...@va...> - 2008-02-25 19:46:09
|
Author: bart
Date: 2008-02-25 19:46:14 +0000 (Mon, 25 Feb 2008)
New Revision: 7461
Log:
Converted several assertions into error messages.
Modified:
trunk/exp-drd/drd_mutex.c
Modified: trunk/exp-drd/drd_mutex.c
===================================================================
--- trunk/exp-drd/drd_mutex.c 2008-02-25 19:40:14 UTC (rev 7460)
+++ trunk/exp-drd/drd_mutex.c 2008-02-25 19:46:14 UTC (rev 7461)
@@ -110,6 +110,16 @@
{
if (s_mutex[i].mutex == 0)
{
+ if (drd_is_any_suppressed(mutex, mutex + size))
+ {
+ MutexErrInfo MEI = { 0, 0, 0 };
+ VG_(maybe_record_error)(VG_(get_running_tid)(),
+ MutexErr,
+ VG_(get_IP)(VG_(get_running_tid)()),
+ "Not a mutex",
+ &MEI);
+ return 0;
+ }
mutex_initialize(&s_mutex[i], mutex, size, mutex_type);
drd_start_suppression(mutex, mutex + size,
mutex_get_typename(&s_mutex[i]));
@@ -220,7 +230,6 @@
{
const DrdThreadId drd_tid = VgThreadIdToDrdThreadId(VG_(get_running_tid)());
struct mutex_info* const p = mutex_get_or_allocate(mutex, size, mutex_type);
- const DrdThreadId last_owner = p->owner;
if (s_trace_mutex)
{
@@ -235,6 +244,17 @@
p ? p->owner : VG_INVALID_THREADID);
}
+ if (p == 0)
+ {
+ MutexErrInfo MEI = { 0, 0, 0 };
+ VG_(maybe_record_error)(VG_(get_running_tid)(),
+ MutexErr,
+ VG_(get_IP)(VG_(get_running_tid)()),
+ "Not a mutex",
+ &MEI);
+ return 0;
+ }
+
tl_assert(mutex_type == mutex_type_mutex
|| mutex_type == mutex_type_spinlock);
tl_assert(p->mutex_type == mutex_type);
@@ -265,6 +285,8 @@
if (p->recursion_count == 1)
{
+ const DrdThreadId last_owner = p->owner;
+
if (last_owner != drd_tid && last_owner != DRD_INVALID_THREADID)
thread_combine_vc2(drd_tid, mutex_get_last_vc(mutex));
thread_new_segment(drd_tid);
@@ -299,6 +321,17 @@
p->owner);
}
+ if (p == 0 || p->owner == DRD_INVALID_THREADID)
+ {
+ MutexErrInfo MEI = { 0, 0, 0 };
+ VG_(maybe_record_error)(vg_tid,
+ MutexErr,
+ VG_(get_IP)(vg_tid),
+ "Not a mutex",
+ &MEI);
+ return 0;
+ }
+
tl_assert(p);
tl_assert(p->mutex_type == mutex_type);
tl_assert(p->owner != DRD_INVALID_THREADID);
@@ -363,7 +396,6 @@
Bool mutex_is_locked_by(const Addr mutex, const DrdThreadId tid)
{
struct mutex_info* const p = mutex_get(mutex);
- tl_assert(p);
if (p)
{
return (p->recursion_count > 0 && p->owner == tid);
|
|
From: <sv...@va...> - 2008-02-25 19:40:11
|
Author: bart
Date: 2008-02-25 19:40:14 +0000 (Mon, 25 Feb 2008)
New Revision: 7460
Log:
The mutex address may now be left zero when triggering a MutexErr.
Modified:
trunk/exp-drd/drd_error.c
Modified: trunk/exp-drd/drd_error.c
===================================================================
--- trunk/exp-drd/drd_error.c 2008-02-25 17:29:13 UTC (rev 7459)
+++ trunk/exp-drd/drd_error.c 2008-02-25 19:40:14 UTC (rev 7460)
@@ -262,9 +262,9 @@
VG_(message)(Vg_UserMsg,
"%s / mutex 0x%lx (recursion count %d, owner %d)",
VG_(get_error_string)(e),
- p->mutex,
- p->recursion_count,
- p->owner);
+ p ? p->mutex : 0,
+ p ? p->recursion_count : 0,
+ p ? p->owner : DRD_INVALID_THREADID);
VG_(pp_ExeContext)(VG_(get_error_where)(e));
break;
}
|
|
From: <sv...@va...> - 2008-02-25 17:29:12
|
Author: bart Date: 2008-02-25 17:29:13 +0000 (Mon, 25 Feb 2008) New Revision: 7459 Log: Added output for the case where the data race is detected in thread 3. Added: trunk/exp-drd/tests/pth_barrier.stderr.exp-thread3 Added: trunk/exp-drd/tests/pth_barrier.stderr.exp-thread3 =================================================================== --- trunk/exp-drd/tests/pth_barrier.stderr.exp-thread3 (rev 0) +++ trunk/exp-drd/tests/pth_barrier.stderr.exp-thread3 2008-02-25 17:29:13 UTC (rev 7459) @@ -0,0 +1,25 @@ + +Thread 3: +Conflicting store by thread 3 at 0x........ size 4 + at 0x........: threadfunc (pth_barrier.c:?) + by 0x........: vg_thread_wrapper (drd_intercepts.c:?) + by 0x........: start_thread (in libpthread-?.?.so) + by 0x........: clone (in /...libc...) +Allocation context: heap, offset 0 in block at 0x........ of size 4 + at 0x........: malloc (vg_replace_malloc.c:...) + by 0x........: barriers_and_races (pth_barrier.c:?) + by 0x........: main (pth_barrier.c:?) +Other segment start (thread 2) + at 0x........: pthread_barrier_wait (drd_intercepts.c:?) + by 0x........: threadfunc (pth_barrier.c:?) + by 0x........: vg_thread_wrapper (drd_intercepts.c:?) + by 0x........: start_thread (in libpthread-?.?.so) + by 0x........: clone (in /...libc...) +Other segment end (thread 2) + at 0x........: pthread_barrier_wait (in libpthread-?.?.so) + by 0x........: threadfunc (pth_barrier.c:?) + by 0x........: vg_thread_wrapper (drd_intercepts.c:?) + by 0x........: start_thread (in libpthread-?.?.so) + by 0x........: clone (in /...libc...) + +ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0) |
|
From: <sv...@va...> - 2008-02-25 17:26:21
|
Author: bart Date: 2008-02-25 17:26:23 +0000 (Mon, 25 Feb 2008) New Revision: 7458 Log: Renamed pth_barrier.stderr.exp into pth_barrier.stderr.exp-thread2. Added: trunk/exp-drd/tests/pth_barrier.stderr.exp-thread2 Removed: trunk/exp-drd/tests/pth_barrier.stderr.exp Deleted: trunk/exp-drd/tests/pth_barrier.stderr.exp =================================================================== --- trunk/exp-drd/tests/pth_barrier.stderr.exp 2008-02-25 13:46:58 UTC (rev 7457) +++ trunk/exp-drd/tests/pth_barrier.stderr.exp 2008-02-25 17:26:23 UTC (rev 7458) @@ -1,23 +0,0 @@ - -Thread 2: -Conflicting store by thread 2 at 0x........ size 4 - at 0x........: threadfunc (pth_barrier.c:?) - by 0x........: vg_thread_wrapper (drd_intercepts.c:?) - by 0x........: start_thread (in libpthread-?.?.so) - by 0x........: clone (in /...libc...) -Allocation context: unknown -Other segment start (thread 3) - at 0x........: pthread_barrier_wait (drd_intercepts.c:?) - by 0x........: threadfunc (pth_barrier.c:?) - by 0x........: vg_thread_wrapper (drd_intercepts.c:?) - by 0x........: start_thread (in libpthread-?.?.so) - by 0x........: clone (in /...libc...) -Other segment end (thread 3) - at 0x........: __lll_mutex_lock_wait (in libpthread-?.?.so) - by 0x........: pthread_barrier_wait (in libpthread-?.?.so) - by 0x........: threadfunc (pth_barrier.c:?) - by 0x........: vg_thread_wrapper (drd_intercepts.c:?) - by 0x........: start_thread (in libpthread-?.?.so) - by 0x........: clone (in /...libc...) - -ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0) Copied: trunk/exp-drd/tests/pth_barrier.stderr.exp-thread2 (from rev 7457, trunk/exp-drd/tests/pth_barrier.stderr.exp) =================================================================== --- trunk/exp-drd/tests/pth_barrier.stderr.exp-thread2 (rev 0) +++ trunk/exp-drd/tests/pth_barrier.stderr.exp-thread2 2008-02-25 17:26:23 UTC (rev 7458) @@ -0,0 +1,23 @@ + +Thread 2: +Conflicting store by thread 2 at 0x........ size 4 + at 0x........: threadfunc (pth_barrier.c:?) + by 0x........: vg_thread_wrapper (drd_intercepts.c:?) + by 0x........: start_thread (in libpthread-?.?.so) + by 0x........: clone (in /...libc...) +Allocation context: unknown +Other segment start (thread 3) + at 0x........: pthread_barrier_wait (drd_intercepts.c:?) + by 0x........: threadfunc (pth_barrier.c:?) + by 0x........: vg_thread_wrapper (drd_intercepts.c:?) + by 0x........: start_thread (in libpthread-?.?.so) + by 0x........: clone (in /...libc...) +Other segment end (thread 3) + at 0x........: __lll_mutex_lock_wait (in libpthread-?.?.so) + by 0x........: pthread_barrier_wait (in libpthread-?.?.so) + by 0x........: threadfunc (pth_barrier.c:?) + by 0x........: vg_thread_wrapper (drd_intercepts.c:?) + by 0x........: start_thread (in libpthread-?.?.so) + by 0x........: clone (in /...libc...) + +ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0) |
|
From: Bart V. A. <bar...@gm...> - 2008-02-25 16:37:33
|
On Mon, Feb 25, 2008 at 1:42 PM, Julian Seward <js...@ac...> wrote:
>
> > Only _start. Even if I would track _stop, I still would need code in
> > the drd_trace_load() / drd_trace_store() functions for verifying
> > whether VG_(get_running_tid)() changed.
>
> You really need to intercept the _stop function.
>
> * when notified with _start, cache the thread ID provided.
>
> * when notified with _stop, discard the cached thread ID.
>
> * when you need to know the thread ID, first see if you have
> a cached ID. If not, call VG_(get_running_tid) (but don't
> cache the result).
The code that is currently executed by exp-drd at the start of every
memory load and store is about as follows:
if (VG_(get_running_tid) != cached_tid)
{ cached_tid = VG_(get_running_tid); /* update danger set */; }
When tracking both _start and _stop, the code at the start of every
memory load and store will look as follows:
if (tracked_thread_id == VG_INVALID_THREADID && VG_(get_running_tid)
!= cached_tid)
{ cached_tid = VG_(get_running_tid); /* update danger set */; }
Is this an improvement ? This would save one function call in the
common path, but there is also an alternative solution for this --
declaring VG_(get_running_tid)() inline. And the code for checking the
thread ID still has to be executed for every client memory load and
for every client memory store.
I still prefer that the Valgrind core calls a tracking function to
notify a tool about any thread ID changes.
Bart.
|
|
From: <sv...@va...> - 2008-02-25 13:47:33
|
Author: sewardj
Date: 2008-02-25 13:44:04 +0000 (Mon, 25 Feb 2008)
New Revision: 7456
Log:
Comment-only changes.
Modified:
branches/DATASYMS/coregrind/m_debuginfo/priv_tytypes.h
branches/DATASYMS/coregrind/m_debuginfo/storage.c
Modified: branches/DATASYMS/coregrind/m_debuginfo/priv_tytypes.h
===================================================================
--- branches/DATASYMS/coregrind/m_debuginfo/priv_tytypes.h 2008-02-25 13:40:42 UTC (rev 7455)
+++ branches/DATASYMS/coregrind/m_debuginfo/priv_tytypes.h 2008-02-25 13:44:04 UTC (rev 7456)
@@ -149,7 +149,7 @@
been converted into pointers) */
void ML_(pp_Type_C_ishly) ( Type* ty );
-/* How big is this type? (post-resolved only) If . b in the
+/* How big is this type? (post-resolved only) If .b in the
returned struct is False, the size is unknown. */
/* FIXME: check all pointers before dereferencing */
Modified: branches/DATASYMS/coregrind/m_debuginfo/storage.c
===================================================================
--- branches/DATASYMS/coregrind/m_debuginfo/storage.c 2008-02-25 13:40:42 UTC (rev 7455)
+++ branches/DATASYMS/coregrind/m_debuginfo/storage.c 2008-02-25 13:44:04 UTC (rev 7456)
@@ -553,13 +553,12 @@
VG_(printf)("}\n");
}
-/* 'inner' is an XArray of DiAddrRange. Find the entry corresponding
- to [aMin,aMax]. If that doesn't exist, create one. Take care to
- preserve the invariant that none of the address ranges have the
- same starting value (aMin). That's unlikely to be the case unless
- the DWARF3 from which these calls results contains bogus range
- info; however in the interests of robustness, do handle the
- case. */
+/* Add the variable 'var' to 'scope' for the address range [aMin,aMax]
+ (inclusive of aMin and aMax). Split existing ranges as required if
+ aMin or aMax or both don't match existing range boundaries, and add
+ 'var' to all required ranges. Take great care to preserve the
+ invariant that the ranges in 'scope' cover the entire address range
+ exactly once, with no overlaps and no holes. */
static void add_var_to_arange (
/*MOD*/OSet* /* of DiAddrRange */ scope,
Addr aMin,
|
|
From: <sv...@va...> - 2008-02-25 13:46:55
|
Author: sewardj
Date: 2008-02-25 13:46:58 +0000 (Mon, 25 Feb 2008)
New Revision: 7457
Log:
Partially fix handling of variables which have Compilation-Unit scope.
In C these correspond to top level 'static' variables.
Modified:
branches/DATASYMS/coregrind/m_debuginfo/debuginfo.c
branches/DATASYMS/coregrind/m_debuginfo/readdwarf3.c
Modified: branches/DATASYMS/coregrind/m_debuginfo/debuginfo.c
===================================================================
--- branches/DATASYMS/coregrind/m_debuginfo/debuginfo.c 2008-02-25 13:44:04 UTC (rev 7456)
+++ branches/DATASYMS/coregrind/m_debuginfo/debuginfo.c 2008-02-25 13:46:58 UTC (rev 7457)
@@ -2014,6 +2014,27 @@
in the stacks of all the threads. First try to figure out which
thread's stack data_addr is in. */
+ /* --- KLUDGE --- Try examining the top frame of all thread stacks.
+ This finds variables which are not stack allocated but are not
+ globally visible either; specifically it appears to pick up
+ variables which are visible only within a compilation unit.
+ These will have the address range of the compilation unit and
+ tend to live at Scope level 1. */
+ VG_(thread_stack_reset_iter)(&tid);
+ while ( VG_(thread_stack_next)(&tid, &stack_min, &stack_max) ) {
+ if (stack_min >= stack_max)
+ continue; /* ignore obviously stupid cases */
+ if (consider_vars_in_frame( dname1, dname2, n_dname,
+ data_addr,
+ VG_(get_IP)(tid),
+ VG_(get_SP)(tid),
+ VG_(get_FP)(tid), tid, 0 )) {
+ dname1[n_dname-1] = dname2[n_dname-1] = 0;
+ return True;
+ }
+ }
+ /* --- end KLUDGE --- */
+
/* Perhaps it's on a thread's stack? */
found = False;
VG_(thread_stack_reset_iter)(&tid);
@@ -2050,6 +2071,9 @@
all non-innermost IPs. Note that VG_(get_StackTrace_wrk) itself
has to use the same trick in order to use CFI data to unwind the
stack (as documented therein in comments). */
+ /* As a result of KLUDGE above, starting the loop at j = 0
+ duplicates examination of the top frame and so isn't necessary.
+ Oh well. */
vg_assert(n_frames >= 0 && n_frames <= N_FRAMES);
for (j = 0; j < n_frames; j++) {
Word ip_delta = j == 0 ? 0 : 1;
Modified: branches/DATASYMS/coregrind/m_debuginfo/readdwarf3.c
===================================================================
--- branches/DATASYMS/coregrind/m_debuginfo/readdwarf3.c 2008-02-25 13:44:04 UTC (rev 7456)
+++ branches/DATASYMS/coregrind/m_debuginfo/readdwarf3.c 2008-02-25 13:46:58 UTC (rev 7457)
@@ -1290,7 +1290,7 @@
UWord saved_die_c_offset = get_position_of_Cursor( c_die );
UWord saved_abbv_c_offset = get_position_of_Cursor( c_abbv );
- varstack_preen( parser, td3, level );
+ varstack_preen( parser, td3, level-1 );
if (dtag == DW_TAG_compile_unit) {
Bool have_lo = False;
|
|
From: <sv...@va...> - 2008-02-25 13:40:45
|
Author: sewardj
Date: 2008-02-25 13:40:42 +0000 (Mon, 25 Feb 2008)
New Revision: 7455
Log:
Fix off-by-one error in complex case (range-splitting required) of
add_var_to_range(), and add a bunch more assertions.
Modified:
branches/DATASYMS/coregrind/m_debuginfo/storage.c
Modified: branches/DATASYMS/coregrind/m_debuginfo/storage.c
===================================================================
--- branches/DATASYMS/coregrind/m_debuginfo/storage.c 2008-02-25 12:10:07 UTC (rev 7454)
+++ branches/DATASYMS/coregrind/m_debuginfo/storage.c 2008-02-25 13:40:42 UTC (rev 7455)
@@ -567,8 +567,12 @@
DiVariable* var
)
{
- DiAddrRange *first, *last;
- DiAddrRange *range, *rangep;
+ DiAddrRange *first, *last, *range;
+ /* These xx variables are for assertion checking only; they don't
+ contribute anything to the actual work of this function. */
+ DiAddrRange *xxRangep, *xxFirst, *xxLast;
+ UWord xxIters;
+
vg_assert(aMin <= aMax);
if (0) VG_(printf)("add_var_to_arange: %p .. %p\n", aMin, aMax);
@@ -649,36 +653,55 @@
vg_assert(aMax == last->aMax);
+ xxFirst = (DiAddrRange*)VG_(OSetGen_Lookup)(scope, &aMin);
+ xxLast = (DiAddrRange*)VG_(OSetGen_Lookup)(scope, &aMax);
+ vg_assert(xxFirst);
+ vg_assert(xxLast);
+ vg_assert(xxFirst->aMin == aMin);
+ vg_assert(xxLast->aMax == aMax);
+ if (xxFirst != xxLast)
+ vg_assert(xxFirst->aMax < xxLast->aMin);
+
/* Great. Now we merely need to iterate over the segments from
'first' to 'last' inclusive, and add 'var' to the variable set
of each of them. */
- if (0) show_scope( scope, "add_var_to_arange(2)" );
+ if (0) {
+ static UWord ctr = 0;
+ ctr++;
+ VG_(printf)("ctr = %lu\n", ctr);
+ if (ctr >= 33263) show_scope( scope, "add_var_to_arange(2)" );
+ }
- range = rangep = NULL;
+ xxIters = 0;
+ range = xxRangep = NULL;
VG_(OSetGen_ResetIterAt)( scope, &aMin );
while (True) {
- range = VG_(OSetGen_Next)( scope );
+ xxRangep = range;
+ range = VG_(OSetGen_Next)( scope );
if (!range) break;
- if (range->aMin >= aMax) break;
+ if (range->aMin > aMax) break;
+ xxIters++;
if (0) VG_(printf)("have range %p %p\n",
range->aMin, range->aMax);
/* Sanity checks */
- if (!rangep) {
+ if (!xxRangep) {
/* This is the first in the range */
vg_assert(range->aMin == aMin);
} else {
- vg_assert(rangep->aMax + 1 == range->aMin);
+ vg_assert(xxRangep->aMax + 1 == range->aMin);
}
vg_assert(range->vars);
VG_(addToXA)( range->vars, var );
-
- rangep = range;
}
/* Done. We should have seen at least one range. */
- vg_assert(rangep);
- vg_assert(rangep->aMax == aMax);
+ vg_assert(xxIters >= 1);
+ if (xxIters == 1) vg_assert(xxFirst == xxLast);
+ if (xxFirst == xxLast) vg_assert(xxIters == 1);
+ vg_assert(xxRangep);
+ vg_assert(xxRangep->aMax == aMax);
+ vg_assert(xxRangep == xxLast);
}
|
|
From: Julian S. <js...@ac...> - 2008-02-25 12:46:06
|
> In exp-drd I need the value of VG_(get_running_tid)() upon *every* > client memory access, not just for the memory accesses generated by > translated code. [...] Yes. And the same is true in Helgrind. > Only _start. Even if I would track _stop, I still would need code in > the drd_trace_load() / drd_trace_store() functions for verifying > whether VG_(get_running_tid)() changed. You really need to intercept the _stop function. * when notified with _start, cache the thread ID provided. * when notified with _stop, discard the cached thread ID. * when you need to know the thread ID, first see if you have a cached ID. If not, call VG_(get_running_tid) (but don't cache the result). J |
|
From: <sv...@va...> - 2008-02-25 12:10:17
|
Author: sewardj
Date: 2008-02-25 12:10:07 +0000 (Mon, 25 Feb 2008)
New Revision: 7454
Log:
Intercept pthread_rwlock_try{rd,wr}lock. Fixes #158212.
Modified:
trunk/helgrind/hg_intercepts.c
trunk/helgrind/hg_main.c
Modified: trunk/helgrind/hg_intercepts.c
===================================================================
--- trunk/helgrind/hg_intercepts.c 2008-02-25 00:11:05 UTC (rev 7453)
+++ trunk/helgrind/hg_intercepts.c 2008-02-25 12:10:07 UTC (rev 7454)
@@ -790,6 +790,7 @@
}
+// pthread_rwlock_wrlock
PTH_FUNC(int, pthreadZurwlockZuwrlock, // pthread_rwlock_wrlock
pthread_rwlock_t* rwlock)
{
@@ -800,8 +801,9 @@
fprintf(stderr, "<< pthread_rwl_wlk %p", rwlock); fflush(stderr);
}
- DO_CREQ_v_WW(_VG_USERREQ__HG_PTHREAD_RWLOCK_LOCK_PRE,
- pthread_rwlock_t*,rwlock, long,1/*isW*/);
+ DO_CREQ_v_WWW(_VG_USERREQ__HG_PTHREAD_RWLOCK_LOCK_PRE,
+ pthread_rwlock_t*,rwlock,
+ long,1/*isW*/, long,0/*!isTryLock*/);
CALL_FN_W_W(ret, fn, rwlock);
@@ -819,6 +821,7 @@
}
+// pthread_rwlock_rdlock
PTH_FUNC(int, pthreadZurwlockZurdlock, // pthread_rwlock_rdlock
pthread_rwlock_t* rwlock)
{
@@ -829,8 +832,9 @@
fprintf(stderr, "<< pthread_rwl_rlk %p", rwlock); fflush(stderr);
}
- DO_CREQ_v_WW(_VG_USERREQ__HG_PTHREAD_RWLOCK_LOCK_PRE,
- pthread_rwlock_t*,rwlock, long,0/*!isW*/);
+ DO_CREQ_v_WWW(_VG_USERREQ__HG_PTHREAD_RWLOCK_LOCK_PRE,
+ pthread_rwlock_t*,rwlock,
+ long,0/*!isW*/, long,0/*!isTryLock*/);
CALL_FN_W_W(ret, fn, rwlock);
@@ -848,6 +852,81 @@
}
+// pthread_rwlock_trywrlock
+PTH_FUNC(int, pthreadZurwlockZutrywrlock, // pthread_rwlock_trywrlock
+ pthread_rwlock_t* rwlock)
+{
+ int ret;
+ OrigFn fn;
+ VALGRIND_GET_ORIG_FN(fn);
+ if (TRACE_PTH_FNS) {
+ fprintf(stderr, "<< pthread_rwl_trywlk %p", rwlock); fflush(stderr);
+ }
+
+ DO_CREQ_v_WWW(_VG_USERREQ__HG_PTHREAD_RWLOCK_LOCK_PRE,
+ pthread_rwlock_t*,rwlock,
+ long,1/*isW*/, long,1/*isTryLock*/);
+
+ CALL_FN_W_W(ret, fn, rwlock);
+
+ /* There's a hole here: libpthread now knows the lock is locked,
+ but the tool doesn't, so some other thread could run and detect
+ that the lock has been acquired by someone (this thread). Does
+ this matter? Not sure, but I don't think so. */
+
+ if (ret == 0 /*success*/) {
+ DO_CREQ_v_WW(_VG_USERREQ__HG_PTHREAD_RWLOCK_LOCK_POST,
+ pthread_rwlock_t*,rwlock, long,1/*isW*/);
+ } else {
+ if (ret != EBUSY)
+ DO_PthAPIerror( "pthread_rwlock_trywrlock", ret );
+ }
+
+ if (TRACE_PTH_FNS) {
+ fprintf(stderr, " :: rwl_trywlk -> %d >>\n", ret);
+ }
+ return ret;
+}
+
+
+// pthread_rwlock_tryrdlock
+PTH_FUNC(int, pthreadZurwlockZutryrdlock, // pthread_rwlock_tryrdlock
+ pthread_rwlock_t* rwlock)
+{
+ int ret;
+ OrigFn fn;
+ VALGRIND_GET_ORIG_FN(fn);
+ if (TRACE_PTH_FNS) {
+ fprintf(stderr, "<< pthread_rwl_tryrlk %p", rwlock); fflush(stderr);
+ }
+
+ DO_CREQ_v_WWW(_VG_USERREQ__HG_PTHREAD_RWLOCK_LOCK_PRE,
+ pthread_rwlock_t*,rwlock,
+ long,0/*!isW*/, long,1/*isTryLock*/);
+
+ CALL_FN_W_W(ret, fn, rwlock);
+
+ /* There's a hole here: libpthread now knows the lock is locked,
+ but the tool doesn't, so some other thread could run and detect
+ that the lock has been acquired by someone (this thread). Does
+ this matter? Not sure, but I don't think so. */
+
+ if (ret == 0 /*success*/) {
+ DO_CREQ_v_WW(_VG_USERREQ__HG_PTHREAD_RWLOCK_LOCK_POST,
+ pthread_rwlock_t*,rwlock, long,0/*!isW*/);
+ } else {
+ if (ret != EBUSY)
+ DO_PthAPIerror( "pthread_rwlock_tryrdlock", ret );
+ }
+
+ if (TRACE_PTH_FNS) {
+ fprintf(stderr, " :: rwl_tryrlk -> %d >>\n", ret);
+ }
+ return ret;
+}
+
+
+// pthread_rwlock_unlock
PTH_FUNC(int, pthreadZurwlockZuunlock, // pthread_rwlock_unlock
pthread_rwlock_t* rwlock)
{
@@ -1155,8 +1234,9 @@
fflush(stderr);
}
- DO_CREQ_v_WW(_VG_USERREQ__HG_PTHREAD_RWLOCK_LOCK_PRE,
- void*,self, long,0/*!isW*/);
+ DO_CREQ_v_WWW(_VG_USERREQ__HG_PTHREAD_RWLOCK_LOCK_PRE,
+ void*,self,
+ long,0/*!isW*/, long,0/*!isTryLock*/);
CALL_FN_v_W(fn, self);
@@ -1181,8 +1261,9 @@
fflush(stderr);
}
- DO_CREQ_v_WW(_VG_USERREQ__HG_PTHREAD_RWLOCK_LOCK_PRE,
- void*,self, long,1/*isW*/);
+ DO_CREQ_v_WWW(_VG_USERREQ__HG_PTHREAD_RWLOCK_LOCK_PRE,
+ void*,self,
+ long,1/*isW*/, long,0/*!isTryLock*/);
CALL_FN_v_W(fn, self);
Modified: trunk/helgrind/hg_main.c
===================================================================
--- trunk/helgrind/hg_main.c 2008-02-25 00:11:05 UTC (rev 7453)
+++ trunk/helgrind/hg_main.c 2008-02-25 12:10:07 UTC (rev 7454)
@@ -6245,7 +6245,9 @@
}
static
-void evh__HG_PTHREAD_RWLOCK_LOCK_PRE ( ThreadId tid, void* rwl, Word isW )
+void evh__HG_PTHREAD_RWLOCK_LOCK_PRE ( ThreadId tid,
+ void* rwl,
+ Word isW, Word isTryLock )
{
/* Just check the rwl is sane; nothing else to do. */
// 'rwl' may be invalid - not checked by wrapper
@@ -6256,6 +6258,7 @@
(Int)tid, (Int)isW, (void*)rwl );
tl_assert(isW == 0 || isW == 1); /* assured us by wrapper */
+ tl_assert(isTryLock == 0 || isTryLock == 1); /* assured us by wrapper */
thr = map_threads_maybe_lookup( tid );
tl_assert(thr); /* cannot fail - Thread* must already exist */
@@ -7652,9 +7655,10 @@
evh__HG_PTHREAD_RWLOCK_DESTROY_PRE( tid, (void*)args[1] );
break;
- /* rwlock=arg[1], isW=arg[2] */
+ /* rwlock=arg[1], isW=arg[2], isTryLock=arg[3] */
case _VG_USERREQ__HG_PTHREAD_RWLOCK_LOCK_PRE:
- evh__HG_PTHREAD_RWLOCK_LOCK_PRE( tid, (void*)args[1], args[2] );
+ evh__HG_PTHREAD_RWLOCK_LOCK_PRE( tid, (void*)args[1],
+ args[2], args[3] );
break;
/* rwlock=arg[1], isW=arg[2] */
|
|
From: Bart V. A. <bar...@gm...> - 2008-02-25 12:05:57
|
On Mon, Feb 25, 2008 at 4:31 AM, Tom Hughes <th...@cy...> wrote: > > Nightly build on dellow ( x86_64, Fedora 8 ) started at 2008-02-25 03:10:06 GMT > Results differ from 24 hours ago > ... > exp-drd/tests/pth_barrier (stderr) > ... While all exp-drd regression tests ran fine on my development system, the pth_barrier regression test failed on all systems the nightly build ran on. The result of this regression test must be that a single data race is be reported. Depending on how the Valgrind core scheduled the threads of this test, the data race is either reported in thread 2 or in thread 3. Furthermore, the details of the call stacks printed depend on the glibc library used during the test. So I would like to change this test such that only the number of errors is compared during the regression tests instead of the full output. I would like to have a facility to suppress the output of the error messages generated by a tool while keeping the error count summary. Should I implement such functionality in the Valgrind core or in the exp-drd tool ? Bart. |
|
From: Tom H. <th...@cy...> - 2008-02-25 06:07:22
|
Nightly build on alvis ( i686, Red Hat 7.3 ) started at 2008-02-25 03:15:18 GMT Results unchanged from 24 hours ago Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 338 tests, 80 stderr failures, 1 stdout failure, 29 post failures == memcheck/tests/addressable (stderr) memcheck/tests/badjump (stderr) memcheck/tests/describe-block (stderr) memcheck/tests/erringfds (stderr) memcheck/tests/leak-0 (stderr) memcheck/tests/leak-cycle (stderr) memcheck/tests/leak-pool-0 (stderr) memcheck/tests/leak-pool-1 (stderr) memcheck/tests/leak-pool-2 (stderr) memcheck/tests/leak-pool-3 (stderr) memcheck/tests/leak-pool-4 (stderr) memcheck/tests/leak-pool-5 (stderr) memcheck/tests/leak-regroot (stderr) memcheck/tests/leak-tree (stderr) memcheck/tests/long_namespace_xml (stderr) memcheck/tests/lsframe1 (stderr) memcheck/tests/lsframe2 (stderr) memcheck/tests/malloc_free_fill (stderr) memcheck/tests/match-overrun (stderr) memcheck/tests/noisy_child (stderr) memcheck/tests/partial_load_dflt (stderr) memcheck/tests/partial_load_ok (stderr) memcheck/tests/partiallydefinedeq (stderr) memcheck/tests/pointer-trace (stderr) memcheck/tests/sigkill (stderr) memcheck/tests/stack_changes (stderr) memcheck/tests/x86/bug152022 (stderr) memcheck/tests/x86/scalar (stderr) memcheck/tests/x86/scalar_supp (stderr) memcheck/tests/x86/xor-undef-x86 (stderr) memcheck/tests/xml1 (stderr) massif/tests/alloc-fns-A (post) massif/tests/alloc-fns-B (post) massif/tests/basic (post) massif/tests/basic2 (post) massif/tests/big-alloc (post) massif/tests/culling1 (stderr) massif/tests/culling2 (stderr) massif/tests/custom_alloc (post) massif/tests/deep-A (post) massif/tests/deep-B (stderr) massif/tests/deep-B (post) massif/tests/deep-C (stderr) massif/tests/deep-C (post) massif/tests/deep-D (post) massif/tests/ignoring (post) massif/tests/insig (post) massif/tests/long-names (post) massif/tests/long-time (post) massif/tests/new-cpp (post) massif/tests/null (post) massif/tests/one (post) massif/tests/overloaded-new (post) massif/tests/peak (post) massif/tests/peak2 (stderr) massif/tests/peak2 (post) massif/tests/realloc (stderr) massif/tests/realloc (post) massif/tests/thresholds_0_0 (post) massif/tests/thresholds_0_10 (post) massif/tests/thresholds_10_0 (post) massif/tests/thresholds_10_10 (post) massif/tests/thresholds_5_0 (post) massif/tests/thresholds_5_10 (post) massif/tests/zero1 (post) massif/tests/zero2 (post) none/tests/blockfault (stderr) none/tests/mremap (stderr) none/tests/mremap2 (stdout) helgrind/tests/hg01_all_ok (stderr) helgrind/tests/hg02_deadlock (stderr) helgrind/tests/hg03_inherit (stderr) helgrind/tests/hg04_race (stderr) helgrind/tests/hg05_race2 (stderr) helgrind/tests/hg06_readshared (stderr) helgrind/tests/tc01_simple_race (stderr) helgrind/tests/tc02_simple_tls (stderr) helgrind/tests/tc03_re_excl (stderr) helgrind/tests/tc05_simple_race (stderr) helgrind/tests/tc06_two_races (stderr) helgrind/tests/tc07_hbl1 (stderr) helgrind/tests/tc08_hbl2 (stderr) helgrind/tests/tc09_bad_unlock (stderr) helgrind/tests/tc11_XCHG (stderr) helgrind/tests/tc12_rwl_trivial (stderr) helgrind/tests/tc14_laog_dinphils (stderr) helgrind/tests/tc16_byterace (stderr) helgrind/tests/tc17_sembar (stderr) helgrind/tests/tc18_semabuse (stderr) helgrind/tests/tc19_shadowmem (stderr) helgrind/tests/tc20_verifywrap (stderr) helgrind/tests/tc21_pthonce (stderr) helgrind/tests/tc22_exit_w_lock (stderr) helgrind/tests/tc23_bogus_condwait (stderr) helgrind/tests/tc24_nonzero_sem (stderr) exp-drd/tests/fp_race (stderr) exp-drd/tests/fp_race2 (stderr) exp-drd/tests/matinv (stderr) exp-drd/tests/pth_barrier (stderr) exp-drd/tests/pth_broadcast (stderr) exp-drd/tests/pth_cond_race (stderr) exp-drd/tests/pth_cond_race2 (stderr) exp-drd/tests/pth_create_chain (stderr) exp-drd/tests/pth_detached (stderr) exp-drd/tests/pth_detached2 (stderr) exp-drd/tests/sem_as_mutex (stderr) exp-drd/tests/sem_as_mutex2 (stderr) exp-drd/tests/sigalrm (stderr) exp-drd/tests/tc17_sembar (stderr) exp-drd/tests/tc18_semabuse (stderr) |
|
From: Tom H. <th...@cy...> - 2008-02-25 04:12:27
|
Nightly build on lloyd ( x86_64, Fedora 7 ) started at 2008-02-25 03:05:05 GMT Results differ from 24 hours ago Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 372 tests, 8 stderr failures, 2 stdout failures, 0 post failures == memcheck/tests/malloc_free_fill (stderr) memcheck/tests/pointer-trace (stderr) memcheck/tests/vcpu_fnfns (stdout) memcheck/tests/x86/scalar (stderr) memcheck/tests/xml1 (stderr) none/tests/mremap (stderr) none/tests/mremap2 (stdout) helgrind/tests/tc20_verifywrap (stderr) helgrind/tests/tc22_exit_w_lock (stderr) exp-drd/tests/pth_barrier (stderr) ================================================= == Results from 24 hours ago == ================================================= Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 372 tests, 7 stderr failures, 2 stdout failures, 0 post failures == memcheck/tests/malloc_free_fill (stderr) memcheck/tests/pointer-trace (stderr) memcheck/tests/vcpu_fnfns (stdout) memcheck/tests/x86/scalar (stderr) memcheck/tests/xml1 (stderr) none/tests/mremap (stderr) none/tests/mremap2 (stdout) helgrind/tests/tc20_verifywrap (stderr) helgrind/tests/tc22_exit_w_lock (stderr) ================================================= == Difference between 24 hours ago and now == ================================================= *** old.short Mon Feb 25 03:38:53 2008 --- new.short Mon Feb 25 04:12:29 2008 *************** *** 8,10 **** ! == 372 tests, 7 stderr failures, 2 stdout failures, 0 post failures == memcheck/tests/malloc_free_fill (stderr) --- 8,10 ---- ! == 372 tests, 8 stderr failures, 2 stdout failures, 0 post failures == memcheck/tests/malloc_free_fill (stderr) *************** *** 18,19 **** --- 18,20 ---- helgrind/tests/tc22_exit_w_lock (stderr) + exp-drd/tests/pth_barrier (stderr) |
|
From: Tom H. <th...@cy...> - 2008-02-25 03:53:40
|
Nightly build on aston ( x86_64, Fedora Core 5 ) started at 2008-02-25 03:20:08 GMT Results differ from 24 hours ago Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 378 tests, 9 stderr failures, 1 stdout failure, 0 post failures == memcheck/tests/malloc_free_fill (stderr) memcheck/tests/pointer-trace (stderr) memcheck/tests/x86/scalar (stderr) memcheck/tests/xml1 (stderr) none/tests/blockfault (stderr) none/tests/mremap (stderr) none/tests/mremap2 (stdout) helgrind/tests/tc20_verifywrap (stderr) helgrind/tests/tc22_exit_w_lock (stderr) exp-drd/tests/pth_barrier (stderr) ================================================= == Results from 24 hours ago == ================================================= Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 378 tests, 8 stderr failures, 1 stdout failure, 0 post failures == memcheck/tests/malloc_free_fill (stderr) memcheck/tests/pointer-trace (stderr) memcheck/tests/x86/scalar (stderr) memcheck/tests/xml1 (stderr) none/tests/blockfault (stderr) none/tests/mremap (stderr) none/tests/mremap2 (stdout) helgrind/tests/tc20_verifywrap (stderr) helgrind/tests/tc22_exit_w_lock (stderr) ================================================= == Difference between 24 hours ago and now == ================================================= *** old.short Mon Feb 25 03:35:48 2008 --- new.short Mon Feb 25 03:53:43 2008 *************** *** 8,10 **** ! == 378 tests, 8 stderr failures, 1 stdout failure, 0 post failures == memcheck/tests/malloc_free_fill (stderr) --- 8,10 ---- ! == 378 tests, 9 stderr failures, 1 stdout failure, 0 post failures == memcheck/tests/malloc_free_fill (stderr) *************** *** 18,19 **** --- 18,20 ---- helgrind/tests/tc22_exit_w_lock (stderr) + exp-drd/tests/pth_barrier (stderr) |
|
From: Tom H. <th...@cy...> - 2008-02-25 03:47:15
|
Nightly build on trojan ( x86_64, Fedora Core 6 ) started at 2008-02-25 03:25:20 GMT Results differ from 24 hours ago Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 376 tests, 7 stderr failures, 5 stdout failures, 0 post failures == memcheck/tests/pointer-trace (stderr) memcheck/tests/vcpu_fnfns (stdout) memcheck/tests/x86/bug133694 (stdout) memcheck/tests/x86/bug133694 (stderr) memcheck/tests/x86/scalar (stderr) none/tests/cmdline1 (stdout) none/tests/cmdline2 (stdout) none/tests/mremap (stderr) none/tests/mremap2 (stdout) helgrind/tests/tc20_verifywrap (stderr) helgrind/tests/tc22_exit_w_lock (stderr) exp-drd/tests/pth_barrier (stderr) ================================================= == Results from 24 hours ago == ================================================= Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 376 tests, 6 stderr failures, 5 stdout failures, 0 post failures == memcheck/tests/pointer-trace (stderr) memcheck/tests/vcpu_fnfns (stdout) memcheck/tests/x86/bug133694 (stdout) memcheck/tests/x86/bug133694 (stderr) memcheck/tests/x86/scalar (stderr) none/tests/cmdline1 (stdout) none/tests/cmdline2 (stdout) none/tests/mremap (stderr) none/tests/mremap2 (stdout) helgrind/tests/tc20_verifywrap (stderr) helgrind/tests/tc22_exit_w_lock (stderr) ================================================= == Difference between 24 hours ago and now == ================================================= *** old.short Mon Feb 25 03:36:47 2008 --- new.short Mon Feb 25 03:47:18 2008 *************** *** 8,10 **** ! == 376 tests, 6 stderr failures, 5 stdout failures, 0 post failures == memcheck/tests/pointer-trace (stderr) --- 8,10 ---- ! == 376 tests, 7 stderr failures, 5 stdout failures, 0 post failures == memcheck/tests/pointer-trace (stderr) *************** *** 20,21 **** --- 20,22 ---- helgrind/tests/tc22_exit_w_lock (stderr) + exp-drd/tests/pth_barrier (stderr) |
|
From: Tom H. <th...@cy...> - 2008-02-25 03:31:06
|
Nightly build on dellow ( x86_64, Fedora 8 ) started at 2008-02-25 03:10:06 GMT Results differ from 24 hours ago Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 372 tests, 9 stderr failures, 3 stdout failures, 0 post failures == memcheck/tests/malloc_free_fill (stderr) memcheck/tests/pointer-trace (stderr) memcheck/tests/vcpu_fnfns (stdout) memcheck/tests/x86/scalar (stderr) memcheck/tests/xml1 (stderr) none/tests/mremap (stderr) none/tests/mremap2 (stdout) none/tests/pth_cvsimple (stdout) helgrind/tests/tc18_semabuse (stderr) helgrind/tests/tc20_verifywrap (stderr) helgrind/tests/tc22_exit_w_lock (stderr) exp-drd/tests/pth_barrier (stderr) ================================================= == Results from 24 hours ago == ================================================= Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 372 tests, 9 stderr failures, 3 stdout failures, 0 post failures == memcheck/tests/malloc_free_fill (stderr) memcheck/tests/pointer-trace (stderr) memcheck/tests/vcpu_fnfns (stdout) memcheck/tests/x86/scalar (stderr) memcheck/tests/xml1 (stderr) none/tests/mremap (stderr) none/tests/mremap2 (stdout) none/tests/pth_cvsimple (stdout) helgrind/tests/tc17_sembar (stderr) helgrind/tests/tc18_semabuse (stderr) helgrind/tests/tc20_verifywrap (stderr) helgrind/tests/tc22_exit_w_lock (stderr) ================================================= == Difference between 24 hours ago and now == ================================================= *** old.short Mon Feb 25 03:21:44 2008 --- new.short Mon Feb 25 03:31:07 2008 *************** *** 17,19 **** none/tests/pth_cvsimple (stdout) - helgrind/tests/tc17_sembar (stderr) helgrind/tests/tc18_semabuse (stderr) --- 17,18 ---- *************** *** 21,22 **** --- 20,22 ---- helgrind/tests/tc22_exit_w_lock (stderr) + exp-drd/tests/pth_barrier (stderr) |
|
From: Tom H. <th...@cy...> - 2008-02-25 03:20:12
|
Nightly build on gill ( x86_64, Fedora Core 2 ) started at 2008-02-25 03:00:15 GMT Results differ from 24 hours ago Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 378 tests, 30 stderr failures, 3 stdout failures, 0 post failures == memcheck/tests/malloc_free_fill (stderr) memcheck/tests/pointer-trace (stderr) memcheck/tests/stack_switch (stderr) memcheck/tests/x86/scalar (stderr) memcheck/tests/x86/scalar_supp (stderr) none/tests/amd64/insn_ssse3 (stdout) none/tests/amd64/insn_ssse3 (stderr) none/tests/amd64/ssse3_misaligned (stderr) none/tests/blockfault (stderr) none/tests/fdleak_fcntl (stderr) none/tests/mremap (stderr) none/tests/mremap2 (stdout) none/tests/x86/insn_ssse3 (stdout) none/tests/x86/insn_ssse3 (stderr) none/tests/x86/ssse3_misaligned (stderr) helgrind/tests/hg01_all_ok (stderr) helgrind/tests/hg02_deadlock (stderr) helgrind/tests/hg03_inherit (stderr) helgrind/tests/hg04_race (stderr) helgrind/tests/hg05_race2 (stderr) helgrind/tests/tc01_simple_race (stderr) helgrind/tests/tc05_simple_race (stderr) helgrind/tests/tc06_two_races (stderr) helgrind/tests/tc09_bad_unlock (stderr) helgrind/tests/tc14_laog_dinphils (stderr) helgrind/tests/tc16_byterace (stderr) helgrind/tests/tc17_sembar (stderr) helgrind/tests/tc19_shadowmem (stderr) helgrind/tests/tc20_verifywrap (stderr) helgrind/tests/tc21_pthonce (stderr) helgrind/tests/tc22_exit_w_lock (stderr) helgrind/tests/tc23_bogus_condwait (stderr) exp-drd/tests/pth_barrier (stderr) ================================================= == Results from 24 hours ago == ================================================= Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 378 tests, 29 stderr failures, 3 stdout failures, 0 post failures == memcheck/tests/malloc_free_fill (stderr) memcheck/tests/pointer-trace (stderr) memcheck/tests/stack_switch (stderr) memcheck/tests/x86/scalar (stderr) memcheck/tests/x86/scalar_supp (stderr) none/tests/amd64/insn_ssse3 (stdout) none/tests/amd64/insn_ssse3 (stderr) none/tests/amd64/ssse3_misaligned (stderr) none/tests/blockfault (stderr) none/tests/fdleak_fcntl (stderr) none/tests/mremap (stderr) none/tests/mremap2 (stdout) none/tests/x86/insn_ssse3 (stdout) none/tests/x86/insn_ssse3 (stderr) none/tests/x86/ssse3_misaligned (stderr) helgrind/tests/hg01_all_ok (stderr) helgrind/tests/hg02_deadlock (stderr) helgrind/tests/hg03_inherit (stderr) helgrind/tests/hg04_race (stderr) helgrind/tests/hg05_race2 (stderr) helgrind/tests/tc01_simple_race (stderr) helgrind/tests/tc05_simple_race (stderr) helgrind/tests/tc06_two_races (stderr) helgrind/tests/tc09_bad_unlock (stderr) helgrind/tests/tc14_laog_dinphils (stderr) helgrind/tests/tc16_byterace (stderr) helgrind/tests/tc17_sembar (stderr) helgrind/tests/tc19_shadowmem (stderr) helgrind/tests/tc20_verifywrap (stderr) helgrind/tests/tc21_pthonce (stderr) helgrind/tests/tc22_exit_w_lock (stderr) helgrind/tests/tc23_bogus_condwait (stderr) ================================================= == Difference between 24 hours ago and now == ================================================= *** old.short Mon Feb 25 03:10:19 2008 --- new.short Mon Feb 25 03:20:13 2008 *************** *** 8,10 **** ! == 378 tests, 29 stderr failures, 3 stdout failures, 0 post failures == memcheck/tests/malloc_free_fill (stderr) --- 8,10 ---- ! == 378 tests, 30 stderr failures, 3 stdout failures, 0 post failures == memcheck/tests/malloc_free_fill (stderr) *************** *** 41,42 **** --- 41,43 ---- helgrind/tests/tc23_bogus_condwait (stderr) + exp-drd/tests/pth_barrier (stderr) |
|
From: <sv...@va...> - 2008-02-25 00:11:02
|
Author: sewardj
Date: 2008-02-25 00:11:05 +0000 (Mon, 25 Feb 2008)
New Revision: 7453
Log:
Fix off-by-one problem in IP values obtained from stack unwinding,
that caused non-identification of variables on stacks in some cases.
Modified:
branches/DATASYMS/coregrind/m_debuginfo/debuginfo.c
branches/DATASYMS/coregrind/m_stacktrace.c
Modified: branches/DATASYMS/coregrind/m_debuginfo/debuginfo.c
===================================================================
--- branches/DATASYMS/coregrind/m_debuginfo/debuginfo.c 2008-02-24 19:51:51 UTC (rev 7452)
+++ branches/DATASYMS/coregrind/m_debuginfo/debuginfo.c 2008-02-25 00:11:05 UTC (rev 7453)
@@ -1815,7 +1815,7 @@
static UInt n_search = 0;
static UInt n_steps = 0;
n_search++;
-
+ if (0) VG_(printf)("QQQQ: cvif: ip,sp,fp %p,%p,%p\n", ip,sp,fp);
/* first, find the DebugInfo that pertains to 'ip'. */
for (di = debugInfo_list; di; di = di->next) {
n_steps++;
@@ -1867,6 +1867,7 @@
DiAddrRange* arange;
OSet* this_scope
= *(OSet**)VG_(indexXA)( di->varinfo, i );
+ if (0) VG_(printf)("QQQQ: considering scope %ld\n", (Word)i);
if (!this_scope)
continue;
/* Find the set of variables in this scope that
@@ -1935,7 +1936,7 @@
vg_assert(n_dname > 1);
dname1[n_dname-1] = dname2[n_dname-1] = 0;
- if (0) VG_(printf)("GDD: dataaddr %p\n", data_addr);
+ if (0) VG_(printf)("get_data_description: dataaddr %p\n", data_addr);
/* First, see if data_addr is (or is part of) a global variable.
Loop over the DebugInfos we have. Check data_addr against the
@@ -2033,14 +2034,29 @@
/* We conclude data_addr is in thread tid's stack. Unwind the
stack to get a bunch of (ip,sp,fp) triples describing the
frames, and for each frame, consider the local variables. */
-
n_frames = VG_(get_StackTrace)( tid, ips, N_FRAMES,
sps, fps, 0/*first_ip_delta*/ );
+ /* Re ip_delta in the next loop: There's a subtlety in the meaning
+ of the IP values in a stack obtained from VG_(get_StackTrace).
+ The innermost value really is simply the thread's program
+ counter at the time the snapshot was taken. However, all the
+ other values are actually return addresses, and so point just
+ after the call instructions. Hence they notionally reflect not
+ what the program counters were at the time those calls were
+ made, but what they will be when those calls return. This can
+ be of significance should an address range happen to end at the
+ end of a call instruction -- we may ignore the range when in
+ fact it should be considered. Hence, back up the IPs by 1 for
+ all non-innermost IPs. Note that VG_(get_StackTrace_wrk) itself
+ has to use the same trick in order to use CFI data to unwind the
+ stack (as documented therein in comments). */
vg_assert(n_frames >= 0 && n_frames <= N_FRAMES);
for (j = 0; j < n_frames; j++) {
+ Word ip_delta = j == 0 ? 0 : 1;
if (consider_vars_in_frame( dname1, dname2, n_dname,
data_addr,
- ips[j], sps[j], fps[j], tid, j )) {
+ ips[j] - ip_delta,
+ sps[j], fps[j], tid, j )) {
dname1[n_dname-1] = dname2[n_dname-1] = 0;
return True;
}
Modified: branches/DATASYMS/coregrind/m_stacktrace.c
===================================================================
--- branches/DATASYMS/coregrind/m_stacktrace.c 2008-02-24 19:51:51 UTC (rev 7452)
+++ branches/DATASYMS/coregrind/m_stacktrace.c 2008-02-25 00:11:05 UTC (rev 7453)
@@ -136,6 +136,11 @@
* This most frequently happens at the end of a function when
* a tail call occurs and we wind up using the CFI info for the
* next function which is completely wrong.
+ *
+ * Note that VG_(get_data_description) (in m_debuginfo) has to take
+ * this same problem into account when unwinding the stack to
+ * examine local variable descriptions (as documented therein in
+ * comments).
*/
while (True) {
@@ -208,6 +213,11 @@
* This most frequently happens at the end of a function when
* a tail call occurs and we wind up using the CFI info for the
* next function which is completely wrong.
+ *
+ * Note that VG_(get_data_description) (in m_debuginfo) has to take
+ * this same problem into account when unwinding the stack to
+ * examine local variable descriptions (as documented therein in
+ * comments).
*/
while (True) {
|
|
From: Tom H. <to...@co...> - 2008-02-24 21:02:13
|
In message <200...@ac...>
Julian Seward <js...@ac...> wrote:
> On Sunday 24 February 2008 20:15, Bart Van Assche wrote:
> > On Sun, Feb 17, 2008 at 1:06 PM, Julian Seward <js...@ac...> wrote:
> > > > > So what's the oldest commonly-used distro that supported NPTL?
> > > >
> > > > RH9 is pretty much the first distro to support it isn't it?
> > >
> > > Yes. According to Ulrich Drepper "RHL9 was the first with NPTL and
> > > it served as the basis for RHEL3".
> > >
> > > So I'm inclined to declare RHL9 as the new oldest-supported-distro
> > > for the trunk, which means we can drop support for LinuxThreads,
> > > gcc < 3.0, and stabs.
> >
> > As far as I know there are still RHEL3 setups running, and RHEL3 is
> > based on the 2.4.21 Linux kernel. So how could RHEL3 include NPTL ?
>
> Because the Red Hat crew backported a bunch of stuff from 2.6 into some
> of the 2.4s they were distributing, and I think that included NPTL. At
> least -- that is my impression.
Correct - the same applies to RH9 (and FC1) as both use a 2.4 kernel.
Tom
--
Tom Hughes (to...@co...)
http://www.compton.nu/
|
|
From: <sv...@va...> - 2008-02-24 19:51:49
|
Author: sewardj
Date: 2008-02-24 19:51:51 +0000 (Sun, 24 Feb 2008)
New Revision: 7452
Log:
Make some efforts to recover the large Dwarf3-reading performance loss
caused by r7435. r7435 causes information about many more variables
than previously, to be recorded, especially in programs with a lot of
inlining. This commit recovers some of that lossage by representing
address ranges for TempVars which turns over less memory.
Modified:
branches/DATASYMS/coregrind/m_debuginfo/readdwarf3.c
branches/DATASYMS/coregrind/m_debuginfo/storage.c
Modified: branches/DATASYMS/coregrind/m_debuginfo/readdwarf3.c
===================================================================
--- branches/DATASYMS/coregrind/m_debuginfo/readdwarf3.c 2008-02-24 18:47:12 UTC (rev 7451)
+++ branches/DATASYMS/coregrind/m_debuginfo/readdwarf3.c 2008-02-24 19:51:51 UTC (rev 7452)
@@ -84,17 +84,33 @@
different DIEs (generally a declarer and a definer). We punt on
these. Could do better here.
- Improve performance. The number of type entities that end up in
- the list of TyAdmins rapidly becomes huge (eg, for
- libQtGui.so.4.3.2 (amd64-linux, size 80729047 bytes), there are
- 786860 entries in the list). Mostly this seems to be caused by g++
- adding type DIEs for all the basic types once for each source file
- contributing to the compilation unit, and for a large library they
- add up quickly. That causes both a lot of work for this reader
- module, and also wastes vast amounts of memory storing this
- duplicated information. We could surely do a lot better here.
-*/
+ POTENTIAL PERFORMANCE IMPROVEMENTS:
+ The number of type entities that end up in the list of TyAdmins
+ rapidly becomes huge (eg, for libQtGui.so.4.3.2 (amd64-linux, size
+ 80729047 bytes), there are 786860 entries in the list). Mostly
+ this seems to be caused by g++ adding type DIEs for all the basic
+ types once for each source file contributing to the compilation
+ unit, and for a large library they add up quickly. That causes
+ both a lot of work for this reader module, and also wastes vast
+ amounts of memory storing this duplicated information. We could
+ surely do a lot better here.
+
+ Handle interaction between read_DIE and parse_{var,type}_DIE
+ better. Currently read_DIE reads the entire DIE just to find where
+ the end is (and for debug printing), so that it can later reliably
+ move the cursor to the end regardless of what parse_{var,type}_DIE
+ do. This means many DIEs (most, even?) are read twice. It would
+ be smarter to make parse_{var,type}_DIE return a Bool indicating
+ whether or not they advanced the DIE cursor, and only if they
+ didn't should read_DIE itself read through the DIE.
+
+ More generally, reduce the amount of memory allocated and freed
+ while reading Dwarf3 type/variable information. Even modest (20MB)
+ objects cause this module to allocate and free hundreds of
+ thousands of small blocks, and ML_(arena_malloc) and its various
+ groupies always show up at the top of performance profiles. */
+
#include "pub_core_basics.h"
#include "pub_core_libcbase.h"
#include "pub_core_libcassert.h"
@@ -1005,7 +1021,19 @@
struct _TempVar {
struct _TempVar* next;
UChar* name; /* in DebugInfo's .strchunks */
- XArray* ranges; /* of AddrRange. UNIQUE PTR in AR_DINFO. */
+ /* Represent ranges economically. nRanges is the number of
+ ranges. Cases:
+ 0: .rngOneMin .rngOneMax .manyRanges are all zero
+ 1: .rngOneMin .rngOneMax hold the range; .rngMany is NULL
+ 2: .rngOneMin .rngOneMax are zero; .rngMany holds the ranges.
+ This is merely an optimisation to avoid having to allocate
+ and free the XArray in the common (98%) of cases where there
+ is zero or one address ranges. */
+ UWord nRanges;
+ Addr rngOneMin;
+ Addr rngOneMax;
+ XArray* rngMany; /* of AddrRange. UNIQUE PTR in AR_DINFO. */
+ /* --- */
Int level;
Type* typeR;
GExpr* gexpr; /* for this variable */
@@ -1021,7 +1049,7 @@
}
TempVar;
-#define N_D3_VAR_STACK 16
+#define N_D3_VAR_STACK 24
typedef
struct {
@@ -1066,10 +1094,14 @@
vg_assert(parser->fbGX[i] == NULL);
}
VG_(printf)(": ");
- for (j = 0; j < VG_(sizeXA)( xa ); j++) {
- AddrRange* range = (AddrRange*) VG_(indexXA)( xa, j );
- vg_assert(range);
- VG_(printf)("[%p,%p] ", range->aMin, range->aMax);
+ if (VG_(sizeXA)( xa ) == 0) {
+ VG_(printf)("** empty PC range array **");
+ } else {
+ for (j = 0; j < VG_(sizeXA)( xa ); j++) {
+ AddrRange* range = (AddrRange*) VG_(indexXA)( xa, j );
+ vg_assert(range);
+ VG_(printf)("[%p,%p] ", range->aMin, range->aMax);
+ }
}
VG_(printf)("\n");
}
@@ -1493,7 +1525,7 @@
will be the address ranges at the top of the varparser's
stack. */
GExpr* fbGX = NULL;
- Word i;
+ Word i, nRanges;
XArray* /* of AddrRange */ xa;
TempVar* tv;
/* Stack can't be empty; we put a dummy entry on it for the
@@ -1544,9 +1576,11 @@
address space. It is asserted elsewhere that level 0
always covers the entire address space. */
xa = parser->ranges[external ? 0 : parser->sp];
+ nRanges = VG_(sizeXA)(xa);
+ vg_assert(nRanges >= 0);
+
tv = ML_(dinfo_zalloc)( sizeof(TempVar) );
tv->name = name;
- tv->ranges = xa;
tv->level = external ? 0 : parser->sp;
tv->typeR = typeR;
tv->gexpr = gexpr;
@@ -1555,13 +1589,37 @@
tv->fLine = lineNo;
tv->dioff = posn;
tv->absOri = abs_ori;
- tv->ranges = VG_(cloneXA)( xa ); /* free when 'tv' freed */
+ /* See explanation on definition of type TempVar for the
+ reason for this elaboration. */
+ tv->nRanges = nRanges;
+ tv->rngOneMin = 0;
+ tv->rngOneMax = 0;
+ tv->rngMany = NULL;
+ if (nRanges == 1) {
+ AddrRange* range = VG_(indexXA)(xa, 0);
+ tv->rngOneMin = range->aMin;
+ tv->rngOneMax = range->aMax;
+ }
+ else if (nRanges > 1) {
+ tv->rngMany = VG_(cloneXA)( xa ); /* free when 'tv' freed */
+ }
+
tv->next = *tempvars;
*tempvars = tv;
TRACE_D3(" Recording this variable, with %ld PC range(s)\n",
VG_(sizeXA)(xa) );
+ /* collect stats on how effective the ->ranges special
+ casing is */
+ if (0) {
+ static Int ntot=0, ngt=0;
+ ntot++;
+ if (tv->rngMany) ngt++;
+ if (0 == (ntot % 100000))
+ VG_(printf)("XXXX %d tot, %d cloned\n", ntot, ngt);
+ }
+
}
/* Here are some other weird cases seen in the wild:
@@ -2682,7 +2740,6 @@
UWord dr_offset;
Word i;
Bool td3 = di->trace_symtab;
- XArray* /* of AddrRange */ xa;
XArray* /* of TempVar* */ dioff_lookup_tab;
#if 0
@@ -3121,45 +3178,67 @@
vg_assert(varp->name);
vg_assert(varp->typeR);
vg_assert(varp->level >= 0);
- vg_assert(varp->ranges);
/* Ok. So we're going to keep it. Call ML_(addVar) once for
each address range in which the variable exists. */
- xa = varp->ranges;
- if (varp->level == 0)
- vg_assert( VG_(sizeXA)(xa) == 1 );
-
- /* Level 0 is the global address range. So at level 0 we don't
- want to bias pcMin/pcMax; but at all other levels we do since
- those are derived from svmas in the Dwarf we're reading. Be
- paranoid ... */
TRACE_D3(" ACQUIRE for range(s) ");
- for (i = 0; i < VG_(sizeXA)( xa ); i++) {
- AddrRange* range = VG_(indexXA)(xa, i);
- Addr pcMin = range->aMin;
- Addr pcMax = range->aMax;
- vg_assert(pcMin <= pcMax);
- if (varp->level == 0) {
- vg_assert(pcMin == (Addr)0);
- vg_assert(pcMax == ~(Addr)0);
- } else {
- /* vg_assert(pcMin > (Addr)0);
- No .. we can legitimately expect to see ranges like
- 0x0-0x11D (pre-biasing, of course). */
- vg_assert(pcMax < ~(Addr)0);
- }
+ { AddrRange oneRange;
+ AddrRange* varPcRanges;
+ Word nVarPcRanges;
+ /* Set up to iterate over address ranges, however
+ represented. */
+ if (varp->nRanges == 0 || varp->nRanges == 1) {
+ vg_assert(!varp->rngMany);
+ if (varp->nRanges == 0) {
+ vg_assert(varp->rngOneMin == 0);
+ vg_assert(varp->rngOneMax == 0);
+ }
+ nVarPcRanges = varp->nRanges;
+ oneRange.aMin = varp->rngOneMin;
+ oneRange.aMax = varp->rngOneMax;
+ varPcRanges = &oneRange;
+ } else {
+ vg_assert(varp->rngMany);
+ vg_assert(varp->rngOneMin == 0);
+ vg_assert(varp->rngOneMax == 0);
+ nVarPcRanges = VG_(sizeXA)(varp->rngMany);
+ vg_assert(nVarPcRanges >= 2);
+ vg_assert(nVarPcRanges == (Word)varp->nRanges);
+ varPcRanges = VG_(indexXA)(varp->rngMany, 0);
+ }
+ if (varp->level == 0)
+ vg_assert( nVarPcRanges == 1 );
+ /* and iterate */
+ for (i = 0; i < nVarPcRanges; i++) {
+ Addr pcMin = varPcRanges[i].aMin;
+ Addr pcMax = varPcRanges[i].aMax;
+ vg_assert(pcMin <= pcMax);
+ /* Level 0 is the global address range. So at level 0 we
+ don't want to bias pcMin/pcMax; but at all other levels
+ we do since those are derived from svmas in the Dwarf
+ we're reading. Be paranoid ... */
+ if (varp->level == 0) {
+ vg_assert(pcMin == (Addr)0);
+ vg_assert(pcMax == ~(Addr)0);
+ } else {
+ /* vg_assert(pcMin > (Addr)0);
+ No .. we can legitimately expect to see ranges like
+ 0x0-0x11D (pre-biasing, of course). */
+ vg_assert(pcMax < ~(Addr)0);
+ }
- if (i > 0 && (i%2) == 0) TRACE_D3("\n ");
- TRACE_D3("[%p,%p] ", pcMin, pcMax );
+ if (i > 0 && (i%2) == 0) TRACE_D3("\n ");
+ TRACE_D3("[%p,%p] ", pcMin, pcMax );
- ML_(addVar)(
- di, varp->level,
- pcMin + (varp->level==0 ? 0 : di->text_bias),
- pcMax + (varp->level==0 ? 0 : di->text_bias),
- varp->name, (void*)varp->typeR,
- varp->gexpr, varp->fbGX,
- varp->fName, varp->fLine, td3
- );
+ ML_(addVar)(
+ di, varp->level,
+ pcMin + (varp->level==0 ? 0 : di->text_bias),
+ pcMax + (varp->level==0 ? 0 : di->text_bias),
+ varp->name, (void*)varp->typeR,
+ varp->gexpr, varp->fbGX,
+ varp->fName, varp->fLine, td3
+ );
+ }
}
TRACE_D3("\n\n");
@@ -3169,8 +3248,8 @@
/* Now free all the TempVars */
for (varp = tempvars; varp; varp = varp2) {
varp2 = varp->next;
- vg_assert(varp->ranges);
- VG_(deleteXA)(varp->ranges);
+ if (varp->rngMany)
+ VG_(deleteXA)(varp->rngMany);
ML_(dinfo_free)(varp);
}
tempvars = NULL;
Modified: branches/DATASYMS/coregrind/m_debuginfo/storage.c
===================================================================
--- branches/DATASYMS/coregrind/m_debuginfo/storage.c 2008-02-24 18:47:12 UTC (rev 7451)
+++ branches/DATASYMS/coregrind/m_debuginfo/storage.c 2008-02-24 19:51:51 UTC (rev 7452)
@@ -585,6 +585,17 @@
vg_assert(first->aMin <= first->aMax);
vg_assert(first->aMin <= aMin && aMin <= first->aMax);
+ /* Fast track common case, which is that the range specified for
+ the variable exactly coincides with one already-existing
+ range. */
+ if (first->aMin == aMin && first->aMax == aMax) {
+ vg_assert(first->vars);
+ VG_(addToXA)( first->vars, var );
+ return;
+ }
+
+ /* We have to get into splitting ranges, which is complex
+ and slow. */
if (first->aMin < aMin) {
DiAddrRange* nyu;
/* Ok. We'll have to split 'first'. */
@@ -670,6 +681,7 @@
vg_assert(rangep->aMax == aMax);
}
+
/* Top-level place to call to add a variable description (as extracted
from a DWARF3 .debug_info section. */
void ML_(addVar)( struct _DebugInfo* di,
|
|
From: Julian S. <js...@ac...> - 2008-02-24 19:30:39
|
On Sunday 24 February 2008 20:15, Bart Van Assche wrote: > On Sun, Feb 17, 2008 at 1:06 PM, Julian Seward <js...@ac...> wrote: > > > > So what's the oldest commonly-used distro that supported NPTL? > > > > > > RH9 is pretty much the first distro to support it isn't it? > > > > Yes. According to Ulrich Drepper "RHL9 was the first with NPTL and > > it served as the basis for RHEL3". > > > > So I'm inclined to declare RHL9 as the new oldest-supported-distro > > for the trunk, which means we can drop support for LinuxThreads, > > gcc < 3.0, and stabs. > > As far as I know there are still RHEL3 setups running, and RHEL3 is > based on the 2.4.21 Linux kernel. So how could RHEL3 include NPTL ? Because the Red Hat crew backported a bunch of stuff from 2.6 into some of the 2.4s they were distributing, and I think that included NPTL. At least -- that is my impression. J |
|
From: Bart V. A. <bar...@gm...> - 2008-02-24 19:15:10
|
On Sun, Feb 17, 2008 at 1:06 PM, Julian Seward <js...@ac...> wrote: > > > So what's the oldest commonly-used distro that supported NPTL? > > > > RH9 is pretty much the first distro to support it isn't it? > > Yes. According to Ulrich Drepper "RHL9 was the first with NPTL and > it served as the basis for RHEL3". > > So I'm inclined to declare RHL9 as the new oldest-supported-distro > for the trunk, which means we can drop support for LinuxThreads, > gcc < 3.0, and stabs. As far as I know there are still RHEL3 setups running, and RHEL3 is based on the 2.4.21 Linux kernel. So how could RHEL3 include NPTL ? The kernel version included in RHEL3 can be verified easily: as known the CentOS RPM's package the same software versions as the equivalent RHEL version. It can be verified on any CentOS mirror that version CentOS 3.0 includes kernel 2.4.21. See e.g. ftp://ftp.belnet.be/mirror/ftp.centos.org/3/os/i386/RedHat/RPMS. Bart. |
|
From: <sv...@va...> - 2008-02-24 18:47:10
|
Author: bart Date: 2008-02-24 18:47:12 +0000 (Sun, 24 Feb 2008) New Revision: 7451 Log: Updated to do list. Modified: trunk/exp-drd/TODO.txt Modified: trunk/exp-drd/TODO.txt =================================================================== --- trunk/exp-drd/TODO.txt 2008-02-24 18:46:05 UTC (rev 7450) +++ trunk/exp-drd/TODO.txt 2008-02-24 18:47:12 UTC (rev 7451) @@ -15,8 +15,12 @@ - Find out why a race is reported on std::string::string(std::string const&) (stc test case 16). - Add a regression test for pthread_mutex_timedlock(). -- Find a way for suppressing races on _IO_2_1_stdout (this race is triggered - by calling printf() from more than one thread). +- Find a way for suppressing races reported on _IO_2_1_stdout. This race is + triggered by calling printf() from more than one thread. An example: + ./vg-in-place --tool=exp-drd exp-drd/tests/pth_barrier 2 1 +- Add support for objects that are shared over threads and that use reference + counting, e.g. std::string -- no races should be reported on the reference + count. - Performance testing and tuning. - testing on PPC and AIX (current implementation is only tested on X86 and AMD64). @@ -38,6 +42,9 @@ Documentation ~~~~~~~~~~~~~ - Document the command-line options of the exp-drd tool. +- Explain that happens-before race detectors are also suited for certain + classes of programs that do not follow a locking discipline + (e.g. exp-drd/test/matinv.c). Known bugs @@ -51,6 +58,9 @@ (works fine on i386). This is a bug in Valgrind's debug info reader -- VG_(find_seginfo)() returns NULL for BSS symbols on x86_64. Not yet in the KDE bug tracking system. +- --trace-mem=yes can cause crashes. This might be caused by the code that + prints backtraces. An example (AMD64): + ./vg-in-place --tool=exp-drd --trace-mem=yes exp-drd/tests/pth_barrier 2 2 1 Known performance issues: - According to cachegrind, VG_(OSet_Next)() is taking up most CPU cycles. |
|
From: <sv...@va...> - 2008-02-24 18:46:05
|
Author: bart
Date: 2008-02-24 18:46:05 +0000 (Sun, 24 Feb 2008)
New Revision: 7450
Log:
Added --trace-csw and --trace-danger-set. Removed commented out code.
Modified:
trunk/exp-drd/drd_main.c
Modified: trunk/exp-drd/drd_main.c
===================================================================
--- trunk/exp-drd/drd_main.c 2008-02-24 18:42:53 UTC (rev 7449)
+++ trunk/exp-drd/drd_main.c 2008-02-24 18:46:05 UTC (rev 7450)
@@ -73,6 +73,8 @@
{
Bool trace_barrier = False;
Bool trace_cond = False;
+ Bool trace_csw = False;
+ Bool trace_danger_set = False;
Bool trace_mutex = False;
Bool trace_segment = False;
Bool trace_suppression = False;
@@ -81,6 +83,8 @@
VG_BOOL_CLO (arg, "--drd-stats", drd_print_stats)
else VG_BOOL_CLO(arg, "--trace-barrier", trace_barrier)
else VG_BOOL_CLO(arg, "--trace-cond", trace_cond)
+ else VG_BOOL_CLO(arg, "--trace-csw", trace_csw)
+ else VG_BOOL_CLO(arg, "--trace-danger-set", trace_danger_set)
else VG_BOOL_CLO(arg, "--trace-fork-join", drd_trace_fork_join)
else VG_BOOL_CLO(arg, "--trace-mem", drd_trace_mem)
else VG_BOOL_CLO(arg, "--trace-mutex", trace_mutex)
@@ -93,15 +97,15 @@
if (trace_address)
{
drd_trace_address = VG_(strtoll16)(trace_address, 0);
-#if 0
- VG_(message)(Vg_DebugMsg, "Tracing address %s <> 0x%x\n",
- trace_address, drd_trace_address);
-#endif
}
if (trace_barrier)
barrier_set_trace(trace_barrier);
if (trace_cond)
cond_set_trace(trace_cond);
+ if (trace_csw)
+ thread_trace_context_switches(trace_csw);
+ if (trace_danger_set)
+ thread_trace_danger_set(trace_danger_set);
if (trace_mutex)
mutex_set_trace(trace_mutex);
if (trace_segment)
@@ -714,9 +718,6 @@
void drd_fini(Int exitcode)
{
// thread_print_all();
-#ifdef OLD_RACE_DETECTION_ALGORITHM
- thread_report_all_races();
-#endif
if (VG_(clo_verbosity) > 1 || drd_print_stats)
{
VG_(message)(Vg_DebugMsg,
@@ -724,12 +725,7 @@
" / %lld updates of the danger set",
thread_get_context_switch_count(),
thread_get_update_danger_set_count());
-#ifdef OLD_RACE_DETECTION_ALGORITHM
VG_(message)(Vg_DebugMsg,
- " analysis: %lld data race analysis points",
- thread_get_report_races_count());
-#endif
- VG_(message)(Vg_DebugMsg,
" segments: %lld total, %lld max, %lld discard points",
sg_get_segments_created_count(),
sg_get_max_segments_alive_count(),
|
|
From: <sv...@va...> - 2008-02-24 18:42:55
|
Author: bart
Date: 2008-02-24 18:42:53 +0000 (Sun, 24 Feb 2008)
New Revision: 7449
Log:
Fixed race conditions in client pthread_barrier_wait() intercept code.
Modified:
trunk/exp-drd/drd_barrier.c
Modified: trunk/exp-drd/drd_barrier.c
===================================================================
--- trunk/exp-drd/drd_barrier.c 2008-02-24 18:37:08 UTC (rev 7448)
+++ trunk/exp-drd/drd_barrier.c 2008-02-24 18:42:53 UTC (rev 7449)
@@ -38,31 +38,34 @@
// Type definitions.
-struct barrier_thread_info
-{
- UWord tid; // A DrdThreadId
- Word iteration; // barrier number corresponding to ongoing
- // pthread_barrier() call modulo two.
- VectorClock vc[2]; // vector clocks corresponding to the last two
- // pthread_barrier() calls.
-};
-
+/* Information associated with a client-side pthread_barrier_t object. */
struct barrier_info
{
Addr barrier; // Client address of barrier.
SizeT size; // Size in bytes of client-side object.
Word count; // Participant count in a barrier wait.
- Word iteration; // barrier number corresponding to ongoing
- // pthread_barrier() call modulo two.
- Word participants; // Number of participants that still have to join
- // the most recent barrier.
- OSet* oset; // Information about specific threads.
+ Word pre_iteration; // pthread_barrier_wait() call count modulo two.
+ Word post_iteration; // pthread_barrier_wait() call count modulo two.
+ Word pre_waiters_left; // number of waiters left for a complete barrier.
+ Word post_waiters_left; // number of waiters left for a complete barrier.
+ OSet* oset; // Thread-specific barrier information.
};
+/* Information associated with one thread participating in a barrier. */
+struct barrier_thread_info
+{
+ UWord tid; // A DrdThreadId
+ Word iteration; // iteration of last pthread_barrier_wait()
+ // call thread tid participated in.
+ VectorClock vc[2]; // vector clocks corresponding to the last two
+ // pthread_barrier() calls by thread tid.
+};
+
// Local variables.
static Bool s_trace_barrier = False;
+/* To do: eliminate the upper limit on the number of barriers (4). */
struct barrier_info s_barrier[4];
@@ -73,6 +76,8 @@
s_trace_barrier = trace_barrier;
}
+/** Initialize the structure *p with the specified thread ID and iteration
+ * information. */
static void barrier_thread_initialize(struct barrier_thread_info* const p,
const DrdThreadId tid,
const Word iteration)
@@ -83,12 +88,15 @@
vc_init(&p->vc[1], 0, 0);
}
+/** Deallocate the memory that was allocated in barrier_thread_initialize(). */
static void barrier_thread_destroy(struct barrier_thread_info* const p)
{
vc_cleanup(&p->vc[0]);
vc_cleanup(&p->vc[1]);
}
+/** Initialize the structure *p with the specified client-side barrier address,
+ * barrier object size and number of participants in each barrier. */
static
void barrier_initialize(struct barrier_info* const p,
const Addr barrier,
@@ -99,17 +107,20 @@
tl_assert(size > 0);
tl_assert(count > 0);
- p->barrier = barrier;
- p->size = size;
- p->count = count;
- p->iteration = 0;
- p->participants = count;
+ p->barrier = barrier;
+ p->size = size;
+ p->count = count;
+ p->pre_iteration = 0;
+ p->post_iteration = 0;
+ p->pre_waiters_left = count;
+ p->post_waiters_left = count;
tl_assert(sizeof(((struct barrier_thread_info*)0)->tid) == sizeof(Word));
tl_assert(sizeof(((struct barrier_thread_info*)0)->tid)
>= sizeof(DrdThreadId));
p->oset = VG_(OSetGen_Create)(0, 0, VG_(malloc), VG_(free));
}
+/** Deallocate the memory allocated by barrier_initialize() and in p->oset. */
void barrier_destroy(struct barrier_info* const p)
{
struct barrier_thread_info* q;
@@ -124,13 +135,17 @@
barrier_thread_destroy(q);
}
VG_(OSetGen_Destroy)(p->oset);
- p->barrier = 0;
- p->size = 0;
- p->count = 0;
- p->iteration = 0;
- p->participants = 0;
+ p->barrier = 0;
+ p->size = 0;
+ p->count = 0;
+ p->pre_iteration = 0;
+ p->post_iteration = 0;
+ p->pre_waiters_left = 0;
+ p->post_waiters_left = 0;
}
+/** Look up the client-side barrier address barrier in s_barrier[]. If not
+ * found, add it. */
static
struct barrier_info*
barrier_get_or_allocate(const Addr barrier, const SizeT size, const Word count)
@@ -158,6 +173,8 @@
return 0;
}
+/** Initialize a barrier with client address barrier, client size size, and
+ * where count threads participate in each barrier. */
struct barrier_info*
barrier_init(const Addr barrier, const SizeT size, const Word count)
{
@@ -165,6 +182,8 @@
return barrier_get_or_allocate(barrier, size, count);
}
+/** Look up the address of the information associated with the client-side
+ * barrier object. */
struct barrier_info* barrier_get(const Addr barrier)
{
int i;
@@ -186,26 +205,26 @@
if (s_trace_barrier)
{
VG_(message)(Vg_DebugMsg,
- "[%d] barrier_pre_wait(%p) iteration %d / left %d/%d",
- tid, barrier, p->iteration, p->participants, p->count);
+ "[%d] barrier_pre_wait(%p) iteration %d",
+ tid, barrier, p->pre_iteration);
}
- if (--p->participants <= 0)
- {
- p->iteration = ! p->iteration;
- p->participants = p->count;
- }
q = VG_(OSetGen_Lookup)(p->oset, &word_tid);
if (q == 0)
{
q = VG_(OSetGen_AllocNode)(p->oset, sizeof(*q));
- barrier_thread_initialize(q, tid, p->iteration);
- tl_assert(q->tid == tid);
+ barrier_thread_initialize(q, tid, p->pre_iteration);
VG_(OSetGen_Insert)(p->oset, q);
tl_assert(VG_(OSetGen_Lookup)(p->oset, &word_tid) == q);
}
- tl_assert(VG_(OSetGen_Lookup)(p->oset, &word_tid) == q);
- vc_copy(&q->vc[p->iteration], &thread_get_segment(tid)->vc);
+ vc_assign(&q->vc[p->pre_iteration], &thread_get_segment(tid)->vc);
+ tl_assert(q->vc[p->pre_iteration].size > 0);
+
+ if (--p->pre_waiters_left <= 0)
+ {
+ p->pre_iteration = 1 - p->pre_iteration;
+ p->pre_waiters_left = p->count;
+ }
}
void barrier_post_wait(const DrdThreadId tid, const Addr barrier,
@@ -213,10 +232,12 @@
{
struct barrier_info* const p = barrier_get(barrier);
+ tl_assert(p);
+
if (s_trace_barrier)
{
VG_(message)(Vg_DebugMsg, "[%d] barrier_post_wait(%p) iteration %d",
- tid, barrier, p ? 1 - p->iteration : -1);
+ tid, barrier, p->post_iteration);
}
if (waited)
@@ -225,7 +246,6 @@
struct barrier_thread_info* q;
struct barrier_thread_info* r;
- tl_assert(p);
q = VG_(OSetGen_Lookup)(p->oset, &word_tid);
tl_assert(q);
VG_(OSetGen_ResetIter)(p->oset);
@@ -236,33 +256,48 @@
if (s_trace_barrier)
{
VG_(message)(Vg_DebugMsg,
- "[%d] barrier_post_wait: combining vc of thread %d",
- tid, r->tid);
+ "[%d] barrier_post_wait: combining vc of thread %d, "
+ "iteration %d",
+ tid, r->tid, p->post_iteration);
+ vc_print(&thread_get_segment(tid)->vc);
+ VG_(printf)(", ");
+ vc_print(&r->vc[p->post_iteration]);
+ VG_(printf)(" -> ");
}
- thread_combine_vc2(tid, &r->vc[1 - q->iteration]);
+ thread_combine_vc2(tid, &r->vc[p->post_iteration]);
+ if (s_trace_barrier)
+ {
+ vc_print(&thread_get_segment(tid)->vc);
+ VG_(printf)("\n");
+ }
}
}
+
+ thread_new_segment(tid);
+
+ if (--p->post_waiters_left <= 0)
+ {
+ p->post_iteration = 1 - p->post_iteration;
+ p->post_waiters_left = p->count;
+ }
}
}
-/**
- * Call this function when thread threadid stops to exist, such that the
- * "last owner" field can be cleared if it still refers to that thread.
- */
+/** Call this function when thread tid stops to exist. */
void barrier_thread_delete(const DrdThreadId tid)
{
int i;
- struct barrier_thread_info* q;
for (i = 0; i < sizeof(s_barrier)/sizeof(s_barrier[0]); i++)
{
struct barrier_info* const p = &s_barrier[i];
if (p->barrier)
{
- VG_(OSetGen_ResetIter)(p->oset);
- for ( ; (q = VG_(OSetGen_Next)(p->oset)) != 0; )
- {
- }
+ struct barrier_thread_info* q;
+ const UWord word_tid = tid;
+ q = VG_(OSetGen_Remove)(p->oset, &word_tid);
+ barrier_thread_destroy(q);
+ VG_(OSetGen_FreeNode)(p->oset, q);
}
}
}
|