Skip to content

Commit 0db9110

Browse files
author
Sagar Thakur
committed
[TSAN] Relax the expected output of race_on_mutex.c
The stack trace produced by TSan on MIPS is: Previous write of size 8 at 0x0120ed2930 by thread T1: #0 memset /home/slt/LLVM/llvm/projects/compiler-rt/lib/tsan/rtl/tsan_interceptors.cc:678 (race_on_mutex.c.tmp+0x0120071808) rust-lang#1 __GI___pthread_mutex_init /build/glibc-g99ldr/glibc-2.19/nptl/pthread_mutex_init.c:84 (libpthread.so.0+0x000000d634) rust-lang#2 <null> /home/slt/LLVM/llvm/projects/compiler-rt/test/tsan/race_on_mutex.c:11 (race_on_mutex.c.tmp+0x01200ea59c) Reviewers: samsonov, dvyukov Subscribers: llvm-commits, mohit.bhakkad, jaydeep Differential: http://reviews.llvm.org/D17796 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@263778 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent 61d4798 commit 0db9110

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

test/tsan/race_on_mutex.c

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22
// This test fails when run on powerpc64 (VMA=46).
33
// The size of the write reported by Tsan for T1 is 8 instead of 1.
44
// XFAIL: powerpc64
5-
// This test expects pthread_mutex_init in the frame #0 of thread T1 but we
6-
// get memset at frame #0 because memset that is called from pthread_init_mutex
7-
// is being intercepted by TSan
8-
// XFAIL: mips64
95
#include "test.h"
106

117
pthread_mutex_t Mtx;
@@ -24,9 +20,9 @@ void *Thread2(void *x) {
2420
}
2521

2622
void *Thread1(void *x) {
27-
// CHECK: Previous write of size 1 at {{.*}} by thread T1:
28-
// CHECK-NEXT: #0 pthread_mutex_init {{.*}} ({{.*}})
29-
// CHECK-NEXT: #1 Thread1{{.*}} {{.*}}race_on_mutex.c:[[@LINE+1]]{{(:3)?}} ({{.*}})
23+
// CHECK: Previous write of size {{[0-9]+}} at {{.*}} by thread T1:
24+
// CHECK: #{{[0-9]+}} {{.*}}pthread_mutex_init {{.*}} ({{.*}})
25+
// CHECK-NEXT: #{{[0-9]+}} Thread1{{.*}} {{.*}}race_on_mutex.c:[[@LINE+1]]{{(:3)?}} ({{.*}})
3026
pthread_mutex_init(&Mtx, 0);
3127
pthread_mutex_lock(&Mtx);
3228
Global = 42;

0 commit comments

Comments
 (0)