0

I write a macOS app with SwiftUI, Xcode crashed at AppDelegate, but not crash every time. I have tried to add Exception Breakpoint, but it didn't work. The probably code as below

    var body: some View {
        ZStack {
            if updateTrackingPoint {
                ForEach(faceMark.points, id: \.id, content: { point in
                    self.circleViewForPoint(point)
                }).allowsHitTesting(true)
            } else if canvasViewModel.showHandGesturePoints {
                ForEach(faceMark.points.filter{ return $0.id >= 110 && $0.id <= 114 }, id: \.id, content: { point in
                    self.circleViewForPoint(point)
                }).allowsHitTesting(true)
            } else {
                ForEach(faceMark.points, id: \.id, content: { point in
                    self.circleViewForPoint(point)
                }).allowsHitTesting(false)
            }
        }
    }

Here is the crash stack.

* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0)
    frame #0: 0x00007fff42052f3d SwiftUI`SwiftUI._VariadicView_Children.subscript.read : (Swift.Int) -> SwiftUI._VariadicView_Children.Element + 205
    frame #1: 0x00007fff42052e39 SwiftUI`protocol witness for Swift.Collection.subscript.read : (A.Index) -> A.Element in conformance SwiftUI._VariadicView_Children : Swift.Collection in SwiftUI + 41
    frame #2: 0x00007fff41e0dd21 SwiftUI`SwiftUI.(ForEachChild in _00713678F075B914F7FE0E74B0A90E85).updateValue() -> () + 785
    frame #3: 0x00007fff41a56b2a SwiftUI`partial apply forwarder for implicit closure #2 (Swift.UnsafeMutableRawPointer, __C.AGAttribute) -> () in implicit closure #1 (A1.Type) -> (Swift.UnsafeMutableRawPointer, __C.AGAttribute) -> () in closure #1 () -> (Swift.UnsafeMutableRawPointer, __C.AGAttribute) -> () in closure #1 (Swift.UnsafePointer<A1>) -> AttributeGraph.Attribute<A> in AttributeGraph.Attribute.init<A where A == A1.Value, A1: AttributeGraph.StatefulRule>(A1) -> AttributeGraph.Attribute<A> + 26
    frame #4: 0x00007fff4250417f AttributeGraph`AG::Graph::UpdateStack::update() + 505
    frame #5: 0x00007fff42504608 AttributeGraph`AG::Graph::update_attribute(AG::data::ptr<AG::Node>, bool) + 322
    frame #6: 0x00007fff425095bb AttributeGraph`AG::Graph::input_value_ref_slow(AG::data::ptr<AG::Node>, AG::AttributeID, unsigned int, AGSwiftMetadata const*, bool*, long) + 523
    frame #7: 0x00007fff4251aafd AttributeGraph`AGGraphGetValue + 198
    frame #8: 0x00007fff4193ad47 SwiftUI`SwiftUI.LazyMenuContent.itemList.getter : Swift.Optional<SwiftUI.PlatformItemList> + 39
    frame #9: 0x00007fff4193af5d SwiftUI`SwiftUI.LazyMenuContent.updateValue() -> () + 509
    frame #10: 0x00007fff41a56b2a SwiftUI`partial apply forwarder for implicit closure #2 (Swift.UnsafeMutableRawPointer, __C.AGAttribute) -> () in implicit closure #1 (A1.Type) -> (Swift.UnsafeMutableRawPointer, __C.AGAttribute) -> () in closure #1 () -> (Swift.UnsafeMutableRawPointer, __C.AGAttribute) -> () in closure #1 (Swift.UnsafePointer<A1>) -> AttributeGraph.Attribute<A> in AttributeGraph.Attribute.init<A where A == A1.Value, A1: AttributeGraph.StatefulRule>(A1) -> AttributeGraph.Attribute<A> + 26
    frame #11: 0x00007fff4250417f AttributeGraph`AG::Graph::UpdateStack::update() + 505
    frame #12: 0x00007fff42504608 AttributeGraph`AG::Graph::update_attribute(AG::data::ptr<AG::Node>, bool) + 322
    frame #13: 0x00007fff4250909a AttributeGraph`AG::Graph::value_ref(AG::AttributeID, AGSwiftMetadata const*, bool*) + 130
    frame #14: 0x00007fff4251ab4b AttributeGraph`AGGraphGetValue + 276
    frame #15: 0x00007fff41f09f43 SwiftUI`generic specialization <SwiftUI._ResolvedPopUpButton.DetailLabel> of SwiftUI.AppKitPopUpButton.(PlatformView in _9826ADB71E4B5CD44D3C087EB61B7359).Coordinator.menuNeedsUpdate(__C.NSMenu) -> () + 227
    frame #16: 0x00007fff41f09bd8 SwiftUI`generic specialization <SwiftUI._ResolvedPopUpButton.DetailLabel> of SwiftUI.AppKitPopUpButton.(PlatformView in _9826ADB71E4B5CD44D3C087EB61B7359).updateNSView(_: __C.NSPopUpButton, context: SwiftUI.NSViewRepresentableContext<SwiftUI.AppKitPopUpButton<A>.(PlatformView in _9826ADB71E4B5CD44D3C087EB61B7359)>) -> () + 936
    frame #17: 0x00007fff41ea1160 SwiftUI`generic specialization <SwiftUI.AppKitPopUpButton<SwiftUI._ResolvedPopUpButton.DetailLabel>.(PlatformView in _9826ADB71E4B5CD44D3C087EB61B7359)> of SwiftUI.(PlatformViewRepresentableAdaptor in _38FE679A85C91B802D25DB73BF37B09F).updateViewProvider(_: A.NSViewType, context: SwiftUI.PlatformViewRepresentableContext<SwiftUI.(PlatformViewRepresentableAdaptor in _38FE679A85C91B802D25DB73BF37B09F)<A>>) -> () + 240
    frame #18: 0x00007fff41f21a26 SwiftUI`merged generic specialization <SwiftUI.(PlatformViewRepresentableAdaptor in _38FE679A85C91B802D25DB73BF37B09F)<SwiftUI.AppKitPopUpButton<SwiftUI._ResolvedPopUpButton.DetailLabel>.(PlatformView in _9826ADB71E4B5CD44D3C087EB61B7359)>> of closure #1 () -> () in closure #1 () -> () in closure #4 () -> () in closure #1 () -> () in SwiftUI.(PlatformViewChild in _A513612C07DFA438E70B9FA90719B40D).updateValue() -> () + 134
    frame #19: 0x00007fff41f2054f SwiftUI`generic specialization <SwiftUI.(PlatformViewRepresentableAdaptor in _38FE679A85C91B802D25DB73BF37B09F)<SwiftUI.AppKitPopUpButton<SwiftUI._ResolvedPopUpButton.DetailLabel>.(PlatformView in _9826ADB71E4B5CD44D3C087EB61B7359)>> of closure #1 () -> () in closure #4 () -> () in closure #1 () -> () in SwiftUI.(PlatformViewChild in _A513612C07DFA438E70B9FA90719B40D).updateValue() -> () + 223
    frame #20: 0x00007fff421af78a SwiftUI`(extension in SwiftUI):SwiftUI.ViewRendererHost.performExternalUpdate(() -> ()) -> () + 186
    frame #21: 0x00007fff41f12614 SwiftUI`generic specialization <SwiftUI.(PlatformViewRepresentableAdaptor in _38FE679A85C91B802D25DB73BF37B09F)<SwiftUI.AppKitPopUpButton<SwiftUI._ResolvedPopUpButton.DetailLabel>.(PlatformView in _9826ADB71E4B5CD44D3C087EB61B7359)>> of closure #1 () -> () in SwiftUI.(PlatformViewChild in _A513612C07DFA438E70B9FA90719B40D).updateValue() -> () + 1956
    frame #22: 0x00007fff41f1145d SwiftUI`merged generic specialization <SwiftUI.(PlatformViewRepresentableAdaptor in _38FE679A85C91B802D25DB73BF37B09F)<SwiftUI.AppKitPopUpButton<SwiftUI._ResolvedPopUpButton.DetailLabel>.(PlatformView in _9826ADB71E4B5CD44D3C087EB61B7359)>> of SwiftUI.(PlatformViewChild in _A513612C07DFA438E70B9FA90719B40D).updateValue() -> () + 637
    frame #23: 0x00007fff41fbdd90 SwiftUI`partial apply forwarder for generic specialization <SwiftUI.ModifiedContent<SwiftUI.ModifiedContent<SwiftUI.ModifiedContent<SwiftUI.ViewLeafView<SwiftUI.(PlatformViewRepresentableAdaptor in _38FE679A85C91B802D25DB73BF37B09F)<SwiftUI.AppKitPopUpButton<SwiftUI._ResolvedPopUpButton.DetailLabel>.(PlatformView in _9826ADB71E4B5CD44D3C087EB61B7359)>>, SwiftUI.AccessibilityPlatformModifier>, SwiftUI._AlignmentWritingModifier>, SwiftUI._AlignmentWritingModifier>, SwiftUI.(PlatformViewChild in _A513612C07DFA438E70B9FA90719B40D)<SwiftUI.(PlatformViewRepresentableAdaptor in _38FE679A85C91B802D25DB73BF37B09F)<SwiftUI.AppKitPopUpButton<SwiftUI._ResolvedPopUpButton.DetailLabel>.(PlatformView in _9826ADB71E4B5CD44D3C087EB61B7359)>>> of implicit closure #2 (Swift.UnsafeMutableRawPointer, __C.AGAttribute) -> () in implicit closure #1 (A1.Type) -> (Swift.UnsafeMutableRawPointer, __C.AGAttribute) -> () in closure #1 () -> (Swift.UnsafeMutableRawPointer, __C.AGAttribute) -> () in closure #1 (Swift.UnsafePointer<A1>) -> AttributeGraph.Attribute<A> in AttributeGraph.Attribute.init<A where A == A1.Value, A1: AttributeGraph.StatefulRule>(A1) -> AttributeGraph.Attribute<A> + 32
    frame #24: 0x00007fff4250417f AttributeGraph`AG::Graph::UpdateStack::update() + 505
    frame #25: 0x00007fff42504608 AttributeGraph`AG::Graph::update_attribute(AG::data::ptr<AG::Node>, bool) + 322
    frame #26: 0x00007fff425095bb AttributeGraph`AG::Graph::input_value_ref_slow(AG::data::ptr<AG::Node>, AG::AttributeID, unsigned int, AGSwiftMetadata const*, bool*, long) + 523
    frame #27: 0x00007fff4251aafd AttributeGraph`AGGraphGetValue + 198
    frame #28: 0x00007fff41ccc6e1 SwiftUI`SwiftUI.(AlignmentModifiedLayoutComputer in _3A1D0350CBB400C95A809DBE8B845F0C).updateValue() -> () + 33
    frame #29: 0x00007fff41fc626f SwiftUI`partial apply forwarder for generic specialization <SwiftUI.LayoutComputer, SwiftUI.(AlignmentModifiedLayoutComputer in _3A1D0350CBB400C95A809DBE8B845F0C)> of implicit closure #2 (Swift.UnsafeMutableRawPointer, __C.AGAttribute) -> () in implicit closure #1 (A1.Type) -> (Swift.UnsafeMutableRawPointer, __C.AGAttribute) -> () in closure #1 () -> (Swift.UnsafeMutableRawPointer, __C.AGAttribute) -> () in closure #1 (Swift.UnsafePointer<A1>) -> AttributeGraph.Attribute<A> in AttributeGraph.Attribute.init<A where A == A1.Value, A1: AttributeGraph.StatefulRule>(A1) -> AttributeGraph.Attribute<A> + 15
    frame #30: 0x00007fff4250417f AttributeGraph`AG::Graph::UpdateStack::update() + 505
    frame #31: 0x00007fff42504608 AttributeGraph`AG::Graph::update_attribute(AG::data::ptr<AG::Node>, bool) + 322
    frame #32: 0x00007fff425095bb AttributeGraph`AG::Graph::input_value_ref_slow(AG::data::ptr<AG::Node>, AG::AttributeID, unsigned int, AGSwiftMetadata const*, bool*, long) + 523
    frame #33: 0x00007fff4251a923 AttributeGraph`AGGraphGetInputValue + 234
    frame #34: 0x00007fff41bb6bfe SwiftUI`generic specialization <SwiftUI._AlignmentLayout> of (extension in SwiftUI):SwiftUI.UnaryLayout.spacing(in: SwiftUI.SizeAndSpacingContext, child: SwiftUI.LayoutProxy) -> SwiftUI.Spacing + 62
    frame #35: 0x00007fff41ccafbd SwiftUI`SwiftUI.LayoutComputer.EngineDelegate.spacing() -> SwiftUI.Spacing + 61
    frame #36: 0x00007fff423237b7 SwiftUI`accumulateSpacing #1 (ofChild: Swift.Int) -> CoreGraphics.CGFloat in SwiftUI.StackLayout.(Header in _68D684484B5AEF917B6B8353D57CF590).init(layoutContext: SwiftUI.SizeAndSpacingContext, proxies: SwiftUI.LayoutProxyCollection, majorAxis: SwiftUI.Axis, minorAxisAlignment: SwiftUI.AlignmentKey, uniformSpacing: Swift.Optional<CoreGraphics.CGFloat>, childStorage: Swift.UnsafeMutablePointer<SwiftUI.StackLayout.(Child in _68D684484B5AEF917B6B8353D57CF590)>, capacity: Swift.Int, resizeChildrenWithTrailingOverflow: Swift.Bool) -> SwiftUI.StackLayout.(Header in _68D684484B5AEF917B6B8353D57CF590) + 279
    frame #37: 0x00007fff4232330e SwiftUI`SwiftUI.StackLayout.(Header in _68D684484B5AEF917B6B8353D57CF590).init(layoutContext: SwiftUI.SizeAndSpacingContext, proxies: SwiftUI.LayoutProxyCollection, majorAxis: SwiftUI.Axis, minorAxisAlignment: SwiftUI.AlignmentKey, uniformSpacing: Swift.Optional<CoreGraphics.CGFloat>, childStorage: Swift.UnsafeMutablePointer<SwiftUI.StackLayout.(Child in _68D684484B5AEF917B6B8353D57CF590)>, capacity: Swift.Int, resizeChildrenWithTrailingOverflow: Swift.Bool) -> SwiftUI.StackLayout.(Header in _68D684484B5AEF917B6B8353D57CF590) + 414
    frame #38: 0x00007fff42322ff7 SwiftUI`closure #1 (SwiftUI.StackLayout.(UnmanagedImplementation in _68D684484B5AEF917B6B8353D57CF590)) -> Swift.Bool in SwiftUI.StackLayout.(Storage in _68D684484B5AEF917B6B8353D57CF590).update(layoutContext: SwiftUI.SizeAndSpacingContext, children: SwiftUI.LayoutProxyCollection, majorAxis: SwiftUI.Axis, minorAxisAlignment: SwiftUI.AlignmentKey, uniformSpacing: Swift.Optional<CoreGraphics.CGFloat>) -> Swift.Bool + 167
    frame #39: 0x00007fff4232259f SwiftUI`function signature specialization <Arg[0] = [Closure Propagated : closure #1 (SwiftUI.StackLayout.(UnmanagedImplementation in _68D684484B5AEF917B6B8353D57CF590)) -> Swift.Bool in SwiftUI.StackLayout.(Storage in _68D684484B5AEF917B6B8353D57CF590).update(layoutContext: SwiftUI.SizeAndSpacingContext, children: SwiftUI.LayoutProxyCollection, majorAxis: SwiftUI.Axis, minorAxisAlignment: SwiftUI.AlignmentKey, uniformSpacing: Swift.Optional<CoreGraphics.CGFloat>) -> Swift.Bool, Argument Types : [SwiftUI.LayoutProxyCollectionSwiftUI.SizeAndSpacingContextSwiftUI.AxisSwiftUI.AlignmentKeySwift.Optional<CoreGraphics.CGFloat>]> of generic specialization <Swift.Bool> of SwiftUI.StackLayout.(Storage in _68D684484B5AEF917B6B8353D57CF590).withUnmanagedImplementation<A>((SwiftUI.StackLayout.(UnmanagedImplementation in _68D684484B5AEF917B6B8353D57CF590)) -> A) -> A + 143
    frame #40: 0x00007fff41f32bb9 SwiftUI`merged generic specialization <SwiftUI._HStackLayout, SwiftUI.(StaticLayoutComputer in _B0B50B213A0802E1084335D0AD6CD036)<SwiftUI._HStackLayout>> of closure #1 (SwiftUI.StackLayout.(Storage in _68D684484B5AEF917B6B8353D57CF590)) -> Swift.Bool in (extension in SwiftUI):SwiftUI.HVStack.updateLayoutComputer<A where A1: AttributeGraph.StatefulRule, A1.Value == SwiftUI.LayoutComputer>(rule: inout A1, layoutContext: SwiftUI.SizeAndSpacingContext, children: SwiftUI.LayoutProxyCollection) -> () + 105
    frame #41: 0x00007fff41fb5405 SwiftUI`merged generic not re-abstracted specialization <SwiftUI._HStackLayout, SwiftUI.(StaticLayoutComputer in _B0B50B213A0802E1084335D0AD6CD036)<SwiftUI._HStackLayout>> of closure #1 (SwiftUI.StackLayout.(Storage in _68D684484B5AEF917B6B8353D57CF590)) -> Swift.Bool in (extension in SwiftUI):SwiftUI.HVStack.updateLayoutComputer<A where A1: AttributeGraph.StatefulRule, A1.Value == SwiftUI.LayoutComputer>(rule: inout A1, layoutContext: SwiftUI.SizeAndSpacingContext, children: SwiftUI.LayoutProxyCollection) -> () + 37
    frame #42: 0x00007fff41fc3f16 SwiftUI`merged partial apply forwarder for generic not re-abstracted specialization <SwiftUI._VStackLayout, SwiftUI.(StaticLayoutComputer in _B0B50B213A0802E1084335D0AD6CD036)<SwiftUI._VStackLayout>> of closure #1 (SwiftUI.StackLayout.(Storage in _68D684484B5AEF917B6B8353D57CF590)) -> Swift.Bool in (extension in SwiftUI):SwiftUI.HVStack.updateLayoutComputer<A where A1: AttributeGraph.StatefulRule, A1.Value == SwiftUI.LayoutComputer>(rule: inout A1, layoutContext: SwiftUI.SizeAndSpacingContext, children: SwiftUI.LayoutProxyCollection) -> () + 38
    frame #43: 0x00007fff41ed57f9 SwiftUI`generic specialization <SwiftUI.StackLayout.(Storage in _68D684484B5AEF917B6B8353D57CF590), SwiftUI.(StaticLayoutComputer in _B0B50B213A0802E1084335D0AD6CD036)<SwiftUI._FormVStackLayout>> of static (extension in SwiftUI):SwiftUI.LayoutComputerDelegate.update<A where A1: AttributeGraph.StatefulRule, A1.Value == SwiftUI.LayoutComputer>(_: inout A1, maybeInPlace: (A) -> Swift.Bool, create: () -> A) -> () + 105
    frame #44: 0x00007fff41e911f0 SwiftUI`merged generic specialization <SwiftUI.(StaticLayoutComputer in _B0B50B213A0802E1084335D0AD6CD036)<SwiftUI._HStackLayout>, SwiftUI._HStackLayout> of (extension in SwiftUI):AttributeGraph.StatefulRule< where A.Value == SwiftUI.LayoutComputer>.updateLayoutComputer<A where A1: SwiftUI._Layout>(layout: A1, environment: AttributeGraph.Attribute<SwiftUI.EnvironmentValues>, layoutComputers: Swift.Array<AttributeGraph.OptionalAttribute<SwiftUI.LayoutComputer>>) -> () + 176
    frame #45: 0x00007fff41fad9a3 SwiftUI`merged generic specialization <SwiftUI.LayoutComputer, SwiftUI.(StaticLayoutComputer in _B0B50B213A0802E1084335D0AD6CD036)<SwiftUI._HStackLayout>> of implicit closure #2 (Swift.UnsafeMutableRawPointer, __C.AGAttribute) -> () in implicit closure #1 (A1.Type) -> (Swift.UnsafeMutableRawPointer, __C.AGAttribute) -> () in closure #1 () -> (Swift.UnsafeMutableRawPointer, __C.AGAttribute) -> () in closure #1 (Swift.UnsafePointer<A1>) -> AttributeGraph.Attribute<A> in AttributeGraph.Attribute.init<A where A == A1.Value, A1: AttributeGraph.StatefulRule>(A1) -> AttributeGraph.Attribute<A> + 115
    frame #46: 0x00007fff41fbcc32 SwiftUI`partial apply forwarder for generic specialization <SwiftUI.LayoutComputer, SwiftUI.(StaticLayoutComputer in _B0B50B213A0802E1084335D0AD6CD036)<SwiftUI._VStackLayout>> of implicit closure #2 (Swift.UnsafeMutableRawPointer, __C.AGAttribute) -> () in implicit closure #1 (A1.Type) -> (Swift.UnsafeMutableRawPointer, __C.AGAttribute) -> () in closure #1 () -> (Swift.UnsafeMutableRawPointer, __C.AGAttribute) -> () in closure #1 (Swift.UnsafePointer<A1>) -> AttributeGraph.Attribute<A> in AttributeGraph.Attribute.init<A where A == A1.Value, A1: AttributeGraph.StatefulRule>(A1) -> AttributeGraph.Attribute<A> + 34
    frame #47: 0x00007fff4250417f AttributeGraph`AG::Graph::UpdateStack::update() + 505
    frame #48: 0x00007fff42504608 AttributeGraph`AG::Graph::update_attribute(AG::data::ptr<AG::Node>, bool) + 322
    frame #49: 0x00007fff4250c8f3 AttributeGraph`AG::Subgraph::update(unsigned int) + 781
    frame #50: 0x00007fff422f3b6a SwiftUI`SwiftUI.GraphHost.runTransaction() -> () + 186
    frame #51: 0x00007fff422f50af SwiftUI`SwiftUI.GraphHost.(runTransaction in _30C09FF16BC95EC5173809B57186CAC3)(SwiftUI.(AsyncTransaction in _30C09FF16BC95EC5173809B57186CAC3)) -> () + 79
    frame #52: 0x00007fff422f43a9 SwiftUI`SwiftUI.GraphHost.flushTransactions() -> () + 217
    frame #53: 0x00007fff422f504f SwiftUI`closure #1 (SwiftUI.GraphHost) -> () in closure #1 () -> () in SwiftUI.GraphHost.asyncTransaction<A where A: SwiftUI.GraphMutation>(_: SwiftUI.Transaction, mutation: A, style: SwiftUI._GraphMutation_Style) -> () + 15
    frame #54: 0x00007fff422f4c19 SwiftUI`function signature specialization <Arg[2] = [Constant Propagated Function : closure #1 (SwiftUI.GraphHost) -> () in closure #1 () -> () in SwiftUI.GraphHost.asyncTransaction<A where A: SwiftUI.GraphMutation>(_: SwiftUI.Transaction, mutation: A, style: SwiftUI._GraphMutation_Style) -> ()]> of reabstraction thunk helper from @callee_guaranteed (@guaranteed SwiftUI.GraphHost) -> () to @escaping @callee_guaranteed (@guaranteed SwiftUI.GraphHost) -> (@out ()) + 9
    frame #55: 0x00007fff41ba91a1 SwiftUI`partial apply forwarder for closure #1 (SwiftUI.ViewGraph) -> A1 in (extension in SwiftUI):SwiftUI.ViewGraphDelegate.updateGraph<A>(body: (SwiftUI.GraphHost) -> A1) -> A1 + 17
    frame #56: 0x00007fff421b05ea SwiftUI`closure #1 () -> A1 in (extension in SwiftUI):SwiftUI.ViewRendererHost.updateViewGraph<A>(body: (SwiftUI.ViewGraph) -> A1) -> A1 + 74
    frame #57: 0x00007fff421ae849 SwiftUI`(extension in SwiftUI):SwiftUI.ViewRendererHost.updateViewGraph<A>(body: (SwiftUI.ViewGraph) -> A1) -> A1 + 73
    frame #58: 0x00007fff421ba2d9 SwiftUI`protocol witness for SwiftUI.ViewGraphDelegate.updateViewGraph<A>(body: (SwiftUI.ViewGraph) -> A1) -> A1 in conformance SwiftUI.NSHostingView<A1> : SwiftUI.ViewGraphDelegate in SwiftUI + 25
    frame #59: 0x00007fff41ba4f27 SwiftUI`(extension in SwiftUI):SwiftUI.ViewGraphDelegate.updateGraph<A>(body: (SwiftUI.GraphHost) -> A1) -> A1 + 55
    frame #60: 0x00007fff41ba9149 SwiftUI`protocol witness for SwiftUI.GraphDelegate.updateGraph<A>(body: (SwiftUI.GraphHost) -> A1) -> A1 in conformance SwiftUI.NSHostingView<A1> : SwiftUI.GraphDelegate in SwiftUI + 25
    frame #61: 0x00007fff422f502a SwiftUI`merged closure #1 () -> () in SwiftUI.GraphHost.init(data: SwiftUI.GraphHost.Data) -> SwiftUI.GraphHost + 122
    frame #62: 0x00007fff41baab8c SwiftUI`reabstraction thunk helper from @escaping @callee_guaranteed () -> () to @escaping @callee_guaranteed () -> (@out ()) + 12
    frame #63: 0x00007fff4220a5d1 SwiftUI`partial apply forwarder for reabstraction thunk helper from @escaping @callee_guaranteed () -> () to @escaping @callee_guaranteed () -> (@out ()) + 17
    frame #64: 0x00007fff42208266 SwiftUI`static (extension in SwiftUI):__C.NSRunLoop.flushObservers() -> () + 118
    frame #65: 0x00007fff4220a519 SwiftUI`closure #1 () -> () in closure #1 (Swift.Optional<__C.CFRunLoopObserverRef>, __C.CFRunLoopActivity, Swift.Optional<Swift.UnsafeMutableRawPointer>) -> () in static (extension in SwiftUI):__C.NSRunLoop.addObserver(() -> ()) -> () + 9
    frame #66: 0x00007fff4220597e SwiftUI`function signature specialization <Arg[1] = [Constant Propagated Function : closure #1 () -> () in closure #1 (Swift.Optional<__C.CFRunLoopObserverRef>, __C.CFRunLoopActivity, Swift.Optional<Swift.UnsafeMutableRawPointer>) -> () in static (extension in SwiftUI):__C.NSRunLoop.addObserver(() -> ()) -> ()]> of reabstraction thunk helper from @callee_guaranteed () -> (@error @owned Swift.Error) to @escaping @callee_guaranteed () -> (@out (), @error @owned Swift.Error) + 14
    frame #67: 0x00007fff33592d9e libswiftObjectiveC.dylib`ObjectiveC.autoreleasepool<A>(invoking: () throws -> A) throws -> A + 46
    frame #68: 0x00007fff4220a503 SwiftUI`closure #1 (Swift.Optional<__C.CFRunLoopObserverRef>, __C.CFRunLoopActivity, Swift.Optional<Swift.UnsafeMutableRawPointer>) -> () in static (extension in SwiftUI):__C.NSRunLoop.addObserver(() -> ()) -> () + 35
    frame #69: 0x00007fff4220a54b SwiftUI`@objc closure #1 (Swift.Optional<__C.CFRunLoopObserverRef>, __C.CFRunLoopActivity, Swift.Optional<Swift.UnsafeMutableRawPointer>) -> () in static (extension in SwiftUI):__C.NSRunLoop.addObserver(() -> ()) -> () + 43
    frame #70: 0x00007fff2040cd9d CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23
    frame #71: 0x00007fff2040cc2d CoreFoundation`__CFRunLoopDoObservers + 549
    frame #72: 0x00007fff2040b736 CoreFoundation`CFRunLoopRunSpecific + 683
    frame #73: 0x00007fff28677fd0 HIToolbox`RunCurrentEventLoopInMode + 292
    frame #74: 0x00007fff28677c22 HIToolbox`ReceiveNextEventCommon + 283
    frame #75: 0x00007fff28677aef HIToolbox`_BlockUntilNextEventMatchingListInModeWithFilter + 64
    frame #76: 0x00007fff22c24f85 AppKit`_DPSNextEvent + 883
    frame #77: 0x00007fff22c2374b AppKit`-[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 1366
    frame #78: 0x00007fff22c15bda AppKit`-[NSApplication run] + 586
    frame #79: 0x00007fff22be9f31 AppKit`NSApplicationMain + 816
  * frame #80: 0x0000000109bd27fd MusesEffecter`main at AppDelegate.swift:13:7
    frame #81: 0x00007fff20330631 libdyld.dylib`start + 1

Not crash every time, but the probability is very high, crash both on Debug or Release.

Does anyone have any idea how to locate the trouble code?

Mingbao
  • 11
  • 4

1 Answers1

0

This crash seems related to Picker in SwiftUI My code is very similar to the code in this bug reports http://openradar.appspot.com/7385870

Mingbao
  • 11
  • 4