Last active
January 15, 2019 14:12
-
-
Save r-plus/3c5076c1f1c314cec0fe88536ea12159 to your computer and use it in GitHub Desktop.
Swift compiler SEGV in Xcode10.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// =========================== | |
// Pattern1: SEGV in Xcode10(Swift4.2 or Swift4) ~ Xcode10.1(Swift 4.2.1) | |
// This code compilable in Xcode 9.4.1(Swift 4.1) | |
// =========================== | |
class A {} | |
protocol BProtocol { | |
associatedtype Info: A | |
var info: Info? { get set } | |
} | |
class B<T1: A>: BProtocol { | |
var info: T1? | |
} | |
protocol CProtocol { | |
associatedtype Property: BProtocol | |
var property: Property? { get set } | |
} | |
class C<T2: B<A>>: CProtocol { | |
var property: T2? | |
} | |
// =========================== | |
// Pattern2: not SEGV (Remove generic parameter from B class) | |
// =========================== | |
class A {} | |
protocol BProtocol { | |
associatedtype Info: A | |
var info: Info? { get set } | |
} | |
class B: BProtocol { | |
var info: A? | |
} | |
protocol CProtocol { | |
associatedtype Property: BProtocol | |
var property: Property? { get set } | |
} | |
class C<T2: B>: CProtocol { | |
var property: T2? | |
} | |
// =========================== | |
// Pattern3: not SEGV (Remove CProtocol) | |
// =========================== | |
class A {} | |
protocol BProtocol { | |
associatedtype Info: A | |
var info: Info? { get set } | |
} | |
class B<T1: A>: BProtocol { | |
var info: T1? | |
} | |
class C<T2: B<A>> { | |
var property: T2? | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
0 swift 0x0000000111cbe64a PrintStackTraceSignalHandler(void*) + 42 | |
1 swift 0x0000000111cbddfe SignalHandler(int) + 302 | |
2 libsystem_platform.dylib 0x00007fff68bcbb3d _sigtramp + 29 | |
3 libsystem_platform.dylib 0x00007fcb1b856a60 _sigtramp + 2999496512 | |
4 swift 0x000000010f0d2e59 swift::ConformanceChecker::ensureRequirementsAreSatisfied(bool)::GatherConformancesListener::satisfiedConformance(swift::Type, swift::Type, swift::ProtocolConformanceRef) + 201 | |
5 swift 0x000000010f0a8c2f swift::TypeChecker::checkGenericArguments(swift::DeclContext*, swift::SourceLoc, swift::SourceLoc, swift::Type, swift::ArrayRefView<swift::Type, swift::GenericTypeParamType*, swift::GenericTypeParamType* swift::staticCastHelper<swift::GenericTypeParamType>(swift::Type const&), true>, llvm::ArrayRef<swift::Requirement>, llvm::function_ref<swift::Type (swift::SubstitutableType*)>, llvm::function_ref<llvm::Optional<swift::ProtocolConformanceRef> (swift::CanType, swift::Type, swift::ProtocolType*)>, llvm::function_ref<bool (swift::TypeCheckRequest)>*, swift::OptionSet<swift::ConformanceCheckFlags, unsigned int>, swift::GenericRequirementsCheckListener*, swift::SubstOptions) + 1103 | |
6 swift 0x000000010f0d2bcd swift::ConformanceChecker::ensureRequirementsAreSatisfied(bool) + 1325 | |
7 swift 0x000000010f0ee4ba swift::ConformanceChecker::resolveTypeWitnesses() + 378 | |
8 swift 0x000000010f0be973 swift::MultiConformanceChecker::checkIndividualConformance(swift::NormalProtocolConformance*, bool) + 11347 | |
9 swift 0x000000010f0bb8c2 swift::MultiConformanceChecker::checkAllConformances() + 162 | |
10 swift 0x000000010f0d4ac7 swift::TypeChecker::checkConformancesInContext(swift::DeclContext*, swift::IterableDeclContext*) + 4279 | |
11 swift 0x000000010f11ef94 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int) + 2388 | |
12 swift 0x000000010ed5959e swift::CompilerInstance::performSema() + 4238 | |
13 swift 0x000000010df4659b performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef<char const*>, int&, swift::FrontendObserver*, swift::UnifiedStatsReporter*) + 731 | |
14 swift 0x000000010df42dc5 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 7717 | |
15 swift 0x000000010dee8a35 main + 1349 | |
16 libdyld.dylib 0x00007fff689e2085 start + 1 | |
17 libdyld.dylib 0x000000000000004b start + 2539773895 | |
Stack dump: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment