-
Notifications
You must be signed in to change notification settings - Fork 10.6k
Closed
Labels
ConcurrencуArea → standard library: The `Concurrency` module under the standard library umbrellaArea → standard library: The `Concurrency` module under the standard library umbrellaTaskGroupArea → standard library → Concurrency: The `TaskGroup` typeArea → standard library → Concurrency: The `TaskGroup` typeWindowsPlatform: WindowsPlatform: WindowsbugA deviation from expected or documented behavior. Also: expected but undesirable behavior.A deviation from expected or documented behavior. Also: expected but undesirable behavior.crashBug: A crash, i.e., an abnormal termination of softwareBug: A crash, i.e., an abnormal termination of softwarerun-time crashBug → crash: Swift code crashed during executionBug → crash: Swift code crashed during executionstandard libraryArea: Standard library umbrellaArea: Standard library umbrellaswift 5.6
Description
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)
}
}
Metadata
Metadata
Assignees
Labels
ConcurrencуArea → standard library: The `Concurrency` module under the standard library umbrellaArea → standard library: The `Concurrency` module under the standard library umbrellaTaskGroupArea → standard library → Concurrency: The `TaskGroup` typeArea → standard library → Concurrency: The `TaskGroup` typeWindowsPlatform: WindowsPlatform: WindowsbugA deviation from expected or documented behavior. Also: expected but undesirable behavior.A deviation from expected or documented behavior. Also: expected but undesirable behavior.crashBug: A crash, i.e., an abnormal termination of softwareBug: A crash, i.e., an abnormal termination of softwarerun-time crashBug → crash: Swift code crashed during executionBug → crash: Swift code crashed during executionstandard libraryArea: Standard library umbrellaArea: Standard library umbrellaswift 5.6