The new test started failing on bots with: CHECK failed: tsan_rtl.cpp:327 "((addr + size)) <= ((TraceMemEnd()))" (0xf06200e03010, 0xf06200000000) (tid=4073872) https://lab.llvm.org/buildbot#builders/179/builds/1761 This is a latent bug in aarch64 virtual address space layout, there is not enough address space to fit traces for all threads. But since the trace space is going away with the new tsan runtime (D112603), disable the test. Reviewed By: melver Differential Revision: https://reviews.llvm.org/D113990
51 lines
1.4 KiB
C++
51 lines
1.4 KiB
C++
// RUN: %clangxx_tsan %s -o %t
|
|
// RUN: %run %t 2>&1 | FileCheck %s
|
|
|
|
// bench.h needs pthread barriers which are not available on OS X
|
|
// UNSUPPORTED: darwin
|
|
|
|
// aarch64 fails with:
|
|
// CHECK failed: tsan_rtl.cpp:327 "((addr + size)) <= ((TraceMemEnd()))"
|
|
// TODO: try to re-enable when D112603 is landed.
|
|
// XFAIL: aarch64
|
|
|
|
#include "bench.h"
|
|
|
|
void *nop_thread(void *arg) {
|
|
pthread_setname_np(pthread_self(), "nop_thread");
|
|
return nullptr;
|
|
}
|
|
|
|
void thread(int tid) {
|
|
for (int i = 0; i < bench_niter; i++) {
|
|
pthread_t th;
|
|
pthread_create(&th, nullptr, nop_thread, nullptr);
|
|
pthread_join(th, nullptr);
|
|
}
|
|
}
|
|
|
|
void bench() {
|
|
// Benchmark thread creation/joining in presence of a large number
|
|
// of threads (both alive and already joined).
|
|
printf("starting transient threads...\n");
|
|
for (int i = 0; i < 200; i++) {
|
|
const int kBatch = 100;
|
|
pthread_t th[kBatch];
|
|
for (int j = 0; j < kBatch; j++)
|
|
pthread_create(&th[j], nullptr, nop_thread, nullptr);
|
|
for (int j = 0; j < kBatch; j++)
|
|
pthread_join(th[j], nullptr);
|
|
}
|
|
printf("starting persistent threads...\n");
|
|
const int kLiveThreads = 2000;
|
|
pthread_t th[kLiveThreads];
|
|
for (int j = 0; j < kLiveThreads; j++)
|
|
pthread_create(&th[j], nullptr, nop_thread, nullptr);
|
|
printf("starting benchmark threads...\n");
|
|
start_thread_group(bench_nthread, thread);
|
|
for (int j = 0; j < kLiveThreads; j++)
|
|
pthread_join(th[j], nullptr);
|
|
}
|
|
|
|
// CHECK: DONE
|