XCode 7 beta 5 - Compiler Crashes 'While running SILModuleTransform "Generic Specialization".'

Originator:etoop
Number:rdar://22400367 Date Originated:24/08/2015
Status:Open Resolved:
Product:XCode Product Version:7.0 Beta 5
Classification: Reproducible:Always
 
I am currently migrating a Swift 1.2 project over to Swift 2.0 and have encountered this compiler crash:

‘Command failed due to signal: Abort trap: 6’

`Assertion failed: ((getType()->isEqual(foundInherited->getType()) || foundInherited->getType()->isSuperclassOf(getType(), nullptr)) && "inherited conformance does not match type"), function getInheritedConformance, file /Library/Caches/com.apple.xbs/Sources/swiftlang/swiftlang-700.0.52.2/src/swift/lib/AST/ProtocolConformance.cpp, line 467.
0  swift                    0x0000000110601bbb llvm::sys::PrintStackTrace(__sFILE*) + 43
1  swift                    0x00000001106022fb SignalHandler(int) + 379
2  libsystem_platform.dylib 0x00007fff8e079f1a _sigtramp + 26
3  swift                    0x000000010edd2186 swift::Type::transform(std::__1::function<swift::Type (swift::Type)> const&) const + 54
4  libsystem_c.dylib        0x00007fff94891b53 abort + 129
5  libsystem_c.dylib        0x00007fff94859c39 basename + 0
6  swift                    0x000000010edba297 swift::ProtocolConformance::getInheritedConformance(swift::ProtocolDecl*) const + 1319
7  swift                    0x000000010edc7f6f swift::Substitution::subst(swift::ModuleDecl*, llvm::ArrayRef<swift::Substitution>, llvm::DenseMap<swift::TypeBase*, swift::Type, llvm::DenseMapInfo<swift::TypeBase*>, llvm::detail::DenseMapPair<swift::TypeBase*, swift::Type> >&, llvm::DenseMap<swift::ArchetypeType*, llvm::ArrayRef<swift::ProtocolConformance*>, llvm::DenseMapInfo<swift::ArchetypeType*>, llvm::detail::DenseMapPair<swift::ArchetypeType*, llvm::ArrayRef<swift::ProtocolConformance*> > >&) const + 1375
8  swift                    0x000000010edc78f8 swift::Substitution::subst(swift::ModuleDecl*, swift::GenericParamList*, llvm::ArrayRef<swift::Substitution>) const + 1512
9  swift                    0x000000010ead094a swift::TypeSubstCloner<swift::GenericCloner>::visitWitnessMethodInst(swift::WitnessMethodInst*) + 90
10 swift                    0x000000010eacc77b swift::SILCloner<swift::GenericCloner>::visitSILBasicBlock(swift::SILBasicBlock*) + 75
11 swift                    0x000000010eacc0ac swift::GenericCloner::populateCloned() + 396
12 swift                    0x000000010eadc102 swift::GenericCloner::cloneFunction(swift::SILFunction*, llvm::DenseMap<swift::TypeBase*, swift::Type, llvm::DenseMapInfo<swift::TypeBase*>, llvm::detail::DenseMapPair<swift::TypeBase*, swift::Type> >&, llvm::DenseMap<swift::TypeBase*, swift::Type, llvm::DenseMapInfo<swift::TypeBase*>, llvm::detail::DenseMapPair<swift::TypeBase*, swift::Type> >&, llvm::StringRef, swift::ApplySite, std::__1::function<void (swift::SILInstruction*, swift::SILInstruction*)>) + 274
13 swift                    0x000000010eadad45 swift::trySpecializeApplyOfGeneric(swift::ApplySite, swift::SILFunction*&, llvm::SmallVectorImpl<std::__1::pair<swift::FullApplySite, swift::FullApplySite> >&) + 2789
14 swift                    0x000000010e8e8633 (anonymous namespace)::SILGenericSpecializerTransform::run() + 707
15 swift                    0x000000010e8c2dfc swift::SILPassManager::runOneIteration() + 2060
16 swift                    0x000000010e8bf985 swift::runSILOptimizationPasses(swift::SILModule&) + 549
17 swift                    0x000000010e5c53a8 performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef<char const*>, int&) + 12680
18 swift                    0x000000010e5c1fc8 frontend_main(llvm::ArrayRef<char const*>, char const*, void*) + 2728
19 swift                    0x000000010e5be02f main + 2015
20 libdyld.dylib            0x00007fff8f2735c9 start + 1
….
1.	While running SILModuleTransform "Generic Specialization”.`

I have yet to be able to track down what is causing the compiler to crash here. I will update the issue if I discover more. Full stack trace attached.

Steps to Reproduce:
1. Hard clean 
2. Compiler project

Expected Results:
Either the project compiles or a compilation error is provided

Actual Results:
The compiler exits with `Command failed due to signal: Abort trap: 6`

Version:
Xcode 7.0 beta 5 
OS X 10.10.4

Notes:
Full stack trace attached

Configuration:
This happens on all configurations, against all simulators & device, in XCode 7 beta 5.

Attachments:
'CommandFailedDueToSignal.log' was successfully uploaded.

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!