[compiler-rt] beae315 - [test][asan] Reduce recursion to avoid stack overflow

via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 11 14:25:34 PDT 2023


Author: Vitaly Buka
Date: 2023-08-11T14:25:31-07:00
New Revision: beae315238319c395e65ad1b6686cac1206657e8

URL: https://github.com/llvm/llvm-project/commit/beae315238319c395e65ad1b6686cac1206657e8
DIFF: https://github.com/llvm/llvm-project/commit/beae315238319c395e65ad1b6686cac1206657e8.diff

LOG: [test][asan] Reduce recursion to avoid stack overflow

D157552 uses 1000 as over pessimistic value.

We don't want to hardcode stack frame sizeclass of the
Thread frame, so iterate various frame sizes to trigger
reuse.

100 is also significantly above Thread frame, but it's
small enough to avoid overflow.

Added: 
    

Modified: 
    compiler-rt/test/asan/TestCases/Posix/fake_stack_gc.cpp

Removed: 
    


################################################################################
diff  --git a/compiler-rt/test/asan/TestCases/Posix/fake_stack_gc.cpp b/compiler-rt/test/asan/TestCases/Posix/fake_stack_gc.cpp
index 64abf99891d6f3..7e049ba81a1b7d 100644
--- a/compiler-rt/test/asan/TestCases/Posix/fake_stack_gc.cpp
+++ b/compiler-rt/test/asan/TestCases/Posix/fake_stack_gc.cpp
@@ -3,12 +3,6 @@
 // Check that fake stack does not discard frames on the main stack, when GC is
 // triggered from high alt stack.
 
-// FIXME: Investigate.
-// UNSUPPORTED: android
-
-// FIXME: Fails on Darwin
-// UNSUPPORTED: darwin
-
 #include <algorithm>
 #include <assert.h>
 #include <csignal>
@@ -36,7 +30,7 @@ static void Handler(int signo) {
   // Trigger GC and create a lot of frame to reuse "Thread" frame if it was
   // discarded.
   for (int i = 0; i < 1000; ++i)
-    Fn<1000>();
+    Fn<100>();
   // If we discarder and reused "Thread" frame, the next line will crash with
   // false report.
   *on_thread = 10;


        


More information about the llvm-commits mailing list