Created
November 16, 2014 21:30
-
-
Save tjw/b932dacd74c2d5b7e1e8 to your computer and use it in GitHub Desktop.
Radar 18996669: Swift: Attempting to instantiate instance via class pointer crashes
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
| /* | |
| Radar 18996669: Swift: Attempting to instantiate instance via class pointer crashes | |
| % xcrun -sdk macosx swiftc instantiate-from-class.swift | |
| 0 swift 0x0000000107668b68 llvm::sys::PrintStackTrace(__sFILE*) + 40 | |
| 1 swift 0x0000000107669054 SignalHandler(int) + 452 | |
| 2 libsystem_platform.dylib 0x00007fff95c74f1a _sigtramp + 26 | |
| 3 libsystem_platform.dylib 0x0000000108bd3e00 _sigtramp + 1928720128 | |
| 4 swift 0x0000000107a675fc collectFullName(swift::ArchetypeType const*, llvm::SmallVectorImpl<char>&) + 92 | |
| 5 swift 0x0000000107a675c8 collectFullName(swift::ArchetypeType const*, llvm::SmallVectorImpl<char>&) + 40 | |
| 6 swift 0x0000000107a675c8 collectFullName(swift::ArchetypeType const*, llvm::SmallVectorImpl<char>&) + 40 | |
| 7 swift 0x0000000107a67551 swift::ArchetypeType::getFullName() const + 49 | |
| 8 swift 0x0000000106a31716 swift::irgen::IRGenFunction::bindArchetype(swift::ArchetypeType*, llvm::Value*, llvm::ArrayRef<llvm::Value*>) + 70 | |
| 9 swift 0x0000000106a35c56 swift::irgen::emitClassExistentialProjection(swift::irgen::IRGenFunction&, swift::irgen::Explosion&, swift::SILType, swift::CanTypeWrapper<swift::ArchetypeType>) + 102 | |
| 10 swift 0x0000000106a7348e swift::SILVisitor<(anonymous namespace)::IRGenSILFunction, void>::visit(swift::ValueBase*) + 23310 | |
| 11 swift 0x0000000106a6cd3b swift::irgen::IRGenModule::emitSILFunction(swift::SILFunction*) + 9179 | |
| 12 swift 0x00000001069e6447 swift::irgen::IRGenModule::emitLazyDefinitions() + 199 | |
| 13 swift 0x0000000106a59af6 performIRGeneration(swift::IRGenOptions&, swift::Module*, swift::SILModule*, llvm::StringRef, llvm::LLVMContext&, swift::SourceFile*, unsigned int) + 2038 | |
| 14 swift 0x0000000106a5a473 swift::performIRGeneration(swift::IRGenOptions&, swift::SourceFile&, swift::SILModule*, llvm::StringRef, llvm::LLVMContext&, unsigned int) + 51 | |
| 15 swift 0x00000001069af6f4 frontend_main(llvm::ArrayRef<char const*>, char const*, void*) + 5444 | |
| 16 swift 0x00000001069aca6d main + 1677 | |
| 17 libdyld.dylib 0x00007fff981545c9 start + 1 | |
| 18 libdyld.dylib 0x0000000000000010 start + 1743436360 | |
| Stack dump: | |
| 0. Program arguments: /Applications/Xcode 6.1.1 GM.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift -frontend -c -primary-file instantiate-from-class.swift -target x86_64-apple-darwin14.0.0 -target-cpu core2 -sdk /Applications/Xcode 6.1.1 GM.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk -color-diagnostics -module-name main -o /var/folders/wc/zbg165dn60d1glkwdnd7cq780000gp/T/instantiate-from-class-d67574.o | |
| 1. While emitting IR SIL function @top_level_code<unknown>:0: error: unable to execute command: Segmentation fault: 11 | |
| <unknown>:0: error: swift frontend command failed due to signal (use -v to see invocation) | |
| */ | |
| protocol P { | |
| class var name: String { get } | |
| init(i:Int) | |
| } | |
| class A: P { | |
| class var name: String { | |
| get { return "A" } | |
| } | |
| required init(i:Int) {} | |
| } | |
| class B: P { | |
| class var name: String { | |
| get { return "A" } | |
| } | |
| required init(i:Int) {} | |
| } | |
| let cls:P.Type = A.self | |
| let p:P = cls(i:1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment