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
(21) |
|
2
(19) |
3
(33) |
4
(24) |
5
(18) |
6
(13) |
7
(22) |
8
(21) |
|
9
(38) |
10
(25) |
11
(20) |
12
(27) |
13
(43) |
14
(9) |
15
(19) |
|
16
(37) |
17
(19) |
18
(13) |
19
(11) |
20
(8) |
21
(11) |
22
(25) |
|
23
(21) |
24
(30) |
25
(18) |
26
(11) |
27
(10) |
28
(14) |
29
(40) |
|
30
(24) |
31
(14) |
|
|
|
|
|
|
From: <sv...@va...> - 2008-03-12 20:58:22
|
Author: sewardj
Date: 2008-03-12 20:58:23 +0000 (Wed, 12 Mar 2008)
New Revision: 7661
Log:
Don't allow undefinedness to propagate through floating point primops
("lazy approximation" in the USENIX05 paper). Instead check the
operands, complain immediately if either are undefined, and then mark
both the result and the operands as defined ("eager approximation").
Result is that uses of uninitialised floating point values tend to be
reported much closer to the original source of the undefinedness. The
idea to try eager approximation for FP is due to Nick Nethercote.
Currently only the following primops have been changed to the new
behaviour:
Iop_Add64F0x2 Iop_Sub64F0x2 Iop_Mul64F0x2 Iop_Div64F0x2
Iop_MAddF64 Iop_MAddF64r32 Iop_MSubF64 Iop_MSubF64r32
Iop_AddF64 Iop_AddF64r32 Iop_SubF64 Iop_SubF64r32
Iop_MulF64 Iop_MulF64r32 Iop_DivF64 Iop_DivF64r32
Iop_ScaleF64 Iop_Yl2xF64 Iop_Yl2xp1F64 Iop_AtanF64 Iop_PRemF64
Iop_PRem1F64 Iop_PRemC3210F64 Iop_PRem1C3210F64
32-bit FP operations, all unary FP ops (sin, cos, etc), and all SIMD
FP operations, are as-yet unchanged.
Modified:
branches/MCEAGER/memcheck/mc_translate.c
Modified: branches/MCEAGER/memcheck/mc_translate.c
===================================================================
--- branches/MCEAGER/memcheck/mc_translate.c 2008-03-12 20:07:36 UTC (rev 7660)
+++ branches/MCEAGER/memcheck/mc_translate.c 2008-03-12 20:58:23 UTC (rev 7661)
@@ -199,13 +199,15 @@
necessary to give a new value to a shadow once it has been tested
for undefinedness, but unfortunately IR's SSA property disallows
this. Instead we must abandon the old shadow, allocate a new one
- and use that instead. */
-static void newShadowTmp ( MCEnv* mce, IRTemp orig )
+ and use that instead. Returns the new temp. */
+static IRTemp newShadowTmp ( MCEnv* mce, IRTemp orig )
{
+ IRTemp newv;
tl_assert(orig < mce->n_originalTmps);
- mce->tmpMap[orig]
- = newIRTemp(mce->bb->tyenv,
- shadowType(mce->bb->tyenv->types[orig]));
+ newv = newIRTemp(mce->bb->tyenv,
+ shadowType(mce->bb->tyenv->types[orig]));
+ mce->tmpMap[orig] = newv;
+ return newv;
}
@@ -255,7 +257,27 @@
return False;
}
+/* (used for sanity checks only): check that atom/vatom are
+ respectively valid original and shadow atoms, and that vatom is
+ currently the shadow of atom. */
+static Bool isAtomPairOV ( MCEnv* mce, IRAtom* atom, IRAtom* vatom )
+{
+ if (!isOriginalAtom(mce,atom)) return False;
+ if (!isShadowAtom(mce,vatom)) return False;
+ if (!sameKindedAtoms(atom,vatom)) return False;
+ if (atom->tag == Iex_RdTmp) {
+ IRTemp otmp;
+ /* assured by sameKindedAtoms */
+ tl_assert(vatom->tag == Iex_RdTmp);
+ otmp = atom->Iex.RdTmp.tmp;
+ tl_assert(otmp >= 0 && otmp < mce->n_originalTmps);
+ return mce->tmpMap[otmp] == vatom->Iex.RdTmp.tmp;
+ } else {
+ return True;
+ }
+}
+
/*------------------------------------------------------------*/
/*--- Type management ---*/
/*------------------------------------------------------------*/
@@ -319,16 +341,77 @@
#define mkV128(_n) IRExpr_Const(IRConst_V128(_n))
#define mkexpr(_tmp) IRExpr_RdTmp((_tmp))
-/* bind the given expression to a new temporary, and return the
+/* Bind the given expression to a new temporary, and return the
temporary. This effectively converts an arbitrary expression into
an atom. */
static IRAtom* assignNew ( MCEnv* mce, IRType ty, IRExpr* e ) {
+ IRType tyE = typeOfIRExpr(mce->bb->tyenv, e);
+ tl_assert(tyE == ty); /* so 'ty' is redundant (!) */
IRTemp t = newIRTemp(mce->bb->tyenv, ty);
assign(mce->bb, t, e);
return mkexpr(t);
}
+/* Allocate a new shadow temporary for 'atom', and assign to it the
+ value in 'vatom'. Except if 'atom' is a literal, in which case do
+ nothing. */
+static void setShadowTo ( MCEnv* mce, IRAtom* atom, IRAtom* vatom ) {
+ tl_assert(isOriginalAtom(mce,atom));
+ tl_assert(isShadowAtom(mce,vatom));
+ tl_assert(typeOfIRExpr(mce->bb->tyenv, vatom)
+ == shadowType(typeOfIRExpr(mce->bb->tyenv, atom)));
+ if (atom->tag == Iex_RdTmp) {
+ IRTemp tv = newShadowTmp(mce, atom->Iex.RdTmp.tmp);
+ assign(mce->bb, tv, vatom);
+ }
+}
+/* Variant of setShadowTo which creates a new shadow for 'atom'
+ and marks it as defined. */
+static void setShadowToDefined ( MCEnv* mce, IRAtom* atom ) {
+ IRType vty = shadowType(typeOfIRExpr(mce->bb->tyenv, atom));
+ setShadowTo(mce, atom, definedOfType(vty));
+}
+
+/* Set the annotations on a dirty helper to indicate that the stack,
+ frame and instruction pointers might be read. This is the
+ behaviour of all 'emit-a-complaint' style functions we might
+ call. */
+static void setHelperAnns ( MCEnv* mce, IRDirty* di ) {
+ di->nFxState = 2;
+ di->fxState[0].fx = Ifx_Read;
+ di->fxState[0].offset = mce->layout->offset_SP;
+ di->fxState[0].size = mce->layout->sizeof_SP;
+ di->fxState[1].fx = Ifx_Read;
+ di->fxState[1].offset = mce->layout->offset_IP;
+ di->fxState[1].size = mce->layout->sizeof_IP;
+}
+
+/* Generate a call to a definedness-error helper function. 'cond' is
+ the guarding expression and is assumed to have Ity_I1, something
+ that post-instrumentation IR sanity checking will check. */
+static void gen_check_fail_call ( MCEnv* mce, IRAtom* cond, Int errszB )
+{
+ IRDirty* di;
+ switch (errszB) {
+ case 8:
+ di = unsafeIRDirty_0_N(
+ 0/*regparms*/,
+ "MC_(helperc_value_check8_fail)",
+ VG_(fnptr_to_fnentry)( &MC_(helperc_value_check8_fail) ),
+ mkIRExprVec_0()
+ );
+ break;
+ default:
+ tl_assert(0);
+ }
+ /* cond will be 0 if all defined, and 1 if any not defined. */
+ di->guard = cond;
+ setHelperAnns( mce, di );
+ stmt( mce->bb, IRStmt_Dirty(di));
+}
+
+
/*------------------------------------------------------------*/
/*--- Constructing definedness primitive ops ---*/
/*------------------------------------------------------------*/
@@ -851,22 +934,6 @@
/*--- Emit a test and complaint if something is undefined. ---*/
/*------------------------------------------------------------*/
-/* Set the annotations on a dirty helper to indicate that the stack
- pointer and instruction pointers might be read. This is the
- behaviour of all 'emit-a-complaint' style functions we might
- call. */
-
-static void setHelperAnns ( MCEnv* mce, IRDirty* di ) {
- di->nFxState = 2;
- di->fxState[0].fx = Ifx_Read;
- di->fxState[0].offset = mce->layout->offset_SP;
- di->fxState[0].size = mce->layout->sizeof_SP;
- di->fxState[1].fx = Ifx_Read;
- di->fxState[1].offset = mce->layout->offset_IP;
- di->fxState[1].size = mce->layout->sizeof_IP;
-}
-
-
/* Check the supplied **original** atom for undefinedness, and emit a
complaint if so. Once that happens, mark it as defined. This is
possible because the atom is either a tmp or literal. If it's a
@@ -1129,15 +1196,13 @@
/*------------------------------------------------------------*/
-/*--- Generating approximations for unknown operations, ---*/
-/*--- using lazy-propagate semantics ---*/
+/*--- Building general-PCast trees ---*/
/*------------------------------------------------------------*/
-/* Lazy propagation of undefinedness from two values, resulting in the
- specified shadow type.
-*/
+/* Lazy pessimistic propagation of undefinedness from two values,
+ resulting in the specified shadow type. ("general PCast") */
static
-IRAtom* mkLazy2 ( MCEnv* mce, IRType finalVty, IRAtom* va1, IRAtom* va2 )
+IRAtom* genPCast2 ( MCEnv* mce, IRType finalVty, IRAtom* va1, IRAtom* va2 )
{
IRAtom* at;
IRType t1 = typeOfIRExpr(mce->bb->tyenv, va1);
@@ -1151,7 +1216,7 @@
/* I64 x I64 -> I64 */
if (t1 == Ity_I64 && t2 == Ity_I64 && finalVty == Ity_I64) {
- if (0) VG_(printf)("mkLazy2: I64 x I64 -> I64\n");
+ if (0) VG_(printf)("genPCast2: I64 x I64 -> I64\n");
at = mkUifU(mce, Ity_I64, va1, va2);
at = mkPCastTo(mce, Ity_I64, at);
return at;
@@ -1159,14 +1224,14 @@
/* I64 x I64 -> I32 */
if (t1 == Ity_I64 && t2 == Ity_I64 && finalVty == Ity_I32) {
- if (0) VG_(printf)("mkLazy2: I64 x I64 -> I32\n");
+ if (0) VG_(printf)("genPCast2: I64 x I64 -> I32\n");
at = mkUifU(mce, Ity_I64, va1, va2);
at = mkPCastTo(mce, Ity_I32, at);
return at;
}
if (0) {
- VG_(printf)("mkLazy2 ");
+ VG_(printf)("genPCast2 ");
ppIRType(t1);
VG_(printf)("_");
ppIRType(t2);
@@ -1185,8 +1250,8 @@
/* 3-arg version of the above. */
static
-IRAtom* mkLazy3 ( MCEnv* mce, IRType finalVty,
- IRAtom* va1, IRAtom* va2, IRAtom* va3 )
+IRAtom* genPCast3 ( MCEnv* mce, IRType finalVty,
+ IRAtom* va1, IRAtom* va2, IRAtom* va3 )
{
IRAtom* at;
IRType t1 = typeOfIRExpr(mce->bb->tyenv, va1);
@@ -1204,7 +1269,7 @@
/* Standard FP idiom: rm x FParg1 x FParg2 -> FPresult */
if (t1 == Ity_I32 && t2 == Ity_I64 && t3 == Ity_I64
&& finalVty == Ity_I64) {
- if (0) VG_(printf)("mkLazy3: I32 x I64 x I64 -> I64\n");
+ if (0) VG_(printf)("genPCast3: I32 x I64 x I64 -> I64\n");
/* Widen 1st arg to I64. Since 1st arg is typically a rounding
mode indication which is fully defined, this should get
folded out later. */
@@ -1220,7 +1285,7 @@
/* I32 x I64 x I64 -> I32 */
if (t1 == Ity_I32 && t2 == Ity_I64 && t3 == Ity_I64
&& finalVty == Ity_I32) {
- if (0) VG_(printf)("mkLazy3: I32 x I64 x I64 -> I64\n");
+ if (0) VG_(printf)("genPCast3: I32 x I64 x I64 -> I64\n");
at = mkPCastTo(mce, Ity_I64, va1);
at = mkUifU(mce, Ity_I64, at, va2);
at = mkUifU(mce, Ity_I64, at, va3);
@@ -1229,7 +1294,7 @@
}
if (1) {
- VG_(printf)("mkLazy3: ");
+ VG_(printf)("genPCast3: ");
ppIRType(t1);
VG_(printf)(" x ");
ppIRType(t2);
@@ -1254,8 +1319,8 @@
/* 4-arg version of the above. */
static
-IRAtom* mkLazy4 ( MCEnv* mce, IRType finalVty,
- IRAtom* va1, IRAtom* va2, IRAtom* va3, IRAtom* va4 )
+IRAtom* genPCast4 ( MCEnv* mce, IRType finalVty,
+ IRAtom* va1, IRAtom* va2, IRAtom* va3, IRAtom* va4 )
{
IRAtom* at;
IRType t1 = typeOfIRExpr(mce->bb->tyenv, va1);
@@ -1275,7 +1340,7 @@
/* Standard FP idiom: rm x FParg1 x FParg2 x FParg3 -> FPresult */
if (t1 == Ity_I32 && t2 == Ity_I64 && t3 == Ity_I64 && t4 == Ity_I64
&& finalVty == Ity_I64) {
- if (0) VG_(printf)("mkLazy4: I32 x I64 x I64 x I64 -> I64\n");
+ if (0) VG_(printf)("genPCast4: I32 x I64 x I64 x I64 -> I64\n");
/* Widen 1st arg to I64. Since 1st arg is typically a rounding
mode indication which is fully defined, this should get
folded out later. */
@@ -1290,7 +1355,7 @@
}
if (1) {
- VG_(printf)("mkLazy4: ");
+ VG_(printf)("genPCast4: ");
ppIRType(t1);
VG_(printf)(" x ");
ppIRType(t2);
@@ -1313,8 +1378,8 @@
arguments should be ignored (via the .mcx_mask field).
*/
static
-IRAtom* mkLazyN ( MCEnv* mce,
- IRAtom** exprvec, IRType finalVtype, IRCallee* cee )
+IRAtom* genPCastN ( MCEnv* mce,
+ IRAtom** exprvec, IRType finalVtype, IRCallee* cee )
{
Int i;
IRAtom* here;
@@ -1360,6 +1425,133 @@
/*------------------------------------------------------------*/
+/*--- Generating approximations for unknown operations, ---*/
+/*--- for both lazy (silently propagate undefinedness) and ---*/
+/*--- strict (check & report undefinedness, the propogate ---*/
+/*--- definedness) semantics. ---*/
+/*------------------------------------------------------------*/
+
+/* Generate IR to pessimistically fold the definedness of atom1,2,3
+ together. If that produces an undefined result, call a helper
+ function as specified by 'reportErrAtSize' to complain. Finally,
+ set the shadows for atom1,2,3 (if appropriate) to indicate that
+ this value is now defined, so as to avoid error cascades. Finally
+ return a defined shadow value at 'finalVty'.
+
+ We don't care what 'reportErrAtSize' is, in the sense that we're
+ combining the shadows for atom1/2/3 into a single bit result. But
+ we do need to use 'reportErrAtSize' to decide which helper fn to
+ call, so that the user gets a complaint about an undefined value,
+ which is claimed to be of a size which makes sense to the user.
+ eg, it's confusing to emit a complaint about use of uninitialised
+ value of size 2 if the actual data involved is 8(byte). Let the
+ caller of mkStrict3 therefore supply a suitable hint in
+ 'reportErrAtSize'. */
+
+static IRExpr* mkStrict3 ( MCEnv* mce,
+ IRType finalVty,
+ IRAtom* atom1,
+ IRAtom* atom2,
+ IRAtom* atom3,
+ Int reportErrAtSize )
+{
+ IRAtom *combined, *cond, *vatom1, *vatom2, *vatom3;
+ tl_assert(isOriginalAtom(mce,atom1));
+ tl_assert(isOriginalAtom(mce,atom2));
+ tl_assert(isOriginalAtom(mce,atom3));
+ vatom1 = expr2vbits( mce, atom1 );
+ vatom2 = expr2vbits( mce, atom2 );
+ vatom3 = expr2vbits( mce, atom3 );
+ tl_assert(isShadowAtom(mce,vatom1));
+ tl_assert(isShadowAtom(mce,vatom2));
+ tl_assert(isShadowAtom(mce,vatom3));
+ tl_assert(sameKindedAtoms(atom1,vatom1));
+ tl_assert(sameKindedAtoms(atom2,vatom2));
+ tl_assert(sameKindedAtoms(atom3,vatom3));
+
+ combined = genPCast3(mce, Ity_I32, vatom1, vatom2, vatom3);
+ tl_assert(isShadowAtom(mce,combined));
+ cond = mkPCastTo( mce, Ity_I1, combined );
+ tl_assert(isShadowAtom(mce,cond));
+
+ /* cond will be 0 if all defined, and 1 if any not defined. */
+ gen_check_fail_call(mce, cond, reportErrAtSize);
+
+ setShadowToDefined(mce, atom1);
+ setShadowToDefined(mce, atom2);
+ setShadowToDefined(mce, atom3);
+ return definedOfType(finalVty);
+}
+
+
+static IRExpr* mkLazy3 ( MCEnv* mce,
+ IRType finalVty,
+ IRAtom* atom1,
+ IRAtom* atom2,
+ IRAtom* atom3 )
+{
+ IRAtom *vatom1, *vatom2, *vatom3;
+ tl_assert(isOriginalAtom(mce,atom1));
+ tl_assert(isOriginalAtom(mce,atom2));
+ tl_assert(isOriginalAtom(mce,atom3));
+ vatom1 = expr2vbits( mce, atom1 );
+ vatom2 = expr2vbits( mce, atom2 );
+ vatom3 = expr2vbits( mce, atom3 );
+ tl_assert(isShadowAtom(mce,vatom1));
+ tl_assert(isShadowAtom(mce,vatom2));
+ tl_assert(isShadowAtom(mce,vatom3));
+ tl_assert(sameKindedAtoms(atom1,vatom1));
+ tl_assert(sameKindedAtoms(atom2,vatom2));
+ tl_assert(sameKindedAtoms(atom3,vatom3));
+ return genPCast3(mce, finalVty, vatom1, vatom2, vatom3);
+}
+
+
+/* 4-way version of mkStrict3 */
+
+static IRExpr* mkStrict4 ( MCEnv* mce,
+ IRType finalVty,
+ IRAtom* atom1,
+ IRAtom* atom2,
+ IRAtom* atom3,
+ IRAtom* atom4,
+ Int reportErrAtSize )
+{
+ IRAtom *combined, *cond, *vatom1, *vatom2, *vatom3, *vatom4;
+ tl_assert(isOriginalAtom(mce,atom1));
+ tl_assert(isOriginalAtom(mce,atom2));
+ tl_assert(isOriginalAtom(mce,atom3));
+ tl_assert(isOriginalAtom(mce,atom4));
+ vatom1 = expr2vbits( mce, atom1 );
+ vatom2 = expr2vbits( mce, atom2 );
+ vatom3 = expr2vbits( mce, atom3 );
+ vatom4 = expr2vbits( mce, atom4 );
+ tl_assert(isShadowAtom(mce,vatom1));
+ tl_assert(isShadowAtom(mce,vatom2));
+ tl_assert(isShadowAtom(mce,vatom3));
+ tl_assert(isShadowAtom(mce,vatom4));
+ tl_assert(sameKindedAtoms(atom1,vatom1));
+ tl_assert(sameKindedAtoms(atom2,vatom2));
+ tl_assert(sameKindedAtoms(atom3,vatom3));
+ tl_assert(sameKindedAtoms(atom4,vatom4));
+
+ combined = genPCast4(mce, Ity_I32, vatom1, vatom2, vatom3, vatom4);
+ tl_assert(isShadowAtom(mce,combined));
+ cond = mkPCastTo( mce, Ity_I1, combined );
+ tl_assert(isShadowAtom(mce,cond));
+
+ /* cond will be 0 if all defined, and 1 if any not defined. */
+ gen_check_fail_call(mce, cond, reportErrAtSize);
+
+ setShadowToDefined(mce, atom1);
+ setShadowToDefined(mce, atom2);
+ setShadowToDefined(mce, atom3);
+ setShadowToDefined(mce, atom4);
+ return definedOfType(finalVty);
+}
+
+
+/*------------------------------------------------------------*/
/*--- Generating expensive sequences for exact carry-chain ---*/
/*--- propagation in add/sub and related operations. ---*/
/*------------------------------------------------------------*/
@@ -1642,7 +1834,7 @@
}
static
-IRAtom* binary64F0x2 ( MCEnv* mce, IRAtom* vatomX, IRAtom* vatomY )
+IRAtom* lazyBinary64F0x2 ( MCEnv* mce, IRAtom* vatomX, IRAtom* vatomY )
{
IRAtom* at;
tl_assert(isShadowAtom(mce, vatomX));
@@ -1653,7 +1845,34 @@
at = assignNew(mce, Ity_V128, binop(Iop_SetV128lo64, vatomX, at));
return at;
}
+static
+IRAtom* strictBinary64F0x2 ( MCEnv* mce, IRAtom* atomX, IRAtom* vatomX,
+ IRAtom* atomY, IRAtom* vatomY )
+{
+ IRAtom *defd64, *vXlo, *vYlo, *vRlo, *vXnew, *vYnew;
+ tl_assert(isAtomPairOV(mce, atomX, vatomX));
+ tl_assert(isAtomPairOV(mce, atomY, vatomY));
+ vXlo = assignNew(mce, Ity_I64, unop(Iop_V128to64, vatomX));
+ vYlo = assignNew(mce, Ity_I64, unop(Iop_V128to64, vatomY));
+ vRlo = genPCast2(mce, Ity_I1, vXlo, vYlo);
+ gen_check_fail_call(mce, vRlo, 8);
+
+ defd64 = definedOfType(Ity_I64);
+ vXnew = assignNew(mce, Ity_V128,
+ binop(Iop_SetV128lo64, vatomX, defd64));
+ vYnew = assignNew(mce, Ity_V128,
+ binop(Iop_SetV128lo64, vatomY, defd64));
+
+ setShadowTo(mce, atomX, vXnew);
+ setShadowTo(mce, atomY, vYnew);
+ /* return vXnew because the copy-though part (upper half) is
+ defined to come from the first operand, not the second, for
+ 64F0x2 style primops */
+ return vXnew;
+}
+
+
static
IRAtom* unary64F0x2 ( MCEnv* mce, IRAtom* vatomX )
{
@@ -1817,30 +2036,18 @@
IRAtom* atom1, IRAtom* atom2,
IRAtom* atom3, IRAtom* atom4 )
{
- IRAtom* vatom1 = expr2vbits( mce, atom1 );
- IRAtom* vatom2 = expr2vbits( mce, atom2 );
- IRAtom* vatom3 = expr2vbits( mce, atom3 );
- IRAtom* vatom4 = expr2vbits( mce, atom4 );
-
tl_assert(isOriginalAtom(mce,atom1));
tl_assert(isOriginalAtom(mce,atom2));
tl_assert(isOriginalAtom(mce,atom3));
tl_assert(isOriginalAtom(mce,atom4));
- tl_assert(isShadowAtom(mce,vatom1));
- tl_assert(isShadowAtom(mce,vatom2));
- tl_assert(isShadowAtom(mce,vatom3));
- tl_assert(isShadowAtom(mce,vatom4));
- tl_assert(sameKindedAtoms(atom1,vatom1));
- tl_assert(sameKindedAtoms(atom2,vatom2));
- tl_assert(sameKindedAtoms(atom3,vatom3));
- tl_assert(sameKindedAtoms(atom4,vatom4));
switch (op) {
case Iop_MAddF64:
case Iop_MAddF64r32:
case Iop_MSubF64:
case Iop_MSubF64r32:
/* I32(rm) x F64 x F64 x F64 -> F64 */
- return mkLazy4(mce, Ity_I64, vatom1, vatom2, vatom3, vatom4);
+ return mkStrict4(mce, Ity_I64, atom1, atom2, atom3,
+ atom4, 8/*errszB*/);
default:
ppIROp(op);
VG_(tool_panic)("memcheck:expr2vbits_Qop");
@@ -1853,19 +2060,9 @@
IROp op,
IRAtom* atom1, IRAtom* atom2, IRAtom* atom3 )
{
- IRAtom* vatom1 = expr2vbits( mce, atom1 );
- IRAtom* vatom2 = expr2vbits( mce, atom2 );
- IRAtom* vatom3 = expr2vbits( mce, atom3 );
-
tl_assert(isOriginalAtom(mce,atom1));
tl_assert(isOriginalAtom(mce,atom2));
tl_assert(isOriginalAtom(mce,atom3));
- tl_assert(isShadowAtom(mce,vatom1));
- tl_assert(isShadowAtom(mce,vatom2));
- tl_assert(isShadowAtom(mce,vatom3));
- tl_assert(sameKindedAtoms(atom1,vatom1));
- tl_assert(sameKindedAtoms(atom2,vatom2));
- tl_assert(sameKindedAtoms(atom3,vatom3));
switch (op) {
case Iop_AddF64:
case Iop_AddF64r32:
@@ -1882,11 +2079,11 @@
case Iop_PRemF64:
case Iop_PRem1F64:
/* I32(rm) x F64 x F64 -> F64 */
- return mkLazy3(mce, Ity_I64, vatom1, vatom2, vatom3);
+ return mkStrict3(mce, Ity_I64, atom1, atom2, atom3, 8/*errszB*/);
case Iop_PRemC3210F64:
case Iop_PRem1C3210F64:
/* I32(rm) x F64 x F64 -> I32 */
- return mkLazy3(mce, Ity_I32, vatom1, vatom2, vatom3);
+ return mkStrict3(mce, Ity_I32, atom1, atom2, atom3, 8/*errszB*/);
default:
ppIROp(op);
VG_(tool_panic)("memcheck:expr2vbits_Triop");
@@ -2113,17 +2310,18 @@
case Iop_Add64Fx2:
return binary64Fx2(mce, vatom1, vatom2);
+ case Iop_Add64F0x2:
case Iop_Sub64F0x2:
case Iop_Mul64F0x2:
+ case Iop_Div64F0x2:
+ return strictBinary64F0x2(mce, atom1, vatom1, atom2, vatom2);
case Iop_Min64F0x2:
case Iop_Max64F0x2:
- case Iop_Div64F0x2:
case Iop_CmpLT64F0x2:
case Iop_CmpLE64F0x2:
case Iop_CmpEQ64F0x2:
case Iop_CmpUN64F0x2:
- case Iop_Add64F0x2:
- return binary64F0x2(mce, vatom1, vatom2);
+ return lazyBinary64F0x2(mce, vatom1, vatom2);
case Iop_Sub32Fx4:
case Iop_Mul32Fx4:
@@ -2235,29 +2433,29 @@
case Iop_2xm1F64:
case Iop_SqrtF64:
/* I32(rm) x I64/F64 -> I64/F64 */
- return mkLazy2(mce, Ity_I64, vatom1, vatom2);
+ return genPCast2(mce, Ity_I64, vatom1, vatom2);
case Iop_F64toI32:
case Iop_F64toF32:
/* First arg is I32 (rounding mode), second is F64 (data). */
- return mkLazy2(mce, Ity_I32, vatom1, vatom2);
+ return genPCast2(mce, Ity_I32, vatom1, vatom2);
case Iop_F64toI16:
/* First arg is I32 (rounding mode), second is F64 (data). */
- return mkLazy2(mce, Ity_I16, vatom1, vatom2);
+ return genPCast2(mce, Ity_I16, vatom1, vatom2);
case Iop_CmpF64:
- return mkLazy2(mce, Ity_I32, vatom1, vatom2);
+ return genPCast2(mce, Ity_I32, vatom1, vatom2);
/* non-FP after here */
case Iop_DivModU64to32:
case Iop_DivModS64to32:
- return mkLazy2(mce, Ity_I64, vatom1, vatom2);
+ return genPCast2(mce, Ity_I64, vatom1, vatom2);
case Iop_DivModU128to64:
case Iop_DivModS128to64:
- return mkLazy2(mce, Ity_I128, vatom1, vatom2);
+ return genPCast2(mce, Ity_I128, vatom1, vatom2);
case Iop_16HLto32:
return assignNew(mce, Ity_I32, binop(op, vatom1, vatom2));
@@ -2294,11 +2492,11 @@
case Iop_DivS32:
case Iop_DivU32:
- return mkLazy2(mce, Ity_I32, vatom1, vatom2);
+ return genPCast2(mce, Ity_I32, vatom1, vatom2);
case Iop_DivS64:
case Iop_DivU64:
- return mkLazy2(mce, Ity_I64, vatom1, vatom2);
+ return genPCast2(mce, Ity_I64, vatom1, vatom2);
case Iop_Add32:
if (mce->bogusLiterals)
@@ -2754,9 +2952,9 @@
e->Iex.Load.addr, 0/*addr bias*/ );
case Iex_CCall:
- return mkLazyN( mce, e->Iex.CCall.args,
- e->Iex.CCall.retty,
- e->Iex.CCall.cee );
+ return genPCastN( mce, e->Iex.CCall.args,
+ e->Iex.CCall.retty,
+ e->Iex.CCall.cee );
case Iex_Mux0X:
return expr2vbits_Mux0X( mce, e->Iex.Mux0X.cond, e->Iex.Mux0X.expr0,
|
|
From: <sv...@va...> - 2008-03-12 20:07:38
|
Author: sewardj Date: 2008-03-12 20:07:36 +0000 (Wed, 12 Mar 2008) New Revision: 7660 Log: Make a copy of trunk r7659 to be used for the purposes of experimenting with variants on Memcheck's uninitialised-value tracking scheme. Added: branches/MCEAGER/ Copied: branches/MCEAGER (from rev 7659, trunk) |
|
From: Bart V. A. <bar...@gm...> - 2008-03-12 19:00:46
|
On Wed, Mar 5, 2008 at 1:47 AM, Julian Seward <js...@ac...> wrote: ... > The attached tarball gives details of how to use GNU OpenMP in gcc-4.2.3. ... > Good. I will be interested to see the results. ... Hello Julian, Did you notice that neither Helgrind nor DRD print any line number information for races detected in parallel sections in OpenMP programs ? An example: $ ./vg-in-place --tool=helgrind exp-drd/tests/omp_prime 4 -t 2 ... ==11416== Possible data race during write of size 4 at 0x7FEFFFBF0 ==11416== at 0x40120F: main.omp_fn.0 (in /home/bart/software/valgrind/exp-drd/tests/omp_prime) ==11416== by 0x50808DC: gomp_thread_start (in /home/bart/gcc-4.2.3/lib64/libgomp.so.1.0.0) ==11416== by 0x4C2589E: mythread_wrapper (hg_intercepts.c:193) ==11416== by 0x528A01F: start_thread (in /lib64/libpthread-2.6.1.so) ==11416== by 0x5563F8C: clone (in /lib64/libc-2.6.1.so) ... The above report refers to the stack variable named 'total'. No line number information is printed for the omp_prime executable and the name of the variable 'total' is not shown. That makes it really hard to interpret such a report. Bart. |
|
From: <sv...@va...> - 2008-03-12 18:21:05
|
Author: bart Date: 2008-03-12 18:21:08 +0000 (Wed, 12 Mar 2008) New Revision: 7659 Log: Updated expected output. Modified: trunk/exp-drd/tests/tc20_verifywrap2.stderr.exp-linuxthreads Modified: trunk/exp-drd/tests/tc20_verifywrap2.stderr.exp-linuxthreads =================================================================== --- trunk/exp-drd/tests/tc20_verifywrap2.stderr.exp-linuxthreads 2008-03-12 18:10:59 UTC (rev 7658) +++ trunk/exp-drd/tests/tc20_verifywrap2.stderr.exp-linuxthreads 2008-03-12 18:21:08 UTC (rev 7659) @@ -1,10 +1,8 @@ -[1/1] pre_mutex_lock (?) 0x........ rc 0 owner 0 -[1/1] mutex_init mutex 0x........ +[1/1] pre_mutex_lock mutex 0x........ rc 0 owner 0 [1/1] post_mutex_lock mutex 0x........ rc 0 owner 0 [1/1] mutex_unlock mutex 0x........ rc 1 -[1/1] pre_mutex_lock (?) 0x........ rc 0 owner 0 -[1/1] mutex_init mutex 0x........ +[1/1] pre_mutex_lock mutex 0x........ rc 0 owner 0 [1/1] post_mutex_lock mutex 0x........ rc 0 owner 0 [1/1] mutex_unlock mutex 0x........ rc 1 [1/1] pre_mutex_lock mutex 0x........ rc 0 owner 1 @@ -13,8 +11,7 @@ [1/1] pre_mutex_lock mutex 0x........ rc 0 owner 1 [1/1] post_mutex_lock mutex 0x........ rc 0 owner 1 [1/1] mutex_unlock mutex 0x........ rc 1 -[1/1] pre_mutex_lock (?) 0x........ rc 0 owner 0 -[1/1] mutex_init recursive mutex 0x........ +[1/1] pre_mutex_lock recursive mutex 0x........ rc 0 owner 0 [1/1] post_mutex_lock recursive mutex 0x........ rc 0 owner 0 @@ -33,8 +30,7 @@ after having upgraded to a newer version of your Linux distribution. Giving up. [1/1] mutex_unlock recursive mutex 0x........ rc 1 -[1/1] pre_mutex_lock (?) 0x........ rc 0 owner 0 -[1/1] mutex_init recursive mutex 0x........ +[1/1] pre_mutex_lock recursive mutex 0x........ rc 0 owner 0 [1/1] post_mutex_lock recursive mutex 0x........ rc 0 owner 0 [1/1] mutex_unlock recursive mutex 0x........ rc 1 |
|
From: <sv...@va...> - 2008-03-12 18:11:01
|
Author: bart Date: 2008-03-12 18:10:59 +0000 (Wed, 12 Mar 2008) New Revision: 7658 Log: Fixed typo's. Modified: trunk/exp-drd/tests/omp_matinv.vgtest trunk/exp-drd/tests/omp_matinv_racy.vgtest Modified: trunk/exp-drd/tests/omp_matinv.vgtest =================================================================== --- trunk/exp-drd/tests/omp_matinv.vgtest 2008-03-12 18:04:41 UTC (rev 7657) +++ trunk/exp-drd/tests/omp_matinv.vgtest 2008-03-12 18:10:59 UTC (rev 7658) @@ -1,3 +1,3 @@ prereq: test -e omp_matinv -prog: matinv_openmp +prog: omp_matinv args: 30 -t 15 -q Modified: trunk/exp-drd/tests/omp_matinv_racy.vgtest =================================================================== --- trunk/exp-drd/tests/omp_matinv_racy.vgtest 2008-03-12 18:04:41 UTC (rev 7657) +++ trunk/exp-drd/tests/omp_matinv_racy.vgtest 2008-03-12 18:10:59 UTC (rev 7658) @@ -1,4 +1,4 @@ prereq: test -e omp_matinv -prog: matinv_openmp +prog: omp_matinv args: 3 -t 2 -q -r stderr_filter: filter_error_summary |
|
From: <sv...@va...> - 2008-03-12 18:04:38
|
Author: bart Date: 2008-03-12 18:04:41 +0000 (Wed, 12 Mar 2008) New Revision: 7657 Log: Added to repository. Added: trunk/exp-drd/tests/omp_prime_racy.stderr.exp trunk/exp-drd/tests/omp_prime_racy.vgtest Added: trunk/exp-drd/tests/omp_prime_racy.stderr.exp =================================================================== --- trunk/exp-drd/tests/omp_prime_racy.stderr.exp (rev 0) +++ trunk/exp-drd/tests/omp_prime_racy.stderr.exp 2008-03-12 18:04:41 UTC (rev 7657) @@ -0,0 +1 @@ +ERROR SUMMARY: 3 errors from 3 contexts Added: trunk/exp-drd/tests/omp_prime_racy.vgtest =================================================================== --- trunk/exp-drd/tests/omp_prime_racy.vgtest (rev 0) +++ trunk/exp-drd/tests/omp_prime_racy.vgtest 2008-03-12 18:04:41 UTC (rev 7657) @@ -0,0 +1,4 @@ +prereq: test -e omp_prime +prog: omp_prime +args: 4 -q +stderr_filter: filter_error_summary |
|
From: <sv...@va...> - 2008-03-12 17:49:56
|
Author: bart
Date: 2008-03-12 17:49:57 +0000 (Wed, 12 Mar 2008)
New Revision: 7656
Log:
Renamed matinv_openmp test into omp_matinv. Added omp_matinv_racy and omp_prime_racy tests.
Added:
trunk/exp-drd/tests/omp_matinv.c
trunk/exp-drd/tests/omp_matinv.stderr.exp
trunk/exp-drd/tests/omp_matinv.stdout.exp
trunk/exp-drd/tests/omp_matinv.vgtest
trunk/exp-drd/tests/omp_matinv_racy.stderr.exp
trunk/exp-drd/tests/omp_matinv_racy.stdout.exp
trunk/exp-drd/tests/omp_matinv_racy.vgtest
Removed:
trunk/exp-drd/tests/matinv_openmp.c
trunk/exp-drd/tests/matinv_openmp.stderr.exp
trunk/exp-drd/tests/matinv_openmp.stdout.exp
trunk/exp-drd/tests/matinv_openmp.vgtest
Modified:
trunk/exp-drd/tests/Makefile.am
Modified: trunk/exp-drd/tests/Makefile.am
===================================================================
--- trunk/exp-drd/tests/Makefile.am 2008-03-12 17:27:20 UTC (rev 7655)
+++ trunk/exp-drd/tests/Makefile.am 2008-03-12 17:49:57 UTC (rev 7656)
@@ -50,12 +50,15 @@
matinv.stdout.exp \
matinv.stdout.exp-linuxthreads \
matinv.vgtest \
- matinv_openmp.stderr.exp \
- matinv_openmp.stdout.exp \
- matinv_openmp.vgtest \
+ omp_matinv.stderr.exp \
+ omp_matinv.stdout.exp \
+ omp_matinv.vgtest \
omp_matinv_racy.stderr.exp \
omp_matinv_racy.stdout.exp \
omp_matinv_racy.vgtest \
+ omp_prime_racy.stderr.exp \
+ omp_prime_racy.stdout.exp \
+ omp_prime_racy.vgtest \
pth_barrier.stderr.exp \
pth_barrier.stderr.exp-linuxthreads \
pth_barrier.vgtest \
@@ -232,7 +235,7 @@
tc24_nonzero_sem \
trylock
-check_PROGRAMS_OPENMP = omp_prime matinv_openmp
+check_PROGRAMS_OPENMP = omp_matinv omp_prime
if HAVE_OPENMP
check_PROGRAMS = $(check_PROGRAMS_COMMON) $(check_PROGRAMS_OPENMP)
@@ -370,10 +373,10 @@
trylock_LDADD = -lpthread -lrt
if HAVE_OPENMP
-matinv_openmp_SOURCES = matinv_openmp.c
-matinv_openmp_CFLAGS = -fopenmp
-matinv_openmp_LDFLAGS = -fopenmp
-matinv_openmp_LDADD = -lm
+omp_matinv_SOURCES = omp_matinv.c
+omp_matinv_CFLAGS = -fopenmp
+omp_matinv_LDFLAGS = -fopenmp
+omp_matinv_LDADD = -lm
omp_prime_SOURCES = omp_prime.c
omp_prime_CFLAGS = -fopenmp
Deleted: trunk/exp-drd/tests/matinv_openmp.c
===================================================================
--- trunk/exp-drd/tests/matinv_openmp.c 2008-03-12 17:27:20 UTC (rev 7655)
+++ trunk/exp-drd/tests/matinv_openmp.c 2008-03-12 17:49:57 UTC (rev 7656)
@@ -1,334 +0,0 @@
-/** Compute the matrix inverse via Gauss-Jordan elimination.
- * This program uses OpenMP separate computation steps but no
- * mutexes. It is an example of a race-free program on which no data races
- * are reported by the happens-before algorithm (drd), but a lot of data races
- * (all false positives) are reported by the Eraser-algorithm (helgrind).
- */
-
-
-#define _GNU_SOURCE
-
-/***********************/
-/* Include directives. */
-/***********************/
-
-#include <assert.h>
-#include <math.h>
-#include <omp.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h> // getopt()
-
-
-/*********************/
-/* Type definitions. */
-/*********************/
-
-typedef double elem_t;
-
-
-/********************/
-/* Local variables. */
-/********************/
-
-static int s_trigger_race;
-
-
-/*************************/
-/* Function definitions. */
-/*************************/
-
-/** Allocate memory for a matrix with the specified number of rows and
- * columns.
- */
-static elem_t* new_matrix(const int rows, const int cols)
-{
- assert(rows > 0);
- assert(cols > 0);
- return malloc(rows * cols * sizeof(elem_t));
-}
-
-/** Free the memory that was allocated for a matrix. */
-static void delete_matrix(elem_t* const a)
-{
- free(a);
-}
-
-/** Fill in some numbers in a matrix. */
-static void init_matrix(elem_t* const a, const int rows, const int cols)
-{
- int i, j;
- for (i = 0; i < rows; i++)
- {
- for (j = 0; j < rows; j++)
- {
- a[i * cols + j] = 1.0 / (1 + abs(i-j));
- }
- }
-}
-
-/** Print all elements of a matrix. */
-void print_matrix(const char* const label,
- const elem_t* const a, const int rows, const int cols)
-{
- int i, j;
- printf("%s:\n", label);
- for (i = 0; i < rows; i++)
- {
- for (j = 0; j < cols; j++)
- {
- printf("%g ", a[i * cols + j]);
- }
- printf("\n");
- }
-}
-
-/** Copy a subset of the elements of a matrix into another matrix. */
-static void copy_matrix(const elem_t* const from,
- const int from_rows,
- const int from_cols,
- const int from_row_first,
- const int from_row_last,
- const int from_col_first,
- const int from_col_last,
- elem_t* const to,
- const int to_rows,
- const int to_cols,
- const int to_row_first,
- const int to_row_last,
- const int to_col_first,
- const int to_col_last)
-{
- int i, j;
-
- assert(from_row_last - from_row_first == to_row_last - to_row_first);
- assert(from_col_last - from_col_first == to_col_last - to_col_first);
-
- for (i = from_row_first; i < from_row_last; i++)
- {
- assert(i < from_rows);
- assert(i - from_row_first + to_row_first < to_rows);
- for (j = from_col_first; j < from_col_last; j++)
- {
- assert(j < from_cols);
- assert(j - from_col_first + to_col_first < to_cols);
- to[(i - from_row_first + to_col_first) * to_cols
- + (j - from_col_first + to_col_first)]
- = from[i * from_cols + j];
- }
- }
-}
-
-/** Compute the matrix product of a1 and a2. */
-static elem_t* multiply_matrices(const elem_t* const a1,
- const int rows1,
- const int cols1,
- const elem_t* const a2,
- const int rows2,
- const int cols2)
-{
- int i, j, k;
- elem_t* prod;
-
- assert(cols1 == rows2);
-
- prod = new_matrix(rows1, cols2);
- for (i = 0; i < rows1; i++)
- {
- for (j = 0; j < cols2; j++)
- {
- prod[i * cols2 + j] = 0;
- for (k = 0; k < cols1; k++)
- {
- prod[i * cols2 + j] += a1[i * cols1 + k] * a2[k * cols2 + j];
- }
- }
- }
- return prod;
-}
-
-/** Apply the Gauss-Jordan elimination algorithm on the matrix p->a starting
- * at row r0 and up to but not including row r1. It is assumed that as many
- * threads execute this function concurrently as the count barrier p->b was
- * initialized with. If the matrix p->a is nonsingular, and if matrix p->a
- * has at least as many columns as rows, the result of this algorithm is that
- * submatrix p->a[0..p->rows-1,0..p->rows-1] is the identity matrix.
- * @see http://en.wikipedia.org/wiki/Gauss-Jordan_elimination
- */
-static void gj(elem_t* const a, const int rows, const int cols)
-{
- int i, j, k;
-
- for (i = 0; i < rows; i++)
- {
- {
- // Pivoting.
- j = i;
- for (k = i + 1; k < rows; k++)
- {
- if (a[k * cols + i] > a[j * cols + i])
- {
- j = k;
- }
- }
- if (j != i)
- {
- for (k = 0; k < cols; k++)
- {
- const elem_t t = a[i * cols + k];
- a[i * cols + k] = a[j * cols + k];
- a[j * cols + k] = t;
- }
- }
- // Normalize row i.
- if (a[i * cols + i] != 0)
- {
- for (k = cols - 1; k >= 0; k--)
- {
- a[i * cols + k] /= a[i * cols + i];
- }
- }
- }
-
- // Reduce all rows j != i.
-
- if (s_trigger_race)
- {
-# pragma omp parallel for private(j)
- for (j = 0; j < rows; j++)
- {
- if (i != j)
- {
- const elem_t factor = a[j * cols + i];
- for (k = 0; k < cols; k++)
- {
- a[j * cols + k] -= a[i * cols + k] * factor;
- }
- }
- }
- }
- else
- {
-# pragma omp parallel for private(j, k)
- for (j = 0; j < rows; j++)
- {
- if (i != j)
- {
- const elem_t factor = a[j * cols + i];
- for (k = 0; k < cols; k++)
- {
- a[j * cols + k] -= a[i * cols + k] * factor;
- }
- }
- }
- }
- }
-}
-
-/** Matrix inversion via the Gauss-Jordan algorithm. */
-static elem_t* invert_matrix(const elem_t* const a, const int n)
-{
- int i, j;
- elem_t* const inv = new_matrix(n, n);
- elem_t* const tmp = new_matrix(n, 2*n);
- copy_matrix(a, n, n, 0, n, 0, n, tmp, n, 2 * n, 0, n, 0, n);
- for (i = 0; i < n; i++)
- for (j = 0; j < n; j++)
- tmp[i * 2 * n + n + j] = (i == j);
- gj(tmp, n, 2*n);
- copy_matrix(tmp, n, 2*n, 0, n, n, 2*n, inv, n, n, 0, n, 0, n);
- delete_matrix(tmp);
- return inv;
-}
-
-/** Compute the average square error between the identity matrix and the
- * product of matrix a with its inverse matrix.
- */
-static double identity_error(const elem_t* const a, const int n)
-{
- int i, j;
- elem_t e = 0;
- for (i = 0; i < n; i++)
- {
- for (j = 0; j < n; j++)
- {
- const elem_t d = a[i * n + j] - (i == j);
- e += d * d;
- }
- }
- return sqrt(e / (n * n));
-}
-
-/** Compute epsilon for the numeric type elem_t. Epsilon is defined as the
- * smallest number for which the sum of one and that number is different of
- * one. It is assumed that the underlying representation of elem_t uses
- * base two.
- */
-static elem_t epsilon()
-{
- elem_t eps;
- for (eps = 1; 1 + eps != 1; eps /= 2)
- ;
- return 2 * eps;
-}
-
-int main(int argc, char** argv)
-{
- int matrix_size;
- int nthread = 1;
- int silent = 0;
- int optchar;
- elem_t *a, *inv, *prod;
- elem_t eps;
- double error;
- double ratio;
-
- while ((optchar = getopt(argc, argv, "qrt:")) != EOF)
- {
- switch (optchar)
- {
- case 'q': silent = 1; break;
- case 'r': s_trigger_race = 1; break;
- case 't': nthread = atoi(optarg); break;
- default:
- fprintf(stderr, "Error: unknown option '%c'.\n", optchar);
- return 1;
- }
- }
-
- if (optind + 1 != argc)
- {
- fprintf(stderr, "Error: wrong number of arguments.\n");
- }
- matrix_size = atoi(argv[optind]);
-
- /* Error checking. */
- assert(matrix_size >= 1);
- assert(nthread >= 1);
-
- omp_set_num_threads(nthread);
- omp_set_dynamic(0);
-
- eps = epsilon();
- a = new_matrix(matrix_size, matrix_size);
- init_matrix(a, matrix_size, matrix_size);
- inv = invert_matrix(a, matrix_size);
- prod = multiply_matrices(a, matrix_size, matrix_size,
- inv, matrix_size, matrix_size);
- error = identity_error(prod, matrix_size);
- ratio = error / (eps * matrix_size);
- if (! silent)
- {
- printf("error = %g; epsilon = %g; error / (epsilon * n) = %g\n",
- error, eps, ratio);
- }
- if (isfinite(ratio) && ratio < 100)
- printf("Error within bounds.\n");
- else
- printf("Error out of bounds.\n");
- delete_matrix(prod);
- delete_matrix(inv);
- delete_matrix(a);
-
- return 0;
-}
Deleted: trunk/exp-drd/tests/matinv_openmp.stderr.exp
===================================================================
--- trunk/exp-drd/tests/matinv_openmp.stderr.exp 2008-03-12 17:27:20 UTC (rev 7655)
+++ trunk/exp-drd/tests/matinv_openmp.stderr.exp 2008-03-12 17:49:57 UTC (rev 7656)
@@ -1,3 +0,0 @@
-
-
-ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
Deleted: trunk/exp-drd/tests/matinv_openmp.stdout.exp
===================================================================
--- trunk/exp-drd/tests/matinv_openmp.stdout.exp 2008-03-12 17:27:20 UTC (rev 7655)
+++ trunk/exp-drd/tests/matinv_openmp.stdout.exp 2008-03-12 17:49:57 UTC (rev 7656)
@@ -1 +0,0 @@
-Error within bounds.
Deleted: trunk/exp-drd/tests/matinv_openmp.vgtest
===================================================================
--- trunk/exp-drd/tests/matinv_openmp.vgtest 2008-03-12 17:27:20 UTC (rev 7655)
+++ trunk/exp-drd/tests/matinv_openmp.vgtest 2008-03-12 17:49:57 UTC (rev 7656)
@@ -1,3 +0,0 @@
-prereq: test -e matinv_openmp
-prog: matinv_openmp
-args: 30 -t 15 -q
Copied: trunk/exp-drd/tests/omp_matinv.c (from rev 7654, trunk/exp-drd/tests/matinv_openmp.c)
===================================================================
--- trunk/exp-drd/tests/omp_matinv.c (rev 0)
+++ trunk/exp-drd/tests/omp_matinv.c 2008-03-12 17:49:57 UTC (rev 7656)
@@ -0,0 +1,334 @@
+/** Compute the matrix inverse via Gauss-Jordan elimination.
+ * This program uses OpenMP separate computation steps but no
+ * mutexes. It is an example of a race-free program on which no data races
+ * are reported by the happens-before algorithm (drd), but a lot of data races
+ * (all false positives) are reported by the Eraser-algorithm (helgrind).
+ */
+
+
+#define _GNU_SOURCE
+
+/***********************/
+/* Include directives. */
+/***********************/
+
+#include <assert.h>
+#include <math.h>
+#include <omp.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h> // getopt()
+
+
+/*********************/
+/* Type definitions. */
+/*********************/
+
+typedef double elem_t;
+
+
+/********************/
+/* Local variables. */
+/********************/
+
+static int s_trigger_race;
+
+
+/*************************/
+/* Function definitions. */
+/*************************/
+
+/** Allocate memory for a matrix with the specified number of rows and
+ * columns.
+ */
+static elem_t* new_matrix(const int rows, const int cols)
+{
+ assert(rows > 0);
+ assert(cols > 0);
+ return malloc(rows * cols * sizeof(elem_t));
+}
+
+/** Free the memory that was allocated for a matrix. */
+static void delete_matrix(elem_t* const a)
+{
+ free(a);
+}
+
+/** Fill in some numbers in a matrix. */
+static void init_matrix(elem_t* const a, const int rows, const int cols)
+{
+ int i, j;
+ for (i = 0; i < rows; i++)
+ {
+ for (j = 0; j < rows; j++)
+ {
+ a[i * cols + j] = 1.0 / (1 + abs(i-j));
+ }
+ }
+}
+
+/** Print all elements of a matrix. */
+void print_matrix(const char* const label,
+ const elem_t* const a, const int rows, const int cols)
+{
+ int i, j;
+ printf("%s:\n", label);
+ for (i = 0; i < rows; i++)
+ {
+ for (j = 0; j < cols; j++)
+ {
+ printf("%g ", a[i * cols + j]);
+ }
+ printf("\n");
+ }
+}
+
+/** Copy a subset of the elements of a matrix into another matrix. */
+static void copy_matrix(const elem_t* const from,
+ const int from_rows,
+ const int from_cols,
+ const int from_row_first,
+ const int from_row_last,
+ const int from_col_first,
+ const int from_col_last,
+ elem_t* const to,
+ const int to_rows,
+ const int to_cols,
+ const int to_row_first,
+ const int to_row_last,
+ const int to_col_first,
+ const int to_col_last)
+{
+ int i, j;
+
+ assert(from_row_last - from_row_first == to_row_last - to_row_first);
+ assert(from_col_last - from_col_first == to_col_last - to_col_first);
+
+ for (i = from_row_first; i < from_row_last; i++)
+ {
+ assert(i < from_rows);
+ assert(i - from_row_first + to_row_first < to_rows);
+ for (j = from_col_first; j < from_col_last; j++)
+ {
+ assert(j < from_cols);
+ assert(j - from_col_first + to_col_first < to_cols);
+ to[(i - from_row_first + to_col_first) * to_cols
+ + (j - from_col_first + to_col_first)]
+ = from[i * from_cols + j];
+ }
+ }
+}
+
+/** Compute the matrix product of a1 and a2. */
+static elem_t* multiply_matrices(const elem_t* const a1,
+ const int rows1,
+ const int cols1,
+ const elem_t* const a2,
+ const int rows2,
+ const int cols2)
+{
+ int i, j, k;
+ elem_t* prod;
+
+ assert(cols1 == rows2);
+
+ prod = new_matrix(rows1, cols2);
+ for (i = 0; i < rows1; i++)
+ {
+ for (j = 0; j < cols2; j++)
+ {
+ prod[i * cols2 + j] = 0;
+ for (k = 0; k < cols1; k++)
+ {
+ prod[i * cols2 + j] += a1[i * cols1 + k] * a2[k * cols2 + j];
+ }
+ }
+ }
+ return prod;
+}
+
+/** Apply the Gauss-Jordan elimination algorithm on the matrix p->a starting
+ * at row r0 and up to but not including row r1. It is assumed that as many
+ * threads execute this function concurrently as the count barrier p->b was
+ * initialized with. If the matrix p->a is nonsingular, and if matrix p->a
+ * has at least as many columns as rows, the result of this algorithm is that
+ * submatrix p->a[0..p->rows-1,0..p->rows-1] is the identity matrix.
+ * @see http://en.wikipedia.org/wiki/Gauss-Jordan_elimination
+ */
+static void gj(elem_t* const a, const int rows, const int cols)
+{
+ int i, j, k;
+
+ for (i = 0; i < rows; i++)
+ {
+ {
+ // Pivoting.
+ j = i;
+ for (k = i + 1; k < rows; k++)
+ {
+ if (a[k * cols + i] > a[j * cols + i])
+ {
+ j = k;
+ }
+ }
+ if (j != i)
+ {
+ for (k = 0; k < cols; k++)
+ {
+ const elem_t t = a[i * cols + k];
+ a[i * cols + k] = a[j * cols + k];
+ a[j * cols + k] = t;
+ }
+ }
+ // Normalize row i.
+ if (a[i * cols + i] != 0)
+ {
+ for (k = cols - 1; k >= 0; k--)
+ {
+ a[i * cols + k] /= a[i * cols + i];
+ }
+ }
+ }
+
+ // Reduce all rows j != i.
+
+ if (s_trigger_race)
+ {
+# pragma omp parallel for private(j)
+ for (j = 0; j < rows; j++)
+ {
+ if (i != j)
+ {
+ const elem_t factor = a[j * cols + i];
+ for (k = 0; k < cols; k++)
+ {
+ a[j * cols + k] -= a[i * cols + k] * factor;
+ }
+ }
+ }
+ }
+ else
+ {
+# pragma omp parallel for private(j, k)
+ for (j = 0; j < rows; j++)
+ {
+ if (i != j)
+ {
+ const elem_t factor = a[j * cols + i];
+ for (k = 0; k < cols; k++)
+ {
+ a[j * cols + k] -= a[i * cols + k] * factor;
+ }
+ }
+ }
+ }
+ }
+}
+
+/** Matrix inversion via the Gauss-Jordan algorithm. */
+static elem_t* invert_matrix(const elem_t* const a, const int n)
+{
+ int i, j;
+ elem_t* const inv = new_matrix(n, n);
+ elem_t* const tmp = new_matrix(n, 2*n);
+ copy_matrix(a, n, n, 0, n, 0, n, tmp, n, 2 * n, 0, n, 0, n);
+ for (i = 0; i < n; i++)
+ for (j = 0; j < n; j++)
+ tmp[i * 2 * n + n + j] = (i == j);
+ gj(tmp, n, 2*n);
+ copy_matrix(tmp, n, 2*n, 0, n, n, 2*n, inv, n, n, 0, n, 0, n);
+ delete_matrix(tmp);
+ return inv;
+}
+
+/** Compute the average square error between the identity matrix and the
+ * product of matrix a with its inverse matrix.
+ */
+static double identity_error(const elem_t* const a, const int n)
+{
+ int i, j;
+ elem_t e = 0;
+ for (i = 0; i < n; i++)
+ {
+ for (j = 0; j < n; j++)
+ {
+ const elem_t d = a[i * n + j] - (i == j);
+ e += d * d;
+ }
+ }
+ return sqrt(e / (n * n));
+}
+
+/** Compute epsilon for the numeric type elem_t. Epsilon is defined as the
+ * smallest number for which the sum of one and that number is different of
+ * one. It is assumed that the underlying representation of elem_t uses
+ * base two.
+ */
+static elem_t epsilon()
+{
+ elem_t eps;
+ for (eps = 1; 1 + eps != 1; eps /= 2)
+ ;
+ return 2 * eps;
+}
+
+int main(int argc, char** argv)
+{
+ int matrix_size;
+ int nthread = 1;
+ int silent = 0;
+ int optchar;
+ elem_t *a, *inv, *prod;
+ elem_t eps;
+ double error;
+ double ratio;
+
+ while ((optchar = getopt(argc, argv, "qrt:")) != EOF)
+ {
+ switch (optchar)
+ {
+ case 'q': silent = 1; break;
+ case 'r': s_trigger_race = 1; break;
+ case 't': nthread = atoi(optarg); break;
+ default:
+ fprintf(stderr, "Error: unknown option '%c'.\n", optchar);
+ return 1;
+ }
+ }
+
+ if (optind + 1 != argc)
+ {
+ fprintf(stderr, "Error: wrong number of arguments.\n");
+ }
+ matrix_size = atoi(argv[optind]);
+
+ /* Error checking. */
+ assert(matrix_size >= 1);
+ assert(nthread >= 1);
+
+ omp_set_num_threads(nthread);
+ omp_set_dynamic(0);
+
+ eps = epsilon();
+ a = new_matrix(matrix_size, matrix_size);
+ init_matrix(a, matrix_size, matrix_size);
+ inv = invert_matrix(a, matrix_size);
+ prod = multiply_matrices(a, matrix_size, matrix_size,
+ inv, matrix_size, matrix_size);
+ error = identity_error(prod, matrix_size);
+ ratio = error / (eps * matrix_size);
+ if (! silent)
+ {
+ printf("error = %g; epsilon = %g; error / (epsilon * n) = %g\n",
+ error, eps, ratio);
+ }
+ if (isfinite(ratio) && ratio < 100)
+ printf("Error within bounds.\n");
+ else
+ printf("Error out of bounds.\n");
+ delete_matrix(prod);
+ delete_matrix(inv);
+ delete_matrix(a);
+
+ return 0;
+}
Copied: trunk/exp-drd/tests/omp_matinv.stderr.exp (from rev 7654, trunk/exp-drd/tests/matinv_openmp.stderr.exp)
===================================================================
--- trunk/exp-drd/tests/omp_matinv.stderr.exp (rev 0)
+++ trunk/exp-drd/tests/omp_matinv.stderr.exp 2008-03-12 17:49:57 UTC (rev 7656)
@@ -0,0 +1,3 @@
+
+
+ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
Copied: trunk/exp-drd/tests/omp_matinv.stdout.exp (from rev 7654, trunk/exp-drd/tests/matinv_openmp.stdout.exp)
===================================================================
--- trunk/exp-drd/tests/omp_matinv.stdout.exp (rev 0)
+++ trunk/exp-drd/tests/omp_matinv.stdout.exp 2008-03-12 17:49:57 UTC (rev 7656)
@@ -0,0 +1 @@
+Error within bounds.
Copied: trunk/exp-drd/tests/omp_matinv.vgtest (from rev 7654, trunk/exp-drd/tests/matinv_openmp.vgtest)
===================================================================
--- trunk/exp-drd/tests/omp_matinv.vgtest (rev 0)
+++ trunk/exp-drd/tests/omp_matinv.vgtest 2008-03-12 17:49:57 UTC (rev 7656)
@@ -0,0 +1,3 @@
+prereq: test -e omp_matinv
+prog: matinv_openmp
+args: 30 -t 15 -q
Added: trunk/exp-drd/tests/omp_matinv_racy.stderr.exp
===================================================================
--- trunk/exp-drd/tests/omp_matinv_racy.stderr.exp (rev 0)
+++ trunk/exp-drd/tests/omp_matinv_racy.stderr.exp 2008-03-12 17:49:57 UTC (rev 7656)
@@ -0,0 +1 @@
+ERROR SUMMARY: 76 errors from 76 contexts
Added: trunk/exp-drd/tests/omp_matinv_racy.stdout.exp
===================================================================
--- trunk/exp-drd/tests/omp_matinv_racy.stdout.exp (rev 0)
+++ trunk/exp-drd/tests/omp_matinv_racy.stdout.exp 2008-03-12 17:49:57 UTC (rev 7656)
@@ -0,0 +1 @@
+Error within bounds.
Added: trunk/exp-drd/tests/omp_matinv_racy.vgtest
===================================================================
--- trunk/exp-drd/tests/omp_matinv_racy.vgtest (rev 0)
+++ trunk/exp-drd/tests/omp_matinv_racy.vgtest 2008-03-12 17:49:57 UTC (rev 7656)
@@ -0,0 +1,4 @@
+prereq: test -e omp_matinv
+prog: matinv_openmp
+args: 3 -t 2 -q -r
+stderr_filter: filter_error_summary
|
|
From: <sv...@va...> - 2008-03-12 17:27:20
|
Author: bart Date: 2008-03-12 17:27:20 +0000 (Wed, 12 Mar 2008) New Revision: 7655 Log: Removed empty *.stdout.exp* files. Removed: trunk/exp-drd/tests/fp_race.stdout.exp trunk/exp-drd/tests/fp_race2.stdout.exp trunk/exp-drd/tests/pth_broadcast.stdout.exp trunk/exp-drd/tests/pth_cond_race.stdout.exp trunk/exp-drd/tests/pth_cond_race2.stdout.exp trunk/exp-drd/tests/pth_create_chain.stdout.exp trunk/exp-drd/tests/sigalrm.stdout.exp Modified: trunk/exp-drd/tests/Makefile.am Modified: trunk/exp-drd/tests/Makefile.am =================================================================== --- trunk/exp-drd/tests/Makefile.am 2008-03-12 17:23:07 UTC (rev 7654) +++ trunk/exp-drd/tests/Makefile.am 2008-03-12 17:27:20 UTC (rev 7655) @@ -17,11 +17,9 @@ $(noinst_SCRIPTS) \ fp_race.stderr.exp \ fp_race.stderr.exp-linuxthreads \ - fp_race.stdout.exp \ fp_race.vgtest \ fp_race2.stderr.exp \ fp_race2.stderr.exp-linuxthreads \ - fp_race2.stdout.exp \ fp_race2.vgtest \ hg01_all_ok.stderr.exp \ hg01_all_ok.stderr.exp-linuxthreads \ @@ -46,6 +44,7 @@ linuxthreads_det.stderr.exp-linuxthreads \ linuxthreads_det.stdout.exp \ linuxthreads_det.stdout.exp-linuxthreads \ + linuxthreads_det.stdout.exp-linuxthreads \ matinv.stderr.exp \ matinv.stderr.exp-linuxthreads \ matinv.stdout.exp \ @@ -54,6 +53,9 @@ matinv_openmp.stderr.exp \ matinv_openmp.stdout.exp \ matinv_openmp.vgtest \ + omp_matinv_racy.stderr.exp \ + omp_matinv_racy.stdout.exp \ + omp_matinv_racy.vgtest \ pth_barrier.stderr.exp \ pth_barrier.stderr.exp-linuxthreads \ pth_barrier.vgtest \ @@ -65,25 +67,20 @@ pth_barrier3.vgtest \ pth_broadcast.stderr.exp \ pth_broadcast.stderr.exp-linuxthreads \ - pth_broadcast.stdout.exp \ pth_broadcast.vgtest \ pth_cond_race.stderr.exp \ pth_cond_race.stderr.exp-linuxthreads \ - pth_cond_race.stdout.exp \ pth_cond_race.vgtest \ pth_cond_race2.stderr.exp \ pth_cond_race2.stderr.exp-linuxthreads \ - pth_cond_race2.stdout.exp \ pth_cond_race2.vgtest \ pth_create_chain.stderr.exp \ pth_create_chain.stderr.exp-linuxthreads \ - pth_create_chain.stdout.exp \ pth_create_chain.vgtest \ pth_detached.stderr.exp \ pth_detached.stderr.exp-linuxthreads \ pth_detached.stdout.exp \ pth_detached.stdout.exp-linuxthreads \ - pth_detached.stdout.exp-linuxthreads \ pth_detached.vgtest \ pth_detached2.stderr.exp \ pth_detached2.stderr.exp-linuxthreads \ @@ -92,6 +89,7 @@ pth_detached2.stdout.exp-linuxthreads \ pth_detached2.vgtest \ recursive_mutex.stderr.exp \ + recursive_mutex.stdout.exp \ recursive_mutex.vgtest \ rwlock_race.stderr.exp \ rwlock_race.stderr.exp-linuxthreads \ @@ -102,8 +100,8 @@ sem_as_mutex2.stderr.exp \ sem_as_mutex2.stderr.exp-linuxthreads \ sem_as_mutex2.vgtest \ + sigalrm.stderr.exp \ sigalrm.stderr.exp-linuxthreads \ - sigalrm.stdout.exp sigalrm.stderr.exp \ sigalrm.vgtest \ tc01_simple_race.stderr.exp \ tc01_simple_race.stderr.exp-linuxthreads \ @@ -141,8 +139,6 @@ tc10_rec_lock.vgtest \ tc11_XCHG.stderr.exp tc11_XCHG.stdout.exp \ tc11_XCHG.stderr.exp-linuxthreads \ - tc11_XCHG.stdout.exp-linuxthreads \ - tc11_XCHG.stdout.exp-linuxthreads \ tc11_XCHG.vgtest \ tc12_rwl_trivial.stderr.exp \ tc12_rwl_trivial.stderr.exp-linuxthreads \ @@ -175,7 +171,6 @@ tc21_pthonce.stderr.exp-linuxthreads \ tc21_pthonce.stdout.exp \ tc21_pthonce.stdout.exp-linuxthreads \ - tc21_pthonce.stdout.exp-linuxthreads \ tc21_pthonce.vgtest \ tc22_exit_w_lock.stderr.exp-32bit \ tc22_exit_w_lock.stderr.exp-64bit \ Deleted: trunk/exp-drd/tests/fp_race.stdout.exp =================================================================== Deleted: trunk/exp-drd/tests/fp_race2.stdout.exp =================================================================== Deleted: trunk/exp-drd/tests/pth_broadcast.stdout.exp =================================================================== Deleted: trunk/exp-drd/tests/pth_cond_race.stdout.exp =================================================================== Deleted: trunk/exp-drd/tests/pth_cond_race2.stdout.exp =================================================================== Deleted: trunk/exp-drd/tests/pth_create_chain.stdout.exp =================================================================== Deleted: trunk/exp-drd/tests/sigalrm.stdout.exp =================================================================== |
|
From: <sv...@va...> - 2008-03-12 17:23:11
|
Author: bart
Date: 2008-03-12 17:23:07 +0000 (Wed, 12 Mar 2008)
New Revision: 7654
Log:
Bug fix: sometimes an assert was triggered if pthread_barrier_destroy() was called after the last pthread_barrier_wait() finished and before the post-pthread_barrier_wait() client request finished.
Modified:
trunk/exp-drd/drd_barrier.c
trunk/exp-drd/drd_clientobj.h
Modified: trunk/exp-drd/drd_barrier.c
===================================================================
--- trunk/exp-drd/drd_barrier.c 2008-03-12 17:19:48 UTC (rev 7653)
+++ trunk/exp-drd/drd_barrier.c 2008-03-12 17:23:07 UTC (rev 7654)
@@ -52,7 +52,9 @@
// Local functions.
-void barrier_cleanup(struct barrier_info* p);
+static void barrier_cleanup(struct barrier_info* p);
+static const char* barrier_get_typename(struct barrier_info* const p);
+static const char* barrier_type_name(const BarrierT bt);
// Local variables.
@@ -100,6 +102,7 @@
tl_assert(p->a1 == barrier);
p->cleanup = (void(*)(DrdClientobj*))barrier_cleanup;
+ p->barrier_type = barrier_type;
p->count = count;
p->pre_iteration = 0;
p->post_iteration = 0;
@@ -121,7 +124,7 @@
tl_assert(p);
- if (p->pre_waiters_left != p->count || p->post_waiters_left != p->count)
+ if (p->pre_waiters_left != p->count)
{
BarrierErrInfo bei = { p->a1 };
VG_(maybe_record_error)(VG_(get_running_tid)(),
@@ -178,17 +181,44 @@
const BarrierT barrier_type, const Word count,
const Bool reinitialization)
{
+ struct barrier_info* p;
+
+ tl_assert(barrier_type == pthread_barrier || barrier_type == gomp_barrier);
+
+ p = barrier_get_or_allocate(barrier, barrier_type, count);
+
if (s_trace_barrier)
{
- VG_(message)(Vg_UserMsg,
- "[%d/%d] barrier_init 0x%lx",
- VG_(get_running_tid)(),
- thread_get_running_tid(),
- barrier);
+ if (reinitialization)
+ {
+ VG_(message)(Vg_UserMsg,
+ "[%d/%d] barrier_reinit %s 0x%lx count %d -> %d",
+ VG_(get_running_tid)(),
+ thread_get_running_tid(),
+ barrier_get_typename(p),
+ barrier,
+ p->count,
+ count);
+ }
+ else
+ {
+ VG_(message)(Vg_UserMsg,
+ "[%d/%d] barrier_init %s 0x%lx",
+ VG_(get_running_tid)(),
+ thread_get_running_tid(),
+ barrier_get_typename(p),
+ barrier);
+ }
}
- tl_assert(barrier_get(barrier) == 0);
- tl_assert(barrier_type == pthread_barrier || barrier_type == gomp_barrier);
- barrier_get_or_allocate(barrier, barrier_type, count);
+
+ if (reinitialization && p->count != count)
+ {
+ if (p->pre_waiters_left != p->count || p->post_waiters_left != p->count)
+ {
+ VG_(message)(Vg_UserMsg, "Error: reinitialization with active waiters");
+ }
+ p->count = count;
+ }
}
/** Called after pthread_barrier_destroy(). */
@@ -196,16 +226,18 @@
{
struct barrier_info* p;
+ p = barrier_get(barrier);
+
if (s_trace_barrier)
{
VG_(message)(Vg_UserMsg,
- "[%d/%d] barrier_destroy 0x%lx",
+ "[%d/%d] barrier_destroy %s 0x%lx",
VG_(get_running_tid)(),
thread_get_running_tid(),
+ barrier_get_typename(p),
barrier);
}
- p = barrier_get(barrier);
if (p == 0)
{
GenericErrInfo GEI;
@@ -234,9 +266,10 @@
if (s_trace_barrier)
{
VG_(message)(Vg_UserMsg,
- "[%d/%d] barrier_pre_wait 0x%lx iteration %d",
+ "[%d/%d] barrier_pre_wait %s 0x%lx iteration %d",
VG_(get_running_tid)(),
thread_get_running_tid(),
+ barrier_get_typename(p),
barrier,
p->pre_iteration);
}
@@ -266,18 +299,24 @@
struct barrier_info* p;
p = barrier_get(barrier);
- tl_assert(p);
if (s_trace_barrier)
{
VG_(message)(Vg_UserMsg,
- "[%d/%d] barrier_post_wait 0x%lx iteration %d",
+ "[%d/%d] barrier_post_wait %s 0x%lx iteration %d",
VG_(get_running_tid)(),
tid,
+ p ? barrier_get_typename(p) : "(?)",
barrier,
- p->post_iteration);
+ p ? p->post_iteration : -1);
}
+ /* If p == 0, this means that the barrier has been destroyed after */
+ /* *_barrier_wait() returned and before this function was called. Just */
+ /* return in that case. */
+ if (p == 0)
+ return;
+
if (waited)
{
const UWord word_tid = tid;
@@ -322,3 +361,22 @@
VG_(OSetGen_FreeNode)(p->oset, q);
}
}
+
+static const char* barrier_get_typename(struct barrier_info* const p)
+{
+ tl_assert(p);
+
+ return barrier_type_name(p->barrier_type);
+}
+
+static const char* barrier_type_name(const BarrierT bt)
+{
+ switch (bt)
+ {
+ case pthread_barrier:
+ return "pthread barrier";
+ case gomp_barrier:
+ return "gomp barrier";
+ }
+ return "?";
+}
Modified: trunk/exp-drd/drd_clientobj.h
===================================================================
--- trunk/exp-drd/drd_clientobj.h 2008-03-12 17:19:48 UTC (rev 7653)
+++ trunk/exp-drd/drd_clientobj.h 2008-03-12 17:23:07 UTC (rev 7654)
@@ -92,6 +92,7 @@
Addr a1;
ObjType type;
void (*cleanup)(union drd_clientobj*);
+ BarrierT barrier_type; // pthread_barrier or gomp_barrier.
Word count; // Participant count in a barrier wait.
Word pre_iteration; // pthread_barrier_wait() call count modulo two.
Word post_iteration; // pthread_barrier_wait() call count modulo two.
|
|
From: <sv...@va...> - 2008-03-12 17:19:43
|
Author: bart
Date: 2008-03-12 17:19:48 +0000 (Wed, 12 Mar 2008)
New Revision: 7653
Log:
Cosmetic change.
Modified:
trunk/exp-drd/drd_gomp_intercepts.c
Modified: trunk/exp-drd/drd_gomp_intercepts.c
===================================================================
--- trunk/exp-drd/drd_gomp_intercepts.c 2008-03-12 17:11:48 UTC (rev 7652)
+++ trunk/exp-drd/drd_gomp_intercepts.c 2008-03-12 17:19:48 UTC (rev 7653)
@@ -96,8 +96,7 @@
OrigFn fn;
VALGRIND_GET_ORIG_FN(fn);
VALGRIND_DO_CLIENT_REQUEST(res, -1, VG_USERREQ__PRE_BARRIER_DESTROY,
- barrier, gomp_barrier,
- 0, 0, 0);
+ barrier, gomp_barrier, 0, 0, 0);
CALL_FN_W_W(ret, fn, barrier);
VALGRIND_DO_CLIENT_REQUEST(res, -1, VG_USERREQ__POST_BARRIER_DESTROY,
barrier, gomp_barrier, 0, 0, 0);
|
|
From: <sv...@va...> - 2008-03-12 17:11:45
|
Author: bart
Date: 2008-03-12 17:11:48 +0000 (Wed, 12 Mar 2008)
New Revision: 7652
Log:
Renamed HAVE_GCC_FOPENMP into HAVE_OPENMP. Changed compile test into link test.
Modified:
trunk/configure.in
trunk/exp-drd/Makefile.am
trunk/exp-drd/tests/Makefile.am
Modified: trunk/configure.in
===================================================================
--- trunk/configure.in 2008-03-12 16:50:09 UTC (rev 7651)
+++ trunk/configure.in 2008-03-12 17:11:48 UTC (rev 7652)
@@ -553,20 +553,30 @@
# does this compiler support -fopenmp, does it have the include file
# <omp.h> and does it have libgomp ?
+AC_MSG_CHECKING([for OpenMP])
+
safe_CFLAGS=$CFLAGS
CFLAGS="-fopenmp"
-AC_COMPILE_CHECK([OpenMP], [#include <omp.h>], [ omp_set_dynamic(0); ],
+AC_LINK_IFELSE(
[
-ac_have_gcc_fopenmp=yes
+#include <omp.h>
+int main(int argc, char** argv)
+{
+ omp_set_dynamic(0);
+ return 0;
+}
+],
+[
+ac_have_openmp=yes
AC_MSG_RESULT([yes])
], [
-ac_have_gcc_fopenmp=no
+ac_have_openmp=no
AC_MSG_RESULT([no])
])
CFLAGS=$safe_CFLAGS
-AM_CONDITIONAL([HAVE_GCC_FOPENMP], [test x$ac_have_gcc_fopenmp = xyes])
+AM_CONDITIONAL([HAVE_OPENMP], [test x$ac_have_openmp = xyes])
# does this compiler support -m32 ?
Modified: trunk/exp-drd/Makefile.am
===================================================================
--- trunk/exp-drd/Makefile.am 2008-03-12 16:50:09 UTC (rev 7651)
+++ trunk/exp-drd/Makefile.am 2008-03-12 17:11:48 UTC (rev 7652)
@@ -20,7 +20,7 @@
noinst_PROGRAMS += exp-drd-ppc64-aix5 vgpreload_exp-drd-ppc64-aix5.so
endif
-if HAVE_GCC_FOPENMP
+if HAVE_OPENMP
VGPRELOAD_DRD_SOURCES_COMMON = drd_pthread_intercepts.c drd_gomp_intercepts.c
else
VGPRELOAD_DRD_SOURCES_COMMON = drd_pthread_intercepts.c
Modified: trunk/exp-drd/tests/Makefile.am
===================================================================
--- trunk/exp-drd/tests/Makefile.am 2008-03-12 16:50:09 UTC (rev 7651)
+++ trunk/exp-drd/tests/Makefile.am 2008-03-12 17:11:48 UTC (rev 7652)
@@ -239,7 +239,7 @@
check_PROGRAMS_OPENMP = omp_prime matinv_openmp
-if HAVE_GCC_FOPENMP
+if HAVE_OPENMP
check_PROGRAMS = $(check_PROGRAMS_COMMON) $(check_PROGRAMS_OPENMP)
else
check_PROGRAMS = $(check_PROGRAMS_COMMON)
@@ -374,7 +374,7 @@
trylock_SOURCES = trylock.c
trylock_LDADD = -lpthread -lrt
-if HAVE_GCC_FOPENMP
+if HAVE_OPENMP
matinv_openmp_SOURCES = matinv_openmp.c
matinv_openmp_CFLAGS = -fopenmp
matinv_openmp_LDFLAGS = -fopenmp
|
|
From: <sv...@va...> - 2008-03-12 16:50:05
|
Author: bart Date: 2008-03-12 16:50:09 +0000 (Wed, 12 Mar 2008) New Revision: 7651 Log: matinv_openmp and omp_prime linking now also succeeds with older automake versions. Modified: trunk/exp-drd/tests/Makefile.am Modified: trunk/exp-drd/tests/Makefile.am =================================================================== --- trunk/exp-drd/tests/Makefile.am 2008-03-12 16:48:07 UTC (rev 7650) +++ trunk/exp-drd/tests/Makefile.am 2008-03-12 16:50:09 UTC (rev 7651) @@ -377,9 +377,11 @@ if HAVE_GCC_FOPENMP matinv_openmp_SOURCES = matinv_openmp.c matinv_openmp_CFLAGS = -fopenmp +matinv_openmp_LDFLAGS = -fopenmp matinv_openmp_LDADD = -lm omp_prime_SOURCES = omp_prime.c omp_prime_CFLAGS = -fopenmp +omp_prime_LDFLAGS = -fopenmp omp_prime_LDADD = -lm endif |
|
From: <sv...@va...> - 2008-03-12 16:48:03
|
Author: bart
Date: 2008-03-12 16:48:07 +0000 (Wed, 12 Mar 2008)
New Revision: 7650
Log:
Replaced positional command line arguments by command options.
Modified:
trunk/exp-drd/tests/omp_prime.c
Modified: trunk/exp-drd/tests/omp_prime.c
===================================================================
--- trunk/exp-drd/tests/omp_prime.c 2008-03-12 16:47:07 UTC (rev 7649)
+++ trunk/exp-drd/tests/omp_prime.c 2008-03-12 16:48:07 UTC (rev 7650)
@@ -9,6 +9,7 @@
#include <omp.h>
#include <stdio.h>
#include <stdlib.h>
+#include <unistd.h> // getopt()
#include "../drd_clientreq.h"
@@ -35,11 +36,31 @@
{
int i;
int total = 0;
- const int n = argc > 1 ? atoi(argv[1]) : 300;
- const int num_threads = argc > 2 ? atoi(argv[2]) : 4;
+ int silent = 0;
+ int n;
+ int num_threads = 2;
+ int optchar;
int* primes;
int* pflag;
+ while ((optchar = getopt(argc, argv, "qt:")) != EOF)
+ {
+ switch (optchar)
+ {
+ case 'q': silent = 1; break;
+ case 't': num_threads = atoi(optarg); break;
+ default:
+ fprintf(stderr, "Error: unknown option '%c'.\n", optchar);
+ return 1;
+ }
+ }
+
+ if (optind + 1 != argc)
+ {
+ fprintf(stderr, "Error: wrong number of arguments.\n");
+ }
+ n = atoi(argv[optind]);
+
// Not the most user-friendly way to do error checking, but better than
// nothing.
assert(n > 2);
@@ -51,14 +72,6 @@
omp_set_num_threads(num_threads);
omp_set_dynamic(0);
-#if 1
- {
- int res;
- VALGRIND_DO_CLIENT_REQUEST(res, 0, VG_USERREQ__DRD_TRACE_ADDR,
- &total, 0, 0, 0, 0);
- }
-#endif
-
for (i = 0; i < n; i++) {
pflag[i] = 1;
}
@@ -72,11 +85,14 @@
total++;
}
}
- printf("Number of prime numbers between 2 and %d: %d\n",
- n, total);
- for (i = 0; i < total; i++)
+ if (! silent)
{
- printf("%d\n", primes[i]);
+ printf("Number of prime numbers between 2 and %d: %d\n",
+ n, total);
+ for (i = 0; i < total; i++)
+ {
+ printf("%d\n", primes[i]);
+ }
}
free(pflag);
|
|
From: <sv...@va...> - 2008-03-12 16:47:05
|
Author: bart
Date: 2008-03-12 16:47:07 +0000 (Wed, 12 Mar 2008)
New Revision: 7649
Log:
Replaced positional command line arguments by command options. Changed matrix initialization.
Modified:
trunk/exp-drd/tests/matinv_openmp.c
trunk/exp-drd/tests/matinv_openmp.vgtest
Modified: trunk/exp-drd/tests/matinv_openmp.c
===================================================================
--- trunk/exp-drd/tests/matinv_openmp.c 2008-03-12 16:46:36 UTC (rev 7648)
+++ trunk/exp-drd/tests/matinv_openmp.c 2008-03-12 16:47:07 UTC (rev 7649)
@@ -17,6 +17,7 @@
#include <omp.h>
#include <stdio.h>
#include <stdlib.h>
+#include <unistd.h> // getopt()
/*********************/
@@ -53,10 +54,7 @@
free(a);
}
-/** Fill in some numbers in a matrix.
- * @note It is important not to call srand() in this program, such that
- * the results of a run are reproducible.
- */
+/** Fill in some numbers in a matrix. */
static void init_matrix(elem_t* const a, const int rows, const int cols)
{
int i, j;
@@ -64,7 +62,7 @@
{
for (j = 0; j < rows; j++)
{
- a[i * cols + j] = rand() * 1.0 / RAND_MAX;
+ a[i * cols + j] = 1.0 / (1 + abs(i-j));
}
}
}
@@ -196,7 +194,7 @@
if (s_trigger_race)
{
-# pragma omp parallel for
+# pragma omp parallel for private(j)
for (j = 0; j < rows; j++)
{
if (i != j)
@@ -277,18 +275,37 @@
int main(int argc, char** argv)
{
int matrix_size;
- int nthread;
- int silent;
+ int nthread = 1;
+ int silent = 0;
+ int optchar;
elem_t *a, *inv, *prod;
elem_t eps;
double error;
double ratio;
- matrix_size = (argc > 1) ? atoi(argv[1]) : 3;
- nthread = (argc > 2) ? atoi(argv[2]) : 3;
- silent = (argc > 3) ? atoi(argv[3]) : 0;
- s_trigger_race = (argc > 4) ? atoi(argv[4]) : 0;
+ while ((optchar = getopt(argc, argv, "qrt:")) != EOF)
+ {
+ switch (optchar)
+ {
+ case 'q': silent = 1; break;
+ case 'r': s_trigger_race = 1; break;
+ case 't': nthread = atoi(optarg); break;
+ default:
+ fprintf(stderr, "Error: unknown option '%c'.\n", optchar);
+ return 1;
+ }
+ }
+ if (optind + 1 != argc)
+ {
+ fprintf(stderr, "Error: wrong number of arguments.\n");
+ }
+ matrix_size = atoi(argv[optind]);
+
+ /* Error checking. */
+ assert(matrix_size >= 1);
+ assert(nthread >= 1);
+
omp_set_num_threads(nthread);
omp_set_dynamic(0);
Modified: trunk/exp-drd/tests/matinv_openmp.vgtest
===================================================================
--- trunk/exp-drd/tests/matinv_openmp.vgtest 2008-03-12 16:46:36 UTC (rev 7648)
+++ trunk/exp-drd/tests/matinv_openmp.vgtest 2008-03-12 16:47:07 UTC (rev 7649)
@@ -1,3 +1,3 @@
prereq: test -e matinv_openmp
prog: matinv_openmp
-args: 30 15 1
+args: 30 -t 15 -q
|
|
From: <sv...@va...> - 2008-03-12 16:46:32
|
Author: bart
Date: 2008-03-12 16:46:36 +0000 (Wed, 12 Mar 2008)
New Revision: 7648
Log:
Replaced positional command line arguments by command options. Changed matrix initialization.
Modified:
trunk/exp-drd/tests/matinv.c
trunk/exp-drd/tests/matinv.vgtest
Modified: trunk/exp-drd/tests/matinv.c
===================================================================
--- trunk/exp-drd/tests/matinv.c 2008-03-12 16:44:52 UTC (rev 7647)
+++ trunk/exp-drd/tests/matinv.c 2008-03-12 16:46:36 UTC (rev 7648)
@@ -1,8 +1,8 @@
-/* Compute the matrix inverse via Gauss-Jordan elimination.
- * This program uses only barriers to separate computation steps but no
- * mutexes. It is an example of a race-free program on which no data races
- * are reported by the happens-before algorithm (drd), but a lot of data races
- * (all false positives) are reported by the Eraser-algorithm (helgrind).
+/** Compute the matrix inverse via Gauss-Jordan elimination.
+ * This program uses only barriers to separate computation steps but no
+ * mutexes. It is an example of a race-free program on which no data races
+ * are reported by the happens-before algorithm (drd), but a lot of data races
+ * (all false positives) are reported by the Eraser-algorithm (helgrind).
*/
@@ -15,8 +15,9 @@
#include <assert.h>
#include <math.h>
#include <pthread.h>
+#include <stdio.h>
#include <stdlib.h>
-#include <stdio.h>
+#include <unistd.h> // getopt()
/*********************/
@@ -64,10 +65,7 @@
free(a);
}
-/** Fill in some numbers in a matrix.
- * @note It is important not to call srand() in this program, such that
- * the results of a run are reproducible.
- */
+/** Fill in some numbers in a matrix. */
static void init_matrix(elem_t* const a, const int rows, const int cols)
{
int i, j;
@@ -75,7 +73,7 @@
{
for (j = 0; j < rows; j++)
{
- a[i * cols + j] = rand() * 1.0 / RAND_MAX;
+ a[i * cols + j] = 1.0 / (1 + abs(i-j));
}
}
}
@@ -306,16 +304,35 @@
int main(int argc, char** argv)
{
int matrix_size;
- int silent;
+ int silent = 0;
+ int optchar;
elem_t *a, *inv, *prod;
elem_t eps;
double error;
double ratio;
- matrix_size = (argc > 1) ? atoi(argv[1]) : 3;
- s_nthread = (argc > 2) ? atoi(argv[2]) : 3;
- silent = (argc > 3) ? atoi(argv[3]) : 0;
+ while ((optchar = getopt(argc, argv, "qt:")) != EOF)
+ {
+ switch (optchar)
+ {
+ case 'q': silent = 1; break;
+ case 't': s_nthread = atoi(optarg); break;
+ default:
+ fprintf(stderr, "Error: unknown option '%c'.\n", optchar);
+ return 1;
+ }
+ }
+ if (optind + 1 != argc)
+ {
+ fprintf(stderr, "Error: wrong number of arguments.\n");
+ }
+ matrix_size = atoi(argv[optind]);
+
+ /* Error checking. */
+ assert(matrix_size >= 1);
+ assert(s_nthread >= 1);
+
eps = epsilon();
a = new_matrix(matrix_size, matrix_size);
init_matrix(a, matrix_size, matrix_size);
@@ -329,7 +346,7 @@
printf("error = %g; epsilon = %g; error / (epsilon * n) = %g\n",
error, eps, ratio);
}
- if (ratio < 100)
+ if (isfinite(ratio) && ratio < 100)
printf("Error within bounds.\n");
else
printf("Error out of bounds.\n");
Modified: trunk/exp-drd/tests/matinv.vgtest
===================================================================
--- trunk/exp-drd/tests/matinv.vgtest 2008-03-12 16:44:52 UTC (rev 7647)
+++ trunk/exp-drd/tests/matinv.vgtest 2008-03-12 16:46:36 UTC (rev 7648)
@@ -1,2 +1,2 @@
prog: matinv
-args: 30 15 1
+args: 30 -t 15 -q
|
|
From: <sv...@va...> - 2008-03-12 16:44:50
|
Author: bart
Date: 2008-03-12 16:44:52 +0000 (Wed, 12 Mar 2008)
New Revision: 7647
Log:
Fixed compiler warning.
Modified:
trunk/memcheck/tests/oset_test.c
Modified: trunk/memcheck/tests/oset_test.c
===================================================================
--- trunk/memcheck/tests/oset_test.c 2008-03-12 12:37:03 UTC (rev 7646)
+++ trunk/memcheck/tests/oset_test.c 2008-03-12 16:44:52 UTC (rev 7647)
@@ -370,7 +370,7 @@
// comparisons.
OSet* oset = VG_(OSetGen_Create)(offsetof(Block, first),
blockCmp,
- malloc, free);
+ (void*)malloc, free);
// Try some operations on an empty OSet to ensure they don't screw up.
vg_assert( ! VG_(OSetGen_Contains)(oset, &v) );
|
|
From: <sv...@va...> - 2008-03-12 12:37:02
|
Author: sewardj
Date: 2008-03-12 12:37:03 +0000 (Wed, 12 Mar 2008)
New Revision: 7646
Log:
Minor cosmetic changes (no functionality changes)
Modified:
branches/HGDEV/helgrind/hg_main.c
Modified: branches/HGDEV/helgrind/hg_main.c
===================================================================
--- branches/HGDEV/helgrind/hg_main.c 2008-03-12 00:14:01 UTC (rev 7645)
+++ branches/HGDEV/helgrind/hg_main.c 2008-03-12 12:37:03 UTC (rev 7646)
@@ -416,7 +416,7 @@
not detected (useful for unit tests). */
typedef
struct {
- Addr ptr; ///< Pointer from the client request.
+ Addr addr; ///< Data address (of race to ignore)
HChar* descr; ///< Arbitrary text supplied by client.
HChar* file; ///< File name (for debug output).
Int line; ///< Line number (for debug output)
@@ -2032,9 +2032,10 @@
ExpectedError *expected_error = NULL;
if (HG_(lookupFM)( map_expected_errors,
NULL/*keyP*/, (Word*)&expected_error, (Word)ptr)) {
- tl_assert(expected_error->ptr == ptr);
+ tl_assert(expected_error->addr == ptr);
VG_(printf)("Found expected race: %s:%d %p\t%s\n",
- expected_error->file, expected_error->line, ptr, expected_error->descr);
+ expected_error->file, expected_error->line,
+ ptr, expected_error->descr);
return expected_error;
}
return NULL;
@@ -2057,7 +2058,7 @@
/* create a new one */
// VG_(printf)("New\n");
error = (ExpectedError*)hg_zalloc(sizeof(ExpectedError));
- error->ptr = ptr;
+ error->addr = ptr;
error->detected = False;
error->is_benign = is_benign;
error->descr = description;
@@ -8162,27 +8163,24 @@
break;
}
-
-
case VG_USERREQ__HG_EXPECT_RACE: { // void*, char*, char *, int
- Addr ptr = (Addr)args[1];
- char *descr = (char*)args[2];
- char *file = (char*)args[3];
- int line = (int) args[4];
+ Addr ptr = (Addr) args[1];
+ HChar* descr = (HChar*)args[2];
+ HChar* file = (HChar*)args[3];
+ Int line = (Int) args[4];
maybe_set_expected_error(ptr, descr, file, line, False);
break;
}
case VG_USERREQ__HG_BENIGN_RACE: { // void*, char*, char *, int
- Addr ptr = (Addr)args[1];
- char *descr = (char*)args[2];
- char *file = (char*)args[3];
- int line = (int) args[4];
+ Addr ptr = (Addr) args[1];
+ HChar* descr = (HChar*)args[2];
+ HChar* file = (HChar*)args[3];
+ Int line = (Int) args[4];
maybe_set_expected_error(ptr, descr, file, line, True);
break;
}
-
case VG_USERREQ__HG_PCQ_CREATE: // void *
pcq_create(args[1]);
break;
@@ -8196,7 +8194,6 @@
pcq_get(tid, args[1]);
break;
-
case VG_USERREQ__HG_TRACE_MEM: // void *
mem_trace_on(args[1], tid);
break;
@@ -8223,7 +8220,6 @@
break;
}
-
default:
/* Unhandled Helgrind client request! */
tl_assert2(0, "unhandled Helgrind client request!");
|
|
From: Julian S. <js...@ac...> - 2008-03-12 11:59:42
|
Nuno Sorry to be slow replying. Slowness is because I don't have any good alternative suggestions. > > As the Valgrind paper says, these are fairly heavyweight optimisations > > for a binary translation system. You could try to do some more > > compiler-style optimisations, but I think the scope for improvement there > > is not so great. But I could be wrong -- Julian, what do you think? > > Uhm, it seems that most easy optimizations are already implemented, as I > would expect. Anyway I'll take a closer look (maybe next week) to what is > implemented to see if we have any chance do improve anything at all. > Inter-block optimizations (e.g. inlining, GCSE, ...) would be really cool, > but I'm not sure how Vex is suited for that. I agree .. earlier in the life of the project there was a lot of effort put into doing good IR level optimisation; and then before 3.3.0 another round of iropt and code generator tuning. So most of the easy and even the not-so-easy stuff is already done. From a general usability perspective, when a Valgrind tool runs too slowly to be usable, that is almost always a problem to do with the tool and not to do with the core code generation mechanisms. So speeding up the core doesn't improve usability much. Hacking on the tools usually makes a much bigger difference. It depends what you want to do. If you want to do some hacking on classical compiler transformations then perhaps there are not so many interesting opportunities left in Valgrind. > > A very interesting project you could be try would be to implement > > chaining for Vex -- the Valgrind paper (above) talks about this. > > (Section 2.3.6 of http://www.valgrind.org/docs/phd2004.pdf discusses the > > old implementation of chaining that was in pre-Vex Valgrind -- you can > > see the actual implementation in Valgrind 2.4.1 at > > http://www.valgrind.org/downloads/old.html.) > > Sounds interesting, but maybe this requires too much valgrind internals > knowledge, but I'll take a look into this as well. Another thing you could chase is to consider enhancing the superblock formation. Currently vex follows unconditional branches and calls when forming superblocks, but stops at indirect and conditional branches. I experimented with the usual simple heuristic for conditional branches: assume backwards branches taken and forward not taken, and extended it to follow conditional branches on that basis. Often made performance worse, though; although the translations might be a bit faster, they are also a lot bigger (more I1 misses) and the JIT of course runs more slowly too. Not worth the hassle I reckon. > > this in section 5.4). A more interesting thing is to speed up any of the > > real existing tools, especially Memcheck, since that's the most widely > > used. > > Yes, but I'm not sure I can justify such a project about dynamic program > analysis in a virtual execution class. The class is targeted at dynamic > binary translation, binary interpretation, intra-block optimizations, > virtualization, and so on. Yes, I see that. Nevertheless if it does happen that working on a tool is OK, it might be worth looking at Callgrind. It's a great tool (I have used it quite a lot in '08) but a little slow; and from some initial profiles it looks like there are some possibilities for speedup in there. Also, porting the branch-mispredict profiling from Cachegrind into Callgrind would be a cool thing to do. J |
|
From: Konstantin S. <kon...@gm...> - 2008-03-12 09:51:22
|
Hi,
I just discovered that oprofile's callgraph works fine on x86_64.
One just needs to compile the program in question with -fno-omit-frame-pointer.
So, in order to get valgrind's callgraph on x86_64 you'll need this change:
--- Makefile.flags.am (revision 7635)
+++ Makefile.flags.am (working copy)
@@ -20,7 +20,7 @@
AM_FLAG_M3264_AMD64_LINUX = @FLAG_M64@
AM_CPPFLAGS_AMD64_LINUX = $(add_includes_amd64_linux)
-AM_CFLAGS_AMD64_LINUX = $(WERROR) @FLAG_M64@ -fomit-frame-pointer \
+AM_CFLAGS_AMD64_LINUX = $(WERROR) @FLAG_M64@ -fno-omit-frame-pointer \
@PREFERRED_STACK_BOUNDARY@ $(AM_CFLAGS_BASE)
AM_CCASFLAGS_AMD64_LINUX = $(add_includes_amd64_linux) @FLAG_M64@ -g
--kcc
On Mon, Jan 21, 2008 at 1:20 PM, Konstantin Serebryany
<kon...@gm...> wrote:
>
>
> On Jan 15, 2008 12:38 PM, Julian Seward <js...@ac...> wrote:
> >
> > On Tuesday 15 January 2008 10:32, Konstantin Serebryany wrote:
> > > You mean it requires 32-bit hardware? or 32-bit-only os? or 32-bit
> > > executable?
> >
> > I _think_ requires 32-bit executable.
> >
> >
> >
>
> It looks like oprofile's callgraph requires 32-bit OS.
> At least it started working for me only when I rebooted my box in 32-bit
> mode.
>
>
> A bit of fun: I tried to profile helgrind with vtssrun (a tool from Intel
> Performance Tuning Utilities).
> vtssrun EXPERIMENT_DIR -- valgrind ...
> When running usual programs, vtssrun performs stack sampling of the program
> and then produces nice callgraphs, flat profiles, etc.
> But not for valgrind -- instead of profiling valgrind with vtssrun my
> command line debugged the vtssrun utility with valgrind!!
> Both tools try to inject themselves into the same address space... LOL
>
> --kcc
>
>
|
|
From: Bart V. A. <bar...@gm...> - 2008-03-12 07:18:25
|
On Mon, Mar 3, 2008 at 12:51 AM, Julian Seward <js...@ac...> wrote: > > I intend to merge the DATASYMS branch to trunk shortly. Hello Julian, When I run Valgrind with option -v on an Ubuntu 7.10 (i386) system, Valgrind complains about CRC mismatches in the debug info. Is this an Ubuntu bug ? $ ./vg-in-place -v --tool=none none/tests/pth_empty ... --13503-- Reading syms from /lib/ld-2.6.1.so (0x4000000) --13503-- Reading debug info from /lib/ld-2.6.1.so .. --13503-- .. CRC mismatch (computed b27da0e3 wanted c257421f) --13503-- object doesn't have a symbol table ... Bart. |
|
From: Tom H. <th...@cy...> - 2008-03-12 06:13:37
|
Nightly build on alvis ( i686, Red Hat 7.3 ) started at 2008-03-12 03:15:03 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, 79 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/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) 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/faultstatus (stderr) none/tests/mremap (stderr) none/tests/mremap2 (stdout) none/tests/shell (stderr) none/tests/shell_valid1 (stderr) none/tests/shell_valid2 (stderr) none/tests/shell_valid3 (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/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/tc09_bad_unlock (stderr) exp-drd/tests/tc12_rwl_trivial (stderr) exp-drd/tests/tc20_verifywrap2 (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, 78 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/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) 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/faultstatus (stderr) none/tests/mremap (stderr) none/tests/mremap2 (stdout) none/tests/shell (stderr) none/tests/shell_valid1 (stderr) none/tests/shell_valid2 (stderr) none/tests/shell_valid3 (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/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/tc09_bad_unlock (stderr) exp-drd/tests/tc12_rwl_trivial (stderr) ================================================= == Difference between 24 hours ago and now == ================================================= *** old.short Wed Mar 12 05:00:37 2008 --- new.short Wed Mar 12 06:13:40 2008 *************** *** 8,10 **** ! == 378 tests, 78 stderr failures, 1 stdout failure, 29 post failures == memcheck/tests/addressable (stderr) --- 8,10 ---- ! == 378 tests, 79 stderr failures, 1 stdout failure, 29 post failures == memcheck/tests/addressable (stderr) *************** *** 117,118 **** --- 117,119 ---- exp-drd/tests/tc12_rwl_trivial (stderr) + exp-drd/tests/tc20_verifywrap2 (stderr) |
|
From: Tom H. <th...@cy...> - 2008-03-12 04:27:40
|
Nightly build on lloyd ( x86_64, Fedora 7 ) started at 2008-03-12 03:05: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 == 413 tests, 7 stderr failures, 2 stdout failures, 0 post failures == memcheck/tests/pointer-trace (stderr) memcheck/tests/vcpu_fnfns (stdout) memcheck/tests/x86/scalar (stderr) none/tests/faultstatus (stderr) none/tests/mremap (stderr) none/tests/mremap2 (stdout) helgrind/tests/tc20_verifywrap (stderr) helgrind/tests/tc22_exit_w_lock (stderr) exp-drd/tests/matinv_openmp (stderr) |
|
From: Tom H. <th...@cy...> - 2008-03-12 03:35:02
|
Nightly build on aston ( x86_64, Fedora Core 5 ) started at 2008-03-12 03:20:06 GMT Results differ from 24 hours ago Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Last 20 lines of verbose log follow echo omp_prime-omp_prime.o: In function `main': omp_prime.c:(.text+0x467): undefined reference to `omp_set_num_threads' omp_prime.c:(.text+0x471): undefined reference to `omp_set_dynamic' omp_prime.c:(.text+0x52a): undefined reference to `GOMP_parallel_start' omp_prime.c:(.text+0x538): undefined reference to `GOMP_parallel_end' omp_prime-omp_prime.o: In function `main.omp_fn.0': omp_prime.c:(.text+0x5cb): undefined reference to `omp_get_num_threads' omp_prime.c:(.text+0x5d2): undefined reference to `omp_get_thread_num' collect2: ld returned 1 exit status make[5]: *** [omp_prime] Error 1 make[5]: Leaving directory `/tmp/vgtest/2008-03-12/valgrind/exp-drd/tests' make[4]: *** [check-am] Error 2 make[4]: Leaving directory `/tmp/vgtest/2008-03-12/valgrind/exp-drd/tests' make[3]: *** [check-recursive] Error 1 make[3]: Leaving directory `/tmp/vgtest/2008-03-12/valgrind/exp-drd/tests' make[2]: *** [check-recursive] Error 1 make[2]: Leaving directory `/tmp/vgtest/2008-03-12/valgrind/exp-drd' make[1]: *** [check-recursive] Error 1 make[1]: Leaving directory `/tmp/vgtest/2008-03-12/valgrind' make: *** [check] Error 2 ================================================= == Results from 24 hours ago == ================================================= Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Last 20 lines of verbose log follow echo omp_prime-omp_prime.o: In function `main': omp_prime.c:(.text+0x1a4): undefined reference to `omp_set_num_threads' omp_prime.c:(.text+0x1ae): undefined reference to `omp_set_dynamic' omp_prime.c:(.text+0x205): undefined reference to `GOMP_parallel_start' omp_prime.c:(.text+0x213): undefined reference to `GOMP_parallel_end' omp_prime-omp_prime.o: In function `main.omp_fn.0': omp_prime.c:(.text+0x2ac): undefined reference to `omp_get_num_threads' omp_prime.c:(.text+0x2b3): undefined reference to `omp_get_thread_num' collect2: ld returned 1 exit status make[5]: *** [omp_prime] Error 1 make[5]: Leaving directory `/tmp/vgtest/2008-03-12/valgrind/exp-drd/tests' make[4]: *** [check-am] Error 2 make[4]: Leaving directory `/tmp/vgtest/2008-03-12/valgrind/exp-drd/tests' make[3]: *** [check-recursive] Error 1 make[3]: Leaving directory `/tmp/vgtest/2008-03-12/valgrind/exp-drd/tests' make[2]: *** [check-recursive] Error 1 make[2]: Leaving directory `/tmp/vgtest/2008-03-12/valgrind/exp-drd' make[1]: *** [check-recursive] Error 1 make[1]: Leaving directory `/tmp/vgtest/2008-03-12/valgrind' make: *** [check] Error 2 ================================================= == Difference between 24 hours ago and now == ================================================= *** old.short Wed Mar 12 03:28:04 2008 --- new.short Wed Mar 12 03:35:03 2008 *************** *** 8,16 **** omp_prime-omp_prime.o: In function `main': ! omp_prime.c:(.text+0x1a4): undefined reference to `omp_set_num_threads' ! omp_prime.c:(.text+0x1ae): undefined reference to `omp_set_dynamic' ! omp_prime.c:(.text+0x205): undefined reference to `GOMP_parallel_start' ! omp_prime.c:(.text+0x213): undefined reference to `GOMP_parallel_end' omp_prime-omp_prime.o: In function `main.omp_fn.0': ! omp_prime.c:(.text+0x2ac): undefined reference to `omp_get_num_threads' ! omp_prime.c:(.text+0x2b3): undefined reference to `omp_get_thread_num' collect2: ld returned 1 exit status --- 8,16 ---- omp_prime-omp_prime.o: In function `main': ! omp_prime.c:(.text+0x467): undefined reference to `omp_set_num_threads' ! omp_prime.c:(.text+0x471): undefined reference to `omp_set_dynamic' ! omp_prime.c:(.text+0x52a): undefined reference to `GOMP_parallel_start' ! omp_prime.c:(.text+0x538): undefined reference to `GOMP_parallel_end' omp_prime-omp_prime.o: In function `main.omp_fn.0': ! omp_prime.c:(.text+0x5cb): undefined reference to `omp_get_num_threads' ! omp_prime.c:(.text+0x5d2): undefined reference to `omp_get_thread_num' collect2: ld returned 1 exit status |
|
From: Tom H. <th...@cy...> - 2008-03-12 03:33:51
|
Nightly build on dellow ( x86_64, Fedora 8 ) started at 2008-03-12 03:10:04 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 == 413 tests, 10 stderr failures, 2 stdout failures, 0 post failures == memcheck/tests/pointer-trace (stderr) memcheck/tests/vcpu_fnfns (stdout) memcheck/tests/x86/scalar (stderr) none/tests/faultstatus (stderr) none/tests/mremap (stderr) none/tests/mremap2 (stdout) helgrind/tests/tc17_sembar (stderr) helgrind/tests/tc18_semabuse (stderr) helgrind/tests/tc20_verifywrap (stderr) helgrind/tests/tc21_pthonce (stderr) helgrind/tests/tc22_exit_w_lock (stderr) exp-drd/tests/matinv_openmp (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 == 413 tests, 9 stderr failures, 2 stdout failures, 0 post failures == memcheck/tests/pointer-trace (stderr) memcheck/tests/vcpu_fnfns (stdout) memcheck/tests/x86/scalar (stderr) none/tests/faultstatus (stderr) none/tests/mremap (stderr) none/tests/mremap2 (stdout) helgrind/tests/tc18_semabuse (stderr) helgrind/tests/tc20_verifywrap (stderr) helgrind/tests/tc21_pthonce (stderr) helgrind/tests/tc22_exit_w_lock (stderr) exp-drd/tests/matinv_openmp (stderr) ================================================= == Difference between 24 hours ago and now == ================================================= *** old.short Wed Mar 12 03:22:09 2008 --- new.short Wed Mar 12 03:33:55 2008 *************** *** 8,10 **** ! == 413 tests, 9 stderr failures, 2 stdout failures, 0 post failures == memcheck/tests/pointer-trace (stderr) --- 8,10 ---- ! == 413 tests, 10 stderr failures, 2 stdout failures, 0 post failures == memcheck/tests/pointer-trace (stderr) *************** *** 15,16 **** --- 15,17 ---- none/tests/mremap2 (stdout) + helgrind/tests/tc17_sembar (stderr) helgrind/tests/tc18_semabuse (stderr) |
|
From: Tom H. <th...@cy...> - 2008-03-12 03:31:52
|
Nightly build on trojan ( x86_64, Fedora Core 6 ) started at 2008-03-12 03:25:04 GMT Results differ from 24 hours ago Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Last 20 lines of verbose log follow echo omp_prime-omp_prime.o: In function `main': omp_prime.c:(.text+0x467): undefined reference to `omp_set_num_threads' omp_prime.c:(.text+0x471): undefined reference to `omp_set_dynamic' omp_prime.c:(.text+0x52a): undefined reference to `GOMP_parallel_start' omp_prime.c:(.text+0x538): undefined reference to `GOMP_parallel_end' omp_prime-omp_prime.o: In function `main.omp_fn.0': omp_prime.c:(.text+0x5cb): undefined reference to `omp_get_num_threads' omp_prime.c:(.text+0x5d2): undefined reference to `omp_get_thread_num' collect2: ld returned 1 exit status make[5]: *** [omp_prime] Error 1 make[5]: Leaving directory `/tmp/vgtest/2008-03-12/valgrind/exp-drd/tests' make[4]: *** [check-am] Error 2 make[4]: Leaving directory `/tmp/vgtest/2008-03-12/valgrind/exp-drd/tests' make[3]: *** [check-recursive] Error 1 make[3]: Leaving directory `/tmp/vgtest/2008-03-12/valgrind/exp-drd/tests' make[2]: *** [check-recursive] Error 1 make[2]: Leaving directory `/tmp/vgtest/2008-03-12/valgrind/exp-drd' make[1]: *** [check-recursive] Error 1 make[1]: Leaving directory `/tmp/vgtest/2008-03-12/valgrind' make: *** [check] Error 2 ================================================= == Results from 24 hours ago == ================================================= Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Last 20 lines of verbose log follow echo omp_prime-omp_prime.o: In function `main': omp_prime.c:(.text+0x1a4): undefined reference to `omp_set_num_threads' omp_prime.c:(.text+0x1ae): undefined reference to `omp_set_dynamic' omp_prime.c:(.text+0x205): undefined reference to `GOMP_parallel_start' omp_prime.c:(.text+0x213): undefined reference to `GOMP_parallel_end' omp_prime-omp_prime.o: In function `main.omp_fn.0': omp_prime.c:(.text+0x2ac): undefined reference to `omp_get_num_threads' omp_prime.c:(.text+0x2b3): undefined reference to `omp_get_thread_num' collect2: ld returned 1 exit status make[5]: *** [omp_prime] Error 1 make[5]: Leaving directory `/tmp/vgtest/2008-03-12/valgrind/exp-drd/tests' make[4]: *** [check-am] Error 2 make[4]: Leaving directory `/tmp/vgtest/2008-03-12/valgrind/exp-drd/tests' make[3]: *** [check-recursive] Error 1 make[3]: Leaving directory `/tmp/vgtest/2008-03-12/valgrind/exp-drd/tests' make[2]: *** [check-recursive] Error 1 make[2]: Leaving directory `/tmp/vgtest/2008-03-12/valgrind/exp-drd' make[1]: *** [check-recursive] Error 1 make[1]: Leaving directory `/tmp/vgtest/2008-03-12/valgrind' make: *** [check] Error 2 ================================================= == Difference between 24 hours ago and now == ================================================= *** old.short Wed Mar 12 03:28:35 2008 --- new.short Wed Mar 12 03:31:56 2008 *************** *** 8,16 **** omp_prime-omp_prime.o: In function `main': ! omp_prime.c:(.text+0x1a4): undefined reference to `omp_set_num_threads' ! omp_prime.c:(.text+0x1ae): undefined reference to `omp_set_dynamic' ! omp_prime.c:(.text+0x205): undefined reference to `GOMP_parallel_start' ! omp_prime.c:(.text+0x213): undefined reference to `GOMP_parallel_end' omp_prime-omp_prime.o: In function `main.omp_fn.0': ! omp_prime.c:(.text+0x2ac): undefined reference to `omp_get_num_threads' ! omp_prime.c:(.text+0x2b3): undefined reference to `omp_get_thread_num' collect2: ld returned 1 exit status --- 8,16 ---- omp_prime-omp_prime.o: In function `main': ! omp_prime.c:(.text+0x467): undefined reference to `omp_set_num_threads' ! omp_prime.c:(.text+0x471): undefined reference to `omp_set_dynamic' ! omp_prime.c:(.text+0x52a): undefined reference to `GOMP_parallel_start' ! omp_prime.c:(.text+0x538): undefined reference to `GOMP_parallel_end' omp_prime-omp_prime.o: In function `main.omp_fn.0': ! omp_prime.c:(.text+0x5cb): undefined reference to `omp_get_num_threads' ! omp_prime.c:(.text+0x5d2): undefined reference to `omp_get_thread_num' collect2: ld returned 1 exit status |