Xcode 在颜色面板中选择选项卡时崩溃

Xcode crashes on selecting tab in color panel

我几个小时前就遇到了这个奇怪的问题,而且它突然开始了。每当我尝试在 Xcode 的颜色面板中 select 不同的选项卡时,整个 Xcode 都会因错误而崩溃,

UNCAUGHT EXCEPTION (NSRangeException): Cannot remove an observer <NSColorPickerPageableNameListScrollView 0x7fb8f6ce0910> for the key path "contentLayoutRect" from <HighlightColorPanel 0x7fb8f6c94af0> because it is not registered as an observer.

以下是错误的完整堆栈跟踪,

    Process:               Xcode [1958]
    Path:                  /Applications/Xcode.app/Contents/MacOS/Xcode
    Identifier:            com.apple.dt.Xcode
    Version:               6.3.2 (7718)
    Build Info:            IDEFrameworks-7718000000000000~2
    App Item ID:           497799835
    App External ID:       812404257
    Code Type:             X86-64 (Native)
    Parent Process:        ??? [1]
    Responsible:           Xcode [1958]
    User ID:               501

    Date/Time:             2015-06-20 13:50:18.080 +0530
    OS Version:            Mac OS X 10.10.3 (14D136)
    Report Version:        11
    Anonymous UUID:        1A8B5EF9-7E79-106C-D0F5-5648FF5FD699


Time Awake Since Boot: 6500 seconds

Crashed Thread:        0  Dispatch queue: com.apple.main-thread

Exception Type:        EXC_CRASH (SIGABRT)
Exception Codes:       0x0000000000000000, 0x0000000000000000

Application Specific Information:
ProductBuildVersion: 6D2105
UNCAUGHT EXCEPTION (NSRangeException): Cannot remove an observer <NSColorPickerPageableNameListScrollView 0x7fb8f6ce0910> for the key path "contentLayoutRect" from <HighlightColorPanel 0x7fb8f6c94af0> because it is not registered as an observer.
UserInfo: (null)
Hints: None
Backtrace:
  0  0x00007fff8a22e024 __exceptionPreprocess (in CoreFoundation)
  1  0x0000000104b5abb4 DVTFailureHintExceptionPreprocessor (in DVTFoundation)
  2  0x00007fff8839f76e objc_exception_throw (in libobjc.A.dylib)
  3  0x00007fff8a22deed +[NSException raise:format:] (in CoreFoundation)
  4  0x00007fff89de0896 -[NSObject(NSKeyValueObserverRegistration) _removeObserver:forProperty:] (in Foundation)
  5  0x00007fff89de05d9 -[NSObject(NSKeyValueObserverRegistration) removeObserver:forKeyPath:] (in Foundation)
  6  0x00007fff89de04a4 -[NSObject(NSKeyValueObserverRegistration) removeObserver:forKeyPath:context:] (in Foundation)
  7  0x00007fff8ae8f09b -[NSScrollView _setWindow:] (in AppKit)
  8  0x00007fff8a14d705 __53-[__NSArrayM enumerateObjectsWithOptions:usingBlock:]_block_invoke (in CoreFoundation)
  9  0x00007fff8a14ce09 -[__NSArrayM enumerateObjectsWithOptions:usingBlock:] (in CoreFoundation)
 10  0x00007fff8b535474 __21-[NSView _setWindow:]_block_invoke735 (in AppKit)
 11  0x00007fff89e013be -[NSISEngine withBehaviors:performModifications:] (in Foundation)
 12  0x00007fff8adb1c54 -[NSView _setWindow:] (in AppKit)
 13  0x00007fff8ade9091 -[NSView removeFromSuperview] (in AppKit)
 14  0x00007fff8b280034 -[NSColorPanel _switchToPicker:] (in AppKit)
 15  0x00007fff8b0ee1b1 -[NSToolbarButton sendAction:to:] (in AppKit)
 16  0x00007fff8afdef5a -[NSToolbarItemViewer mouseDown:] (in AppKit)
 17  0x00007fff8b54f2fc -[NSWindow _reallySendEvent:isDelayedEvent:] (in AppKit)
 18  0x00007fff8aeded76 -[NSWindow sendEvent:] (in AppKit)
 19  0x00007fff8aedb312 -[NSApplication sendEvent:] (in AppKit)
 20  0x0000000105bd8c14 -[IDEApplication sendEvent:] (in IDEKit)
 21  0x00007fff8ae04c68 -[NSApplication run] (in AppKit)
 22  0x00007fff8ad81354 NSApplicationMain (in AppKit)
 23  0x00007fff952435c9 start (in libdyld.dylib)
 24  0x0000000000000001

