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

SyntaxRewriter visitation exhausts the stack space that dispatch threads get

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Medium
    • Resolution: Done
    • Component/s: swift-format, SwiftSyntax
    • Labels:
      None
    • Environment:

      macOS 10.14.5, Xcode 11 beta 4

      Description

      I've been working on putting together an Xcode Source Editor Extension that will allow me to format code from within Xcode using the SwiftFormat library, however when I use essentially the same code to reformat the source as the command line `swift-format` utility, I get a crash in SwiftSyntax, as shown in the backtrace below:

      * thread #3, queue = 'com.apple.NSXPCConnection.user.16716', stop reason = EXC_BAD_ACCESS (code=2, address=0x70000b360ff8)
          frame #0: 0x00000001087ac09b SwiftFormatter`initializeBufferWithCopyOfBuffer for IdentifierPatternSyntax at <compiler-generated>:0
          frame #1: 0x0000000108311bf8 SwiftFormatter`outlined init with copy of SyntaxData at <compiler-generated>:0
        * frame #2: 0x00000001084e47aa SwiftFormatter`makeSyntax(data=SwiftSyntax.SyntaxData @ 0x000070000b365370) at SyntaxKind.swift:456:15
          frame #3: 0x00000001087d3698 SwiftFormatter`closure #1 in SyntaxRewriter.visitChildren(n=(Swift.Optional<SwiftSyntax.RawSyntax>, SwiftSyntax.AbsoluteSyntaxInfo) @ 0x000070000b365418, node=SwiftSyntax.IdentifierPatternSyntax @ 0x00007fea3ed0dbb0, self=0x00007fea3ed019c0) at SyntaxRewriter.swift:1182:20
          frame #4: 0x00000001087d393d SwiftFormatter`thunk for @callee_guaranteed (@guaranteed RawSyntax?, @unowned AbsoluteSyntaxInfo) -> (@owned RawSyntax?, @error @owned Error) at <compiler-generated>:0
          frame #5: 0x00000001087d39b4 SwiftFormatter`partial apply for thunk for @callee_guaranteed (@guaranteed RawSyntax?, @unowned AbsoluteSyntaxInfo) -> (@owned RawSyntax?, @error @owned Error) at <compiler-generated>:0
          frame #6: 0x00007fff639bdc23 libswiftCore.dylib`(extension in Swift):Swift.Sequence.map<A>((A.Element) throws -> A1) throws -> Swift.Array<A1> + 1331
          frame #7: 0x00000001087d2ee4 SwiftFormatter`SyntaxRewriter.visitChildren(nodeS=SwiftSyntax.IdentifierPatternSyntax @ 0x00007fea3ed0db60, self=0x00007fea3ed019c0) at SyntaxRewriter.swift:1177:45
          frame #8: 0x00000001087c275f SwiftFormatter`SyntaxRewriter.visit(node=SwiftSyntax.IdentifierPatternSyntax @ 0x000070000b36fc10, self=0x00007fea3ed019c0) at SyntaxRewriter.swift:862:12
          frame #9: 0x00000001087d1af4 SwiftFormatter`SyntaxRewriter.visit(node=SwiftSyntax.IdentifierPatternSyntax @ 0x00007fea3ed0dae0, self=0x00007fea3ed019c0) at SyntaxRewriter.swift:1155:37
          frame #10: 0x00000001087d3761 SwiftFormatter`closure #1 in SyntaxRewriter.visitChildren(n=(Swift.Optional<SwiftSyntax.RawSyntax>, SwiftSyntax.AbsoluteSyntaxInfo) @ 0x000070000b370568, node=SwiftSyntax.PatternBindingSyntax @ 0x00007fea3ed0da40, self=0x00007fea3ed019c0) at SyntaxRewriter.swift:1182:14
          frame #11: 0x00000001087d393d SwiftFormatter`thunk for @callee_guaranteed (@guaranteed RawSyntax?, @unowned AbsoluteSyntaxInfo) -> (@owned RawSyntax?, @error @owned Error) at <compiler-generated>:0
          frame #12: 0x00000001087d39b4 SwiftFormatter`partial apply for thunk for @callee_guaranteed (@guaranteed RawSyntax?, @unowned AbsoluteSyntaxInfo) -> (@owned RawSyntax?, @error @owned Error) at <compiler-generated>:0
          frame #13: 0x00007fff639bdc23 libswiftCore.dylib`(extension in Swift):Swift.Sequence.map<A>((A.Element) throws -> A1) throws -> Swift.Array<A1> + 1331
          frame #14: 0x00000001087d2ee4 SwiftFormatter`SyntaxRewriter.visitChildren(nodeS=SwiftSyntax.PatternBindingSyntax @ 0x00007fea3ed0d9f0, self=0x00007fea3ed019c0) at SyntaxRewriter.swift:1177:45
          frame #15: 0x00000001087bb648 SwiftFormatter`SyntaxRewriter.visit(node=SwiftSyntax.PatternBindingSyntax @ 0x000070000b3780e0, self=0x00007fea3ed019c0) at SyntaxRewriter.swift:486:12
          frame #16: 0x00000001087cbb1a SwiftFormatter`SyntaxRewriter.visit(node=SwiftSyntax.PatternBindingSyntax @ 0x00007fea3ed0d7c0, self=0x00007fea3ed019c0) at SyntaxRewriter.swift:1061:34
          frame #17: 0x00000001087d3761 SwiftFormatter`closure #1 in SyntaxRewriter.visitChildren(n=(Swift.Optional<SwiftSyntax.RawSyntax>, SwiftSyntax.AbsoluteSyntaxInfo) @ 0x000070000b37b658, node=SwiftSyntax.PatternBindingListSyntax @ 0x00007fea3ed0d720, self=0x00007fea3ed019c0) at SyntaxRewriter.swift:1182:14
          frame #18: 0x00000001087d393d SwiftFormatter`thunk for @callee_guaranteed (@guaranteed RawSyntax?, @unowned AbsoluteSyntaxInfo) -> (@owned RawSyntax?, @error @owned Error) at <compiler-generated>:0
          frame #19: 0x00000001087d39b4 SwiftFormatter`partial apply for thunk for @callee_guaranteed (@guaranteed RawSyntax?, @unowned AbsoluteSyntaxInfo) -> (@owned RawSyntax?, @error @owned Error) at <compiler-generated>:0
          frame #20: 0x00007fff639bdc23 libswiftCore.dylib`(extension in Swift):Swift.Sequence.map<A>((A.Element) throws -> A1) throws -> Swift.Array<A1> + 1331
          frame #21: 0x00000001087d2ee4 SwiftFormatter`SyntaxRewriter.visitChildren(nodeS=SwiftSyntax.PatternBindingListSyntax @ 0x00007fea3ed0d6d0, self=0x00007fea3ed019c0) at SyntaxRewriter.swift:1177:45
          frame #22: 0x00000001087bb748 SwiftFormatter`SyntaxRewriter.visit(node=SwiftSyntax.PatternBindingListSyntax @ 0x000070000b383238, self=0x00007fea3ed019c0) at SyntaxRewriter.swift:490:12
          frame #23: 0x00000001087cbbe2 SwiftFormatter`SyntaxRewriter.visit(node=SwiftSyntax.PatternBindingListSyntax @ 0x00007fea3ed0d8d0, self=0x00007fea3ed019c0) at SyntaxRewriter.swift:1062:38
          frame #24: 0x00000001087d3761 SwiftFormatter`closure #1 in SyntaxRewriter.visitChildren(n=(Swift.Optional<SwiftSyntax.RawSyntax>, SwiftSyntax.AbsoluteSyntaxInfo) @ 0x000070000b386748, node=SwiftSyntax.VariableDeclSyntax @ 0x00007fea3ed0d650, self=0x00007fea3ed019c0) at SyntaxRewriter.swift:1182:14
          frame #25: 0x00000001087d393d SwiftFormatter`thunk for @callee_guaranteed (@guaranteed RawSyntax?, @unowned AbsoluteSyntaxInfo) -> (@owned RawSyntax?, @error @owned Error) at <compiler-generated>:0
          frame #26: 0x00000001087d39b4 SwiftFormatter`partial apply for thunk for @callee_guaranteed (@guaranteed RawSyntax?, @unowned AbsoluteSyntaxInfo) -> (@owned RawSyntax?, @error @owned Error) at <compiler-generated>:0
          frame #27: 0x00007fff639bdc23 libswiftCore.dylib`(extension in Swift):Swift.Sequence.map<A>((A.Element) throws -> A1) throws -> Swift.Array<A1> + 1331
          frame #28: 0x00000001087d2ee4 SwiftFormatter`SyntaxRewriter.visitChildren(nodeS=SwiftSyntax.VariableDeclSyntax @ 0x00007fea3ed0d600, self=0x00007fea3ed019c0) at SyntaxRewriter.swift:1177:45
          frame #29: 0x00000001087bb85f SwiftFormatter`SyntaxRewriter.visit(node=SwiftSyntax.VariableDeclSyntax @ 0x000070000b38e3f0, self=0x00007fea3ed019c0) at SyntaxRewriter.swift:494:12
          frame #30: 0x00000001087cbcaa SwiftFormatter`SyntaxRewriter.visit(node=SwiftSyntax.VariableDeclSyntax @ 0x00007fea3ed0d580, self=0x00007fea3ed019c0) at SyntaxRewriter.swift:1063:32
          frame #31: 0x00000001087d3761 SwiftFormatter`closure #1 in SyntaxRewriter.visitChildren(n=(Swift.Optional<SwiftSyntax.RawSyntax>, SwiftSyntax.AbsoluteSyntaxInfo) @ 0x000070000b391898, node=SwiftSyntax.MemberDeclListItemSyntax @ 0x00007fea3ed0d0f0, self=0x00007fea3ed019c0) at SyntaxRewriter.swift:1182:14
          frame #32: 0x00000001087d393d SwiftFormatter`thunk for @callee_guaranteed (@guaranteed RawSyntax?, @unowned AbsoluteSyntaxInfo) -> (@owned RawSyntax?, @error @owned Error) at <compiler-generated>:0
          frame #33: 0x00000001087d39b4 SwiftFormatter`partial apply for thunk for @callee_guaranteed (@guaranteed RawSyntax?, @unowned AbsoluteSyntaxInfo) -> (@owned RawSyntax?, @error @owned Error) at <compiler-generated>:0
          frame #34: 0x00007fff639bdc23 libswiftCore.dylib`(extension in Swift):Swift.Sequence.map<A>((A.Element) throws -> A1) throws -> Swift.Array<A1> + 1331
          frame #35: 0x00000001087d2ee4 SwiftFormatter`SyntaxRewriter.visitChildren(nodeS=SwiftSyntax.MemberDeclListItemSyntax @ 0x00007fea3ed0d0a0, self=0x00007fea3ed019c0) at SyntaxRewriter.swift:1177:45
          frame #36: 0x00000001087ba248 SwiftFormatter`SyntaxRewriter.visit(node=SwiftSyntax.MemberDeclListItemSyntax @ 0x000070000b398c38, self=0x00007fea3ed019c0) at SyntaxRewriter.swift:418:12
          frame #37: 0x00000001087caa48 SwiftFormatter`SyntaxRewriter.visit(node=SwiftSyntax.MemberDeclListItemSyntax @ 0x00007fea3ed0d050, self=0x00007fea3ed019c0) at SyntaxRewriter.swift:1044:38
          frame #38: 0x00000001087d3761 SwiftFormatter`closure #1 in SyntaxRewriter.visitChildren(n=(Swift.Optional<SwiftSyntax.RawSyntax>, SwiftSyntax.AbsoluteSyntaxInfo) @ 0x000070000b39c988, node=SwiftSyntax.MemberDeclListSyntax @ 0x00007fea3ed0cfb0, self=0x00007fea3ed019c0) at SyntaxRewriter.swift:1182:14
          frame #39: 0x00000001087d393d SwiftFormatter`thunk for @callee_guaranteed (@guaranteed RawSyntax?, @unowned AbsoluteSyntaxInfo) -> (@owned RawSyntax?, @error @owned Error) at <compiler-generated>:0
          frame #40: 0x00000001087d39b4 SwiftFormatter`partial apply for thunk for @callee_guaranteed (@guaranteed RawSyntax?, @unowned AbsoluteSyntaxInfo) -> (@owned RawSyntax?, @error @owned Error) at <compiler-generated>:0
          frame #41: 0x00007fff639bdc23 libswiftCore.dylib`(extension in Swift):Swift.Sequence.map<A>((A.Element) throws -> A1) throws -> Swift.Array<A1> + 1331
          frame #42: 0x00000001087d2ee4 SwiftFormatter`SyntaxRewriter.visitChildren(nodeS=SwiftSyntax.MemberDeclListSyntax @ 0x00007fea3ed0d450, self=0x00007fea3ed019c0) at SyntaxRewriter.swift:1177:45
          frame #43: 0x00000001087ba148 SwiftFormatter`SyntaxRewriter.visit(node=SwiftSyntax.MemberDeclListSyntax @ 0x000070000b3a3cc0, self=0x00007fea3ed019c0) at SyntaxRewriter.swift:414:12
          frame #44: 0x00000001087ca980 SwiftFormatter`SyntaxRewriter.visit(node=SwiftSyntax.MemberDeclListSyntax @ 0x00007fea3ed0d3d0, self=0x00007fea3ed019c0) at SyntaxRewriter.swift:1043:34
          frame #45: 0x00000001087d3761 SwiftFormatter`closure #1 in SyntaxRewriter.visitChildren(n=(Swift.Optional<SwiftSyntax.RawSyntax>, SwiftSyntax.AbsoluteSyntaxInfo) @ 0x000070000b3a7a78, node=SwiftSyntax.MemberDeclBlockSyntax @ 0x00007fea3ed0c660, self=0x00007fea3ed019c0) at SyntaxRewriter.swift:1182:14
          frame #46: 0x00000001087d393d SwiftFormatter`thunk for @callee_guaranteed (@guaranteed RawSyntax?, @unowned AbsoluteSyntaxInfo) -> (@owned RawSyntax?, @error @owned Error) at <compiler-generated>:0
          frame #47: 0x00000001087d39b4 SwiftFormatter`partial apply for thunk for @callee_guaranteed (@guaranteed RawSyntax?, @unowned AbsoluteSyntaxInfo) -> (@owned RawSyntax?, @error @owned Error) at <compiler-generated>:0
          frame #48: 0x00007fff639bdc23 libswiftCore.dylib`(extension in Swift):Swift.Sequence.map<A>((A.Element) throws -> A1) throws -> Swift.Array<A1> + 1331
          frame #49: 0x00000001087d2ee4 SwiftFormatter`SyntaxRewriter.visitChildren(nodeS=SwiftSyntax.MemberDeclBlockSyntax @ 0x00007fea3ed0cea0, self=0x00007fea3ed019c0) at SyntaxRewriter.swift:1177:45
          frame #50: 0x00000001087ba048 SwiftFormatter`SyntaxRewriter.visit(node=SwiftSyntax.MemberDeclBlockSyntax @ 0x000070000b3aed48, self=0x00007fea3ed019c0) at SyntaxRewriter.swift:410:12
          frame #51: 0x00000001087ca8b8 SwiftFormatter`SyntaxRewriter.visit(node=SwiftSyntax.MemberDeclBlockSyntax @ 0x00007fea3ed0d220, self=0x00007fea3ed019c0) at SyntaxRewriter.swift:1042:35
          frame #52: 0x00000001087d3761 SwiftFormatter`closure #1 in SyntaxRewriter.visitChildren(n=(Swift.Optional<SwiftSyntax.RawSyntax>, SwiftSyntax.AbsoluteSyntaxInfo) @ 0x000070000b3b2b68, node=SwiftSyntax.ClassDeclSyntax @ 0x00007fea3ed0c610, self=0x00007fea3ed019c0) at SyntaxRewriter.swift:1182:14
          frame #53: 0x00000001087d393d SwiftFormatter`thunk for @callee_guaranteed (@guaranteed RawSyntax?, @unowned AbsoluteSyntaxInfo) -> (@owned RawSyntax?, @error @owned Error) at <compiler-generated>:0
          frame #54: 0x00000001087d39b4 SwiftFormatter`partial apply for thunk for @callee_guaranteed (@guaranteed RawSyntax?, @unowned AbsoluteSyntaxInfo) -> (@owned RawSyntax?, @error @owned Error) at <compiler-generated>:0
          frame #55: 0x00007fff639bdc23 libswiftCore.dylib`(extension in Swift):Swift.Sequence.map<A>((A.Element) throws -> A1) throws -> Swift.Array<A1> + 1331
          frame #56: 0x00000001087d2ee4 SwiftFormatter`SyntaxRewriter.visitChildren(nodeS=SwiftSyntax.ClassDeclSyntax @ 0x00007fea3ed0c5c0, self=0x00007fea3ed019c0) at SyntaxRewriter.swift:1177:45
          frame #57: 0x00000001087b9a5f SwiftFormatter`SyntaxRewriter.visit(node=SwiftSyntax.ClassDeclSyntax @ 0x000070000b3b9c58, self=0x00007fea3ed019c0) at SyntaxRewriter.swift:394:12
          frame #58: 0x00000001087ca33c SwiftFormatter`SyntaxRewriter.visit(node=SwiftSyntax.ClassDeclSyntax @ 0x00007fea3ed0c910, self=0x00007fea3ed019c0) at SyntaxRewriter.swift:1038:29
          frame #59: 0x00000001087d3761 SwiftFormatter`closure #1 in SyntaxRewriter.visitChildren(n=(Swift.Optional<SwiftSyntax.RawSyntax>, SwiftSyntax.AbsoluteSyntaxInfo) @ 0x000070000b3bdcb8, node=SwiftSyntax.CodeBlockItemSyntax @ 0x00007fea3ed0c870, self=0x00007fea3ed019c0) at SyntaxRewriter.swift:1182:14
          frame #60: 0x00000001087d393d SwiftFormatter`thunk for @callee_guaranteed (@guaranteed RawSyntax?, @unowned AbsoluteSyntaxInfo) -> (@owned RawSyntax?, @error @owned Error) at <compiler-generated>:0
          frame #61: 0x00000001087d39b4 SwiftFormatter`partial apply for thunk for @callee_guaranteed (@guaranteed RawSyntax?, @unowned AbsoluteSyntaxInfo) -> (@owned RawSyntax?, @error @owned Error) at <compiler-generated>:0
          frame #62: 0x00007fff639bdc23 libswiftCore.dylib`(extension in Swift):Swift.Sequence.map<A>((A.Element) throws -> A1) throws -> Swift.Array<A1> + 1331
          frame #63: 0x00000001087d2ee4 SwiftFormatter`SyntaxRewriter.visitChildren(nodeS=SwiftSyntax.CodeBlockItemSyntax @ 0x00007fea3ed0c7d0, self=0x00007fea3ed019c0) at SyntaxRewriter.swift:1177:45
          frame #64: 0x00000001087b2ac8 SwiftFormatter`SyntaxRewriter.visit(node=SwiftSyntax.CodeBlockItemSyntax @ 0x000070000b3c2248, self=0x00007fea3ed019c0) at SyntaxRewriter.swift:46:12
          frame #65: 0x00000001087c425d SwiftFormatter`SyntaxRewriter.visit(node=SwiftSyntax.CodeBlockItemSyntax @ 0x00007fea3ed0cb90, self=0x00007fea3ed019c0) at SyntaxRewriter.swift:951:33
          frame #66: 0x00000001087d3761 SwiftFormatter`closure #1 in SyntaxRewriter.visitChildren(n=(Swift.Optional<SwiftSyntax.RawSyntax>, SwiftSyntax.AbsoluteSyntaxInfo) @ 0x000070000b3c8da8, node=SwiftSyntax.CodeBlockItemListSyntax @ 0x00007fea3ed0c570, self=0x00007fea3ed019c0) at SyntaxRewriter.swift:1182:14
          frame #67: 0x00000001087d393d SwiftFormatter`thunk for @callee_guaranteed (@guaranteed RawSyntax?, @unowned AbsoluteSyntaxInfo) -> (@owned RawSyntax?, @error @owned Error) at <compiler-generated>:0
          frame #68: 0x00000001087d39b4 SwiftFormatter`partial apply for thunk for @callee_guaranteed (@guaranteed RawSyntax?, @unowned AbsoluteSyntaxInfo) -> (@owned RawSyntax?, @error @owned Error) at <compiler-generated>:0
          frame #69: 0x00007fff639bdc23 libswiftCore.dylib`(extension in Swift):Swift.Sequence.map<A>((A.Element) throws -> A1) throws -> Swift.Array<A1> + 1331
          frame #70: 0x00000001087d2ee4 SwiftFormatter`SyntaxRewriter.visitChildren(nodeS=SwiftSyntax.CodeBlockItemListSyntax @ 0x00007fea3ed0c520, self=0x00007fea3ed019c0) at SyntaxRewriter.swift:1177:45
          frame #71: 0x00000001087b2bc8 SwiftFormatter`SyntaxRewriter.visit(node=SwiftSyntax.CodeBlockItemListSyntax @ 0x000070000b3cd3a0, self=0x00007fea3ed019c0) at SyntaxRewriter.swift:50:12
          frame #72: 0x00000001087c4325 SwiftFormatter`SyntaxRewriter.visit(node=SwiftSyntax.CodeBlockItemListSyntax @ 0x00007fea3ed0c4d0, self=0x00007fea3ed019c0) at SyntaxRewriter.swift:952:37
          frame #73: 0x00000001087d3761 SwiftFormatter`closure #1 in SyntaxRewriter.visitChildren(n=(Swift.Optional<SwiftSyntax.RawSyntax>, SwiftSyntax.AbsoluteSyntaxInfo) @ 0x000070000b3d3e98, node=SwiftSyntax.SourceFileSyntax @ 0x00007fea3ed0bb80, self=0x00007fea3ed019c0) at SyntaxRewriter.swift:1182:14
          frame #74: 0x00000001087d393d SwiftFormatter`thunk for @callee_guaranteed (@guaranteed RawSyntax?, @unowned AbsoluteSyntaxInfo) -> (@owned RawSyntax?, @error @owned Error) at <compiler-generated>:0
          frame #75: 0x00000001087d39b4 SwiftFormatter`partial apply for thunk for @callee_guaranteed (@guaranteed RawSyntax?, @unowned AbsoluteSyntaxInfo) -> (@owned RawSyntax?, @error @owned Error) at <compiler-generated>:0
          frame #76: 0x00007fff639bdc23 libswiftCore.dylib`(extension in Swift):Swift.Sequence.map<A>((A.Element) throws -> A1) throws -> Swift.Array<A1> + 1331
          frame #77: 0x00000001087d2ee4 SwiftFormatter`SyntaxRewriter.visitChildren(nodeS=SwiftSyntax.SourceFileSyntax @ 0x00007fea3ed0b8b0, self=0x00007fea3ed019c0) at SyntaxRewriter.swift:1177:45
          frame #78: 0x00000001087ba348 SwiftFormatter`SyntaxRewriter.visit(node=SwiftSyntax.SourceFileSyntax @ 0x000070000b3db2a0, self=0x00007fea3ed019c0) at SyntaxRewriter.swift:422:12
          frame #79: 0x00000001087cab10 SwiftFormatter`SyntaxRewriter.visit(node=SwiftSyntax.SourceFileSyntax @ 0x00007fea3ed03420, self=0x00007fea3ed019c0) at SyntaxRewriter.swift:1045:30
          frame #80: 0x00000001082cd468 SwiftFormatter`FormatPipeline.visit(node=SwiftSyntax.SourceFileSyntax @ 0x00007fea3ed060f0, self=SwiftFormat.FormatPipeline @ 0x000070000b3df878) at Pipelines+Generated.swift:280:48
          frame #81: 0x00000001082cf54a SwiftFormatter`SwiftFormatter.format<Output>(syntax=SwiftSyntax.SourceFileSyntax @ 0x000070000b3e00d0, url=Foundation.URL @ 0x000070000b3dfb50, outputStream=<no summary available>, self=0x00007fea88a0b590) at SwiftFormatter.swift:79:38
          frame #82: 0x00000001081be67c SwiftFormatter`FormatEntireFileCommand.perform(invocation=0x00007fea5ef00d80, completionHandler=0x00000001081bf360 SwiftFormatter`partial apply forwarder for reabstraction thunk helper from @escaping @callee_unowned @convention(block) (@unowned Swift.Optional<__C.NSError>) -> () to @escaping @callee_guaranteed (@guaranteed Swift.Optional<Swift.Error>) -> () at <compiler-generated>, self=0x00007fea5ef04230) at FormatEntireFileCommand.swift:27:27
          frame #83: 0x00000001081bf2fb SwiftFormatter`@objc FormatEntireFileCommand.perform(with:completionHandler:) at <compiler-generated>:0
          frame #84: 0x0000000109b80ba1 XcodeKit`-[_XCSourceEditorService performCommandInvocation:commandIdentifier:request:reply:] + 469
          frame #85: 0x00007fff3a4b3efb Foundation`__NSXPCCONNECTION_IS_CALLING_OUT_TO_EXPORTED_OBJECT_S4__ + 12
          frame #86: 0x00007fff3a458e7f Foundation`-[NSXPCConnection _decodeAndInvokeMessageWithEvent:flags:] + 2499
          frame #87: 0x00007fff3a458253 Foundation`message_handler + 215
          frame #88: 0x00007fff64350f08 libxpc.dylib`_xpc_connection_call_event_handler + 56
          frame #89: 0x00007fff6434ee9e libxpc.dylib`_xpc_connection_mach_event + 933
          frame #90: 0x00007fff640cf6dd libdispatch.dylib`_dispatch_client_callout4 + 9
          frame #91: 0x00007fff640e40d6 libdispatch.dylib`_dispatch_mach_msg_invoke + 436
          frame #92: 0x00007fff640d5792 libdispatch.dylib`_dispatch_lane_serial_drain + 268
          frame #93: 0x00007fff640e4c19 libdispatch.dylib`_dispatch_mach_invoke + 481
          frame #94: 0x00007fff640d5792 libdispatch.dylib`_dispatch_lane_serial_drain + 268
          frame #95: 0x00007fff640d63c6 libdispatch.dylib`_dispatch_lane_invoke + 433
          frame #96: 0x00007fff640de6ed libdispatch.dylib`_dispatch_workloop_worker_thread + 598
          frame #97: 0x00007fff6430f611 libsystem_pthread.dylib`_pthread_wqthread + 421
          frame #98: 0x00007fff6430f3fd libsystem_pthread.dylib`start_wqthread + 13

      I've uploaded the current state of the project to https://github.com/tonyarnold/XcodeSwiftFormatter as a reproduction of this crash.

      Please let me know if you'd like more detail on anything - I'm happy to help!

        Attachments

          Activity

            People

            Assignee:
            ahoppen Alex Hoppen
            Reporter:
            tonyarnold Tony Arnold
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: