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-1426] Bus error when conforming to multiple protocols with associatedtype #44035

Closed
swift-ci opened this issue May 6, 2016 · 2 comments
Closed
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

Comments

@swift-ci
Copy link
Collaborator

swift-ci commented May 6, 2016

Previous ID SR-1426
Radar None
Original Reporter wisolith (JIRA User)
Type Bug
Status Resolved
Resolution Duplicate

Attachment: Download

Environment

Swift 2.2
Xcode 7.3.1

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

md5: 8242d35723faac0f76f9aa9b99f8b3bc

is duplicated by:

  • SR-2171 Crash with typealias X = Y in protocol & redundant class constraint

Issue Description:

The attached file, abstracted from the Eureka form library, results in the following bus error during compilation:

Command failed due to signal: Bus error: 10
0  swift                    0x0000000103ac366b llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 43
1  swift                    0x0000000103ac2956 llvm::sys::RunSignalHandlers() + 70
2  swift                    0x0000000103ac3ccf SignalHandler(int) + 287
3  libsystem_platform.dylib 0x00007fff87394eaa _sigtramp + 26
4  swift                    0x00000001038ee90b llvm::FoldingSet<llvm::AttributeSetNode>::NodeEquals(llvm::FoldingSetImpl::Node*, llvm::FoldingSetNodeID const&, unsigned int, llvm::FoldingSetNodeID&) const + 59
5  swift                    0x0000000102eeceff llvm::CallInst::Create(llvm::FunctionType*, llvm::Value*, llvm::ArrayRef<llvm::Value*>, llvm::ArrayRef<llvm::OperandBundleDefT<llvm::Value*> >, llvm::Twine const&, llvm::Instruction*) + 367
6  swift                    0x0000000102eed090 llvm::IRBuilder<true, llvm::ConstantFolder, llvm::IRBuilderDefaultInserter<true> >::CreateCall(llvm::Value*, llvm::ArrayRef<llvm::Value*>, llvm::Twine const&) + 64
7  swift                    0x0000000101913fb5 swift::irgen::IRGenModule::emitSILWitnessTable(swift::SILWitnessTable*) + 1829
8  swift                    0x00000001018a76cd swift::irgen::IRGenModuleDispatcher::emitGlobalTopLevel() + 861
9  swift                    0x000000010193304e performIRGeneration(swift::IRGenOptions&, swift::ModuleDecl*, swift::SILModule*, llvm::StringRef, llvm::LLVMContext&, swift::SourceFile*, unsigned int) + 1278
10 swift                    0x00000001019334f6 swift::performIRGeneration(swift::IRGenOptions&, swift::SourceFile&, swift::SILModule*, llvm::StringRef, llvm::LLVMContext&, unsigned int) + 70
11 swift                    0x0000000101816c8c performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef<char const*>, int&) + 15004
12 swift                    0x000000010181268d frontend_main(llvm::ArrayRef<char const*>, char const*, void*) + 2781
13 swift                    0x000000010180e0ac main + 1932
14 libdyld.dylib            0x00007fff882c95ad start + 1
15 libdyld.dylib            0x000000000000003c start + 2010344080

Adding a generic type placeholder to the definition of CustomRow resolves the error, for example:

class CustomRow<T>: Row<String, CustomCell>, SelectableRowType {
  var selectableValue: String?
}
@belkadan
Copy link
Contributor

belkadan commented May 6, 2016

In a debug compiler:

no relation found that declares conformance to target
UNREACHABLE executed at /Volumes/Data/swift-public/swift/lib/IRGen/GenArchetype.cpp:140!
0  swift                    0x0000000102e88ddb llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 43
1  swift                    0x0000000102e88066 llvm::sys::RunSignalHandlers() + 70
2  swift                    0x0000000102e894af SignalHandler(int) + 383
3  libsystem_platform.dylib 0x00007fff893f252a _sigtramp + 26
4  swift                    0x0000000103a0e400 clang::vfs::getNextVirtualUniqueID()::UID + 71784
5  swift                    0x0000000102e89286 abort + 22
6  swift                    0x0000000102e2b0ad llvm::llvm_unreachable_internal(char const*, char const*, unsigned int) + 493
7  swift                    0x0000000100406820 llvm::Value* llvm::function_ref<llvm::Value* (unsigned int)>::callback_fn<swift::irgen::emitArchetypeWitnessTableRef(swift::irgen::IRGenFunction&, swift::CanTypeWrapper<swift::ArchetypeType>, swift::ProtocolDecl*)::$_0>(long, unsigned int) + 368
8  swift                    0x00000001004d0931 swift::irgen::emitImpliedWitnessTableRef(swift::irgen::IRGenFunction&, llvm::ArrayRef<swift::irgen::ProtocolEntry>, swift::ProtocolDecl*, llvm::function_ref<llvm::Value* (unsigned int)> const&) + 273
9  swift                    0x00000001004041d4 swift::irgen::emitArchetypeWitnessTableRef(swift::irgen::IRGenFunction&, swift::CanTypeWrapper<swift::ArchetypeType>, swift::ProtocolDecl*) + 164
10 swift                    0x00000001004d476c swift::SILWitnessVisitor<(anonymous namespace)::WitnessTableBuilder>::visitProtocolDecl(swift::ProtocolDecl*) + 5004
11 swift                    0x00000001004cd512 swift::irgen::IRGenModule::emitSILWitnessTable(swift::SILWitnessTable*) + 418
12 swift                    0x000000010043e817 swift::irgen::IRGenerator::emitGlobalTopLevel() + 775
13 swift                    0x0000000100504b40 performIRGeneration(swift::IRGenOptions&, swift::ModuleDecl*, swift::SILModule*, llvm::StringRef, llvm::LLVMContext&, swift::SourceFile*, unsigned int) + 1008
14 swift                    0x00000001005050e5 swift::performIRGeneration(swift::IRGenOptions&, swift::SourceFile&, swift::SILModule*, llvm::StringRef, llvm::LLVMContext&, unsigned int) + 69
15 swift                    0x00000001003ee0f9 performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef<char const*>, int&, swift::FrontendObserver*) + 16473
16 swift                    0x00000001003e9196 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 2870
17 swift                    0x00000001003ac480 main + 2640
18 libdyld.dylib            0x00007fff9ae965ad start + 1

@bob-wilson
Copy link

I'm pretty sure this is a duplicate of one of the crashes reported in SR-1951, which was fixed in #4330 It no longer crashes for me.

@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
Projects
None yet
Development

No branches or pull requests

4 participants