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-8045] Swift compiler aborts with trap 6 #50578

Closed
an0 mannequin opened this issue Jun 20, 2018 · 7 comments
Closed

[SR-8045] Swift compiler aborts with trap 6 #50578

an0 mannequin opened this issue Jun 20, 2018 · 7 comments

Comments

@an0
Copy link
Mannequin

@an0 an0 mannequin commented Jun 20, 2018

Previous ID SR-8045
Radar radar://40984769
Original Reporter @an0
Type Bug
Status Resolved
Resolution Done

Attachment: Download

Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, CompilerCrash, Serialization
Assignee @belkadan
Priority Medium

md5: 8dde0a7e96a7bfc6e54eb08dcab30d9d

Issue Description:

:0: error: fatal error encountered while reading from module 'ObservableCrash'; please file a bug report with your project and the crash log

*** DESERIALIZATION FAILURE (please include this section in any bug report) ***
result not found
Cross-reference to module 'ObservableCrash'
... Observable
... addPropertyChangeHandler
... with type <τ_0_0 where τ_0_0 : Observable> (τ_0_0) -> ((τ_0_0.P) -> ()) -> Disposable

0 swift 0x000000010a3d2a9a PrintStackTraceSignalHandler(void*) + 42
1 swift 0x000000010a3d1ea6 SignalHandler(int) + 966
2 libsystem_platform.dylib 0x00007fff5f0ecf5a _sigtramp + 26
3 swift 0x000000010ae77008 (anonymous namespace)::DarwinX86AsmBackend::getCompactUnwindRegNum(unsigned int) const::CU32BitRegs + 101318
4 libsystem_c.dylib 0x00007fff5ee8a1ae abort + 127
5 swift 0x000000010788c80b swift::ModuleFile::fatal(llvm::Error) + 1915
6 swift 0x00000001078c4493 getSILDeclRef(swift::ModuleFile*, llvm::ArrayRef, unsigned int&) + 307
7 swift 0x00000001078c74f8 swift::SILDeserializer::readWitnessTable(llvm::PointerEmbeddedInt<unsigned int, 31>, swift::SILWitnessTable*) + 2008
8 swift 0x000000010796c71d swift::SerializedSILLoader::getAllForModule(swift::Identifier, swift::FileUnit*) + 413
9 swift 0x00000001066c386e performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef<char const*>, int&, swift::FrontendObserver*, swift::UnifiedStatsReporter*) + 34750
10 swift 0x00000001066b7bbf swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 7839
11 swift 0x0000000106661768 main + 13144
12 libdyld.dylib 0x00007fff5edde015 start + 1
13 libdyld.dylib 0x0000000000000044 start + 2703368240
Stack dump:
0. Program arguments: /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift -frontend -merge-modules -emit-module /Users/an0/Library/Developer/Xcode/DerivedData/ObservableCrash-dqmstgdgjoclireosgxpnuswhfkg/Build/Intermediates.noindex/ObservableCrash.build/Debug-iphoneos/ObservableCrash.build/Objects-normal/arm64/ViewControllerpartial.swiftmodule /Users/an0/Library/Developer/Xcode/DerivedData/ObservableCrash-dqmstgdgjoclireosgxpnuswhfkg/Build/Intermediates.noindex/ObservableCrash.build/Debug-iphoneos/ObservableCrash.build/Objects-normal/arm64/Observablepartial.swiftmodule /Users/an0/Library/Developer/Xcode/DerivedData/ObservableCrash-dqmstgdgjoclireosgxpnuswhfkg/Build/Intermediates.noindex/ObservableCrash.build/Debug-iphoneos/ObservableCrash.build/Objects-normal/arm64/Annotablepartial.swiftmodule /Users/an0/Library/Developer/Xcode/DerivedData/ObservableCrash-dqmstgdgjoclireosgxpnuswhfkg/Build/Intermediates.noindex/ObservableCrash.build/Debug-iphoneos/ObservableCrash.build/Objects-normal/arm64/AppDelegatepartial.swiftmodule -parse-as-library -sil-merge-partial-modules -disable-diagnostic-passes -disable-sil-perf-optzns -target arm64-apple-ios12.0 -Xllvm -aarch64-use-tbi -enable-objc-interop -sdk /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.0.sdk -I /Users/an0/Library/Developer/Xcode/DerivedData/ObservableCrash-dqmstgdgjoclireosgxpnuswhfkg/Build/Products/Debug-iphoneos -F /Users/an0/Library/Developer/Xcode/DerivedData/ObservableCrash-dqmstgdgjoclireosgxpnuswhfkg/Build/Products/Debug-iphoneos -enable-testing -g -module-cache-path /Users/an0/Library/Developer/Xcode/DerivedData/ModuleCache.noindex -swift-version 4.2 -enforce-exclusivity=checked -Onone -D DEBUG -serialize-debugging-options -Xcc -working-directory -Xcc https://user-images.githubusercontent.com/2727770/164962806-ce0f54e5-6d53-4f74-b974-bb45b3d232a9.gz -Xcc -I/Users/an0/Library/Developer/Xcode/DerivedData/ObservableCrash-dqmstgdgjoclireosgxpnuswhfkg/Build/Intermediates.noindex/ObservableCrash.build/Debug-iphoneos/ObservableCrash.build/swift-overrides.hmap -Xcc -iquote -Xcc /Users/an0/Library/Developer/Xcode/DerivedData/ObservableCrash-dqmstgdgjoclireosgxpnuswhfkg/Build/Intermediates.noindex/ObservableCrash.build/Debug-iphoneos/ObservableCrash.build/ObservableCrash-generated-files.hmap -Xcc -I/Users/an0/Library/Developer/Xcode/DerivedData/ObservableCrash-dqmstgdgjoclireosgxpnuswhfkg/Build/Intermediates.noindex/ObservableCrash.build/Debug-iphoneos/ObservableCrash.build/ObservableCrash-own-target-headers.hmap -Xcc -I/Users/an0/Library/Developer/Xcode/DerivedData/ObservableCrash-dqmstgdgjoclireosgxpnuswhfkg/Build/Intermediates.noindex/ObservableCrash.build/Debug-iphoneos/ObservableCrash.build/ObservableCrash-all-target-headers.hmap -Xcc -iquote -Xcc /Users/an0/Library/Developer/Xcode/DerivedData/ObservableCrash-dqmstgdgjoclireosgxpnuswhfkg/Build/Intermediates.noindex/ObservableCrash.build/Debug-iphoneos/ObservableCrash.build/ObservableCrash-project-headers.hmap -Xcc -I/Users/an0/Library/Developer/Xcode/DerivedData/ObservableCrash-dqmstgdgjoclireosgxpnuswhfkg/Build/Products/Debug-iphoneos/include -Xcc -I/Users/an0/Library/Developer/Xcode/DerivedData/ObservableCrash-dqmstgdgjoclireosgxpnuswhfkg/Build/Intermediates.noindex/ObservableCrash.build/Debug-iphoneos/ObservableCrash.build/DerivedSources/arm64 -Xcc -I/Users/an0/Library/Developer/Xcode/DerivedData/ObservableCrash-dqmstgdgjoclireosgxpnuswhfkg/Build/Intermediates.noindex/ObservableCrash.build/Debug-iphoneos/ObservableCrash.build/DerivedSources -Xcc -DDEBUG=1 -emit-module-doc-path /Users/an0/Library/Developer/Xcode/DerivedData/ObservableCrash-dqmstgdgjoclireosgxpnuswhfkg/Build/Intermediates.noindex/ObservableCrash.build/Debug-iphoneos/ObservableCrash.build/Objects-normal/arm64/ObservableCrash.swiftdoc -emit-objc-header-path /Users/an0/Library/Developer/Xcode/DerivedData/ObservableCrash-dqmstgdgjoclireosgxpnuswhfkg/Build/Intermediates.noindex/ObservableCrash.build/Debug-iphoneos/ObservableCrash.build/Objects-normal/arm64/ObservableCrash-Swift.h -module-name ObservableCrash -o /Users/an0/Library/Developer/Xcode/DerivedData/ObservableCrash-dqmstgdgjoclireosgxpnuswhfkg/Build/Intermediates.noindex/ObservableCrash.build/Debug-iphoneos/ObservableCrash.build/Objects-normal/arm64/ObservableCrash.swiftmodule

  1. While deserializing SIL witness table for type 'Annotable'
  2. While ... to 'Observable' in module 'ObservableCrash'
    error: Abort trap: 6
