Uploaded image for project: 'Swift'
  1. Swift
  2. SR-12657

Swift 5.2 compiler crash, protocol method reference

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Medium
    • Resolution: Duplicate
    • Component/s: None
    • Labels:
      None
    • Environment:

      MacOS 10.15.4 (19E287), MacBook Pro (15-inch, 2018)

      Description

      The following code snippet crashes the Swift 5.2 compiler with a segmentation fault.

      protocol Something {
          func add(_ n: Int)
      }
      
      let function = Something.add
      

      Here is the stacktrace

      1.  Apple Swift version 5.2.2 (swiftlang-1103.0.32.6 clang-1103.0.32.51)
      0  swift                    0x000000011369f4ea PrintStackTraceSignalHandler(void*) + 42
      1  swift                    0x000000011369ecc0 SignalHandler(int) + 352
      2  libsystem_platform.dylib 0x00007fff6db7d5fd _sigtramp + 29
      3  libsystem_platform.dylib 0x00007ffee08b1f48 _sigtramp + 1926449512
      4  swift                    0x000000010f8885fa swift::Lowering::SILGenFunction::emitOpenExistentialExprImpl(swift::OpenExistentialExpr*, llvm::function_ref<void (swift::Expr*)>) + 666
      5  swift                    0x000000010f87979a swift::ASTVisitor<(anonymous namespace)::RValueEmitter, swift::Lowering::RValue, void, void, void, void, void, swift::Lowering::SGFContext>::visit(swift::Expr*, swift::Lowering::SGFContext) + 38938
      6  swift                    0x000000010f86fd93 swift::Lowering::SILGenFunction::emitExprInto(swift::Expr*, swift::Lowering::Initialization*, llvm::Optional<swift::SILLocation>) + 131
      7  swift                    0x000000010f863c18 swift::Lowering::SILGenFunction::emitPatternBinding(swift::PatternBindingDecl*, unsigned int) + 280
      8  swift                    0x000000010f80ec5d swift::ASTVisitor<swift::Lowering::SILGenFunction, void, void, void, void, void, void>::visit(swift::Decl*) + 109
      9  swift                    0x000000010f8105f1 swift::ASTVisitor<swift::Lowering::SILGenModule, void, void, void, void, void, void>::visit(swift::Decl*) + 1265
      10 swift                    0x000000010f80f31c swift::Lowering::SILGenModule::emitSourceFile(swift::SourceFile*) + 1356
      11 swift                    0x000000010f81139e swift::SILModule::constructSIL(swift::ModuleDecl*, swift::Lowering::TypeConverter&, swift::SILOptions&, swift::FileUnit*) + 1438
      12 swift                    0x000000010f3f1131 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 48065
      13 swift                    0x000000010f368f53 main + 1283
      14 libdyld.dylib            0x00007fff6d984cc9 start + 1
      15 libdyld.dylib            0x0000000000000045 start + 2456269693
      error: Segmentation fault: 11
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              ruzili Ruben Zilibowitz
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: