[PATCH] D17796: [TSAN] Relax the expected output of race_on_mutex.c

Sagar Thakur via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 1 22:51:45 PST 2016


sagar created this revision.
sagar added reviewers: samsonov, dvyukov.
sagar added subscribers: jaydeep, mohit.bhakkad, llvm-commits.
sagar set the repository for this revision to rL LLVM.

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)
     #1 __GI___pthread_mutex_init
 /build/glibc-g99ldr/glibc-2.19/nptl/pthread_mutex_init.c:84
 (libpthread.so.0+0x000000d634)
     #2 <null>
 /home/slt/LLVM/llvm/projects/compiler-rt/test/tsan/race_on_mutex.c:11 (race_on_mutex.c.tmp+0x01200ea59c)
```

Repository:
  rL LLVM

http://reviews.llvm.org/D17796

Files:
  test/tsan/race_on_mutex.c

Index: test/tsan/race_on_mutex.c
===================================================================
--- test/tsan/race_on_mutex.c
+++ test/tsan/race_on_mutex.c
@@ -2,10 +2,6 @@
 // This test fails when run on powerpc64 (VMA=46).
 // The size of the write reported by Tsan for T1 is 8 instead of 1.
 // XFAIL: powerpc64
-// This test expects pthread_mutex_init in the frame #0 of thread T1 but we
-// get memset at frame #0 because memset that is called from pthread_init_mutex
-// is being intercepted by TSan
-// XFAIL: mips64
 #include "test.h"
 
 pthread_mutex_t Mtx;
@@ -24,9 +20,9 @@
 }
 
 void *Thread1(void *x) {
-// CHECK:        Previous write of size 1 at {{.*}} by thread T1:
-// CHECK-NEXT:     #0 pthread_mutex_init {{.*}} ({{.*}})
-// CHECK-NEXT:     #1 Thread1{{.*}} {{.*}}race_on_mutex.c:[[@LINE+1]]{{(:3)?}} ({{.*}})
+// CHECK:        Previous write of size {{[0-9]+}} at {{.*}} by thread T1:
+// CHECK:          #{{[0-9]+}} {{.*}}pthread_mutex_init {{.*}} ({{.*}})
+// CHECK-NEXT:     #{{[0-9]+}} Thread1{{.*}} {{.*}}race_on_mutex.c:[[@LINE+1]]{{(:3)?}} ({{.*}})
   pthread_mutex_init(&Mtx, 0);
   pthread_mutex_lock(&Mtx);
   Global = 42;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D17796.49582.patch
Type: text/x-patch
Size: 1159 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160302/a54e085e/attachment.bin>


More information about the llvm-commits mailing list