Xcode hangs when editing bindings

Originator:macmade
Number:rdar://31049913 Date Originated:14-Mar-2017 11:57 PM
Status:Open Resolved:
Product:Developer Tools Product Version:
Classification:Crash/Hang/Data Loss Reproducible:Sometimes
 
Xcode sometimes hangs when editing a binding from InterfaceBuilder.

This mainly happens when the target application is already running through Xcode, but the crash is actually completely random.

It looks like the main threads hangs while trying to auto-complete the "Model Key Path" field, on the bindings utility palette.

--------------------------------------------------------------------------------

Steps to Reproduce:

Unfortunately, I've not been able to reproduce the problem on a test project, as it happens randomly.

--------------------------------------------------------------------------------

Expected Results:

The "Model Key Path" field of the bindings utility palette should allow editing, possibly showing auto-completion results from reflected properties.

--------------------------------------------------------------------------------

Actual Results:

The user interface becomes completely unresponsive, with a beach ball. Xcode has to be force-quitted...

--------------------------------------------------------------------------------

Version:

macOS 10.12.4 Beta (16E183b) / Xcode 8.2.1 (8C1002)

--------------------------------------------------------------------------------

Notes:

While experiencing this issues, I've attached LLDB to the Xcode process to obtain a backtrace of the hanged main thread.
Stack trace is attached. Might hopefully help to solve this issue...

--------------------------------------------------------------------------------

