-
Notifications
You must be signed in to change notification settings - Fork 72
stack overflow on repeated async function invocation #722
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
Comments
Hmm, what architecture are you building on? If it is x86_64, I think that this is due to the use of concurrency. There is a bug in LLVM that needs to be resolved still which sometimes results in stack exhaustion depending on how things are scheduled. This shouldn't be a problem on ARM64 and may be a good way to test. Another way to test might be to replace the use of the concurrency with dispatch perhaps. |
The architecture is x86_64. If this is indeed an LLVM bug, I consider it not bad news, so it could be resolved (?) and then the code could/should work like this... The form the the logger is mandatory in my real setting (the logger actually conforming to an according protocol), so changing the code here is probably no option. |
I'd say it is closer to must be resolved ... we really do need to fix this. Unfortunately, the bug is a bit complicated and requires some dedicated time to work on, and there are a number of other things in the queue :-(.
Understood. I think that one other option might be to do something particularly heinous like having the async method just push it on a dispatch queue and return rather than The issue is actually the continuous awaits on the single actor, which results in the stack never being cleaned up as it expects to be able to do the tail call optimization which will release the associated stack space. That is currently unsupported on Windows x86_64 and causes trouble. Should we try to enable the use of the mandatory tail call handling, we will abort here: https://github.com/llvm/llvm-project/blob/main/llvm/lib/Target/X86/X86FrameLowering.cpp#L1514 The issue tracking this is swiftlang/swift#57976. |
Oh another two ways to verify that the assumptions here are correct: once the process terminates, run |
Thank you for your precise answers, would wish I could help with the issue. So I hope it will be resolved. I will try to test my sample program on ARM64 (I actually also have an ARM64-Windows running on my Mac). I remember having seen a Windows ARM64 toolchain on Azure, but could not find it now, where can I get it (I am currently using 5.6.1)? Thanks. |
You're welcome :) I am hopeful as well, it's a matter of time and help really. But this is something that is pretty important to get resolved IMO, so hopefully either someone else or I can get to it soon. https://dev.azure.com/compnerd/swift-build/_build/results?buildId=59855&view=results has the latest ARM64 toolchain build that succeeds. I need to repair the builds after the rebranch to get the newer snapshots going for x64 (and thus ARM64).
|
This is an underlying Swift issue rather than an issue with this framework. Going to mark it as closed. |
Uh oh!
There was an error while loading. Please reload this page.
I am trying to use swift-win32 to log into a window. Using the UICatalog example I added the following logger (so access to the
TextView
instance is regulated):When I add the following after the call
window.makeKeyAndVisible()
the messages are written into the text view and the window stays open, so it is working fine:But when I use the following code, the window closes when logging:
The definition of
forEachAsync
is:What could be the cause?
The text was updated successfully, but these errors were encountered: