Skip to content

Commit

Permalink
[test][asan] Reduce recursion to avoid stack overflow
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
vitalybuka committed Aug 11, 2023
1 parent ebf2490 commit beae315
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions compiler-rt/test/asan/TestCases/Posix/fake_stack_gc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit beae315

Please sign in to comment.