You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems that the crash occurs due to a stack overflow in startWaiter lambda function. Coroutines awaiting on the async_auto_reset_event are sometimes resumed inside a call to set(), which is a documented behavior. There are multiple coroutines created by startWaiter, so the chain of nested continuations may become too long.
With a slightly modified startWaiter it is possible to detect nested continuations.
(see code)
std::atomic<int> depth = 0;
auto startWaiter = [&]() -> cppcoro::task<>
{
co_await tp.schedule();
co_await event;
++value;
int d = depth++;
assert(d < 3); // if depth is greater than number of threads in the pool,// this is executed as a nested continuation
event.set();
depth -= 1;
};
Interestingly, when there is only one thread in the thread pool, the test completes successfully.
In:
https://github.com/andreasbuhr/cppcoro/runs/1505811235?check_suite_focus=true
we see
The following tests FAILED:
37 - async auto reset event tests-multi-threaded (SEGFAULT)
wich happens sometimes.
The text was updated successfully, but these errors were encountered: