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
(19) |
Oct
|
Nov
|
Dec
|
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
|
|
1
(12) |
2
(5) |
3
(12) |
4
(9) |
5
(4) |
6
(7) |
|
7
(6) |
8
(10) |
9
(5) |
10
(5) |
11
(4) |
12
(7) |
13
(19) |
|
14
(11) |
15
(9) |
16
(6) |
17
(21) |
18
(13) |
19
(12) |
20
(9) |
|
21
(22) |
22
(24) |
23
(21) |
24
(12) |
25
(6) |
26
(3) |
27
(4) |
|
28
(3) |
29
(5) |
30
(11) |
31
(7) |
|
|
|
|
From: <sv...@va...> - 2008-12-07 11:58:59
|
Author: sewardj
Date: 2008-12-07 11:40:17 +0000 (Sun, 07 Dec 2008)
New Revision: 8810
Log:
Tidy up and comment sanity-checking code/configuration.
Modified:
trunk/helgrind/libhb_core.c
Modified: trunk/helgrind/libhb_core.c
===================================================================
--- trunk/helgrind/libhb_core.c 2008-12-07 01:41:46 UTC (rev 8809)
+++ trunk/helgrind/libhb_core.c 2008-12-07 11:40:17 UTC (rev 8810)
@@ -52,21 +52,61 @@
#include "libhb.h"
-/* fwds for
- Globals needed by other parts of the library. These are set
- once at startup and then never changed. */
-static void (*main_get_stacktrace)( Thr*, Addr*, UWord ) = NULL;
-static ExeContext* (*main_get_EC)( Thr* ) = NULL;
+/////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////
+// //
+// Debugging #defines //
+// //
+/////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////
+/* Check the sanity of shadow values in the core memory state
+ machine. Change #if 0 to #if 1 to enable this. */
+#if 0
+# define CHECK_MSM 1
+#else
+# define CHECK_MSM 0
+#endif
+
+
+/* Check sanity (reference counts, etc) in the conflicting access
+ machinery. Change #if 0 to #if 1 to enable this. */
+#if 0
+# define CHECK_CEM 1
+#else
+# define CHECK_CEM 0
+#endif
+
+
+/* Check sanity in the compressed shadow memory machinery,
+ particularly in its caching innards. Unfortunately there's no
+ almost-zero-cost way to make them selectable at run time. Hence
+ set the #if 0 to #if 1 and rebuild if you want them. */
+#if 0
+# define CHECK_ZSM 1 /* do sanity-check CacheLine stuff */
+# define inline __attribute__((noinline))
+ /* probably want to ditch -fomit-frame-pointer too */
+#else
+# define CHECK_ZSM 0 /* don't sanity-check CacheLine stuff */
+#endif
+
+
/////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////
// //
+// Forward declarations //
// //
-// //
/////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////
+/* fwds for
+ Globals needed by other parts of the library. These are set
+ once at startup and then never changed. */
+static void (*main_get_stacktrace)( Thr*, Addr*, UWord ) = NULL;
+static ExeContext* (*main_get_EC)( Thr* ) = NULL;
+
+
/////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////
// //
@@ -115,28 +155,6 @@
#endif /* ! __HB_ZSM_H */
-/* For the shadow mem cache stuff we may want more intrusive
- checks. Unfortunately there's no almost-zero-cost way to make them
- selectable at run time. Hence set the #if 0 to #if 1 and
- rebuild if you want them. */
-#if 0
-# define SCE_CACHELINE 1 /* do sanity-check CacheLine stuff */
-# define inline __attribute__((noinline))
- /* probably want to ditch -fomit-frame-pointer too */
-#else
-# define SCE_CACHELINE 0 /* don't sanity-check CacheLine stuff */
-#endif
-
-/* For the SegmentID, SegmentSet and SVal stuff we may want more
- intrusive checks. Again there's no zero cost way to do this. Set
- the #if 0 to #if 1 and rebuild if you want them. */
-#if 0
-# define SCE_SVALS 1 /* sanity-check shadow value stuff */
-#else
-# define SCE_SVALS 0
-#endif
-
-
/* Round a up to the next multiple of N. N must be a power of 2 */
#define ROUNDUP(a, N) ((a + N - 1) & ~(N-1))
/* Round a down to the next multiple of N. N must be a power of 2 */
@@ -913,7 +931,7 @@
cl->descrs[tno] = normalise_tree( tree );
}
tl_assert(cloff == N_LINE_ARANGE);
- if (SCE_CACHELINE)
+ if (CHECK_ZSM)
tl_assert(is_sane_CacheLine(cl)); /* EXPENSIVE */
stats__cline_normalises++;
}
@@ -1016,7 +1034,7 @@
lineZ = &sm->linesZ[zix];
/* Generate the data to be stored */
- if (SCE_CACHELINE)
+ if (CHECK_ZSM)
tl_assert(is_sane_CacheLine(cl)); /* EXPENSIVE */
csvalsUsed = -1;
@@ -1033,7 +1051,7 @@
for (k = 0; k < csvalsUsed; k++) {
sv = csvals[k].sval;
- if (SCE_SVALS)
+ if (CHECK_ZSM)
tl_assert(csvals[k].count >= 1 && csvals[k].count <= 8);
/* do we already have it? */
if (sv == lineZ->dict[0]) { j = 0; goto dict_ok; }
@@ -1041,7 +1059,7 @@
if (sv == lineZ->dict[2]) { j = 2; goto dict_ok; }
if (sv == lineZ->dict[3]) { j = 3; goto dict_ok; }
/* no. look for a free slot. */
- if (SCE_SVALS)
+ if (CHECK_ZSM)
tl_assert(sv != SVal_INVALID);
if (lineZ->dict[0]
== SVal_INVALID) { lineZ->dict[0] = sv; j = 0; goto dict_ok; }
@@ -1107,10 +1125,10 @@
lineF->inUse = True;
i = 0;
for (k = 0; k < csvalsUsed; k++) {
- if (SCE_SVALS)
+ if (CHECK_ZSM)
tl_assert(csvals[k].count >= 1 && csvals[k].count <= 8);
sv = csvals[k].sval;
- if (SCE_SVALS)
+ if (CHECK_ZSM)
tl_assert(sv != SVal_INVALID);
for (m = csvals[k].count; m > 0; m--) {
lineF->w64s[i] = sv;
@@ -1121,11 +1139,6 @@
rcinc_LineF(lineF);
stats__cache_F_wbacks++;
}
-
- //if (anyShared)
- // sm->mbHasShared = True;
-
- /* mb_tidy_one_cacheline(); */
}
/* Fetch the cacheline 'wix' from the backing store. The tag
@@ -1270,14 +1283,14 @@
if (is_valid_scache_tag( *tag_old_p )) {
/* EXPENSIVE and REDUNDANT: callee does it */
- if (SCE_CACHELINE)
+ if (CHECK_ZSM)
tl_assert(is_sane_CacheLine(cl)); /* EXPENSIVE */
cacheline_wback( wix );
}
/* and reload the new one */
*tag_old_p = tag;
cacheline_fetch( wix );
- if (SCE_CACHELINE)
+ if (CHECK_ZSM)
tl_assert(is_sane_CacheLine(cl)); /* EXPENSIVE */
return cl;
}
@@ -3248,11 +3261,13 @@
if (0)
VG_(printf)("libhb: event_map GC at size %lu\n", oldrefTreeN);
- /* Check our counting is sane */
- tl_assert(oldrefTreeN == VG_(sizeSWA)( oldrefTree ));
+ /* Check our counting is sane (expensive) */
+ if (CHECK_CEM)
+ tl_assert(oldrefTreeN == VG_(sizeSWA)( oldrefTree ));
- /* Check the reference counts */
- event_map__check_reference_counts( True/*before*/ );
+ /* Check the reference counts (expensive) */
+ if (CHECK_CEM)
+ event_map__check_reference_counts( True/*before*/ );
/* Compute the distribution of generation values in the ref tree.
There are likely only to be a few different generation numbers
@@ -3484,8 +3499,9 @@
}
}
- /* Check the reference counts */
- event_map__check_reference_counts( False/*after*/ );
+ /* Check the reference counts (expensive) */
+ if (CHECK_CEM)
+ event_map__check_reference_counts( False/*after*/ );
//if (0)
//VG_(printf)("XXXX final sizes: oldrefTree %ld, contextTree %ld\n\n",
@@ -3503,10 +3519,6 @@
/* Logic in msm_read/msm_write updated/verified after re-analysis,
19 Nov 08. */
-#define MSM_CONFACC 1
-
-#define MSM_CHECK 0
-
/* 19 Nov 08: it seems that MSM_RACE2ERR == 1 is a bad idea. When
nonzero, the effect is that when a race is detected for a location,
that location is put into a special 'error' state and no further
@@ -3519,11 +3531,11 @@
subsequent race -- including ones we want to see -- will never be
detected until the location is deallocated and reallocated.
- Hence set MSM_CHECK to zero. This causes raced-on locations to
+ Hence set MSM_RACE2ERR to zero. This causes raced-on locations to
remain in the normal 'C' (constrained) state, but places on them
the constraint that the next accesses happen-after both the
existing constraint and the relevant vector clock of the thread
- doing the racing access.
+ doing the racing access.
*/
#define MSM_RACE2ERR 0
@@ -3570,7 +3582,7 @@
stats__msm_read++;
/* Redundant sanity check on the constraints */
- if (MSM_CHECK) {
+ if (CHECK_MSM) {
tl_assert(is_sane_SVal_C(svOld));
}
@@ -3593,15 +3605,16 @@
tl_assert(ordxx == POrd_EQ || ordxx == POrd_LT);
svNew = MSM_RACE2ERR
? SVal__mkE()
-#if 0
- //std
+ /* see comments on corresponding fragment in
+ msm_write for explanation. */
+ /* aggressive setting: */
+ /*
: SVal__mkC( VtsID__join2(wmini,tviR),
VtsID__join2(wmini,tviW) );
-#else
- // relaxed
+ */
+ /* "consistent" setting: */
: SVal__mkC( VtsID__join2(rmini,tviR),
VtsID__join2(wmini,tviW) );
-#endif
record_race_info( acc_thr, acc_addr, szB, False/*!isWrite*/,
svOld, svNew );
goto out;
@@ -3623,12 +3636,12 @@
tl_assert(0);
out:
- if (MSM_CHECK) {
+ if (CHECK_MSM) {
tl_assert(is_sane_SVal_C(svNew));
}
tl_assert(svNew != SVal_INVALID);
if (svNew != svOld) {
- if (MSM_CONFACC && SVal__isC(svOld) && SVal__isC(svNew)) {
+ if (SVal__isC(svOld) && SVal__isC(svNew)) {
event_map_bind( acc_addr, szB, False/*!isWrite*/, acc_thr );
stats__msm_read_change++;
}
@@ -3648,7 +3661,7 @@
stats__msm_write++;
/* Redundant sanity check on the constraints */
- if (MSM_CHECK) {
+ if (CHECK_MSM) {
tl_assert(is_sane_SVal_C(svOld));
}
@@ -3670,15 +3683,20 @@
tl_assert(ordxx == POrd_EQ || ordxx == POrd_LT);
svNew = MSM_RACE2ERR
? SVal__mkE()
-#if 0
- // std
+ /* One possibility is, after a race is seen, to
+ set the location's constraints as aggressively
+ (as far ahead) as possible. However, that just
+ causes lots more races to be reported, which is
+ very confusing. Hence don't do this. */
+ /*
: SVal__mkC( VtsID__join2(wmini,tviR),
VtsID__join2(wmini,tviW) );
-#else
- // relaxed
+ */
+ /* instead, re-set the constraints in a way which
+ is consistent with (ie, as they would have been
+ computed anyway) had no race been detected. */
: SVal__mkC( VtsID__join2(rmini,tviR),
VtsID__join2(wmini,tviW) );
-#endif
record_race_info( acc_thr, acc_addr, szB, True/*isWrite*/,
svOld, svNew );
goto out;
@@ -3700,12 +3718,12 @@
tl_assert(0);
out:
- if (MSM_CHECK) {
+ if (CHECK_MSM) {
tl_assert(is_sane_SVal_C(svNew));
}
tl_assert(svNew != SVal_INVALID);
if (svNew != svOld) {
- if (MSM_CONFACC && SVal__isC(svOld) && SVal__isC(svNew)) {
+ if (SVal__isC(svOld) && SVal__isC(svNew)) {
event_map_bind( acc_addr, szB, True/*isWrite*/, acc_thr );
stats__msm_write_change++;
}
@@ -3736,7 +3754,7 @@
if (UNLIKELY( !(descr & (TREE_DESCR_8_0 << toff)) )) {
SVal* tree = &cl->svals[tno << 3];
cl->descrs[tno] = pulldown_to_8(tree, toff, descr);
- if (SCE_CACHELINE)
+ if (CHECK_ZSM)
tl_assert(is_sane_CacheLine(cl)); /* EXPENSIVE */
}
svOld = cl->svals[cloff];
@@ -3759,7 +3777,7 @@
if (UNLIKELY( !(descr & (TREE_DESCR_8_0 << toff)) )) {
SVal* tree = &cl->svals[tno << 3];
cl->descrs[tno] = pulldown_to_8(tree, toff, descr);
- if (SCE_CACHELINE)
+ if (CHECK_ZSM)
tl_assert(is_sane_CacheLine(cl)); /* EXPENSIVE */
}
svOld = cl->svals[cloff];
@@ -3789,7 +3807,7 @@
SVal* tree = &cl->svals[tno << 3];
cl->descrs[tno] = pulldown_to_16(tree, toff, descr);
}
- if (SCE_CACHELINE)
+ if (CHECK_ZSM)
tl_assert(is_sane_CacheLine(cl)); /* EXPENSIVE */
}
svOld = cl->svals[cloff];
@@ -3822,7 +3840,7 @@
SVal* tree = &cl->svals[tno << 3];
cl->descrs[tno] = pulldown_to_16(tree, toff, descr);
}
- if (SCE_CACHELINE)
+ if (CHECK_ZSM)
tl_assert(is_sane_CacheLine(cl)); /* EXPENSIVE */
}
svOld = cl->svals[cloff];
@@ -3856,7 +3874,7 @@
} else {
goto slowcase;
}
- if (SCE_CACHELINE)
+ if (CHECK_ZSM)
tl_assert(is_sane_CacheLine(cl)); /* EXPENSIVE */
}
svOld = cl->svals[cloff];
@@ -3888,7 +3906,7 @@
} else {
goto slowcase;
}
- if (SCE_CACHELINE)
+ if (CHECK_ZSM)
tl_assert(is_sane_CacheLine(cl)); /* EXPENSIVE */
}
svOld = cl->svals[cloff];
@@ -3972,7 +3990,7 @@
if (UNLIKELY( !(descr & (TREE_DESCR_8_0 << toff)) )) {
SVal* tree = &cl->svals[tno << 3];
cl->descrs[tno] = pulldown_to_8(tree, toff, descr);
- if (SCE_CACHELINE)
+ if (CHECK_ZSM)
tl_assert(is_sane_CacheLine(cl)); /* EXPENSIVE */
}
tl_assert(svNew != SVal_INVALID);
@@ -4005,7 +4023,7 @@
its parent. So first, pull down to this level. */
SVal* tree = &cl->svals[tno << 3];
cl->descrs[tno] = pulldown_to_16(tree, toff, descr);
- if (SCE_CACHELINE)
+ if (CHECK_ZSM)
tl_assert(is_sane_CacheLine(cl)); /* EXPENSIVE */
}
}
@@ -4040,7 +4058,7 @@
its parent. So first, pull down to this level. */
SVal* tree = &cl->svals[tno << 3];
cl->descrs[tno] = pulldown_to_32(tree, toff, descr);
- if (SCE_CACHELINE)
+ if (CHECK_ZSM)
tl_assert(is_sane_CacheLine(cl)); /* EXPENSIVE */
} else {
/* Writing at this level. Need to fix up 'descr'. */
|
|
From: Tom H. <th...@cy...> - 2008-12-07 04:11:44
|
Nightly build on alvis ( i686, Red Hat 7.3 ) started at 2008-12-07 03:15:02 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 == 374 tests, 89 stderr failures, 1 stdout failure, 29 post failures == exp-ptrcheck/tests/bad_percentify (stderr) exp-ptrcheck/tests/base (stderr) exp-ptrcheck/tests/ccc (stderr) exp-ptrcheck/tests/fp (stderr) exp-ptrcheck/tests/globalerr (stderr) exp-ptrcheck/tests/hackedbz2 (stderr) exp-ptrcheck/tests/hp_bounds (stderr) exp-ptrcheck/tests/hp_dangle (stderr) exp-ptrcheck/tests/justify (stderr) exp-ptrcheck/tests/partial_bad (stderr) exp-ptrcheck/tests/partial_good (stderr) exp-ptrcheck/tests/preen_invars (stderr) exp-ptrcheck/tests/pth_create (stderr) exp-ptrcheck/tests/pth_specific (stderr) exp-ptrcheck/tests/realloc (stderr) exp-ptrcheck/tests/stackerr (stderr) exp-ptrcheck/tests/strcpy (stderr) exp-ptrcheck/tests/supp (stderr) exp-ptrcheck/tests/tricky (stderr) exp-ptrcheck/tests/unaligned (stderr) exp-ptrcheck/tests/zero (stderr) helgrind/tests/bar_bad (stderr) helgrind/tests/bar_trivial (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/hg06_readshared (stderr) helgrind/tests/pth_barrier1 (stderr) helgrind/tests/pth_barrier2 (stderr) helgrind/tests/pth_barrier3 (stderr) helgrind/tests/rwlock_race (stderr) helgrind/tests/rwlock_test (stderr) helgrind/tests/tc01_simple_race (stderr) helgrind/tests/tc02_simple_tls (stderr) helgrind/tests/tc03_re_excl (stderr) helgrind/tests/tc04_free_lock (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) 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) memcheck/tests/leak-0 (stderr) memcheck/tests/leak-cycle (stderr) memcheck/tests/leak-regroot (stderr) memcheck/tests/leak-tree (stderr) memcheck/tests/long_namespace_xml (stderr) memcheck/tests/malloc_free_fill (stderr) memcheck/tests/mismatches (stderr) memcheck/tests/origin1-yes (stderr) memcheck/tests/origin4-many (stderr) memcheck/tests/origin5-bz2 (stderr) memcheck/tests/pointer-trace (stderr) memcheck/tests/stack_changes (stderr) memcheck/tests/varinfo1 (stderr) memcheck/tests/varinfo2 (stderr) memcheck/tests/varinfo3 (stderr) memcheck/tests/varinfo4 (stderr) memcheck/tests/varinfo5 (stderr) memcheck/tests/varinfo6 (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) none/tests/blockfault (stderr) none/tests/mremap2 (stdout) none/tests/shell (stderr) none/tests/shell_valid1 (stderr) none/tests/shell_valid2 (stderr) none/tests/shell_valid3 (stderr) |
|
From: Tom H. <th...@cy...> - 2008-12-07 04:09:05
|
Nightly build on lloyd ( x86_64, Fedora 7 ) started at 2008-12-07 03:05:08 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 == 471 tests, 24 stderr failures, 0 stdout failures, 0 post failures == exp-ptrcheck/tests/base (stderr) exp-ptrcheck/tests/ccc (stderr) exp-ptrcheck/tests/preen_invars (stderr) exp-ptrcheck/tests/pth_create (stderr) exp-ptrcheck/tests/pth_specific (stderr) helgrind/tests/bar_bad (stderr) helgrind/tests/hg03_inherit (stderr) helgrind/tests/hg04_race (stderr) helgrind/tests/hg05_race2 (stderr) helgrind/tests/pth_barrier1 (stderr) helgrind/tests/pth_barrier2 (stderr) helgrind/tests/pth_barrier3 (stderr) helgrind/tests/rwlock_race (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/tc16_byterace (stderr) helgrind/tests/tc19_shadowmem (stderr) helgrind/tests/tc20_verifywrap (stderr) helgrind/tests/tc21_pthonce (stderr) helgrind/tests/tc22_exit_w_lock (stderr) memcheck/tests/x86/scalar (stderr) none/tests/blockfault (stderr) |
|
From: Tom H. <th...@cy...> - 2008-12-07 03:47:42
|
Nightly build on trojan ( x86_64, Fedora Core 6 ) started at 2008-12-07 03:25:06 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 == 475 tests, 23 stderr failures, 4 stdout failures, 0 post failures == exp-ptrcheck/tests/ccc (stderr) exp-ptrcheck/tests/preen_invars (stderr) exp-ptrcheck/tests/pth_create (stderr) exp-ptrcheck/tests/pth_specific (stderr) helgrind/tests/hg03_inherit (stderr) helgrind/tests/hg04_race (stderr) helgrind/tests/hg05_race2 (stderr) helgrind/tests/pth_barrier1 (stderr) helgrind/tests/pth_barrier2 (stderr) helgrind/tests/pth_barrier3 (stderr) helgrind/tests/rwlock_race (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/tc16_byterace (stderr) helgrind/tests/tc19_shadowmem (stderr) helgrind/tests/tc20_verifywrap (stderr) helgrind/tests/tc21_pthonce (stderr) helgrind/tests/tc22_exit_w_lock (stderr) memcheck/tests/x86/bug133694 (stdout) memcheck/tests/x86/bug133694 (stderr) memcheck/tests/x86/scalar (stderr) none/tests/blockfault (stderr) none/tests/cmdline1 (stdout) none/tests/cmdline2 (stdout) none/tests/mremap2 (stdout) |
|
From: Tom H. <th...@cy...> - 2008-12-07 03:29:44
|
Nightly build on gill ( x86_64, Fedora Core 2 ) started at 2008-12-07 03:00:04 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 == 477 tests, 37 stderr failures, 3 stdout failures, 0 post failures == exp-ptrcheck/tests/ccc (stderr) exp-ptrcheck/tests/hackedbz2 (stderr) helgrind/tests/bar_bad (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/pth_barrier1 (stderr) helgrind/tests/pth_barrier2 (stderr) helgrind/tests/pth_barrier3 (stderr) helgrind/tests/rwlock_race (stderr) helgrind/tests/rwlock_test (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) memcheck/tests/malloc_free_fill (stderr) memcheck/tests/origin5-bz2 (stderr) memcheck/tests/stack_switch (stderr) memcheck/tests/varinfo6 (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/mremap2 (stdout) none/tests/x86/insn_ssse3 (stdout) none/tests/x86/insn_ssse3 (stderr) none/tests/x86/ssse3_misaligned (stderr) |
|
From: <sv...@va...> - 2008-12-07 01:56:20
|
Author: sewardj
Date: 2008-12-07 01:41:46 +0000 (Sun, 07 Dec 2008)
New Revision: 8809
Log:
* In the conflicting-event mechanism, also record the size and
read-or-writeness of each access, so that these can be displayed in
error messages.
* Use recorded read-or-writeness info to avoid producing error
messages that claim claim two reads race against each other -- this
is clearly silly. For each pair of racing accesses now reported, at
least one of them will (should!) always now be a write, and (as
previously ensured) they will be from different threads.
* Lookups in the conflicting-access map is expensive, so don't do that
as soon as a race is detected. Instead wait until the update_extra
method is called.
Modified:
trunk/helgrind/hg_errors.c
trunk/helgrind/hg_errors.h
trunk/helgrind/libhb.h
trunk/helgrind/libhb_core.c
Modified: trunk/helgrind/hg_errors.c
===================================================================
--- trunk/helgrind/hg_errors.c 2008-12-06 23:34:52 UTC (rev 8808)
+++ trunk/helgrind/hg_errors.c 2008-12-07 01:41:46 UTC (rev 8809)
@@ -43,6 +43,7 @@
#include "hg_basics.h"
#include "hg_wordset.h"
#include "hg_lock_n_thread.h"
+#include "libhb.h"
#include "hg_errors.h" /* self */
@@ -190,6 +191,8 @@
ExeContext* mb_confacc;
Thread* thr;
Thread* mb_confaccthr;
+ Int mb_confaccSzB;
+ Bool mb_confaccIsW;
Char descr1[96];
Char descr2[96];
} Race;
@@ -266,6 +269,11 @@
raced-upon address. This is potentially expensive, which is
why it's only done at the update_extra point, not when the
error is initially created. */
+ static Int xxx = 0;
+ xxx++;
+ if (0)
+ VG_(printf)("HG_(update_extra): "
+ "%d conflicting-event queries\n", xxx);
tl_assert(sizeof(xe->XE.Race.descr1) == sizeof(xe->XE.Race.descr2));
if (VG_(get_data_description)(
&xe->XE.Race.descr1[0],
@@ -277,6 +285,30 @@
tl_assert( xe->XE.Race.descr2
[ sizeof(xe->XE.Race.descr2)-1 ] == 0);
}
+ { Thr* thrp = NULL;
+ ExeContext* wherep = NULL;
+ Addr acc_addr = xe->XE.Race.data_addr;
+ Int acc_szB = xe->XE.Race.szB;
+ Thr* acc_thr = xe->XE.Race.thr->hbthr;
+ Bool acc_isW = xe->XE.Race.isWrite;
+ SizeT conf_szB = 0;
+ Bool conf_isW = False;
+ tl_assert(!xe->XE.Race.mb_confacc);
+ tl_assert(!xe->XE.Race.mb_confaccthr);
+ if (libhb_event_map_lookup(
+ &wherep, &thrp, &conf_szB, &conf_isW,
+ acc_thr, acc_addr, acc_szB, acc_isW )) {
+ Thread* threadp;
+ tl_assert(wherep);
+ tl_assert(thrp);
+ threadp = libhb_get_Thr_opaque( thrp );
+ tl_assert(threadp);
+ xe->XE.Race.mb_confacc = wherep;
+ xe->XE.Race.mb_confaccthr = threadp;
+ xe->XE.Race.mb_confaccSzB = (Int)conf_szB;
+ xe->XE.Race.mb_confaccIsW = conf_isW;
+ }
+ }
}
return sizeof(XError);
@@ -284,9 +316,7 @@
void HG_(record_error_Race) ( Thread* thr,
Addr data_addr, Bool isWrite, Int szB,
- ExeContext* mb_lastlock,
- ExeContext* mb_confacc,
- Thread* mb_confaccthr )
+ ExeContext* mb_lastlock )
{
XError xe;
tl_assert( HG_(is_sane_Thread)(thr) );
@@ -311,13 +341,20 @@
xe.XE.Race.szB = szB;
xe.XE.Race.isWrite = isWrite;
xe.XE.Race.mb_lastlock = mb_lastlock;
- xe.XE.Race.mb_confacc = mb_confacc;
xe.XE.Race.thr = thr;
- xe.XE.Race.mb_confaccthr = mb_confaccthr;
tl_assert(isWrite == False || isWrite == True);
// tl_assert(szB == 8 || szB == 4 || szB == 2 || szB == 1);
xe.XE.Race.descr1[0] = xe.XE.Race.descr2[0] = 0;
// FIXME: tid vs thr
+ // Skip on any of the conflicting-access info at this point.
+ // It's expensive to obtain, and this error is more likely than
+ // not to be discarded. We'll fill these fields in in
+ // HG_(update_extra) just above, assuming the error ever makes
+ // it that far (unlikely).
+ xe.XE.Race.mb_confaccSzB = 0;
+ xe.XE.Race.mb_confaccIsW = False;
+ xe.XE.Race.mb_confacc = NULL;
+ xe.XE.Race.mb_confaccthr = NULL;
tl_assert( HG_(is_sane_ThreadId)(thr->coretid) );
tl_assert( thr->coretid != VG_INVALID_THREADID );
VG_(maybe_record_error)( thr->coretid,
@@ -673,12 +710,17 @@
if (xe->XE.Race.mb_confacc) {
if (xe->XE.Race.mb_confaccthr) {
VG_(message)(Vg_UserMsg,
- " This conflicts with a previous access by thread #%d",
+ " This conflicts with a previous %s of size %d by thread #%d",
+ xe->XE.Race.mb_confaccIsW ? "write" : "read",
+ xe->XE.Race.mb_confaccSzB,
xe->XE.Race.mb_confaccthr->errmsg_index
);
} else {
+ // FIXME: can this ever happen?
VG_(message)(Vg_UserMsg,
- " This conflicts with a previous access"
+ " This conflicts with a previous %s of size %d",
+ xe->XE.Race.mb_confaccIsW ? "write" : "read",
+ xe->XE.Race.mb_confaccSzB
);
}
VG_(pp_ExeContext)( xe->XE.Race.mb_confacc );
Modified: trunk/helgrind/hg_errors.h
===================================================================
--- trunk/helgrind/hg_errors.h 2008-12-06 23:34:52 UTC (rev 8808)
+++ trunk/helgrind/hg_errors.h 2008-12-07 01:41:46 UTC (rev 8809)
@@ -48,9 +48,7 @@
/* Functions for recording various kinds of errors. */
void HG_(record_error_Race) ( Thread* thr,
Addr data_addr, Bool isWrite, Int szB,
- ExeContext* mb_lastlock,
- ExeContext* mb_confacc,
- Thread* mb_confaccthr );
+ ExeContext* mb_lastlock );
void HG_(record_error_FreeMemLock) ( Thread* thr, Lock* lk );
void HG_(record_error_UnlockUnlocked) ( Thread*, Lock* );
void HG_(record_error_UnlockForeign) ( Thread*, Thread*, Lock* );
Modified: trunk/helgrind/libhb.h
===================================================================
--- trunk/helgrind/libhb.h 2008-12-06 23:34:52 UTC (rev 8808)
+++ trunk/helgrind/libhb.h 2008-12-07 01:41:46 UTC (rev 8809)
@@ -142,6 +142,13 @@
garbage-collect its internal data structures. */
void libhb_maybe_GC ( void );
+/* Extract info from the conflicting-access machinery. */
+Bool libhb_event_map_lookup ( /*OUT*/ExeContext** resEC,
+ /*OUT*/Thr** resThr,
+ /*OUT*/SizeT* resSzB,
+ /*OUT*/Bool* resIsW,
+ Thr* thr, Addr a, SizeT szB, Bool isW );
+
#endif /* __LIBHB_H */
/*--------------------------------------------------------------------*/
Modified: trunk/helgrind/libhb_core.c
===================================================================
--- trunk/helgrind/libhb_core.c 2008-12-06 23:34:52 UTC (rev 8808)
+++ trunk/helgrind/libhb_core.c 2008-12-07 01:41:46 UTC (rev 8809)
@@ -2895,6 +2895,12 @@
// (UInt) `echo "Old Reference Information" | md5sum`
#define OldRef_MAGIC 0x30b1f075UL
+/* Records an access: a thread and a context. The size
+ (1,2,4,8) and read-or-writeness are also encoded as
+ follows: bottom bit of .thr is 1 if write, 0 if read
+ bottom 2 bits of .rcec are encode size:
+ 00 = 1, 01 = 2, 10 = 4, 11 = 8
+*/
typedef struct { Thr* thr; RCEC* rcec; } Thr_n_RCEC;
#define N_OLDREF_ACCS 3
@@ -2929,14 +2935,37 @@
static UWord oldrefTreeN = 0; /* # elems in oldrefTree */
static UWord oldrefGenIncAt = 0; /* inc gen # when size hits this */
-static void event_map_bind ( Addr a, Thr* thr )
+inline static void* ptr_or_UWord ( void* p, UWord w ) {
+ return (void*)( ((UWord)p) | ((UWord)w) );
+}
+inline static void* ptr_and_UWord ( void* p, UWord w ) {
+ return (void*)( ((UWord)p) & ((UWord)w) );
+}
+
+static void event_map_bind ( Addr a, SizeT szB, Bool isW, Thr* thr )
{
OldRef* ref;
- RCEC* here;
+ RCEC* rcec;
Word i, j;
UWord keyW, valW;
Bool b;
+ rcec = get_RCEC( thr );
+ ctxt__rcinc(rcec);
+
+ /* encode the size and writeness of the transaction in the bottom
+ two bits of thr and rcec. */
+ thr = ptr_or_UWord(thr, isW ? 1 : 0);
+ switch (szB) {
+ /* This doesn't look particularly branch-predictor friendly. */
+ case 1: rcec = ptr_or_UWord(rcec, 0); break;
+ case 2: rcec = ptr_or_UWord(rcec, 1); break;
+ case 4: rcec = ptr_or_UWord(rcec, 2); break;
+ case 8: rcec = ptr_or_UWord(rcec, 3); break;
+ default: tl_assert(0);
+ }
+
+ /* Look in the map to see if we already have this. */
b = VG_(lookupSWA)( oldrefTree, &keyW, &valW, a );
if (b) {
@@ -2962,16 +2991,12 @@
ref->accs[i] = tmp;
i--;
}
- here = get_RCEC( thr );
- if (here == ref->accs[i].rcec) stats__ctxt_rcdec1_eq++;
- ctxt__rcinc( here );
+ if (rcec == ref->accs[i].rcec) stats__ctxt_rcdec1_eq++;
stats__ctxt_rcdec1++;
- ctxt__rcdec( ref->accs[i].rcec );
- ref->accs[i].rcec = here;
+ ctxt__rcdec( ptr_and_UWord(ref->accs[i].rcec, ~3) );
+ ref->accs[i].rcec = rcec;
tl_assert(ref->accs[i].thr == thr);
} else {
- here = get_RCEC( thr );
- ctxt__rcinc( here );
/* No entry for this thread. Shuffle all of them down one
slot, and put the new entry at the start of the array. */
if (ref->accs[N_OLDREF_ACCS-1].thr) {
@@ -2979,16 +3004,17 @@
associated rcec. */
tl_assert(ref->accs[N_OLDREF_ACCS-1].rcec);
stats__ctxt_rcdec2++;
- ctxt__rcdec(ref->accs[N_OLDREF_ACCS-1].rcec);
+ ctxt__rcdec( ptr_and_UWord(ref->accs[N_OLDREF_ACCS-1].rcec, ~3) );
} else {
tl_assert(!ref->accs[N_OLDREF_ACCS-1].rcec);
}
for (j = N_OLDREF_ACCS-1; j >= 1; j--)
ref->accs[j] = ref->accs[j-1];
ref->accs[0].thr = thr;
- ref->accs[0].rcec = here;
- tl_assert(thr); /* thr==NULL is used to signify an empty slot,
- so we can't add a NULL thr. */
+ ref->accs[0].rcec = rcec;
+ /* thr==NULL is used to signify an empty slot, so we can't
+ add a NULL thr. */
+ tl_assert(ptr_and_UWord(thr, ~3) != 0);
}
ref->gen = oldrefGen;
@@ -3002,17 +3028,15 @@
if (0) VG_(printf)("oldrefTree: new gen %lu at size %lu\n",
oldrefGen, oldrefTreeN );
}
- here = get_RCEC( thr );
- ctxt__rcinc(here);
-
ref = alloc_OldRef();
ref->magic = OldRef_MAGIC;
ref->gen = oldrefGen;
- ref->accs[0].rcec = here;
+ ref->accs[0].rcec = rcec;
ref->accs[0].thr = thr;
- tl_assert(thr); /* thr==NULL is used to signify an empty slot,
- so we can't add a NULL thr. */
+ /* thr==NULL is used to signify an empty slot, so we can't
+ add a NULL thr. */
+ tl_assert(ptr_and_UWord(thr, ~3) != 0);
for (j = 1; j < N_OLDREF_ACCS; j++) {
ref->accs[j].thr = NULL;
ref->accs[j].rcec = NULL;
@@ -3024,18 +3048,25 @@
}
-static
-Bool event_map_lookup ( /*OUT*/ExeContext** resEC,
- /*OUT*/Thr** resThr,
- Thr* thr_acc, Addr a )
+Bool libhb_event_map_lookup ( /*OUT*/ExeContext** resEC,
+ /*OUT*/Thr** resThr,
+ /*OUT*/SizeT* resSzB,
+ /*OUT*/Bool* resIsW,
+ Thr* thr, Addr a, SizeT szB, Bool isW )
{
Word i;
OldRef* ref;
UWord keyW, valW;
Bool b;
- tl_assert(thr_acc);
+ Thr* cand_thr;
+ RCEC* cand_rcec;
+ Bool cand_isW;
+ SizeT cand_szB;
+ tl_assert(thr);
+ tl_assert(szB == 8 || szB == 4 || szB == 2 || szB == 1);
+
b = VG_(lookupSWA)( oldrefTree, &keyW, &valW, a );
if (b) {
ref = (OldRef*)valW;
@@ -3043,26 +3074,60 @@
tl_assert(ref->magic == OldRef_MAGIC);
tl_assert(ref->accs[0].thr); /* first slot must always be used */
+ cand_thr = NULL;
+ cand_rcec = NULL;
+ cand_isW = False;
+ cand_szB = 0;
+
for (i = 0; i < N_OLDREF_ACCS; i++) {
- if (ref->accs[i].thr != NULL
- && ref->accs[i].thr != thr_acc)
- break;
+ Thr_n_RCEC* cand = &ref->accs[i];
+ cand_thr = ptr_and_UWord(cand->thr, ~3);
+ cand_rcec = ptr_and_UWord(cand->rcec, ~3);
+ /* Decode the writeness from the bottom bit of .thr. */
+ cand_isW = 1 == (UWord)ptr_and_UWord(cand->thr, 1);
+ /* Decode the size from the bottom two bits of .rcec. */
+ switch ((UWord)ptr_and_UWord(cand->rcec, 3)) {
+ case 0: cand_szB = 1; break;
+ case 1: cand_szB = 2; break;
+ case 2: cand_szB = 4; break;
+ case 3: cand_szB = 8; break;
+ default: tl_assert(0);
+ }
+
+ if (cand_thr == NULL)
+ /* This slot isn't in use. Ignore it. */
+ continue;
+
+ if (cand_thr == thr)
+ /* This is an access by the same thread, but we're only
+ interested in accesses from other threads. Ignore. */
+ continue;
+
+ if ((!cand_isW) && (!isW))
+ /* We don't want to report a read racing against another
+ read; that's stupid. So in this case move on. */
+ continue;
+
+ /* We have a match. Stop searching. */
+ break;
}
- /* If we didn't find an entry for some thread other than
- thr_acc, just return the entry for thread 0. It'll look
- pretty stupid to the user though. */
+
+ tl_assert(i >= 0 && i <= N_OLDREF_ACCS);
+
if (i == N_OLDREF_ACCS)
- i = 0;
+ return False;
- tl_assert(i >= 0 && i < N_OLDREF_ACCS);
- tl_assert(ref->accs[i].thr);
- tl_assert(ref->accs[i].rcec);
- tl_assert(ref->accs[i].rcec->magic == RCEC_MAGIC);
+ tl_assert(cand_thr);
+ tl_assert(cand_rcec);
+ tl_assert(cand_rcec->magic == RCEC_MAGIC);
+ tl_assert(cand_szB >= 1);
*resEC = VG_(make_ExeContext_from_StackTrace)(
- &ref->accs[i].rcec->frames[1], N_FRAMES
+ &cand_rcec->frames[1], N_FRAMES
);
- *resThr = ref->accs[i].thr;
+ *resThr = cand_thr;
+ *resSzB = cand_szB;
+ *resIsW = cand_isW;
return True;
} else {
return False;
@@ -3145,12 +3210,14 @@
oldref = (OldRef*)valW;
tl_assert(oldref->magic == OldRef_MAGIC);
for (i = 0; i < N_OLDREF_ACCS; i++) {
- if (oldref->accs[i].thr) {
- tl_assert(oldref->accs[i].rcec);
- tl_assert(oldref->accs[i].rcec->magic == RCEC_MAGIC);
- oldref->accs[i].rcec->rcX++;
+ Thr* aThr = ptr_and_UWord(oldref->accs[i].thr, ~3);
+ RCEC* aRef = ptr_and_UWord(oldref->accs[i].rcec, ~3);
+ if (aThr) {
+ tl_assert(aRef);
+ tl_assert(aRef->magic == RCEC_MAGIC);
+ aRef->rcX++;
} else {
- tl_assert(!oldref->accs[i].rcec);
+ tl_assert(!aRef);
}
}
}
@@ -3182,8 +3249,7 @@
VG_(printf)("libhb: event_map GC at size %lu\n", oldrefTreeN);
/* Check our counting is sane */
-#warning Fixme1
- //tl_assert(oldrefTreeN == VG_(sizeFM)( oldrefTree ));
+ tl_assert(oldrefTreeN == VG_(sizeSWA)( oldrefTree ));
/* Check the reference counts */
event_map__check_reference_counts( True/*before*/ );
@@ -3379,12 +3445,14 @@
tl_assert(keyW == ga2del);
oldref = (OldRef*)valW;
for (j = 0; j < N_OLDREF_ACCS; j++) {
- if (oldref->accs[j].rcec) {
- tl_assert(oldref->accs[j].thr);
+ Thr* aThr = ptr_and_UWord(oldref->accs[j].thr, ~3);
+ RCEC* aRef = ptr_and_UWord(oldref->accs[j].rcec, ~3);
+ if (aRef) {
+ tl_assert(aThr);
stats__ctxt_rcdec3++;
- ctxt__rcdec( oldref->accs[j].rcec );
+ ctxt__rcdec( aRef );
} else {
- tl_assert(!oldref->accs[j].thr);
+ tl_assert(!aThr);
}
}
@@ -3393,8 +3461,7 @@
VG_(deleteXA)( refs2del );
-#warning Fixme2
- //tl_assert( VG_(sizeFM)( oldrefTree ) == retained );
+ tl_assert( VG_(sizeSWA)( oldrefTree ) == retained );
oldrefTreeN = retained;
oldrefGenIncAt = oldrefTreeN; /* start new gen right away */
@@ -3470,28 +3537,17 @@
Addr acc_addr, SizeT szB, Bool isWrite,
SVal svOld, SVal svNew )
{
- Bool found;
- Thr* thrp = NULL;
- ExeContext* where = NULL;
- ExeContext* wherep = NULL;
- where = main_get_EC( acc_thr );
- found = event_map_lookup( &wherep, &thrp, acc_thr, acc_addr );
- if (found) {
- tl_assert(wherep);
- tl_assert(thrp);
- tl_assert(thrp->opaque);
- tl_assert(acc_thr->opaque);
- HG_(record_error_Race)( acc_thr->opaque, acc_addr,
- isWrite, szB, NULL/*mb_lastlock*/,
- wherep, thrp->opaque );
- } else {
- tl_assert(!wherep);
- tl_assert(!thrp);
- tl_assert(acc_thr->opaque);
- HG_(record_error_Race)( acc_thr->opaque, acc_addr,
- isWrite, szB, NULL/*mb_lastlock*/,
- NULL, NULL );
- }
+ /* Call here to report a race. We just hand it onwards to
+ HG_(record_error_Race). If that in turn discovers that the
+ error is going to be collected, then that queries the
+ conflicting-event map. The alternative would be to query it
+ right here. But that causes a lot of pointless queries for
+ errors which will shortly be discarded as duplicates, and can
+ become a performance overhead; so we defer the query until we
+ know the error is not a duplicate. */
+ tl_assert(acc_thr->opaque);
+ HG_(record_error_Race)( acc_thr->opaque, acc_addr,
+ isWrite, szB, NULL/*mb_lastlock*/ );
}
static Bool is_sane_SVal_C ( SVal sv ) {
@@ -3573,7 +3629,7 @@
tl_assert(svNew != SVal_INVALID);
if (svNew != svOld) {
if (MSM_CONFACC && SVal__isC(svOld) && SVal__isC(svNew)) {
- event_map_bind( acc_addr, acc_thr );
+ event_map_bind( acc_addr, szB, False/*!isWrite*/, acc_thr );
stats__msm_read_change++;
}
}
@@ -3650,7 +3706,7 @@
tl_assert(svNew != SVal_INVALID);
if (svNew != svOld) {
if (MSM_CONFACC && SVal__isC(svOld) && SVal__isC(svNew)) {
- event_map_bind( acc_addr, acc_thr );
+ event_map_bind( acc_addr, szB, True/*isWrite*/, acc_thr );
stats__msm_write_change++;
}
}
|