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-11573] Segmentation fault 11 while compiling Generics/Type erasure in 2 targets #53978

Closed
swift-ci opened this issue Oct 5, 2019 · 3 comments
Assignees
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 Oct 5, 2019

Previous ID SR-11573
Radar https://feedbackassistant.apple.com/feedback/7351428
Original Reporter twittemb (JIRA User)
Type Bug
Status Resolved
Resolution Done

Attachment: Download

Environment
  • Macbook Pro 15 inch 2017

  • macOS Mojave 10.14.6

  • Xcode 11 (11A420a)

  • Swift version 5.1 (swiftlang-1100.0.270.13 clang-1100.0.33.7)

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

md5: 3196b956cd55f2ad4986feea1eaa9df4

Issue Description:

I have a Xcode project for a framework.

There are 2 targets in this project:

  • Spin: defines the abstractions for a reactive feedback loop (some protocols and there type erasures)

  • Spin.Combine:is an implementation of the abstractions defined in the Spin target, by extending AnyPublisher to conform to the protocols. This target depends on the Spin target.

Repro steps:

  • Step 1: Compile the Spin target

  • Step 2: Compile the Spin.Combine target. The compiler fails with a Segmentation fault 11 error (due to the `spy` function in the extension of `AnyPublisher`

  • Step 3: comment the `spy` function and compile the Spin.Combine target. The compiler succeeds.

There was no issue at all when using with Xcode 10.3 and the Swift 5 compiler.

Here is the stack trace:

1. While emitting IR SIL function "@$s7Combine12AnyPublisherV05Spin_A00D07CommandRzs5NeverORs_AA0C06StreamRpzAJ_5ValueAE08ReactiveG0PQZAJ_6OutputAaIPRTzrlE3spy8functionAE0B8ProducerCyACyxAHGxSo17OS_dispatch_queueCAA0B11CancellableCAwE0M0ADxAeFHD1__AkaIHD2_HCg_Gyxc_tF".

for 'spy(function🙂' (at /Users/twittemberg/Development/Contributions/Spin/Spin/Spin/Spin.Combine/AnyPublisher+Spin.swift:49:12)

2. While mangling type for debugger type 'AnyProducer<AnyPublisher<τ_0_0, Never>, τ_0_0, DispatchQueue, AnyCancellable>'

0 swift 0x0000000105fc8eb3 PrintStackTraceSignalHandler(void*) + 51

1 swift 0x0000000105fc8686 SignalHandler(int) + 358

2 libsystem_platform.dylib 0x00007fff69f8eb5d _sigtramp + 29

3 swift 0x0000000102b312f1 swift::Evaluator::checkDependency(swift::AnyRequest const&) + 449

4 swift 0x0000000102b4c58f swift::GenericSignature::getConformanceAccessPath(swift::Type, swift::ProtocolDecl*) + 31

5 swift 0x0000000102aa7768 swift::Mangle::ASTMangler::appendConcreteProtocolConformance(swift::ProtocolConformance const*) + 1784

6 swift 0x0000000102aa4893 swift::Mangle::ASTMangler::appendRetroactiveConformances(swift::SubstitutionMap, swift::ModuleDecl*) + 179

7 swift 0x0000000102aa3e05 swift::Mangle::ASTMangler::appendRetroactiveConformances(swift::Type) + 389

8 swift 0x0000000102aa2cb0 swift::Mangle::ASTMangler::appendType(swift::Type, swift::ValueDecl const*) + 8864

9 swift 0x0000000101e3e3c9 (anonymous namespace)::IRGenDebugInfoImpl::getOrCreateType(swift::irgen::DebugTypeInfo) + 1449

10 swift 0x0000000101e3da63 (anonymous namespace)::IRGenDebugInfoImpl::createParameterTypes(swift::CanTypeWrapper<swift::SILFunctionType>) + 931

11 swift 0x0000000101e3cbaf (anonymous namespace)::IRGenDebugInfoImpl::emitFunction(swift::SILDebugScope const*, llvm::Function*, swift::SILFunctionTypeRepresentation, swift::SILType, swift::DeclContext*) + 3167

12 swift 0x0000000101e5573e swift::irgen::IRGenModule::emitSILFunction(swift::SILFunction*) + 2750

13 swift 0x0000000101d038e0 swift::irgen::IRGenerator::emitGlobalTopLevel() + 1712

14 swift 0x0000000101e34065 performIRGeneration(swift::IRGenOptions&, swift::ModuleDecl*, std::_1::unique_ptr<swift::SILModule, std::_1::default_delete<swift::SILModule> >, llvm::StringRef, swift::PrimarySpecificPaths const&, llvm::LLVMContext&, swift::SourceFile*, llvm::GlobalVariable**) + 1189

15 swift 0x0000000101c2078a performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef<char const*>, int&, swift::FrontendObserver*, swift::UnifiedStatsReporter*) + 36682

16 swift 0x0000000101c14034 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 6820

17 swift 0x0000000101ba15a3 main + 1219

18 libdyld.dylib 0x00007fff69da33d5 start + 1

19 libdyld.dylib 0x000000000000004d start + 2519059577

error: Segmentation fault: 11 (in target 'Spin.Combine' from project 'Spin')

@theblixguy
Copy link
Collaborator

Should be fixed by #27547

@swift-ci
Copy link
Collaborator Author

swift-ci commented Oct 7, 2019

Comment by Thibault Wittemberg (JIRA)

Thanks for your insight @theblixguy.

@theblixguy
Copy link
Collaborator

Fixed on master. Please verify using the next available development snapshot!

@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

3 participants