* thread #1: tid = 0x2660, 0x00007fffaf39a34a libsystem_kernel.dylib`mach_msg_trap + 10, queue = 'com.apple.main-thread', stop reason = signal SIGSTOP
  * frame #0: 0x00007fffaf39a34a libsystem_kernel.dylib`mach_msg_trap + 10
    frame #1: 0x00007fffaf399797 libsystem_kernel.dylib`mach_msg + 55
    frame #2: 0x00007fffaf257b93 libdispatch.dylib`_dispatch_mach_send_and_wait_for_reply + 591
    frame #3: 0x00007fffaf257ff9 libdispatch.dylib`dispatch_mach_send_with_result_and_wait_for_reply + 45
    frame #4: 0x00007fffaf4c65bc libxpc.dylib`xpc_connection_send_message_with_reply_sync + 154
    frame #5: 0x000000010eba15a0 SourceKit`sourcekit_send_request_sync + 96
    frame #6: 0x000000010cde9ba4 IDEFoundation`-[IDESourceKitLowLevelConnection sendRequestSync:] + 112
    frame #7: 0x000000010cde9d48 IDEFoundation`-[IDESourceKitLowLevelConnection sendRequestSync:error:] + 30
    frame #8: 0x000000010cc2eb4f IDEFoundation`-[IDESourceKitWorkspace(RequestMethods) typeSymbolForSymbolAtDocument:docLocation:fileContent:error:] + 583
    frame #9: 0x000000010caf2f2c IDEFoundation`-[IDESourceKitWorkspace typeSymbolForSymbol:withCurrentFileContentDictionary:] + 280
    frame #10: 0x0000000120a4a42b IDEInterfaceBuilderCocoaIntegration`__80-[IBCocoaBindingsSuggestedKeyPathProvider queryIndexForPropertiesInClassSymbol:]_block_invoke + 81
    frame #11: 0x0000000116e7ebba IBFoundation`IBArrayByMappingCollectionWithBehavior + 382
    frame #12: 0x0000000120a4a364 IDEInterfaceBuilderCocoaIntegration`-[IBCocoaBindingsSuggestedKeyPathProvider queryIndexForPropertiesInClassSymbol:] + 160
    frame #13: 0x0000000120a4a598 IDEInterfaceBuilderCocoaIntegration`-[IBCocoaBindingsSuggestedKeyPathProvider allPropertiesInClassHeirarchyForClassSymbol:] + 93
    frame #14: 0x0000000120a4867f IDEInterfaceBuilderCocoaIntegration`-[IBCocoaBindingsSuggestedKeyPathProvider queryIndexAndCacheAllBindingCompletionItemsInClassNamed:] + 89
    frame #15: 0x0000000120a4b8a3 IDEInterfaceBuilderCocoaIntegration`-[IBCocoaBindingsSuggestedKeyPathProvider bindingCompletionItemsForClassNamed:] + 264
    frame #16: 0x0000000120a49525 IDEInterfaceBuilderCocoaIntegration`-[IBCocoaBindingsSuggestedKeyPathProvider typeNameForAttributeNamed:inClassNamed:] + 83
    frame #17: 0x0000000120a49415 IDEInterfaceBuilderCocoaIntegration`-[IBCocoaBindingsSuggestedKeyPathProvider classNameForResolvedTypeOfKeyPath:fromController:] + 783
    frame #18: 0x0000000120a4bcef IDEInterfaceBuilderCocoaIntegration`-[IBCocoaBindingsSuggestedKeyPathProvider suggestedNextKeysForGivenKeyPath:fromController:] + 297
    frame #19: 0x0000000120a45319 IDEInterfaceBuilderCocoaIntegration`-[IBCocoaBindingsInspectorSlice control:textView:completions:forPartialWordRange:indexOfSelectedItem:] + 711
    frame #20: 0x00007fff97dc1dba AppKit`-[NSTextField textView:completions:forPartialWordRange:indexOfSelectedItem:] + 148
    frame #21: 0x0000000120a38951 IDEInterfaceBuilderCocoaIntegration`-[IBCocoaBindingsAutocompletingTextFieldEditor displayCompletions] + 135
    frame #22: 0x0000000120a38d58 IDEInterfaceBuilderCocoaIntegration`-[IBCocoaBindingsAutocompletingTextFieldEditor didChangeText] + 59
    frame #23: 0x00007fff97942eec AppKit`_NSDoUserReplaceForCharRange + 410
    frame #24: 0x00007fff97942d4c AppKit`_NSDoUserDeleteForCharRange + 38
    frame #25: 0x00007fff979b7ff3 AppKit`-[NSTextView(NSKeyBindingCommands) deleteBackward:] + 576
    frame #26: 0x00007fff977a9687 AppKit`-[NSTextView doCommandBySelector:] + 192
    frame #27: 0x00007fff977a95a1 AppKit`-[NSTextInputContext(NSInputContext_WithCompletion) doCommandBySelector:completionHandler:] + 118
    frame #28: 0x00007fff977871d0 AppKit`-[NSKeyBindingManager(NSKeyBindingManager_MultiClients) interpretEventAsCommand:forClient:] + 2218
    frame #29: 0x00007fff97fc8821 AppKit`__84-[NSTextInputContext _handleEvent:options:allowingSyntheticEvent:completionHandler:]_block_invoke.1096 + 355
    frame #30: 0x00007fff97fc8655 AppKit`__84-[NSTextInputContext _handleEvent:options:allowingSyntheticEvent:completionHandler:]_block_invoke_3 + 80
    frame #31: 0x00007fff9778f329 AppKit`-[NSTextInputContext tryHandleEvent_HasMarkedText_withDispatchCondition:dispatchWork:continuation:] + 93
    frame #32: 0x00007fff97fc85d0 AppKit`__84-[NSTextInputContext _handleEvent:options:allowingSyntheticEvent:completionHandler:]_block_invoke.1086 + 262
    frame #33: 0x00007fff9908989f HIToolbox`__TSMProcessRawKeyEventWithOptionsAndCompletionHandler_block_invoke_5 + 70
    frame #34: 0x00007fff990886e2 HIToolbox`___ZL23DispatchEventToHandlersP14EventTargetRecP14OpaqueEventRefP14HandlerCallRec_block_invoke + 108
    frame #35: 0x00007fff97fc1568 AppKit`__55-[NSTextInputContext handleTSMEvent:completionHandler:]_block_invoke.314 + 2874
    frame #36: 0x00007fff97788c05 AppKit`__55-[NSTextInputContext handleTSMEvent:completionHandler:]_block_invoke_2 + 80
    frame #37: 0x00007fff97788b84 AppKit`-[NSTextInputContext tryHandleTSMEvent_HasMarkedText_withDispatchCondition:dispatchWork:continuation:] + 93
    frame #38: 0x00007fff9778856f AppKit`-[NSTextInputContext handleTSMEvent:completionHandler:] + 2221
    frame #39: 0x00007fff97787c53 AppKit`_NSTSMEventHandler + 321
    frame #40: 0x00007fff9902ed85 HIToolbox`DispatchEventToHandlers(EventTargetRec*, OpaqueEventRef*, HandlerCallRec*) + 1708
    frame #41: 0x00007fff9902dff6 HIToolbox`SendEventToEventTargetInternal(OpaqueEventRef*, OpaqueEventTargetRef*, HandlerCallRec*) + 428
    frame #42: 0x00007fff9902de3f HIToolbox`SendEventToEventTargetWithOptions + 43
    frame #43: 0x00007fff990856d6 HIToolbox`SendTSMEvent_WithCompletionHandler + 408
    frame #44: 0x00007fff99085bb1 HIToolbox`__SendUnicodeTextAEToUnicodeDoc_WithCompletionHandler_block_invoke + 400
    frame #45: 0x00007fff99085a12 HIToolbox`__SendFilterTextEvent_WithCompletionHandler_block_invoke + 215
    frame #46: 0x00007fff99085727 HIToolbox`SendTSMEvent_WithCompletionHandler + 489
    frame #47: 0x00007fff99085511 HIToolbox`SendFilterTextEvent_WithCompletionHandler + 236
    frame #48: 0x00007fff990851d6 HIToolbox`SendUnicodeTextAEToUnicodeDoc_WithCompletionHandler + 284
    frame #49: 0x00007fff99084f8c HIToolbox`__utDeliverTSMEvent_WithCompletionHandler_block_invoke_2 + 296
    frame #50: 0x00007fff99084e32 HIToolbox`__utDeliverTSMEvent_WithCompletionHandler_block_invoke + 439
    frame #51: 0x00007fff99084bf9 HIToolbox`TSMKeyEvent_WithCompletionHandler + 632
    frame #52: 0x00007fff99084948 HIToolbox`__TSMProcessRawKeyEventWithOptionsAndCompletionHandler_block_invoke_4 + 251
    frame #53: 0x00007fff99084775 HIToolbox`__TSMProcessRawKeyEventWithOptionsAndCompletionHandler_block_invoke_3 + 281
    frame #54: 0x00007fff9908448b HIToolbox`__TSMProcessRawKeyEventWithOptionsAndCompletionHandler_block_invoke_2 + 308
    frame #55: 0x00007fff990841c2 HIToolbox`__TSMProcessRawKeyEventWithOptionsAndCompletionHandler_block_invoke + 300
    frame #56: 0x00007fff9908373a HIToolbox`TSMProcessRawKeyEventWithOptionsAndCompletionHandler + 3604
    frame #57: 0x00007fff97fc8441 AppKit`__84-[NSTextInputContext _handleEvent:options:allowingSyntheticEvent:completionHandler:]_block_invoke.1077 + 116
    frame #58: 0x00007fff97fc76f9 AppKit`__204-[NSTextInputContext tryTSMProcessRawKeyEvent_orSubstitution:dispatchCondition:setupForDispatch:furtherCondition:doubleSpaceSubstitutionCondition:doubleSpaceSubstitutionWork:dispatchTSMWork:continuation:]_block_invoke.1003 + 121
    frame #59: 0x00007fff97fc7563 AppKit`-[NSTextInputContext tryTSMProcessRawKeyEvent_orSubstitution:dispatchCondition:setupForDispatch:furtherCondition:doubleSpaceSubstitutionCondition:doubleSpaceSubstitutionWork:dispatchTSMWork:continuation:] + 285
    frame #60: 0x00007fff97fc7e8b AppKit`-[NSTextInputContext _handleEvent:options:allowingSyntheticEvent:completionHandler:] + 1515
    frame #61: 0x00007fff97fc73d2 AppKit`-[NSTextInputContext _handleEvent:allowingSyntheticEvent:] + 114
    frame #62: 0x00007fff9778665b AppKit`-[NSView interpretKeyEvents:] + 232
    frame #63: 0x00007fff97786471 AppKit`-[NSTextView keyDown:] + 704
    frame #64: 0x0000000120a38ea9 IDEInterfaceBuilderCocoaIntegration`-[IBCocoaBindingsAutocompletingTextFieldEditor handleKeyDown:] + 330
    frame #65: 0x00007fff97ee833c AppKit`-[NSWindow(NSEventRouting) _reallySendEvent:isDelayedEvent:] + 4086
    frame #66: 0x00007fff97ee6f7a AppKit`-[NSWindow(NSEventRouting) sendEvent:] + 541
    frame #67: 0x000000010d69fcca IDEKit`-[IDEWorkspaceWindow sendEvent:] + 155
    frame #68: 0x00007fff97d6c518 AppKit`-[NSApplication(NSEvent) sendEvent:] + 4768
    frame #69: 0x000000010d6e4991 IDEKit`-[IDEApplication sendEvent:] + 970
    frame #70: 0x00007fff975e67f7 AppKit`-[NSApplication run] + 1002
    frame #71: 0x00007fff975b11de AppKit`NSApplicationMain + 1237
    frame #72: 0x00007fffaf273235 libdyld.dylib`start + 1

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!