[compiler-rt] f5a32f5 - tsan: fix free_race3.c test

Dmitry Vyukov via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 25 05:51:29 PDT 2021


Author: Dmitry Vyukov
Date: 2021-10-25T14:51:24+02:00
New Revision: f5a32f5a8201369346a0423ddd926a02541c38b1

URL: https://github.com/llvm/llvm-project/commit/f5a32f5a8201369346a0423ddd926a02541c38b1
DIFF: https://github.com/llvm/llvm-project/commit/f5a32f5a8201369346a0423ddd926a02541c38b1.diff

LOG: tsan: fix free_race3.c test

PPC64 bot failed with the following error.
The buildbot output is not particularly useful,
but looking at other similar tests, it seems
that there is something broken in free stacks on PPC64.
Use the same hack as other tests use to expect
an additional stray frame.

/home/buildbots/ppc64le-clang-lnt-test/clang-ppc64le-lnt/llvm/compiler-rt/test/tsan/free_race3.c:28:11: error: CHECK: expected string not found in input
// CHECK: Previous write of size 4 at {{.*}} by thread T1{{.*}}:
          ^
<stdin>:13:9: note: scanning from here
 #1 main /home/buildbots/ppc64le-clang-lnt-test/clang-ppc64le-lnt/llvm/compiler-rt/test/tsan/free_race3.c:17:3 (free_race3.c.tmp+0x1012fab8)
        ^
<stdin>:17:2: note: possible intended match here
ThreadSanitizer: reported 1 warnings
 ^

Input file: <stdin>
Check file: /home/buildbots/ppc64le-clang-lnt-test/clang-ppc64le-lnt/llvm/compiler-rt/test/tsan/free_race3.c

-dump-input=help explains the following input dump.

Input was:
<<<<<<
            .
            .
            .
            8:  Previous write of size 4 at 0x7ffff4d01ab0 by thread T1:
            9:  #0 Thread /home/buildbots/ppc64le-clang-lnt-test/clang-ppc64le-lnt/llvm/compiler-rt/test/tsan/free_race3.c:8:10 (free_race3.c.tmp+0x1012f9dc)
           10:
           11:  Thread T1 (tid=3222898, finished) created by main thread at:
           12:  #0 pthread_create /home/buildbots/ppc64le-clang-lnt-test/clang-ppc64le-lnt/llvm/compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp:1001:3 (free_race3.c.tmp+0x100b9040)
           13:  #1 main /home/buildbots/ppc64le-clang-lnt-test/clang-ppc64le-lnt/llvm/compiler-rt/test/tsan/free_race3.c:17:3 (free_race3.c.tmp+0x1012fab8)
check:28'0             X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: no match found
           14:
check:28'0     ~
           15: SUMMARY: ThreadSanitizer: data race /home/buildbots/ppc64le-clang-lnt-test/clang-ppc64le-lnt/llvm/compiler-rt/test/tsan/free_race3.c:19:3 in main
check:28'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           16: ==================
check:28'0     ~~~~~~~~~~~~~~~~~~~
           17: ThreadSanitizer: reported 1 warnings
check:28'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
check:28'1      ?                                    possible intended match
>>>>>>

Reviewed By: melver

Differential Revision: https://reviews.llvm.org/D112444

Added: 
    

Modified: 
    compiler-rt/test/tsan/free_race3.c

Removed: 
    


################################################################################
diff  --git a/compiler-rt/test/tsan/free_race3.c b/compiler-rt/test/tsan/free_race3.c
index 55efd6e12134..f38a98c1bfa7 100644
--- a/compiler-rt/test/tsan/free_race3.c
+++ b/compiler-rt/test/tsan/free_race3.c
@@ -24,6 +24,6 @@ int main() {
 // CHECK: WARNING: ThreadSanitizer: data race
 // CHECK:   Write of size 8 at {{.*}} by main thread{{.*}}:
 // CHECK:     #0 free
-// CHECK:     #1 main
+// CHECK:     #{{(1|2)}} main
 // CHECK:   Previous write of size 4 at {{.*}} by thread T1{{.*}}:
 // CHECK:     #0 Thread


        


More information about the llvm-commits mailing list