Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions compiler-rt/lib/asan/tests/asan_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1121,6 +1121,8 @@ TEST(AddressSanitizer, StressStackReuseTest) {
TEST(AddressSanitizer, ThreadedStressStackReuseTest) {
const int kNumThreads = 20;
pthread_t t[kNumThreads];
// pthread_attr isn't supported on Windows.
#ifndef _WIN32
size_t curStackSize = 0;
pthread_attr_t attr;
pthread_attr_init(&attr);
Expand All @@ -1130,13 +1132,20 @@ TEST(AddressSanitizer, ThreadedStressStackReuseTest) {
int rc = pthread_attr_setstacksize(&attr, MIN_STACK_SIZE);
ASSERT_EQ(0, rc);
}
#endif
for (int i = 0; i < kNumThreads; i++) {
#ifdef _WIN32
PTHREAD_CREATE(&t[i], 0, (void* (*)(void* x))LotsOfStackReuse, 0);
#else
PTHREAD_CREATE(&t[i], &attr, (void* (*)(void* x))LotsOfStackReuse, 0);
#endif
}
for (int i = 0; i < kNumThreads; i++) {
PTHREAD_JOIN(t[i], 0);
}
#ifndef _WIN32
pthread_attr_destroy(&attr);
#endif
}

// pthread_exit tries to perform unwinding stuff that leads to dlopen'ing
Expand Down
Loading