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

[SR-14086] async await app crash on windows using 5.4 snapshot #56475

Closed
swift-ci opened this issue Jan 22, 2021 · 11 comments
Closed

[SR-14086] async await app crash on windows using 5.4 snapshot #56475

swift-ci opened this issue Jan 22, 2021 · 11 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. concurrency Feature: umbrella label for concurrency language features standard library Area: Standard library umbrella Windows Platform: Windows

Comments

@swift-ci
Copy link
Collaborator

Previous ID SR-14086
Radar rdar://problem/73519269
Original Reporter yostane (JIRA User)
Type Bug
Status Closed
Resolution Done

Attachment: Download

Environment

swift --version
compnerd.org Swift version 5.4-dev (LLVM a9b8270, Swift 31e460b)
Target: x86_64-unknown-windows-msvc

Additional Detail from JIRA
Votes 0
Component/s Standard Library
Labels Bug, Concurrency, Windows
Assignee None
Priority Medium

md5: 582420c1a2edbf3988a9a13f5f5c53c5

Issue Description:

Hello,

I am trying to run a simple swift script async_await.swiftwith async / await but the app crashes on startup.

Here is the command used for building the app (on powershell) :

swiftc -Xfrontend -enable-experimental-concurrency -sdk $env:sdkroot -o main.exe async_await.swift empty.swift

Here is the build output:

async_await-685a59.o : warning LNK4078: plusieurs sections '.rdata' trouvées avec différents attributs (C0401040)
   Création de la bibliothèque main.lib et de l'objet main.exp

When I rue the app, I get a crash window.

@typesanitizer
Copy link

@swift-ci create

@compnerd
Copy link
Collaborator

Interesting, can you provide a stack trace as well? It seems odd that this would fail given that there are tests running in CI.

@swift-ci
Copy link
Collaborator Author

Comment by Yassine BENABBAS (JIRA)

Here is what I get from Visual Studio when I select the "debug" option in the crash window:

Exception non gérée à 0x00007FF99CD5287E (ucrtbase.dll) dans main.exe : Fermeture de programme requise suite à une erreur irrécupérable.

Translation:

Unhandled exception at 0x00007FF99CD5287E (ucrtbase.dll) in main.exe: Required program closed due to a fatal error.

Stack trace

Modules

LLDB

Here is the stack trace that I get with LLDB:

swift  lldb .\main.exe
(lldb) target create ".\\main.exe"
Current executable set to 'D:\swift\main.exe' (x86_64).
(lldb) r
Process 20024 launched: 'D:\swift\main.exe' (x86_64)
Process 20024 stopped
* thread #​1, stop reason = Exception 0xc0000409 encountered at address 0x7ff99cd5287e
    frame #​0: 0x00007ff99cd5287e ucrtbase.dll`abort + 78
ucrtbase.dll`abort:
->  0x7ff99cd5287e <+78>: int    $0x29
    0x7ff99cd52880 <+80>: movl   $0x40000015, %edx         ; imm = 0x40000015        
    0x7ff99cd52885 <+85>: movl   $0x3, %ecx
    0x7ff99cd5288a <+90>: callq  0x7ff99cd50f30            ; _getpid + 16
Target 0: (main.exe) stopped.

@compnerd
Copy link
Collaborator

Okay, even the most cursory look would have identified this as a result of ewilde's explicit `abort` on Windows introduced in 13cc56b.

@compnerd
Copy link
Collaborator

I think that #35577 will help with the abort - but won't really help with the scheduling of the async task. Because libdispatch is not linked against explicitly, I cannot imagine that we have the ability to have scheduled something on the dispatch queue. That will still need to be resolved before the async operation can execute.

@compnerd
Copy link
Collaborator

I'll hopefully remember to upload the second diff tomorrow to actually get something executing (I have that but its dependent on the previous patch).

@swift-ci
Copy link
Collaborator Author

Comment by Yassine BENABBAS (JIRA)

Great news 🙂. Thanks

@compnerd
Copy link
Collaborator

#35584 is the second half, and with that, the test actually succeeds in printing the two strings.

@swift-ci
Copy link
Collaborator Author

Comment by Yassine BENABBAS (JIRA)

Thank you very much 👍. I'm looking forward to try it.

@compnerd
Copy link
Collaborator

You're welcome - thank you for reporting the issue in the first place!

@swift-ci
Copy link
Collaborator Author

Comment by Yassine BENABBAS (JIRA)

You're welcome

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. concurrency Feature: umbrella label for concurrency language features standard library Area: Standard library umbrella Windows Platform: Windows
Projects
None yet
Development

No branches or pull requests

3 participants