@belkadan
Copy link
Contributor

@belkadan belkadan commented Jun 20, 2018

You found a reproducer! Thanks, Ling, this'll be very helpful.

@CodaFi
Copy link
Member

@CodaFi CodaFi commented Jun 20, 2018

Reduced:

// file1.swift

typealias Alias<T> = (T) -> ()

class Super {
  func foo(_ f: @escaping Alias<Void>) {}
}

// file2.swift

class Sub: Super {
  override func foo(_ f: @escaping Alias<Void>) {}
}

@belkadan
Copy link
Contributor

@belkadan belkadan commented Jun 20, 2018

I guess that's good enough to use as a test case! PR coming soon.

@belkadan
Copy link
Contributor

@belkadan belkadan commented Jun 20, 2018

@belkadan
Copy link
Contributor

@belkadan belkadan commented Jun 21, 2018

4.2: #17380

@an0
Copy link
Mannequin Author

@an0 an0 mannequin commented Jul 4, 2018

@belkadan I just checked, it is not fixed in Xcode 10 beta 3.

@belkadan
Copy link
Contributor

@belkadan belkadan commented Jul 5, 2018

Yeah, the change did not make it into beta 3, but should be in a later beta. You can download a 4.2 toolchain from https://swift.org/download to test it out. (Sorry for the somewhat opaque process here.)

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants