Skip to content

[SR-15683] Program crashes when adding many tasks to a TaskGroup on Windows #57962

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

Closed
MarSe32m opened this issue Jan 4, 2022 · 2 comments
Closed
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. Concurrencу Area → standard library: The `Concurrency` module under the standard library umbrella crash Bug: A crash, i.e., an abnormal termination of software run-time crash Bug → crash: Swift code crashed during execution standard library Area: Standard library umbrella swift 5.6 TaskGroup Area → standard library → Concurrency: The `TaskGroup` type Windows Platform: Windows

Comments

@MarSe32m
Copy link

MarSe32m commented Jan 4, 2022

Previous ID SR-15683
Radar None
Original Reporter @MarSe32m
Type Bug
Environment

Windows, snapshot: swift-DEVELOPMENT-SNAPSHOT-2021-12-23-a.

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

md5: 33cb31c018b26c413b20c4f4c1356a81

Issue Description:

When adding many tasks to a TaskGroup, the program crashes when waiting for the tasks to finish. This doesn't happen on "relatively low" values of upperBound. For example when upperBound = 2500, the code executes fine to the end and prints "Done: 2500". But when for example upperBound > 10000, the program crashes. I cannot reproduce this behavior on macOS or Linux.

@main
struct App {
    static func main() async {
        let upperBound = 10000
        await withTaskGroup(of: Void.self) { group in 
            for i in 0..<upperBound {
                group.addTask {
                    print(i)
                }
            }
        }
        print("Done:", upperBound)
    }
}
@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@MarSe32m
Copy link
Author

MarSe32m commented Apr 5, 2023

I cannot reproduce this anymore with nightly toolchain. I think the fix that resolved #57976 also resolved this.

@MarSe32m MarSe32m closed this as completed Apr 5, 2023
@ktoso
Copy link
Contributor

ktoso commented Apr 5, 2023

Great to hear, thanks for looping back to let us know 👍

@AnthonyLatsis AnthonyLatsis added standard library Area: Standard library umbrella Concurrencу Area → standard library: The `Concurrency` module under the standard library umbrella run-time crash Bug → crash: Swift code crashed during execution crash Bug: A crash, i.e., an abnormal termination of software TaskGroup Area → standard library → Concurrency: The `TaskGroup` type swift 5.6 and removed concurrency Feature: umbrella label for concurrency language features labels Apr 6, 2023
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. Concurrencу Area → standard library: The `Concurrency` module under the standard library umbrella crash Bug: A crash, i.e., an abnormal termination of software run-time crash Bug → crash: Swift code crashed during execution standard library Area: Standard library umbrella swift 5.6 TaskGroup Area → standard library → Concurrency: The `TaskGroup` type Windows Platform: Windows
Projects
None yet
Development

No branches or pull requests

3 participants