johnno1962 / GitDiff

Highlights deltas against git repo in Xcode
MIT License
891 stars 54 forks source link

Getting crashes when opening source file in a new window #9

Closed armadillu closed 9 years ago

armadillu commented 9 years ago

When I 2-click a file from the file browser (left column) to open it in a new window, I get a consistent crash.

See crash log: Process: Xcode [30948] Path: /Applications/Xcode.app/Contents/MacOS/Xcode Identifier: com.apple.dt.Xcode Version: 5.1.1 (5085) Build Info: IDEFrameworks-5085000000000000~10 App Item ID: 497799835 App External ID: 520942841 Code Type: X86-64 (Native) Parent Process: launchd [276] Responsible: Xcode [30948] User ID: 501

Date/Time:       2014-08-05 10:43:57.818 -0400
OS Version:      Mac OS X 10.9.4 (13E28)
Report Version:  11
Anonymous UUID:  6F557A12-5116-DFCE-DDB8-6C870F3C8716

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

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

Application Specific Information:
Sending openDoubleClickedNavigableItemsAction: to <IDEStructureNavigator: 0x7f9972c374b0 representing: <DVTExtension 0x7f99d7c4b910: Structure Navigator (Xcode.IDEKit.Navigator.Structure) v0.1>> from <IDENavigatorOutlineView: 0x7f9972c37fa0>
ProductBuildVersion: 5B1008
UNCAUGHT EXCEPTION (NSInternalInconsistencyException): -[DVTTextSidebarView(0x7f9932e36ec0) lockFocus] failed with window=0x7f99dc9b3510, windowNumber=5001, [self isHiddenOrHasHiddenAncestor]=1
UserInfo: (null)
Hints: 
  0: Sending openDoubleClickedNavigableItemsAction: to <IDEStructureNavigator: 0x7f9972c374b0 representing: <DVTExtension 0x7f99d7c4b910: Structure Navigator (Xcode.IDEKit.Navigator.Structure) v0.1>> from <IDENavigatorOutlineView: 0x7f9972c37fa0>
