Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SR-5191] Abort 6 when Protocols Inherits from Another Protocol #47767

Closed
swift-ci opened this issue Jun 12, 2017 · 16 comments
Closed

[SR-5191] Abort 6 when Protocols Inherits from Another Protocol #47767

swift-ci opened this issue Jun 12, 2017 · 16 comments
Assignees
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself crash Bug: A crash, i.e., an abnormal termination of software regression swift 4.0

Comments

@swift-ci
Copy link
Collaborator

Previous ID SR-5191
Radar rdar://problem/32713660
Original Reporter codecaffeine (JIRA User)
Type Bug
Status Resolved
Resolution Done

Attachment: Download

Environment

Xcode 9 Beta 1 Building in SWIFT_VERSION 3.2
Xcode 8.3.2 with Xcode 4 Toolchain downloaded 6/6/2017

Additional Detail from JIRA
Votes 2
Component/s Compiler
Labels Bug, 4.0Regression, CompilerCrash
Assignee @belkadan
Priority Medium

md5: 5baa9ab77112f6c5b2f5a0cb6c32d3fc

Issue Description:

With the Xcode 8.3.2 Swift 4 toolchain (built 6/5/2017) and Xcode 9 Beta 1 (with the project in SWIFT_VERSION: 3.2), I’m getting the following error attempting to build the attached project:

Command failed due to signal: Abort trap: 6

It seems like I can fix this crash if my protocol doesn’t conform to another protocol:

