WeakList implementation segfaults compiler

Originator:rnewman
Number:rdar://24540588 Date Originated:2016-02-06
Status:Open Resolved:
Product:Developer Tools Product Version:
Classification: Reproducible:
 
Summary:
A WeakList implementation that compiles and works with earlier versions of Xcode causes a compiler crash in Xcode 7.3 beta (7D129n).

The only change for the new beta is to rename anyGenerator to AnyGenerator to match language changes.

Steps to Reproduce:
Load the attached file in a playground.

Expected Results:
Compile completes.

Actual Results:
Compiler segfaults with this stack:

0  swift                    0x000000010a4f05ab llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 43
1  swift                    0x000000010a4efa46 llvm::sys::RunSignalHandlers() + 70
2  swift                    0x000000010a4f0bd3 SignalHandler(int) + 243
3  libsystem_platform.dylib 0x00007fff99fb0eaa _sigtramp + 26
4  libsystem_platform.dylib 0xe1723eb0ffffffff _sigtramp + 1711599983
5  swift                    0x00000001083b1a4e (anonymous namespace)::WitnessTableBuilder::emitReturnOfCheckedLoadFromCache(swift::irgen::IRGenFunction&, swift::irgen::Address, llvm::Value*, llvm::function_ref<llvm::Value* ()>) + 1358
6  swift                    0x00000001083b0c4e swift::SILWitnessVisitor<(anonymous namespace)::WitnessTableBuilder>::visitProtocolDecl(swift::ProtocolDecl*) + 1534
7  swift                    0x00000001083ab495 swift::irgen::IRGenModule::emitSILWitnessTable(swift::SILWitnessTable*) + 293
8  swift                    0x00000001083415fd swift::irgen::IRGenModuleDispatcher::emitGlobalTopLevel() + 621
9  swift                    0x00000001083c9e63 performIRGeneration(swift::IRGenOptions&, swift::ModuleDecl*, swift::SILModule*, llvm::StringRef, llvm::LLVMContext&, swift::SourceFile*, unsigned int) + 1059
10 swift                    0x00000001083ca310 swift::performIRGeneration(swift::IRGenOptions&, swift::SourceFile&, swift::SILModule*, llvm::StringRef, llvm::LLVMContext&, unsigned int) + 64
11 swift                    0x00000001082b51ea performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef<char const*>, int&) + 15098
12 swift                    0x00000001082b0b62 frontend_main(llvm::ArrayRef<char const*>, char const*, void*) + 2722
13 swift                    0x00000001082ac8db main + 3051
14 libdyld.dylib            0x00007fff950005ad start + 1
15 libdyld.dylib            0x0000000000000079 start + 1795160781

Version:
Xcode 7.3 beta (7D129n), OS 10.11.3.

Notes:


Configuration:
N/A

Attachments:
'WeakList.swift' was successfully uploaded.

File is almost exactly:

https://github.com/mozilla/firefox-ios/blob/master/Utils/WeakList.swift

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!