Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix segfaults in test 37 #33

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

karzhenkov
Copy link

Resolves #25.

The crash is caused by stack overflow. Coroutine contnuations can be nested, and the depth of nesting can exceed the available stack space. Such a nesting occurs if async_auto_reset_event::set is called by startWaiter while some other startAwaiter coroutine is already awaiting on the event.

It's also possible to achieve strict nesting - for example, by activating startSignaller after all startWaiter calls are suspended in the co_await event. If the number of waiters is big enough, then the failure is likely to occur in all test configurations.

@karzhenkov
Copy link
Author

Almost all test configurations have a large depth of nested continuation calls (see, for example, here)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

On MSVC 2017, segfaults occur in test 37
1 participant