protocol ServiceModel: JSONDecodable { // Crash
protocol ServiceModel { // No Crash

But I want this conformance in place. Crash Logs

MergeSwiftModule normal arm64 /Users/thomasm1/Library/Developer/Xcode/DerivedData/SwiftCrash-dvulzcltnmpumccegptcnqkyrjpl/Build/Intermediates.noindex/SwiftCrash.build/Debug-iphoneos/SwiftCrash.build/Objects-normal/arm64/SwiftCrash.swiftmodule
    cd /Users/thomasm1/Desktop/SwiftCrash
    /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift -frontend -emit-module /Users/thomasm1/Library/Developer/Xcode/DerivedData/SwiftCrash-dvulzcltnmpumccegptcnqkyrjpl/Build/Intermediates.noindex/SwiftCrash.build/Debug-iphoneos/SwiftCrash.build/Objects-normal/arm64/Album~partial.swiftmodule /Users/thomasm1/Library/Developer/Xcode/DerivedData/SwiftCrash-dvulzcltnmpumccegptcnqkyrjpl/Build/Intermediates.noindex/SwiftCrash.build/Debug-iphoneos/SwiftCrash.build/Objects-normal/arm64/ModelProtocols~partial.swiftmodule /Users/thomasm1/Library/Developer/Xcode/DerivedData/SwiftCrash-dvulzcltnmpumccegptcnqkyrjpl/Build/Intermediates.noindex/SwiftCrash.build/Debug-iphoneos/SwiftCrash.build/Objects-normal/arm64/JSONDecodable~partial.swiftmodule /Users/thomasm1/Library/Developer/Xcode/DerivedData/SwiftCrash-dvulzcltnmpumccegptcnqkyrjpl/Build/Intermediates.noindex/SwiftCrash.build/Debug-iphoneos/SwiftCrash.build/Objects-normal/arm64/AppDelegate~partial.swiftmodule /Users/thomasm1/Library/Developer/Xcode/DerivedData/SwiftCrash-dvulzcltnmpumccegptcnqkyrjpl/Build/Intermediates.noindex/SwiftCrash.build/Debug-iphoneos/SwiftCrash.build/Objects-normal/arm64/AlbumScratchModel~partial.swiftmodule -parse-as-library -target arm64-apple-ios11.0 -Xllvm -aarch64-use-tbi -enable-objc-interop -sdk /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.0.sdk -I /Users/thomasm1/Library/Developer/Xcode/DerivedData/SwiftCrash-dvulzcltnmpumccegptcnqkyrjpl/Build/Products/Debug-iphoneos -F /Users/thomasm1/Library/Developer/Xcode/DerivedData/SwiftCrash-dvulzcltnmpumccegptcnqkyrjpl/Build/Products/Debug-iphoneos -enable-testing -g -module-cache-path /Users/thomasm1/Library/Developer/Xcode/DerivedData/ModuleCache -swift-version 3 -D DEBUG -serialize-debugging-options -Xcc -I/Users/thomasm1/Library/Developer/Xcode/DerivedData/SwiftCrash-dvulzcltnmpumccegptcnqkyrjpl/Build/Intermediates.noindex/SwiftCrash.build/Debug-iphoneos/SwiftCrash.build/swift-overrides.hmap -Xcc -iquote -Xcc /Users/thomasm1/Library/Developer/Xcode/DerivedData/SwiftCrash-dvulzcltnmpumccegptcnqkyrjpl/Build/Intermediates.noindex/SwiftCrash.build/Debug-iphoneos/SwiftCrash.build/SwiftCrash-generated-files.hmap -Xcc -I/Users/thomasm1/Library/Developer/Xcode/DerivedData/SwiftCrash-dvulzcltnmpumccegptcnqkyrjpl/Build/Intermediates.noindex/SwiftCrash.build/Debug-iphoneos/SwiftCrash.build/SwiftCrash-own-target-headers.hmap -Xcc -I/Users/thomasm1/Library/Developer/Xcode/DerivedData/SwiftCrash-dvulzcltnmpumccegptcnqkyrjpl/Build/Intermediates.noindex/SwiftCrash.build/Debug-iphoneos/SwiftCrash.build/SwiftCrash-all-target-headers.hmap -Xcc -iquote -Xcc /Users/thomasm1/Library/Developer/Xcode/DerivedData/SwiftCrash-dvulzcltnmpumccegptcnqkyrjpl/Build/Intermediates.noindex/SwiftCrash.build/Debug-iphoneos/SwiftCrash.build/SwiftCrash-project-headers.hmap -Xcc -I/Users/thomasm1/Library/Developer/Xcode/DerivedData/SwiftCrash-dvulzcltnmpumccegptcnqkyrjpl/Build/Products/Debug-iphoneos/include -Xcc -I/Users/thomasm1/Library/Developer/Xcode/DerivedData/SwiftCrash-dvulzcltnmpumccegptcnqkyrjpl/Build/Intermediates.noindex/SwiftCrash.build/Debug-iphoneos/SwiftCrash.build/DerivedSources/arm64 -Xcc -I/Users/thomasm1/Library/Developer/Xcode/DerivedData/SwiftCrash-dvulzcltnmpumccegptcnqkyrjpl/Build/Intermediates.noindex/SwiftCrash.build/Debug-iphoneos/SwiftCrash.build/DerivedSources -Xcc -DDEBUG=1 -Xcc -working-directory/Users/thomasm1/Desktop/SwiftCrash -emit-module-doc-path /Users/thomasm1/Library/Developer/Xcode/DerivedData/SwiftCrash-dvulzcltnmpumccegptcnqkyrjpl/Build/Intermediates.noindex/SwiftCrash.build/Debug-iphoneos/SwiftCrash.build/Objects-normal/arm64/SwiftCrash.swiftdoc -module-name SwiftCrash -emit-objc-header-path /Users/thomasm1/Library/Developer/Xcode/DerivedData/SwiftCrash-dvulzcltnmpumccegptcnqkyrjpl/Build/Intermediates.noindex/SwiftCrash.build/Debug-iphoneos/SwiftCrash.build/Objects-normal/arm64/SwiftCrash-Swift.h -o /Users/thomasm1/Library/Developer/Xcode/DerivedData/SwiftCrash-dvulzcltnmpumccegptcnqkyrjpl/Build/Intermediates.noindex/SwiftCrash.build/Debug-iphoneos/SwiftCrash.build/Objects-normal/arm64/SwiftCrash.swiftmodule

0  swift                    0x00000001087913aa PrintStackTraceSignalHandler(void*) + 42
1  swift                    0x00000001087907e6 SignalHandler(int) + 662
2  libsystem_platform.dylib 0x00007fffaab36b3a _sigtramp + 26
3  libsystem_platform.dylib 0x0000000000000004 _sigtramp + 1431082212
4  libsystem_c.dylib        0x00007fffaa9bb420 abort + 129
5  swift                    0x0000000105ebed1a swift::ModuleFile::readConformance(llvm::BitstreamCursor&, swift::GenericEnvironment*) + 4042
6  swift                    0x0000000105ebeb75 swift::ModuleFile::readConformance(llvm::BitstreamCursor&, swift::GenericEnvironment*) + 3621
7  swift                    0x0000000105ec15cc swift::ModuleFile::loadAllConformances(swift::Decl const*, unsigned long long, llvm::SmallVectorImpl<swift::ProtocolConformance*>&) + 300
8  swift                    0x00000001062f0b0c swift::ConformanceLookupTable::updateLookupTable(swift::NominalTypeDecl*, swift::ConformanceLookupTable::ConformanceStage, swift::LazyResolver*) + 1068
9  swift                    0x00000001062f07d7 swift::ConformanceLookupTable::updateLookupTable(swift::NominalTypeDecl*, swift::ConformanceLookupTable::ConformanceStage, swift::LazyResolver*) + 247
10 swift                    0x00000001062f4a51 swift::ConformanceLookupTable::lookupConformance(swift::ModuleDecl*, swift::NominalTypeDecl*, swift::ProtocolDecl*, swift::LazyResolver*, llvm::SmallVectorImpl<swift::ProtocolConformance*>&) + 49
11 swift                    0x0000000105ebe32e swift::ModuleFile::readConformance(llvm::BitstreamCursor&, swift::GenericEnvironment*) + 1502
12 swift                    0x0000000105ebeb75 swift::ModuleFile::readConformance(llvm::BitstreamCursor&, swift::GenericEnvironment*) + 3621
13 swift                    0x0000000105ec15cc swift::ModuleFile::loadAllConformances(swift::Decl const*, unsigned long long, llvm::SmallVectorImpl<swift::ProtocolConformance*>&) + 300
14 swift                    0x00000001062f0b0c swift::ConformanceLookupTable::updateLookupTable(swift::NominalTypeDecl*, swift::ConformanceLookupTable::ConformanceStage, swift::LazyResolver*) + 1068
15 swift                    0x00000001062f07d7 swift::ConformanceLookupTable::updateLookupTable(swift::NominalTypeDecl*, swift::ConformanceLookupTable::ConformanceStage, swift::LazyResolver*) + 247
16 swift                    0x00000001062f084c swift::ConformanceLookupTable::updateLookupTable(swift::NominalTypeDecl*, swift::ConformanceLookupTable::ConformanceStage, swift::LazyResolver*) + 364
17 swift                    0x00000001062f5427 swift::ConformanceLookupTable::getAllProtocols(swift::NominalTypeDecl*, swift::LazyResolver*, llvm::SmallVectorImpl<swift::ProtocolDecl*>&) + 39
18 swift                    0x0000000105ab163d (anonymous namespace)::NominalTypeWalker::walkToDeclPre(swift::Decl*) + 189
19 swift                    0x00000001062db535 (anonymous namespace)::Traversal::doIt(swift::Decl*) + 277
20 swift                    0x0000000105b906df swift::SILPassManager::SILPassManager(swift::SILModule*, llvm::StringRef) + 1599
21 swift                    0x0000000105b96cff swift::runSILDiagnosticPasses(swift::SILModule&) + 143
22 swift                    0x00000001051630f0 performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef<char const*>, int&, swift::FrontendObserver*, swift::UnifiedStatsReporter*) + 13696
23 swift                    0x000000010515e304 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 7332
24 swift                    0x0000000105114728 main + 12248
25 libdyld.dylib            0x00007fffaa927235 start + 1
26 libdyld.dylib            0x000000000000003d start + 1433243145
Stack dump:
0.  Program arguments: /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift -frontend -emit-module /Users/thomasm1/Library/Developer/Xcode/DerivedData/SwiftCrash-dvulzcltnmpumccegptcnqkyrjpl/Build/Intermediates.noindex/SwiftCrash.build/Debug-iphoneos/SwiftCrash.build/Objects-normal/arm64/Album~partial.swiftmodule /Users/thomasm1/Library/Developer/Xcode/DerivedData/SwiftCrash-dvulzcltnmpumccegptcnqkyrjpl/Build/Intermediates.noindex/SwiftCrash.build/Debug-iphoneos/SwiftCrash.build/Objects-normal/arm64/ModelProtocols~partial.swiftmodule /Users/thomasm1/Library/Developer/Xcode/DerivedData/SwiftCrash-dvulzcltnmpumccegptcnqkyrjpl/Build/Intermediates.noindex/SwiftCrash.build/Debug-iphoneos/SwiftCrash.build/Objects-normal/arm64/JSONDecodable~partial.swiftmodule /Users/thomasm1/Library/Developer/Xcode/DerivedData/SwiftCrash-dvulzcltnmpumccegptcnqkyrjpl/Build/Intermediates.noindex/SwiftCrash.build/Debug-iphoneos/SwiftCrash.build/Objects-normal/arm64/AppDelegate~partial.swiftmodule /Users/thomasm1/Library/Developer/Xcode/DerivedData/SwiftCrash-dvulzcltnmpumccegptcnqkyrjpl/Build/Intermediates.noindex/SwiftCrash.build/Debug-iphoneos/SwiftCrash.build/Objects-normal/arm64/AlbumScratchModel~partial.swiftmodule -parse-as-library -target arm64-apple-ios11.0 -Xllvm -aarch64-use-tbi -enable-objc-interop -sdk /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.0.sdk -I /Users/thomasm1/Library/Developer/Xcode/DerivedData/SwiftCrash-dvulzcltnmpumccegptcnqkyrjpl/Build/Products/Debug-iphoneos -F /Users/thomasm1/Library/Developer/Xcode/DerivedData/SwiftCrash-dvulzcltnmpumccegptcnqkyrjpl/Build/Products/Debug-iphoneos -enable-testing -g -module-cache-path /Users/thomasm1/Library/Developer/Xcode/DerivedData/ModuleCache -swift-version 3 -D DEBUG -serialize-debugging-options -Xcc -I/Users/thomasm1/Library/Developer/Xcode/DerivedData/SwiftCrash-dvulzcltnmpumccegptcnqkyrjpl/Build/Intermediates.noindex/SwiftCrash.build/Debug-iphoneos/SwiftCrash.build/swift-overrides.hmap -Xcc -iquote -Xcc /Users/thomasm1/Library/Developer/Xcode/DerivedData/SwiftCrash-dvulzcltnmpumccegptcnqkyrjpl/Build/Intermediates.noindex/SwiftCrash.build/Debug-iphoneos/SwiftCrash.build/SwiftCrash-generated-files.hmap -Xcc -I/Users/thomasm1/Library/Developer/Xcode/DerivedData/SwiftCrash-dvulzcltnmpumccegptcnqkyrjpl/Build/Intermediates.noindex/SwiftCrash.build/Debug-iphoneos/SwiftCrash.build/SwiftCrash-own-target-headers.hmap -Xcc -I/Users/thomasm1/Library/Developer/Xcode/DerivedData/SwiftCrash-dvulzcltnmpumccegptcnqkyrjpl/Build/Intermediates.noindex/SwiftCrash.build/Debug-iphoneos/SwiftCrash.build/SwiftCrash-all-target-headers.hmap -Xcc -iquote -Xcc /Users/thomasm1/Library/Developer/Xcode/DerivedData/SwiftCrash-dvulzcltnmpumccegptcnqkyrjpl/Build/Intermediates.noindex/SwiftCrash.build/Debug-iphoneos/SwiftCrash.build/SwiftCrash-project-headers.hmap -Xcc -I/Users/thomasm1/Library/Developer/Xcode/DerivedData/SwiftCrash-dvulzcltnmpumccegptcnqkyrjpl/Build/Products/Debug-iphoneos/include -Xcc -I/Users/thomasm1/Library/Developer/Xcode/DerivedData/SwiftCrash-dvulzcltnmpumccegptcnqkyrjpl/Build/Intermediates.noindex/SwiftCrash.build/Debug-iphoneos/SwiftCrash.build/DerivedSources/arm64 -Xcc -I/Users/thomasm1/Library/Developer/Xcode/DerivedData/SwiftCrash-dvulzcltnmpumccegptcnqkyrjpl/Build/Intermediates.noindex/SwiftCrash.build/Debug-iphoneos/SwiftCrash.build/DerivedSources -Xcc -DDEBUG=1 -Xcc -working-directory/Users/thomasm1/Desktop/SwiftCrash -emit-module-doc-path /Users/thomasm1/Library/Developer/Xcode/DerivedData/SwiftCrash-dvulzcltnmpumccegptcnqkyrjpl/Build/Intermediates.noindex/SwiftCrash.build/Debug-iphoneos/SwiftCrash.build/Objects-normal/arm64/SwiftCrash.swiftdoc -module-name SwiftCrash -emit-objc-header-path /Users/thomasm1/Library/Developer/Xcode/DerivedData/SwiftCrash-dvulzcltnmpumccegptcnqkyrjpl/Build/Intermediates.noindex/SwiftCrash.build/Debug-iphoneos/SwiftCrash.build/Objects-normal/arm64/SwiftCrash-Swift.h -o /Users/thomasm1/Library/Developer/Xcode/DerivedData/SwiftCrash-dvulzcltnmpumccegptcnqkyrjpl/Build/Intermediates.noindex/SwiftCrash.build/Debug-iphoneos/SwiftCrash.build/Objects-normal/arm64/SwiftCrash.swiftmodule 
1.  While loading conformances for 'Album' in module 'SwiftCrash'
2.  While reading conformance for type 'Album'
3.  While ... to 'Scratchable' in module 'SwiftCrash'
4.  While cross-referencing conformance for 'AlbumScratchModel' in module 'SwiftCrash'
5.  While ... to 'ScratchingModel' in module 'SwiftCrash'
6.  While loading conformances for 'AlbumScratchModel' in module 'SwiftCrash'
7.  While reading conformance for type 'AlbumScratchModel'
8.  While ... to 'ScratchingModel' in module 'SwiftCrash'
9.  While cross-referencing conformance for 'Album' in module 'SwiftCrash'
10. While ... to 'ServiceModel' in module 'SwiftCrash'
11. If you're seeing a crash here, check that your SDK and dependencies are at least as new as the versions used to build 'SwiftCrash'
@belkadan
Copy link
Contributor

@swift-ci create

@tkrajacic
Copy link

This is a fun one. When downloading the demo project and building it with Xcode 9 beta, I get the Abort Trap error.

Now:

