Xcode 8.3.x: Swift 3.1 compiler crash (Segmentation fault: 11)
Originator: | rsfinn | ||
Number: | rdar://31803589 | Date Originated: | 2017-04-24 |
Status: | Closed | Resolved: | |
Product: | Developer Tools | Product Version: | Xcode 8.3.2 |
Classification: | Crash | Reproducible: | Always |
Summary: Building a complex project with Xcode 8.3 reliably crashes the Swift compiler in a particular source file. I have been able to reduce the project to a relatively small sample project that crashes the compiler in the same way. The crash occurred in each of Xcode 8.3, 8.3.1, and 8.3.2. Steps to Reproduce: 1. Install Xcode 8.3.x (x = 0, 1, 2) 2. Open and build the attached project. Expected Results: The project build should complete (possibly with compiler errors) without the Swift compiler crashing. Actual Results: The Swift compiler crashes when trying to compile the file "main.swift". Version: Xcode version 8.3.2 (8E2002) Apple LLVM version 8.1.0 (clang-802.0.42) macOS 10.12.4 (16E195)
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!
Fixed in Xcode 9 beta 3
The compiler crash no longer occurs when building the project using the compiler in Xcode 9 beta 3 (9M174d).
Workaround
I have discovered that moving the declaration of an
enum
type that was nested inside a class method definitionto the same level as the method definition suffices to avoid the compiler crash.
Crash log attached to bug report