Swift Compiler Crash

Originator:tternes
Number:rdar://24541346 Date Originated:07-Feb-2016 12:51 AM
Status:Open Resolved:
Product:Developer Tools Product Version:Apple Swift version 2.1.1 (swiftlang-700.1.101.15 clang-700.1.81)
Classification:Security Reproducible:Always
 
Summary:
When attempting to compile the attached Swift source code, the Swift complier crashes 100% of the time.

Steps to Reproduce:
Attempt to compile the attached swift file: swift state.swift

Expected Results:
Complier should successfully compile the file, or emit language errors indicating developer mistakes

Actual Results:
Complier crashes.

Regression:
swiftc -version
Apple Swift version 2.1.1 (swiftlang-700.1.101.15 clang-700.1.81)
Target: x86_64-apple-darwin15.3.0

xcodebuild -version
Xcode 7.2.1
Build version 7C1002


Notes:
Tested against Xcode 7.2, 7.2.1 versions of Swift compiler. I’ve attempted to distill this down as much as possible. It manifests itself as a playground crash (where I originally encountered it). Obviously, it also causes problems within normal iOS projects as well.

Crash log:
0  swift                    0x0000000109c12fbb llvm::sys::PrintStackTrace(__sFILE*) + 43
1  swift                    0x0000000109c136fb SignalHandler(int) + 379
2  libsystem_platform.dylib 0x00007fff9f42aeaa _sigtramp + 26
3  libsystem_platform.dylib 0x00007fff57f05558 _sigtramp + 3098388168
4  swift                    0x0000000107ed9707 swift::SILWitnessVisitor<(anonymous namespace)::SILGenConformance>::visitProtocolDecl(swift::ProtocolDecl*) + 999
5  swift                    0x0000000107ed6ee5 swift::Lowering::SILGenModule::getWitnessTable(swift::ProtocolConformance*) + 277
6  swift                    0x0000000107f265b0 (anonymous namespace)::SILGenType::emitType() + 1264
7  swift                    0x0000000107f2604e swift::Lowering::SILGenModule::visitNominalTypeDecl(swift::NominalTypeDecl*) + 30
8  swift                    0x0000000107eaebdb swift::Lowering::SILGenModule::emitSourceFile(swift::SourceFile*, unsigned int) + 779
9  swift                    0x0000000107eaf790 swift::SILModule::constructSIL(swift::ModuleDecl*, swift::SILOptions&, swift::FileUnit*, llvm::Optional<unsigned int>, bool, bool) + 928
10 swift                    0x0000000107eafb3d swift::performSILGeneration(swift::FileUnit&, swift::SILOptions&, llvm::Optional<unsigned int>, bool) + 109
11 swift                    0x0000000107d03992 performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef<char const*>, int&) + 11442
12 swift                    0x0000000107d00ad3 frontend_main(llvm::ArrayRef<char const*>, char const*, void*) + 2691
13 swift                    0x0000000107cfd154 main + 2324
14 libdyld.dylib            0x00007fff97bc55ad start + 1
15 libdyld.dylib            0x000000000000000f start + 1749264995
Stack dump:
0.	Program arguments: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift -frontend -c -primary-file state.swift -target x86_64-apple-darwin15.3.0 -enable-objc-interop -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk -color-diagnostics -module-name state -o /var/folders/lf/by9b55r91tz5cm_9mm98c5kr0000gq/T/state-40e0f6.o 
<unknown>:0: error: unable to execute command: Segmentation fault: 11
<unknown>:0: error: compile command failed due to signal (use -v to see invocation)

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!