[PATCH] D17757: Make tsan tests more portable

Maxim Kuvyrkov via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 1 02:03:15 PST 2016


maxim-kuvyrkov added a comment.

This patch improves sanitizer testsuite to avoid sporadic failures, especially when [cross-]testing on a remote machine.

There are several unstable sanitizer tests in LLVM testsuite (e.g., tsan/aligned_vs_unaligned_race.C), and the instability comes from the test doing this:

  printf("Pass\n");
  // CHECK: ThreadSanitizer: data race
  // CHECK: Pass

.  Thread sanitizer prints its data to stderr, and then printf prints to stdout.  The testcase expects stderr to be flushed before stdout, and "Pass" to be at the end of the output.  AFAIK, that works fine in native/local environment, but fails in remote testing from time to time.  The failure case happens when stdout output is printed before stderr output.  This is, likely, because there is no strict ordering of stdout and stderr when remote testing.


http://reviews.llvm.org/D17757





More information about the llvm-commits mailing list