Skip to content

Stack overflow occurs when co_await asynchronous function in the loop #5078

@shelllet

Description

@shelllet

The application crash occurs when co_await asynchronous function in the loop.

      co_await resume_background();

        for (int i = 0; i < 10000; ++i) {

            co_await Test();
       }
  1. download source code
    https://github.com/shelllet/winui_stack_overflow.git

  2. compile and run

  3. click button 'clickme'

error:

Symbol loading disabled by Include/Exclude setting.
Exception thrown at 0x00007FF7BAD5A77F in App1.exe: 0xC00000FD: Stack overflow (parameters: 0x0000000000000001, 0x0000007CC4403F88).
Unhandled exception at 0x00007FF7BAD5A77F in App1.exe: 0xC00000FD: Stack overflow (parameters: 0x0000000000000001, 0x0000007CC4403F88).
2021-05-23.15-25-01.mp4

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions