From c65ee98951bd2efc64b5b8a5ea75856df45034f6 Mon Sep 17 00:00:00 2001 From: Joachim Protze Date: Wed, 11 Aug 2021 12:43:02 +0200 Subject: [PATCH 1/6] Add missing data race pairs --- micro-benchmarks/DRB020-privatemissing-var-yes.c | 4 +++- .../DRB136-taskdep-mutexinoutset-orig-yes.c | 15 +++++++++++---- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/micro-benchmarks/DRB020-privatemissing-var-yes.c b/micro-benchmarks/DRB020-privatemissing-var-yes.c index 60b4714..69a9f30 100644 --- a/micro-benchmarks/DRB020-privatemissing-var-yes.c +++ b/micro-benchmarks/DRB020-privatemissing-var-yes.c @@ -45,7 +45,9 @@ THE POSSIBILITY OF SUCH DAMAGE. */ /* tmp should be put as private to avoid race condition -Data race pair: tmp@65:5:W vs. tmp@66:12:R +Data race pairs: + tmp@67:5:W vs. tmp@68:12:R + tmp@67:5:W vs. tmp@67:5:W */ #include int main(int argc, char* argv[]) diff --git a/micro-benchmarks/DRB136-taskdep-mutexinoutset-orig-yes.c b/micro-benchmarks/DRB136-taskdep-mutexinoutset-orig-yes.c index d073296..60346fe 100644 --- a/micro-benchmarks/DRB136-taskdep-mutexinoutset-orig-yes.c +++ b/micro-benchmarks/DRB136-taskdep-mutexinoutset-orig-yes.c @@ -9,10 +9,17 @@ /* Due to the missing mutexinoutset dependence type on c, these tasks will execute in any - * order leading to the data race at line 36. Data Race Pair, d@36:7:W vs. d@36:7:W + * order leading to the data race at line 36. + Data Race Pairs + c@33:7:W vs. c@39:7:W + c@33:7:W vs. c@41:7:W + c@33:7:W vs. c@39:7:R + c@33:7:W vs. c@41:7:R + c@39:7:W vs. c@41:7:W + c@39:7:W vs. c@43:11:R + c@41:7:W vs. c@43:11:R * */ - #include #include @@ -29,9 +36,9 @@ int main(){ #pragma omp task depend(out: b) b = 3; #pragma omp task depend(in: a) - c += a; + c+= a; #pragma omp task depend(in: b) - c += b; + c+= b; #pragma omp task depend(in: c) d = c; } From 8755bd7ec404782f28f58e72edece905d391c756 Mon Sep 17 00:00:00 2001 From: Joachim Protze Date: Wed, 11 Aug 2021 12:44:28 +0200 Subject: [PATCH 2/6] Fix wrong column annotation (probably caused by code reformating) --- micro-benchmarks/DRB090-static-local-orig-yes.c | 4 ++-- micro-benchmarks/DRB106-taskwaitmissing-orig-yes.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/micro-benchmarks/DRB090-static-local-orig-yes.c b/micro-benchmarks/DRB090-static-local-orig-yes.c index d0baaaa..27bbed4 100644 --- a/micro-benchmarks/DRB090-static-local-orig-yes.c +++ b/micro-benchmarks/DRB090-static-local-orig-yes.c @@ -50,8 +50,8 @@ For a variable declared in a scope inside an OpenMP construct: * shared if the variable has a static storage duration. Dependence pairs: - tmp@73:5:W vs. tmp@73:5:W - tmp@73:5:W vs. tmp@74:12:R + tmp@73:7:W vs. tmp@73:7:W + tmp@73:7:W vs. tmp@74:14:R */ #include diff --git a/micro-benchmarks/DRB106-taskwaitmissing-orig-yes.c b/micro-benchmarks/DRB106-taskwaitmissing-orig-yes.c index 4d82235..1d575d5 100644 --- a/micro-benchmarks/DRB106-taskwaitmissing-orig-yes.c +++ b/micro-benchmarks/DRB106-taskwaitmissing-orig-yes.c @@ -46,8 +46,8 @@ THE POSSIBILITY OF SUCH DAMAGE. #include /* This is a program based on a test contributed by Yizi Gu@Rice Univ. * Classic Fibonacci calculation using task but missing taskwait. - * Data races pairs: i@61:5:W vs. i@65:12:R - * j@63:5:W vs. j@65:14:R + * Data races pairs: i@61:5:W vs. i@65:14:R + * j@63:5:W vs. j@65:16:R * */ unsigned int input = 10; int fib(unsigned int n) From 9d8c2737388b51bed0abc2c21c196ada5b4cc682 Mon Sep 17 00:00:00 2001 From: Joachim Protze Date: Wed, 11 Aug 2021 12:45:20 +0200 Subject: [PATCH 3/6] Taking the address of i is not causing a race on i. The race is really for the access in the function. --- micro-benchmarks/DRB074-flush-orig-yes.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/micro-benchmarks/DRB074-flush-orig-yes.c b/micro-benchmarks/DRB074-flush-orig-yes.c index f22a514..90b0eb4 100644 --- a/micro-benchmarks/DRB074-flush-orig-yes.c +++ b/micro-benchmarks/DRB074-flush-orig-yes.c @@ -49,7 +49,7 @@ This benchmark is extracted from flush_nolist.1c of OpenMP Application Programming Interface Examples Version 4.5.0 . We added one critical section to make it a test with only one pair of data races. The data race will not generate wrong result though. So the assertion always passes. -Data race pair: i@70:10:W vs. i@71:11:R +Data race pair: *q@60:3:W vs. i@71:11:R */ #include #include From feb34806a6493389243270970b0695e620320825 Mon Sep 17 00:00:00 2001 From: Joachim Protze Date: Wed, 11 Aug 2021 12:46:42 +0200 Subject: [PATCH 4/6] Removing the space for now, so that the assignment is not more than 2 columns behind the variable name --- micro-benchmarks/DRB134-taskdep5-orig-omp45-yes.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/micro-benchmarks/DRB134-taskdep5-orig-omp45-yes.c b/micro-benchmarks/DRB134-taskdep5-orig-omp45-yes.c index df59a0b..7be5f8a 100644 --- a/micro-benchmarks/DRB134-taskdep5-orig-omp45-yes.c +++ b/micro-benchmarks/DRB134-taskdep5-orig-omp45-yes.c @@ -11,7 +11,7 @@ * by x with the in dependence type in the depend clause of the second task. Generating task * at the first taskwait only waits for the first child task to complete. The second taskwait * guarantees completion of the second task before y is accessed. If we access y before the - * second taskwait, there is a race condition at line 28:2 and 34:18. Data Race Pair, y@28:2:W vs. y@34:19:R + * second taskwait, there is a race condition at line 28:3 and 34:19. Data Race Pair, y@28:3:W vs. y@34:19:R * */ @@ -25,7 +25,7 @@ void foo(){ x++; // 1st child task #pragma omp task depend(in: x) depend(inout: y) shared(x, y) - y -= x; //2nd child task + y-=x; //2nd child task #pragma omp task depend(in: x) if(0) // 1st taskwait {} From 55ec0d435f4d2d5d43c70603047195da3a013e3d Mon Sep 17 00:00:00 2001 From: Joachim Protze Date: Wed, 11 Aug 2021 14:21:11 +0200 Subject: [PATCH 5/6] Add more missing data race pairs --- micro-benchmarks/DRB035-truedepscalar-orig-yes.c | 4 ++-- micro-benchmarks/DRB036-truedepscalar-var-yes.c | 4 ++-- micro-benchmarks/DRB111-linearmissing-orig-yes.c | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/micro-benchmarks/DRB035-truedepscalar-orig-yes.c b/micro-benchmarks/DRB035-truedepscalar-orig-yes.c index 84510ea..ae28fd5 100644 --- a/micro-benchmarks/DRB035-truedepscalar-orig-yes.c +++ b/micro-benchmarks/DRB035-truedepscalar-orig-yes.c @@ -43,10 +43,10 @@ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - /* Loop carried true dep between tmp =.. and ..= tmp. -Data race pair: tmp@66:12:R vs. tmp@67:5:W +Data race pairs: tmp@66:12:R vs. tmp@67:5:W + tmp@67:5:W vs. tmp@67:5:W */ #include #include diff --git a/micro-benchmarks/DRB036-truedepscalar-var-yes.c b/micro-benchmarks/DRB036-truedepscalar-var-yes.c index 924ffad..872822f 100644 --- a/micro-benchmarks/DRB036-truedepscalar-var-yes.c +++ b/micro-benchmarks/DRB036-truedepscalar-var-yes.c @@ -43,10 +43,10 @@ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - /* Loop carried true dep between tmp =.. and ..= tmp. -Data race pair: tmp@66:12:R vs. tmp@67:5:W +Data race pairs: tmp@66:12:R vs. tmp@67:5:W + tmp@67:5:R vs. tmp@67:5:W */ #include int main(int argc, char* argv[]) diff --git a/micro-benchmarks/DRB111-linearmissing-orig-yes.c b/micro-benchmarks/DRB111-linearmissing-orig-yes.c index 159b22b..bb78286 100644 --- a/micro-benchmarks/DRB111-linearmissing-orig-yes.c +++ b/micro-benchmarks/DRB111-linearmissing-orig-yes.c @@ -46,7 +46,7 @@ THE POSSIBILITY OF SUCH DAMAGE. #include /* * loop missing the linear clause - * Data race pair: j@67:7:R vs. j@68:5:W + * Data race pairs: j@67:7:R vs. j@68:5:W and j@68:5:W vs. j@68:5:W */ int main() { From eaa6b0078aa9873ed0d2f8b89512033ba266a346 Mon Sep 17 00:00:00 2001 From: Joachim Protze Date: Wed, 11 Aug 2021 14:38:31 +0200 Subject: [PATCH 6/6] Fixing/Adding more data race annotations --- micro-benchmarks/DRB036-truedepscalar-var-yes.c | 2 +- micro-benchmarks/DRB111-linearmissing-orig-yes.c | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/micro-benchmarks/DRB036-truedepscalar-var-yes.c b/micro-benchmarks/DRB036-truedepscalar-var-yes.c index 872822f..4a8bc75 100644 --- a/micro-benchmarks/DRB036-truedepscalar-var-yes.c +++ b/micro-benchmarks/DRB036-truedepscalar-var-yes.c @@ -46,7 +46,7 @@ THE POSSIBILITY OF SUCH DAMAGE. /* Loop carried true dep between tmp =.. and ..= tmp. Data race pairs: tmp@66:12:R vs. tmp@67:5:W - tmp@67:5:R vs. tmp@67:5:W + tmp@67:5:W vs. tmp@67:5:W */ #include int main(int argc, char* argv[]) diff --git a/micro-benchmarks/DRB111-linearmissing-orig-yes.c b/micro-benchmarks/DRB111-linearmissing-orig-yes.c index bb78286..3462ba6 100644 --- a/micro-benchmarks/DRB111-linearmissing-orig-yes.c +++ b/micro-benchmarks/DRB111-linearmissing-orig-yes.c @@ -46,7 +46,10 @@ THE POSSIBILITY OF SUCH DAMAGE. #include /* * loop missing the linear clause - * Data race pairs: j@67:7:R vs. j@68:5:W and j@68:5:W vs. j@68:5:W + * Data race pairs (race on j allows wrong indexing of c): + j@70:7:R vs. j@71:5:W + j@71:5:W vs. j@71:5:W + c[j]@70:5:W vs. c[j]@70:5:W */ int main() {