[PATCH] D52330: SafeStack: Fix flaky test (PR39001)

Vlad Tsyrklevich via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 21 10:50:58 PDT 2018


vlad.tsyrklevich added inline comments.


================
Comment at: test/safestack/pthread-cleanup.c:38
 
-  if (pthread_create(&t2, NULL, start, NULL))
-    abort();
-  // Second thread destructor cleans up the first thread's stack.
-  if (pthread_join(t2, NULL))
-    abort();
-
-  // should segfault here
-  memset(t1_buffer, 0, kBufferSize);
+  for (int i = 0; i < 3; i++) {
+    if (pthread_create(&t2, NULL, start, NULL))
----------------
vitalybuka wrote:
> Why just 3?
This test seems to only be flaky under high load when one thread runs immediately after the other. 3 seconds of wall time seemed like a reasonably high enough amount of time that the first thread would have been able to finish exiting in the kernel (without making this test very laggy under circumstances where it would actually fail for some reason.)


Repository:
  rCRT Compiler Runtime

https://reviews.llvm.org/D52330





More information about the llvm-commits mailing list