Backtrace:
  0  0x00007fff97d70244 __exceptionPreprocess (in CoreFoundation)
  1  0x0000000105ea3b10 DVTFailureHintExceptionPreprocessor (in DVTFoundation)
  2  0x00007fff8e912e75 objc_exception_throw (in libobjc.A.dylib)
  3  0x00007fff97d70038 +[NSException raise:format:arguments:] (in CoreFoundation)
  4  0x00007fff8dd23d41 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] (in Foundation)
  5  0x00007fff94936903 -[NSView lockFocus] (in AppKit)
  6  0x0000000110057b74 -[NSRulerView(GitDiff) gitdiff_drawLineNumbersInSidebarRect:foldedIndexes:count:linesToInvert:linesToReplace:getParaRectBlock:] at /Users/oriol/Desktop/GitDiff-master/Classes/GitDiff.mm:244 (in GitDiff)
  7  0x0000000106327589 -[DVTTextSidebarView drawRect:] (in DVTKit)
  8  0x00007fff9493e557 -[NSView(NSInternal) _recursive:displayRectIgnoringOpacity:inGraphicsContext:CGContext:topView:shouldChangeFontReferenceColor:] (in AppKit)
  9  0x00007fff9493e890 -[NSView(NSInternal) _recursive:displayRectIgnoringOpacity:inGraphicsContext:CGContext:topView:shouldChangeFontReferenceColor:] (in AppKit)
 10  0x00007fff9493e890 -[NSView(NSInternal) _recursive:displayRectIgnoringOpacity:inGraphicsContext:CGContext:topView:shouldChangeFontReferenceColor:] (in AppKit)
 11  0x00007fff9493e890 -[NSView(NSInternal) _recursive:displayRectIgnoringOpacity:inGraphicsContext:CGContext:topView:shouldChangeFontReferenceColor:] (in AppKit)
 12  0x00007fff9493e890 -[NSView(NSInternal) _recursive:displayRectIgnoringOpacity:inGraphicsContext:CGContext:topView:shouldChangeFontReferenceColor:] (in AppKit)
 13  0x00007fff9493e890 -[NSView(NSInternal) _recursive:displayRectIgnoringOpacity:inGraphicsContext:CGContext:topView:shouldChangeFontReferenceColor:] (in AppKit)
 14  0x00007fff94a6f54e -[NSView(NSInternal) _recursive:displayRectIgnoringOpacity:inContext:topView:] (in AppKit)
 15  0x00007fff94a6f455 -[NSView _drawRectBasedDisplayRectIgnoringOpacity:inContext:] (in AppKit)
 16  0x00007fff94a6f13b -[NSView displayRectIgnoringOpacity:inContext:] (in AppKit)
 17  0x00007fff94ae897d __46-[NSView cacheDisplayInRect:toBitmapImageRep:]_block_invoke (in AppKit)
 18  0x00007fff94ae873b __36-[NSBitmapImageRep _captureDrawing:]_block_invoke (in AppKit)
 19  0x00007fff94853a50 -[NSBitmapImageRep _performBlockUsingBacking:] (in AppKit)
 20  0x00007fff94ae84bf -[NSBitmapImageRep _captureDrawing:] (in AppKit)
 21  0x00007fff94ae83eb -[NSView cacheDisplayInRect:toBitmapImageRep:] (in AppKit)
 22  0x0000000106f09491 -[IDEEditorContext _imageOfCurrentEditor] (in IDEKit)
 23  0x0000000106f0936a -[IDEEditorContext currentHistoryItemWithImageOfCurrentEditor] (in IDEKit)
 24  0x0000000106f08db2 -[IDEEditorContext _notifyDelegateAndOpenEditorOpenSpecifier:updateHistory:] (in IDEKit)
 25  0x0000000106f089a5 -[IDEEditorContext _openEditorOpenSpecifier:updateHistory:] (in IDEKit)
 26  0x0000000106f0888b -[IDEEditorContext openEditorOpenSpecifier:] (in IDEKit)
 27  0x0000000106f180b0 -[IDEEditorGeniusMode openEditorOpenSpecifier:editorContext:] (in IDEKit)
 28  0x0000000106f085ed -[IDEEditorArea _openEditorOpenSpecifier:editorContext:takeFocus:] (in IDEKit)
 29  0x000000010707c001 __108+[IDEEditorCoordinator _doOpenEditorOpenSpecifier:forWorkspaceTabController:editorContext:target:takeFocus:]_block_invoke (in IDEKit)
 30  0x000000010707ca00 +[IDEEditorCoordinator _openNavigationHUDSelection:forWorkspaceDocument:documentURL:usingBlock:] (in IDEKit)
 31  0x000000010707bde7 +[IDEEditorCoordinator _doOpenIn_SeparateWindow_withWorkspaceTabController:documentURL:usingBlock:] (in IDEKit)
 32  0x0000000106f082b4 +[IDEEditorCoordinator _doOpenWithWorkspaceTabController:editorContext:target:allowFallback:documentURL:usingBlock:] (in IDEKit)
 33  0x0000000106f07dc9 +[IDEEditorCoordinator _doOpenEditorOpenSpecifier:forWorkspaceTabController:editorContext:target:takeFocus:] (in IDEKit)
 34  0x0000000106f0790a -[_IDEOpenRequest _runIfNecessary] (in IDEKit)
 35  0x0000000106f0778b -[_IDEOpenRequest _enqueueForEventBehavior:] (in IDEKit)
 36  0x0000000106f07225 +[IDEEditorCoordinator _openRequestForEditorOpenSpecifier:workspaceTabController:editorContext:eventBehavior:takeFocus:] (in IDEKit)
 37  0x000000010707c34e __99+[IDEEditorCoordinator _openEditorOpenSpecifier:forWorkspaceTabController:eventBehavior:takeFocus:]_block_invoke (in IDEKit)
 38  0x000000010707d14e +[IDEEditorCoordinator _performBlockInsideReentrantGuard:] (in IDEKit)
 39  0x0000000106f27554 +[IDEEditorCoordinator _openEditorOpenSpecifier:forWorkspaceTabController:eventBehavior:takeFocus:] (in IDEKit)
 40  0x0000000106f27391 +[IDEEditorCoordinator openEditorOpenSpecifier:forWorkspaceTabController:eventType:] (in IDEKit)
 41  0x0000000106f27222 -[IDEOutlineBasedNavigator _openNavigableItem:eventType:] (in IDEKit)
 42  0x00000001072a3ec0 -[IDEOutlineBasedNavigator openDoubleClickedNavigableItemsAction:] (in IDEKit)
 43  0x00007fff949fb260 -[NSApplication sendAction:to:from:] (in AppKit)
 44  0x0000000106404f85 __37-[DVTApplication sendAction:to:from:]_block_invoke (in DVTKit)
 45  0x0000000105ea3842 DVTInvokeWithFailureHint (in DVTFoundation)
 46  0x00000001062d2b0e -[DVTApplication sendAction:to:from:] (in DVTKit)
 47  0x00007fff949fb0de -[NSControl sendAction:to:] (in AppKit)
 48  0x0000000106f26f86 -[IDENavigatorOutlineView sendAction:to:] (in IDEKit)
 49  0x00007fff949fb017 -[NSTableView _sendAction:to:row:column:] (in AppKit)
 50  0x00007fff949f8702 -[NSTableView mouseDown:] (in AppKit)
 51  0x00007fff94afc0d1 -[NSOutlineView mouseDown:] (in AppKit)
 52  0x0000000106f2626a -[IDENavigatorOutlineView mouseDown:] (in IDEKit)
 53  0x00007fff949e1a58 -[NSWindow sendEvent:] (in AppKit)
 54  0x00007fff949805d4 -[NSApplication sendEvent:] (in AppKit)
 55  0x0000000106e52600 -[IDEApplication sendEvent:] (in IDEKit)
 56  0x00007fff947d09f9 -[NSApplication run] (in AppKit)
 57  0x00007fff947bb783 NSApplicationMain (in AppKit)
 58  0x00007fff8e1155fd start (in libdyld.dylib)
 59  0x0000000000000001

abort() called
armadillu commented 9 years ago

great plugin btw!

johnno1962 commented 9 years ago

Thanks for the report. I’ve not been able to replicate this but I see it is lockFocus causing the crash. I removed this as is seems to be unnecessary anyway. Can you see if this fixes it? If not let me know a little more about how to replicate it. If I set my preferences to open a new window when I double click on a file I don’t get a crash!

armadillu commented 9 years ago

yep, just tried! no crash! :)

johnno1962 commented 9 years ago

Great, good to hear. Thanks again.