Commit f6ca0ac0 authored by Brian Gesiak's avatar Brian Gesiak Committed by Facebook Github Bot

Reduce recursion, for ASAN at -O0

Summary:
At `-O0` each coroutine call results in a heap allocation. This
combined with the increased memory pressure when using ASAN
results in an invalid memory access beyond the maximum address.
Avoid the problem by limiting the recursion to 5,000 frames deep,
instead of 10,000. This still fulfills the intent of the test,
but without pushing the limits of ASAN.

Reviewed By: wqfish

Differential Revision: D7503976

fbshipit-source-id: 7850a9d9db23328d42c25b74a1290caa7773e6a7
parent 9d98a85d
......@@ -116,10 +116,10 @@ coro::Task<int> taskRecursion(int depth) {
TEST(Coro, LargeStack) {
ScopedEventBaseThread evbThread;
auto future = via(evbThread.getEventBase(), taskRecursion(10000));
auto future = via(evbThread.getEventBase(), taskRecursion(5000));
future.wait();
EXPECT_EQ(10000, future.get());
EXPECT_EQ(5000, future.get());
}
coro::Task<void> taskThreadNested(std::thread::id threadId) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment