[compiler-rt] r354377 - [msan] Remove cxa_atexit_race.cc
Vitaly Buka via llvm-commits
llvm-commits at lists.llvm.org
Tue Feb 19 12:36:52 PST 2019
Author: vitalybuka
Date: Tue Feb 19 12:36:52 2019
New Revision: 354377
URL: http://llvm.org/viewvc/llvm-project?rev=354377&view=rev
Log:
[msan] Remove cxa_atexit_race.cc
Summary:
The goal of the test to check that msan does not crash when code is racy on __cxa_atexit. Original crash was caused by race condition in the glibc. With
the msan patch the msan does not crashes however the race is still there and the test triggers it.
Because the test relies on triggering of undefined behavior results are not
very predictable and it may occasionally crashes or hangs.
I don't see how to reasonably improve the test, so I remove it.
Reviewers: eugenis, peter.smith
Subscribers: jfb, jdoerfert, #sanitizers, llvm-commits
Tags: #sanitizers, #llvm
Differential Revision: https://reviews.llvm.org/D58396
Removed:
compiler-rt/trunk/test/msan/cxa_atexit_race.cc
Removed: compiler-rt/trunk/test/msan/cxa_atexit_race.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/msan/cxa_atexit_race.cc?rev=354376&view=auto
==============================================================================
--- compiler-rt/trunk/test/msan/cxa_atexit_race.cc (original)
+++ compiler-rt/trunk/test/msan/cxa_atexit_race.cc (removed)
@@ -1,35 +0,0 @@
-// RUN: %clangxx_msan %s -o %t && %run %t 2>&1 | FileCheck %s
-
-#include <atomic>
-#include <pthread.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-
-extern "C" int
-__cxa_atexit(void (*func)(void *), void *arg, void *d);
-
-void handler(void *) {
-}
-
-std::atomic_int counter;
-
-void *thread(void *) {
- for (int i = 0; i < 10000; ++i) {
- __cxa_atexit(&handler, 0, (void *)&handler);
- ++counter;
- }
- return 0;
-}
-
-int main(void) {
- printf("TEST_MAIN\n");
- pthread_t pt;
- for (int i = 0; i < 2; ++i)
- pthread_create(&pt, 0, &thread, 0);
- while (counter < 1000) {
- };
- return 0;
-}
-// CHECK: TEST_MAIN
-// CHECK-NOT: MemorySanitizer
More information about the llvm-commits
mailing list