Open winlinvip opened 2 years ago
Based on the work of @xiaozhihong, I took the time to examine this issue in detail:
To summarize, here are several conclusions:
See also:
TRANS_BY_GPT4
Coroutine with stack is not compatible with Windows SEH exception, which is introduced by libsrt. Therefore, I beieve if call libsrt APIs in main coroutine, we can bypass this issue. This is achived when SEH exceptions are created in the main coroutine, or threads forked by main coroutine. Actually, the main coroutine is the primordial main thread, whose stack is not created by us but by the OS. This stack should be compatible with the SEH exceptions.
A possible solution is to run libsrt on the primordial coroutine. Since the primordial coroutine is a normal stack without any modifications, it should support SEH, but this requires further research.
Workaround: Now we disable SRT for cygwin by default as a workaround.
The stack is bellow