  • uncheck target membership of the Album.swift file (in inspector pane right)

  • recheck target membership of the Album.swift file

  • builds without issues now

Stale cache somewhere?

@tkrajacic
Copy link

BTW, even after cleaning the build folder the project still builds without issue.

The only way to reproduce is to again download the demo project (or unzip it anew)

@swift-ci
Copy link
Collaborator Author

Comment by Matt Thomas (JIRA)

Oh weird. I’m seeing the exact same thing. I even tried deleting the derived data and I was able to build after toggling off the target membership

@swift-ci
Copy link
Collaborator Author

Comment by Matt Thomas (JIRA)

Just to follow up, I tested this again with Xcode 9 beta 2 and it’s still exhibiting the same problem.

@belkadan
Copy link
Contributor

belkadan commented Jul 5, 2017

I suspect the issue is due to the order of files. There have been a few other issues like this.

@belkadan
Copy link
Contributor

belkadan commented Jul 5, 2017

Seems to have been fixed by #10707 This probably won't be in beta 3 but should appear in Xcode 9 before GM.

@swift-ci
Copy link
Collaborator Author

swift-ci commented Jul 7, 2017

Comment by Matt Thomas (JIRA)

Great news, want me to close this issue once I verify it’s working as expected?

@swift-ci
Copy link
Collaborator Author

Comment by Matt Thomas (JIRA)

Weird, I thought the issue was fixed, but I’m still seeing the issue in Beta 4 and the recent nightly builds.

@swift-ci
Copy link
Collaborator Author

swift-ci commented Aug 8, 2017

Comment by Bill Meltsner (JIRA)

Can confirm this issue is still present in Beta 5.

@swift-ci
Copy link
Collaborator Author

swift-ci commented Aug 9, 2017

Comment by Matt Thomas (JIRA)

Same here, bmelts (JIRA User). With both Beta 5 and the 8/4/17 Swift 4 toolchain

@belkadan
Copy link
Contributor

Sorry, this was fixed by the commit I didn't cherry-pick to the 4.0 branch because it was risky (and didn't realize). Seeing that multiple people are running into this may change that calculation...

@swift-ci
Copy link
Collaborator Author

Comment by Bill Meltsner (JIRA)

Yeah, it's frustrating for my team because it's happening in an autogenerated Xcode project (CocoaPods) – the workaround of changing the compilation order of the problem files works, but because the project file is regularly regenerated, it's challenging to ensure that happens every time.

@swift-ci
Copy link
Collaborator Author

Comment by Matt Thomas (JIRA)

bmelts (JIRA User) yes, our project also uses CocoaPods and each `pod install` breaks compiling (one of these days we’ll migrate to Swift Package Manager). If this can’t be fixed by GM, we might need to figure out a better work-around since we’re adding iOS 11 features.

@swift-ci
Copy link
Collaborator Author

Comment by Bill Meltsner (JIRA)

Still present in Beta 6.

@belkadan
Copy link
Contributor

Okay, fixed for real in #11661 Can't promise when that'll make it into an Xcode release, though.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@AnthonyLatsis AnthonyLatsis added the crash Bug: A crash, i.e., an abnormal termination of software label Dec 12, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself crash Bug: A crash, i.e., an abnormal termination of software regression swift 4.0
Projects
None yet
Development

No branches or pull requests

4 participants