abort() called

Application Specific Signatures:
NSRangeException

Application Specific Backtrace 1:
0   CoreFoundation                      0x00007fff8a22e03c __exceptionPreprocess + 172
1   DVTFoundation                       0x0000000104b5abb4 DVTFailureHintExceptionPreprocessor + 194
2   libobjc.A.dylib                     0x00007fff8839f76e objc_exception_throw + 43
3   CoreFoundation                      0x00007fff8a22deed +[NSException raise:format:] + 205
4   Foundation                          0x00007fff89de0896 -[NSObject(NSKeyValueObserverRegistration) _removeObserver:forProperty:] + 604
5   Foundation                          0x00007fff89de05d9 -[NSObject(NSKeyValueObserverRegistration) removeObserver:forKeyPath:] + 114
6   Foundation                          0x00007fff89de04a4 -[NSObject(NSKeyValueObserverRegistration) removeObserver:forKeyPath:context:] + 253
7   AppKit                              0x00007fff8ae8f09b -[NSScrollView _setWindow:] + 342
8   CoreFoundation                      0x00007fff8a14d705 __53-[__NSArrayM enumerateObjectsWithOptions:usingBlock:]_block_invoke + 133
9   CoreFoundation                      0x00007fff8a14ce09 -[__NSArrayM enumerateObjectsWithOptions:usingBlock:] + 313
10  AppKit                              0x00007fff8b535474 __21-[NSView _setWindow:]_block_invoke735 + 169
11  Foundation                          0x00007fff89e013be -[NSISEngine withBehaviors:performModifications:] + 155
12  AppKit                              0x00007fff8adb1c54 -[NSView _setWindow:] + 3191
13  AppKit                              0x00007fff8ade9091 -[NSView removeFromSuperview] + 453
14  AppKit                              0x00007fff8b280034 -[NSColorPanel _switchToPicker:] + 231
15  AppKit                              0x00007fff8b0ee1b1 -[NSToolbarButton sendAction:to:] + 75
16  AppKit                              0x00007fff8afdef5a -[NSToolbarItemViewer mouseDown:] + 4981
17  AppKit                              0x00007fff8b54f2fc -[NSWindow _reallySendEvent:isDelayedEvent:] + 14125
18  AppKit                              0x00007fff8aeded76 -[NSWindow sendEvent:] + 470
19  AppKit                              0x00007fff8aedb312 -[NSApplication sendEvent:] + 2504
20  IDEKit                              0x0000000105bd8c14 -[IDEApplication sendEvent:] + 924
21  AppKit                              0x00007fff8ae04c68 -[NSApplication run] + 711
22  AppKit                              0x00007fff8ad81354 NSApplicationMain + 1832
23  libdyld.dylib                       0x00007fff952435c9 start + 1
24  ???                                 0x0000000000000001 0x0 + 1

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   libsystem_kernel.dylib          0x00007fff8f7c7286 __pthread_kill + 10
1   libsystem_c.dylib               0x00007fff85fb6b53 abort + 129
2   com.apple.dt.IDEKit             0x0000000105e09753 +[IDEAssertionHandler _handleAssertionWithLogString:assertionSignature:assertionReason:extraBacktrace:] + 1507
3   com.apple.dt.IDEKit             0x0000000105e0a9c8 -[IDEAssertionHandler handleUncaughtException:] + 1077
4   com.apple.dt.IDEKit             0x0000000105e0aa94 IDEHandleUncaughtException + 94
5   com.apple.AppKit                0x00007fff8ae04d1c -[NSApplication run] + 891
6   com.apple.AppKit                0x00007fff8ad81354 NSApplicationMain + 1832
7   libdyld.dylib                   0x00007fff952435c9 start + 1

Thread 1:: Dispatch queue: com.apple.libdispatch-manager
0   libsystem_kernel.dylib          0x00007fff8f7c8232 kevent64 + 10
1   libdispatch.dylib               0x00007fff92c90a6a _dispatch_mgr_thread + 52

Thread 2:
0   libsystem_kernel.dylib          0x00007fff8f7c794a __workq_kernreturn + 10
1   libsystem_pthread.dylib         0x00007fff8d7cb40d start_wqthread + 13

Thread 3:
0   libsystem_kernel.dylib          0x00007fff8f7c794a __workq_kernreturn + 10
1   libsystem_pthread.dylib         0x00007fff8d7cb40d start_wqthread + 13

Thread 4:
0   libsystem_kernel.dylib          0x00007fff8f7c794a __workq_kernreturn + 10
1   libsystem_pthread.dylib         0x00007fff8d7cb40d start_wqthread + 13

Thread 5:
0   libsystem_kernel.dylib          0x00007fff8f7c24de mach_msg_trap + 10
1   libsystem_kernel.dylib          0x00007fff8f7c164f mach_msg + 55
2   com.apple.CoreFoundation        0x00007fff8a13ceb4 __CFRunLoopServiceMachPort + 212
3   com.apple.CoreFoundation        0x00007fff8a13c37b __CFRunLoopRun + 1371
4   com.apple.CoreFoundation        0x00007fff8a13bbd8 CFRunLoopRunSpecific + 296
5   com.apple.Foundation            0x00007fff89e28a59 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 278
6   com.apple.DTDeviceKitBase       0x000000010f108f3c -[DTDKRemoteDeviceDataListener listenerThreadImplementation] + 974
7   com.apple.Foundation            0x00007fff89dd6dc2 __NSThread__main__ + 1345
8   libsystem_pthread.dylib         0x00007fff8d7cd268 _pthread_body + 131
9   libsystem_pthread.dylib         0x00007fff8d7cd1e5 _pthread_start + 176
10  libsystem_pthread.dylib         0x00007fff8d7cb41d thread_start + 13

Thread 6:: com.apple.CFSocket.private
0   libsystem_kernel.dylib          0x00007fff8f7c73fa __select + 10
1   libsystem_pthread.dylib         0x00007fff8d7cd268 _pthread_body + 131
2   libsystem_pthread.dylib         0x00007fff8d7cd1e5 _pthread_start + 176
3   libsystem_pthread.dylib         0x00007fff8d7cb41d thread_start + 13

Thread 7:: com.apple.NSURLConnectionLoader
0   libsystem_kernel.dylib          0x00007fff8f7c24de mach_msg_trap + 10
1   libsystem_kernel.dylib          0x00007fff8f7c164f mach_msg + 55
2   com.apple.CoreFoundation        0x00007fff8a13ceb4 __CFRunLoopServiceMachPort + 212
3   com.apple.CoreFoundation        0x00007fff8a13c37b __CFRunLoopRun + 1371
4   com.apple.CoreFoundation        0x00007fff8a13bbd8 CFRunLoopRunSpecific + 296
5   com.apple.CFNetwork             0x00007fff8600f220 +[NSURLConnection(Loader) _resourceLoadLoop:] + 434
6   com.apple.Foundation            0x00007fff89dd6dc2 __NSThread__main__ + 1345
7   libsystem_pthread.dylib         0x00007fff8d7cd268 _pthread_body + 131
8   libsystem_pthread.dylib         0x00007fff8d7cd1e5 _pthread_start + 176
9   libsystem_pthread.dylib         0x00007fff8d7cb41d thread_start + 13

Thread 8:
0   libsystem_kernel.dylib          0x00007fff8f7c24de mach_msg_trap + 10
1   libsystem_kernel.dylib          0x00007fff8f7c164f mach_msg + 55
2   com.apple.CoreFoundation        0x00007fff8a13ceb4 __CFRunLoopServiceMachPort + 212
3   com.apple.CoreFoundation        0x00007fff8a13c37b __CFRunLoopRun + 1371
4   com.apple.CoreFoundation        0x00007fff8a13bbd8 CFRunLoopRunSpecific + 296
5   com.apple.AppKit                0x00007fff8aed766b _NSEventThread + 137
6   libsystem_pthread.dylib         0x00007fff8d7cd268 _pthread_body + 131
7   libsystem_pthread.dylib         0x00007fff8d7cd1e5 _pthread_start + 176
8   libsystem_pthread.dylib         0x00007fff8d7cb41d thread_start + 13

Thread 9:: DYMobileDeviceManager
0   libsystem_kernel.dylib          0x00007fff8f7c24de mach_msg_trap + 10
1   libsystem_kernel.dylib          0x00007fff8f7c164f mach_msg + 55
2   com.apple.CoreFoundation        0x00007fff8a13ceb4 __CFRunLoopServiceMachPort + 212
3   com.apple.CoreFoundation        0x00007fff8a13c37b __CFRunLoopRun + 1371
4   com.apple.CoreFoundation        0x00007fff8a13bbd8 CFRunLoopRunSpecific + 296
5   com.apple.Foundation            0x00007fff89e28a59 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 278
6   com.apple.Foundation            0x00007fff89e9e17f -[NSRunLoop(NSRunLoop) run] + 74
7   com.apple.GPUToolsMobileFoundation  0x00000001175d789b -[DYMobileDeviceManager _deviceNotificationThread:] + 134
8   com.apple.Foundation            0x00007fff89dd6dc2 __NSThread__main__ + 1345
9   libsystem_pthread.dylib         0x00007fff8d7cd268 _pthread_body + 131
10  libsystem_pthread.dylib         0x00007fff8d7cd1e5 _pthread_start + 176
11  libsystem_pthread.dylib         0x00007fff8d7cb41d thread_start + 13

Thread 10:
0   libsystem_kernel.dylib          0x00007fff8f7c794a __workq_kernreturn + 10
1   libsystem_pthread.dylib         0x00007fff8d7cb40d start_wqthread + 13

Thread 11:
0   libsystem_kernel.dylib          0x00007fff8f7c794a __workq_kernreturn + 10
1   libsystem_pthread.dylib         0x00007fff8d7cb40d start_wqthread + 13

Thread 12:
0   libsystem_kernel.dylib          0x00007fff8f7c7136 __psynch_cvwait + 10
1   com.apple.Xcode.DevToolsCore    0x000000010eb59866 -[XCBlockQueue _processBlocksInThreadSlotNumber:] + 456
2   com.apple.Foundation            0x00007fff89dd6dc2 __NSThread__main__ + 1345
3   libsystem_pthread.dylib         0x00007fff8d7cd268 _pthread_body + 131
4   libsystem_pthread.dylib         0x00007fff8d7cd1e5 _pthread_start + 176
5   libsystem_pthread.dylib         0x00007fff8d7cb41d thread_start + 13

Thread 13:
0   libsystem_kernel.dylib          0x00007fff8f7c7136 __psynch_cvwait + 10
1   com.apple.Xcode.DevToolsCore    0x000000010eb59866 -[XCBlockQueue _processBlocksInThreadSlotNumber:] + 456
2   com.apple.Foundation            0x00007fff89dd6dc2 __NSThread__main__ + 1345
3   libsystem_pthread.dylib         0x00007fff8d7cd268 _pthread_body + 131
4   libsystem_pthread.dylib         0x00007fff8d7cd1e5 _pthread_start + 176
5   libsystem_pthread.dylib         0x00007fff8d7cb41d thread_start + 13

Thread 14:
0   libsystem_kernel.dylib          0x00007fff8f7c7136 __psynch_cvwait + 10
1   com.apple.Xcode.DevToolsCore    0x000000010eb59866 -[XCBlockQueue _processBlocksInThreadSlotNumber:] + 456
2   com.apple.Foundation            0x00007fff89dd6dc2 __NSThread__main__ + 1345
3   libsystem_pthread.dylib         0x00007fff8d7cd268 _pthread_body + 131
4   libsystem_pthread.dylib         0x00007fff8d7cd1e5 _pthread_start + 176
5   libsystem_pthread.dylib         0x00007fff8d7cb41d thread_start + 13

Thread 15:
0   libsystem_kernel.dylib          0x00007fff8f7c24de mach_msg_trap + 10
1   libsystem_kernel.dylib          0x00007fff8f7c164f mach_msg + 55
2   com.apple.CoreFoundation        0x00007fff8a13ceb4 __CFRunLoopServiceMachPort + 212
3   com.apple.CoreFoundation        0x00007fff8a13c37b __CFRunLoopRun + 1371
4   com.apple.CoreFoundation        0x00007fff8a13bbd8 CFRunLoopRunSpecific + 296
5   com.apple.CoreFoundation        0x00007fff8a1f3671 CFRunLoopRun + 97
6   com.apple.DebugSymbols          0x00007fff8ace1b8f SpotlightQueryThread(void*) + 463
7   libsystem_pthread.dylib         0x00007fff8d7cd268 _pthread_body + 131
8   libsystem_pthread.dylib         0x00007fff8d7cd1e5 _pthread_start + 176
9   libsystem_pthread.dylib         0x00007fff8d7cb41d thread_start + 13

Thread 16:
0   libsystem_kernel.dylib          0x00007fff8f7c748a __semwait_signal + 10
1   com.apple.CoreSymbolication     0x00007fff882dbe67 0x7fff882c9000 + 77415
2   libsystem_pthread.dylib         0x00007fff8d7cd268 _pthread_body + 131
3   libsystem_pthread.dylib         0x00007fff8d7cd1e5 _pthread_start + 176
4   libsystem_pthread.dylib         0x00007fff8d7cb41d thread_start + 13

Thread 0 crashed with X86 Thread State (64-bit):
  rax: 0x0000000000000000  rbx: 0x0000000000000006  rcx: 0x00007fff5b27e948  rdx: 0x0000000000000000
  rdi: 0x000000000000130f  rsi: 0x0000000000000006  rbp: 0x00007fff5b27e970  rsp: 0x00007fff5b27e948
   r8: 0x0000000000001fff   r9: 0x00007fb8f3c38f60  r10: 0x0000000008000000  r11: 0x0000000000000206
  r12: 0x00007fff8839a440  r13: 0x00007fb8f3eb68c0  r14: 0x00007fff77741300  r15: 0x00007fb8f3c23f00
  rip: 0x00007fff8f7c7286  rfl: 0x0000000000000206  cr2: 0x00000001075f70e0

Logical CPU:     0
Error Code:      0x020000b8
Trap Number:     133

非常感谢您。

这似乎是 Apple 方面的问题。让我为您消化该日志:

UNCAUGHT EXCEPTION: Cannot remove an observer <NSColorPickerPageableNameListScrollView 0x7fb8f6ce0910> for the key path "contentLayoutRect" from <HighlightColorPanel 0x7fb8f6c94af0> because it is not registered as an observer.

因此,在 Xcode 的代码中,它试图做的是删除类型为 NSColorPickerPagableNameListScrollView 的观察者(在 up/down 列表中选择开发人员的颜色偏好IB) 在内存地址 0x7b7f6ce0910 来自 HighlightColorPanel (可能是颜色选择器的对话框)在内存地址 0x7fb8f6c94af0 在滚动视图注册为颜色观察者之前关键路径的选择器 contentLayoutRect.

通俗地说,滚动颜色视图是颜色选择器的观察者,可以更轻松地查看您的颜色偏好。当颜色选择器选择一种颜色时,它会向它的观察者发送一个通知,即滚动的颜色框。

但是,当框关闭时,滚动视图应该从 观察者树 中删除自己,即 观察者[的项目列表] =37=] 的盒子,努力摆脱(并释放资源)盒子。

该错误仅存在于该部分代码中,因为显然,滚动视图 从未注册为关键路径 contentLayoutRect 的观察者 。它是 观察者 其他所有 的观察者。由于它在试图摆脱它时无法分辨观察者是什么,因此系统崩溃并崩溃。

就我而言,完全相同的问题是由我通过 Alcatraz 安装的 ColorSenseRainbow 插件引起的。我一删除它,一切就恢复正常了。