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-12624] Segmentation Fault 11 #55068

Closed
swift-ci opened this issue Apr 19, 2020 · 1 comment
Closed

[SR-12624] Segmentation Fault 11 #55068

swift-ci opened this issue Apr 19, 2020 · 1 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

Comments

@swift-ci
Copy link
Collaborator

Previous ID SR-12624
Radar rdar://problem/62481584
Original Reporter nv3212 (JIRA User)
Type Bug
Status Resolved
Resolution Duplicate
Additional Detail from JIRA
Votes 0
Component/s
Labels Bug, CompilerCrash
Assignee None
Priority Medium

md5: e497787b6699684c41a1f6218df9781d

duplicates:

  • SR-8814 GenericSignatureBuilder should re-introduce conformance requirements when adding a superclass requirement

Issue Description:

When I use the following, code I have the error "Segmentation Fault 11".

protocol APIResource {
    associatedtype ModelType: Decodable
 
    var baseURL: URL? { get }
}
 
extension APIResource {
    var baseURL: URL? {
        return nil
    }
}
 
class BaseResource<T: Decodable>: APIResource {
    typealias ModelType = T
}

If you use a struct, it compiles successfully.

1. Apple Swift version 5.2.2 (swiftlang-1103.0.32.6 clang-1103.0.32.51)
2. While generating SIL witness table protocol conformance to 'APIResource' (at /.../NetworkManager/Service/APIResource.swift:157:1) for type 'BaseResource<T>' (declared at [/.../NetworkManager/Service/APIResource.swift:170:1 - line:172:1] RangeText="class BaseResource<T: Decodable>: APIResource {
    typealias ModelType = T
")
3. While generating protocol witness thunk SIL function "@$s14NetworkManager12BaseResourceCyqd__GAA12APIResourceA2aEP7baseURL10Foundation0G0VSgvgTW".
 for getter for baseURL (at /.../NetworkManager/Service/APIResource.swift:165:9)
0  swift                    0x000000010a3d34ea PrintStackTraceSignalHandler(void*) + 42
1  swift                    0x000000010a3d2cc0 SignalHandler(int) + 352
2  libsystem_platform.dylib 0x00007fff73aa042d _sigtramp + 29
3  libsystem_platform.dylib 0x000000010bbb1400 _sigtramp + 2551255024
4  swift                    0x00000001065d941d swift::Lowering::SILGenModule::useConformance(swift::ProtocolConformanceRef) + 173
5  swift                    0x00000001065db0fd swift::Lowering::SILGenModule::emitLazyConformancesForFunction(swift::SILFunction*) + 1277
6  swift                    0x000000010662fa9e swift::Lowering::SILGenModule::emitProtocolWitness(swift::ProtocolConformanceRef, swift::SILLinkage, swift::IsSerialized_t, swift::SILDeclRef, swift::SILDeclRef, swift::Lowering::IsFreeFunctionWitness_t, swift::Witness) + 2702
7  swift                    0x000000010662ef96 (anonymous namespace)::SILGenWitnessTable<(anonymous namespace)::SILGenConformance>::addMethod(swift::SILDeclRef) + 902
8  swift                    0x000000010662ebfb void llvm::function_ref<void (swift::AccessorDecl*)>::callback_fn<swift::SILWitnessVisitor<(anonymous namespace)::SILGenConformance>::visitAbstractStorageDecl(swift::AbstractStorageDecl*)::'lambda'(swift::AccessorDecl*)>(long, swift::AccessorDecl*) + 267
9  swift                    0x000000010713fe22 swift::AbstractStorageDecl::visitExpectedOpaqueAccessors(llvm::function_ref<void (swift::AccessorKind)>) const + 322
10 swift                    0x000000010662e33a swift::SILWitnessVisitor<(anonymous namespace)::SILGenConformance>::visitProtocolDecl(swift::ProtocolDecl*) + 1274
11 swift                    0x000000010662daf6 swift::Lowering::SILGenModule::getWitnessTable(swift::NormalProtocolConformance*) + 550
12 swift                    0x00000001066336d8 (anonymous namespace)::SILGenType::emitType() + 6840
13 swift                    0x0000000106544152 swift::ASTVisitor<swift::Lowering::SILGenModule, void, void, void, void, void, void>::visit(swift::Decl*) + 82
14 swift                    0x000000010654331c swift::Lowering::SILGenModule::emitSourceFile(swift::SourceFile*) + 1356
15 swift                    0x000000010654539e swift::SILModule::constructSIL(swift::ModuleDecl*, swift::Lowering::TypeConverter&, swift::SILOptions&, swift::FileUnit*) + 1438
16 swift                    0x0000000106125131 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 48065
17 swift                    0x000000010609cf53 main + 1283
18 libdyld.dylib            0x00007fff738a77fd start + 1
19 libdyld.dylib            0x0000000000000060 start + 2356512868
error: Segmentation fault: 11 (in target 'NetworkManager' from project 'NetworkManager')
@beccadax
Copy link
Contributor

@swift-ci create

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@AnthonyLatsis AnthonyLatsis added crash Bug: A crash, i.e., an abnormal termination of software compiler The Swift compiler in itself labels 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

3 participants