[SR-14081] Assertion failure with -enable-experimental-concurrency: (numClosures < prevNumClosures && "Cyclic closures scopes") #56470
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
compiler
The Swift compiler in itself
concurrency
Feature: umbrella label for concurrency language features
crash
Bug: A crash, i.e., an abnormal termination of software
SILOptimizer
Area → compiler: SIL optimization passes
swift 5.4
Attachment: Download
Environment
Mac OS X 10.15.7 (19H114)
Xcode Version 12.3 (12C33)
swift-DEVELOPMENT-SNAPSHOT-2021-01-19-a-osx.pkg
Hardware Overview:
Model Name: MacBook Pro
Model Identifier: MacBookPro13,1
Processor Name: Dual-Core Intel Core i5
Processor Speed: 2 GHz
Number of Processors: 1
Total Number of Cores: 2
L2 Cache (per Core): 256 KB
L3 Cache: 4 MB
Hyper-Threading Technology: Enabled
Memory: 8 GB
Boot ROM Version: 429.60.3.0.0
SMC Version (system): 2.36f101
Additional Detail from JIRA
md5: 379f705bfd0c5e6a2908b75e3accedaa
Issue Description:
When attempting to use features from https://github.com/apple/swift-evolution/blob/main/proposals/0296-async-await.md and https://github.com/DougGregor/swift-evolution/blob/structured-concurrency/proposals/nnnn-structured-concurrency.md with a complex scenario including a task group, I get an assertion failure (attached log file). As indicated in the log file, this is with development snapshot 2021-01-19, but I get the same outcome with 5.4 development snapshot 2021-01-11. Xcode project file is attached, though it is likely reproductible outside of Xcode, and ought not to depend on the platform as long as libdispatch is present (except for one instance of ProcessInfo.processInfo.activeProcessorCount ; replace that if necessary).
I do realize this may be a bit of a torture test for functionality that is still experimental, but on the other hand this is derived from code that does work (using libdispatch instead): http://wanderingcoder.net/2021/01/13/second-teaser-practical-multithreading/ . Swift structured concurrency is understandably more demanding of the code, and I attempted to conform to it, but I cannot find any way around this assertion failure.
The text was updated successfully, but these errors were encountered: