swiftlang / swift

The Swift Programming Language
https://swift.org
Apache License 2.0
67.57k stars 10.36k forks source link

[SR-4643] Compiler crash referring to non-existing struct deleted from codebase #47220

Open swift-ci opened 7 years ago

swift-ci commented 7 years ago
Previous ID SR-4643
Radar None
Original Reporter mlwoollard (JIRA User)
Type Bug
Additional Detail from JIRA | | | |------------------|-----------------| |Votes | 0 | |Component/s | Compiler | |Labels | Bug, CompilerCrash | |Assignee | graydon (JIRA) | |Priority | Medium | md5: 5e9f89c535751ade1189e2804e86942d

Issue Description:

After some refactoring I got the following compiler crash. The final line PurchasedTicket is the struct that is no longer in the codebase so seems something missing this with incremental build. A clean and build subsequently went though without issue.

Toolchain from Xcode 8.3.2

MergeSwiftModule normal x86_64 /Users/markw/Library/Developer/Xcode/DerivedData/ZipTrip-fnpqeenuvfvjnbcckyfzwkgbdlxn/Build/Intermediates/Checker.build/Debug-iphonesimulator/CheckerApp.build/Objects-normal/x86_64/CheckerApp.swiftmodule
    cd /Users/markw/UrbanThings/zt/checker_frameworks_ios
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift -frontend -emit-module -filelist /var/folders/6w/4yzk82317zbc8jwwdr9cn2xw0000gp/T/inputs-4f1b24 -parse-as-library -target x86_64-apple-ios9.0 -enable-objc-interop -sdk /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.3.sdk -I /Users/markw/Library/Developer/Xcode/DerivedData/ZipTrip-fnpqeenuvfvjnbcckyfzwkgbdlxn/Build/Products/Debug-iphonesimulator -F /Users/markw/Library/Developer/Xcode/DerivedData/ZipTrip-fnpqeenuvfvjnbcckyfzwkgbdlxn/Build/Products/Debug-iphonesimulator -F /Users/markw/UrbanThings/zt/checker_frameworks_ios -F /Users/markw/UrbanThings/zt/checker_frameworks_ios/../Fabric -F /Users/markw/UrbanThings/zt/checker_frameworks_ios/../GoogleMaps -F /Users/markw/UrbanThings/zt/checker_frameworks_ios/../Facebook -F /Users/markw/UrbanThings/zt/checker_frameworks_ios/../GoogleSignIn -F ../Firebase -F ../Firebase/AdMob -F ../Firebase/Analytics -F ../Firebase/AppIndexing -F ../Firebase/Auth -F ../Firebase/Crash -F ../Firebase/Database -F ../Firebase/DynamicLinks -F ../Firebase/Invites -F ../Firebase/Messaging -F ../Firebase/RemoteConfig -F ../Firebase/Storage -F ../Firebase/Invites/Resources -F ../Firebase/Invites/Resources/GINInviteResources.bundle -F ../Firebase/Invites/Resources/GoogleSignIn.bundle -F ../Firebase/Invites/Resources/GPPACLPickerResources.bundle -F ../Firebase/Invites/Resources/GINInviteResources.bundle/GINInviteBuilderImpl.storyboardc -F ../Firebase/Invites/Resources/GINInviteResources.bundle/GINInviteBuilderImplPad.storyboardc -enable-testing -g -import-underlying-module -module-cache-path /Users/markw/Library/Developer/Xcode/DerivedData/ModuleCache -D DEBUG -serialize-debugging-options -Xcc -I/Users/markw/Library/Developer/Xcode/DerivedData/ZipTrip-fnpqeenuvfvjnbcckyfzwkgbdlxn/Build/Intermediates/Checker.build/Debug-iphonesimulator/CheckerApp.build/swift-overrides.hmap -Xcc -iquote -Xcc /Users/markw/Library/Developer/Xcode/DerivedData/ZipTrip-fnpqeenuvfvjnbcckyfzwkgbdlxn/Build/Intermediates/Checker.build/Debug-iphonesimulator/CheckerApp.build/CheckerApp-generated-files.hmap -Xcc -I/Users/markw/Library/Developer/Xcode/DerivedData/ZipTrip-fnpqeenuvfvjnbcckyfzwkgbdlxn/Build/Intermediates/Checker.build/Debug-iphonesimulator/CheckerApp.build/CheckerApp-own-target-headers.hmap -Xcc -I/Users/markw/Library/Developer/Xcode/DerivedData/ZipTrip-fnpqeenuvfvjnbcckyfzwkgbdlxn/Build/Intermediates/Checker.build/Debug-iphonesimulator/CheckerApp.build/CheckerApp-all-non-framework-target-headers.hmap -Xcc -ivfsoverlay -Xcc /Users/markw/Library/Developer/Xcode/DerivedData/ZipTrip-fnpqeenuvfvjnbcckyfzwkgbdlxn/Build/Intermediates/Checker.build/all-product-headers.yaml -Xcc -iquote -Xcc /Users/markw/Library/Developer/Xcode/DerivedData/ZipTrip-fnpqeenuvfvjnbcckyfzwkgbdlxn/Build/Intermediates/Checker.build/Debug-iphonesimulator/CheckerApp.build/CheckerApp-project-headers.hmap -Xcc -I/Users/markw/Library/Developer/Xcode/DerivedData/ZipTrip-fnpqeenuvfvjnbcckyfzwkgbdlxn/Build/Products/Debug-iphonesimulator/include -Xcc -I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include -Xcc -IFAGeneralCategories -Xcc -I/Users/markw/Library/Developer/Xcode/DerivedData/ZipTrip-fnpqeenuvfvjnbcckyfzwkgbdlxn/Build/Intermediates/Checker.build/Debug-iphonesimulator/CheckerApp.build/Objects-normal/x86_64 -Xcc -I/Users/markw/UrbanThings/zt/checker_frameworks_ios/../Firebase -Xcc -I/Users/markw/UrbanThings/zt/checker_frameworks_ios/../Facebook -Xcc -I/Users/markw/Library/Developer/Xcode/DerivedData/ZipTrip-fnpqeenuvfvjnbcckyfzwkgbdlxn/Build/Intermediates/Checker.build/Debug-iphonesimulator/CheckerApp.build/DerivedSources/x86_64 -Xcc -I/Users/markw/Library/Developer/Xcode/DerivedData/ZipTrip-fnpqeenuvfvjnbcckyfzwkgbdlxn/Build/Intermediates/Checker.build/Debug-iphonesimulator/CheckerApp.build/DerivedSources -Xcc -DDEBUG=1 -Xcc -DDEBUG=1 -Xcc -ivfsoverlay -Xcc /Users/markw/Library/Developer/Xcode/DerivedData/ZipTrip-fnpqeenuvfvjnbcckyfzwkgbdlxn/Build/Intermediates/Checker.build/Debug-iphonesimulator/CheckerApp.build/unextended-module-overlay.yaml -Xcc -working-directory/Users/markw/UrbanThings/zt/checker_frameworks_ios -emit-module-doc-path /Users/markw/Library/Developer/Xcode/DerivedData/ZipTrip-fnpqeenuvfvjnbcckyfzwkgbdlxn/Build/Intermediates/Checker.build/Debug-iphonesimulator/CheckerApp.build/Objects-normal/x86_64/CheckerApp.swiftdoc -module-name CheckerApp -emit-objc-header-path /Users/markw/Library/Developer/Xcode/DerivedData/ZipTrip-fnpqeenuvfvjnbcckyfzwkgbdlxn/Build/Intermediates/Checker.build/Debug-iphonesimulator/CheckerApp.build/Objects-normal/x86_64/CheckerApp-Swift.h -o /Users/markw/Library/Developer/Xcode/DerivedData/ZipTrip-fnpqeenuvfvjnbcckyfzwkgbdlxn/Build/Intermediates/Checker.build/Debug-iphonesimulator/CheckerApp.build/Objects-normal/x86_64/CheckerApp.swiftmodule

0  swift                    0x00000001088104f7 PrintStackTraceSignalHandler(void*) + 39
1  swift                    0x000000010880f9a6 SignalHandler(int) + 646
2  libsystem_platform.dylib 0x00007fff912a1b3a _sigtramp + 26
3  libsystem_platform.dylib 0x000000010d3db551 _sigtramp + 2081659441
4  libsystem_c.dylib        0x00007fff91126420 abort + 129
5  swift                    0x00000001062732e4 swift::ModuleFile::getDecl(llvm::PointerEmbeddedInt<unsigned int, 31>, llvm::Optional<swift::DeclContext*>) + 38404
6  swift                    0x000000010627519a swift::ModuleFile::getType(llvm::PointerEmbeddedInt<unsigned int, 31>) + 2106
7  swift                    0x0000000106276030 swift::ModuleFile::getType(llvm::PointerEmbeddedInt<unsigned int, 31>) + 5840
8  swift                    0x000000010627de62 swift::ModuleFile::readConformance(llvm::BitstreamCursor&, swift::GenericEnvironment*) + 1218
9  swift                    0x000000010627dd1a swift::ModuleFile::readConformance(llvm::BitstreamCursor&, swift::GenericEnvironment*) + 890
10 swift                    0x000000010627e710 swift::ModuleFile::readConformance(llvm::BitstreamCursor&, swift::GenericEnvironment*) + 3440
11 swift                    0x000000010627f85c swift::ModuleFile::loadAllConformances(swift::Decl const*, unsigned long long, llvm::SmallVectorImpl<swift::ProtocolConformance*>&) + 316
12 swift                    0x0000000106659a4b swift::ConformanceLookupTable::updateLookupTable(swift::NominalTypeDecl*, swift::ConformanceLookupTable::ConformanceStage, swift::LazyResolver*) + 4875
13 swift                    0x0000000106658837 swift::ConformanceLookupTable::updateLookupTable(swift::NominalTypeDecl*, swift::ConformanceLookupTable::ConformanceStage, swift::LazyResolver*) + 247
14 swift                    0x000000010665c981 swift::ConformanceLookupTable::lookupConformance(swift::ModuleDecl*, swift::NominalTypeDecl*, swift::ProtocolDecl*, swift::LazyResolver*, llvm::SmallVectorImpl<swift::ProtocolConformance*>&) + 49
15 swift                    0x000000010627dfa9 swift::ModuleFile::readConformance(llvm::BitstreamCursor&, swift::GenericEnvironment*) + 1545
16 swift                    0x000000010627e710 swift::ModuleFile::readConformance(llvm::BitstreamCursor&, swift::GenericEnvironment*) + 3440
17 swift                    0x000000010627f85c swift::ModuleFile::loadAllConformances(swift::Decl const*, unsigned long long, llvm::SmallVectorImpl<swift::ProtocolConformance*>&) + 316
18 swift                    0x0000000106658a65 swift::ConformanceLookupTable::updateLookupTable(swift::NominalTypeDecl*, swift::ConformanceLookupTable::ConformanceStage, swift::LazyResolver*) + 805
19 swift                    0x0000000106658837 swift::ConformanceLookupTable::updateLookupTable(swift::NominalTypeDecl*, swift::ConformanceLookupTable::ConformanceStage, swift::LazyResolver*) + 247
20 swift                    0x00000001066588ab swift::ConformanceLookupTable::updateLookupTable(swift::NominalTypeDecl*, swift::ConformanceLookupTable::ConformanceStage, swift::LazyResolver*) + 363
21 swift                    0x000000010665d357 swift::ConformanceLookupTable::getAllProtocols(swift::NominalTypeDecl*, swift::LazyResolver*, llvm::SmallVectorImpl<swift::ProtocolDecl*>&) + 39
22 swift                    0x0000000105efde1d (anonymous namespace)::NominalTypeWalker::walkToDeclPre(swift::Decl*) + 189
23 swift                    0x0000000106645b5b (anonymous namespace)::Traversal::doIt(swift::Decl*) + 139
24 swift                    0x0000000105fb938f swift::SILPassManager::SILPassManager(swift::SILModule*, llvm::StringRef) + 1471
25 swift                    0x0000000105fbff8f swift::runSILDiagnosticPasses(swift::SILModule&) + 159
26 swift                    0x000000010562e7d4 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 42980
27 swift                    0x00000001055ddd6c main + 9052
28 libdyld.dylib            0x00007fff91092235 start + 1
29 libdyld.dylib            0x0000000000000079 start + 1861672517
Stack dump:
0.  Program arguments: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift -frontend -emit-module -filelist /var/folders/6w/4yzk82317zbc8jwwdr9cn2xw0000gp/T/inputs-4f1b24 -parse-as-library -target x86_64-apple-ios9.0 -enable-objc-interop -sdk /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.3.sdk -I /Users/markw/Library/Developer/Xcode/DerivedData/ZipTrip-fnpqeenuvfvjnbcckyfzwkgbdlxn/Build/Products/Debug-iphonesimulator -F /Users/markw/Library/Developer/Xcode/DerivedData/ZipTrip-fnpqeenuvfvjnbcckyfzwkgbdlxn/Build/Products/Debug-iphonesimulator -F /Users/markw/UrbanThings/zt/checker_frameworks_ios -F /Users/markw/UrbanThings/zt/checker_frameworks_ios/../Fabric -F /Users/markw/UrbanThings/zt/checker_frameworks_ios/../GoogleMaps -F /Users/markw/UrbanThings/zt/checker_frameworks_ios/../Facebook -F /Users/markw/UrbanThings/zt/checker_frameworks_ios/../GoogleSignIn -F ../Firebase -F ../Firebase/AdMob -F ../Firebase/Analytics -F ../Firebase/AppIndexing -F ../Firebase/Auth -F ../Firebase/Crash -F ../Firebase/Database -F ../Firebase/DynamicLinks -F ../Firebase/Invites -F ../Firebase/Messaging -F ../Firebase/RemoteConfig -F ../Firebase/Storage -F ../Firebase/Invites/Resources -F ../Firebase/Invites/Resources/GINInviteResources.bundle -F ../Firebase/Invites/Resources/GoogleSignIn.bundle -F ../Firebase/Invites/Resources/GPPACLPickerResources.bundle -F ../Firebase/Invites/Resources/GINInviteResources.bundle/GINInviteBuilderImpl.storyboardc -F ../Firebase/Invites/Resources/GINInviteResources.bundle/GINInviteBuilderImplPad.storyboardc -enable-testing -g -import-underlying-module -module-cache-path /Users/markw/Library/Developer/Xcode/DerivedData/ModuleCache -D DEBUG -serialize-debugging-options -Xcc -I/Users/markw/Library/Developer/Xcode/DerivedData/ZipTrip-fnpqeenuvfvjnbcckyfzwkgbdlxn/Build/Intermediates/Checker.build/Debug-iphonesimulator/CheckerApp.build/swift-overrides.hmap -Xcc -iquote -Xcc /Users/markw/Library/Developer/Xcode/DerivedData/ZipTrip-fnpqeenuvfvjnbcckyfzwkgbdlxn/Build/Intermediates/Checker.build/Debug-iphonesimulator/CheckerApp.build/CheckerApp-generated-files.hmap -Xcc -I/Users/markw/Library/Developer/Xcode/DerivedData/ZipTrip-fnpqeenuvfvjnbcckyfzwkgbdlxn/Build/Intermediates/Checker.build/Debug-iphonesimulator/CheckerApp.build/CheckerApp-own-target-headers.hmap -Xcc -I/Users/markw/Library/Developer/Xcode/DerivedData/ZipTrip-fnpqeenuvfvjnbcckyfzwkgbdlxn/Build/Intermediates/Checker.build/Debug-iphonesimulator/CheckerApp.build/CheckerApp-all-non-framework-target-headers.hmap -Xcc -ivfsoverlay -Xcc /Users/markw/Library/Developer/Xcode/DerivedData/ZipTrip-fnpqeenuvfvjnbcckyfzwkgbdlxn/Build/Intermediates/Checker.build/all-product-headers.yaml -Xcc -iquote -Xcc /Users/markw/Library/Developer/Xcode/DerivedData/ZipTrip-fnpqeenuvfvjnbcckyfzwkgbdlxn/Build/Intermediates/Checker.build/Debug-iphonesimulator/CheckerApp.build/CheckerApp-project-headers.hmap -Xcc -I/Users/markw/Library/Developer/Xcode/DerivedData/ZipTrip-fnpqeenuvfvjnbcckyfzwkgbdlxn/Build/Products/Debug-iphonesimulator/include -Xcc -I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include -Xcc -IFAGeneralCategories -Xcc -I/Users/markw/Library/Developer/Xcode/DerivedData/ZipTrip-fnpqeenuvfvjnbcckyfzwkgbdlxn/Build/Intermediates/Checker.build/Debug-iphonesimulator/CheckerApp.build/Objects-normal/x86_64 -Xcc -I/Users/markw/UrbanThings/zt/checker_frameworks_ios/../Firebase -Xcc -I/Users/markw/UrbanThings/zt/checker_frameworks_ios/../Facebook -Xcc -I/Users/markw/Library/Developer/Xcode/DerivedData/ZipTrip-fnpqeenuvfvjnbcckyfzwkgbdlxn/Build/Intermediates/Checker.build/Debug-iphonesimulator/CheckerApp.build/DerivedSources/x86_64 -Xcc -I/Users/markw/Library/Developer/Xcode/DerivedData/ZipTrip-fnpqeenuvfvjnbcckyfzwkgbdlxn/Build/Intermediates/Checker.build/Debug-iphonesimulator/CheckerApp.build/DerivedSources -Xcc -DDEBUG=1 -Xcc -DDEBUG=1 -Xcc -ivfsoverlay -Xcc /Users/markw/Library/Developer/Xcode/DerivedData/ZipTrip-fnpqeenuvfvjnbcckyfzwkgbdlxn/Build/Intermediates/Checker.build/Debug-iphonesimulator/CheckerApp.build/unextended-module-overlay.yaml -Xcc -working-directory/Users/markw/UrbanThings/zt/checker_frameworks_ios -emit-module-doc-path /Users/markw/Library/Developer/Xcode/DerivedData/ZipTrip-fnpqeenuvfvjnbcckyfzwkgbdlxn/Build/Intermediates/Checker.build/Debug-iphonesimulator/CheckerApp.build/Objects-normal/x86_64/CheckerApp.swiftdoc -module-name CheckerApp -emit-objc-header-path /Users/markw/Library/Developer/Xcode/DerivedData/ZipTrip-fnpqeenuvfvjnbcckyfzwkgbdlxn/Build/Intermediates/Checker.build/Debug-iphonesimulator/CheckerApp.build/Objects-normal/x86_64/CheckerApp-Swift.h -o /Users/markw/Library/Developer/Xcode/DerivedData/ZipTrip-fnpqeenuvfvjnbcckyfzwkgbdlxn/Build/Intermediates/Checker.build/Debug-iphonesimulator/CheckerApp.build/Objects-normal/x86_64/CheckerApp.swiftmodule 
1.  While loading conformances for 'TicketDetailPaneInteractor' in module 'CheckerApp'
2.  While reading conformance for type 'TicketDetailPaneInteractor'
3.  While ... to 'TicketDetailPaneInteractorType' in module 'CheckerApp'
4.  While cross-referencing conformance for 'TicketDetailPaneInteractor' in module 'CheckerApp'
5.  While ... to 'TicketDetailPaneInteractorParentApi' in module 'CheckerApp'
6.  While loading conformances for extension of TicketDetailPaneInteractor in module 'CheckerApp'
7.  While reading conformance for type 'TicketDetailPaneInteractor'
8.  While ... to 'TicketDetailPaneInteractorParentApi' in module 'CheckerApp'
9.  While reading inherited conformance for type 'TicketDetailPaneInteractor'
10. While deserializing decl #&#8203;11 (XREF)in 'CheckerApp'
11. Cross-reference to module 'CheckerApp'
    ... PurchasedTicket
belkadan commented 7 years ago

Yikes. Can you reproduce this at will? That is, can you go to a state before the change, build, make the change, build again, and get the crash?

If not I'm not sure how we're going to be able to debug this, though it's clearly very serious.

belkadan commented 7 years ago

cc graydon (JIRA User)

swift-ci commented 7 years ago

Comment by Mark Woollard (JIRA)

I'll take a stab at reproducing tomorrow, have pre-refactor state in source control so fingers crossed:-)