XVimProject / XVim

Xcode plugin for Vim keybindings
MIT License
5.16k stars 595 forks source link

Xcode crash - undo called with too many nested undo groups #817

Open eyuelt opened 9 years ago

eyuelt commented 9 years ago

I got a crash saying undo was called with too many nested undo groups.

Here's part of the crash report:

DVTUndoManager for delegate:<IDESourceCodeDocument 0x7fa7bb576860>
ProductBuildVersion: 6E35b
UNCAUGHT EXCEPTION (NSInternalInconsistencyException): undo: DVTUndoManager 0x7fa7c8d88200 is in invalid state, undo was called with too many nested undo groups
UserInfo: (null)
Hints: 
  0: DVTUndoManager for delegate:<IDESourceCodeDocument: 0x7fa7bb576860>

CreationBacktrace:

  0  0x00000001029d009a -[DVTUndoManager init] (in DVTKit)
  1  0x00000001034a6bf7 -[IDEEditorDocument undoManager] (in IDEKit)
  2  0x00000001035541f0 -[IDEDocumentController editorDocumentsToSave] (in IDEKit)
  3  0x0000000103553e09 +[IDEEditorDocument editedFileContents] (in IDEKit)
  4  0x000000010d5a50ff __117-[IDESourceCodeCallersCalleesGeniusResultsFinder _getUpdateGeniusResultsPhaseOneBlock:phaseTwoBlock:phaseThreeBlock:]_block_invoke (in IDESourceEditor)
  5  0x00000001035329c3 -[IDEIndexGeniusResultsFinder _updateGeniusResults] (in IDEKit)
  6  0x0000000103531f2a -[IDEGeniusResultsFinder findGeniusResultsForEditorDocument:selectedDocumentLocations:] (in IDEKit)
  7  0x00000001037954c5 -[IDEEditorGeniusResults _doFindGeniusResults] (in IDEKit)
  8  0x00007fff8c90641b __NSFireDelayedPerform (in Foundation)
  9  0x00007fff88f172e4 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ (in CoreFoundation)
 10  0x00007fff88f16f73 __CFRunLoopDoTimer (in CoreFoundation)
 11  0x00007fff88f8a53d __CFRunLoopDoTimers (in CoreFoundation)
 12  0x00007fff88ed2608 __CFRunLoopRun (in CoreFoundation)
 13  0x00007fff88ed1bd8 CFRunLoopRunSpecific (in CoreFoundation)
 14  0x00007fff8895056f RunCurrentEventLoopInMode (in HIToolbox)
 15  0x00007fff889502ea ReceiveNextEventCommon (in HIToolbox)
 16  0x00007fff8895012b _BlockUntilNextEventMatchingListInModeWithFilter (in HIToolbox)
 17  0x00007fff8d1648ab _DPSNextEvent (in AppKit)
 18  0x00007fff8d163e58 -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] (in AppKit)
 19  0x00000001029bfaaa -[DVTApplication nextEventMatchingMask:untilDate:inMode:dequeue:] (in DVTKit)
 20  0x00007fff8d159af3 -[NSApplication run] (in AppKit)
 21  0x00007fff8d0d6244 NSApplicationMain (in AppKit)
 22  0x00007fff8ab935c9 start (in libdyld.dylib)

 Ordered begin/end backtraces:

  0  0x00000001029d0ea4 __35-[DVTUndoManager beginUndoGrouping]_block_invoke109 (in DVTKit)
  1  0x000000010243ea48 DVTInvokeWithLazyFailureHint (in DVTFoundation)
  2  0x00000001028eec97 -[DVTUndoManager beginUndoGrouping] (in DVTKit)
  3  0x000000010d4f52ec -[XVimReplaceEvaluator becameHandler] at /Users/eyuelt/code/XVim/XVim/XVimReplaceEvaluator.m:67 (in XVim)
  4  0x000000010d4d5c26 -[XVimWindow handleKeyStroke:onStack:] at /Users/eyuelt/code/XVim/XVim/XVimWindow.m:236 (in XVim)
  5  0x000000010d4d51e1 -[XVimWindow handleOneXVimString:] at /Users/eyuelt/code/XVim/XVim/XVimWindow.m:191 (in XVim)
  6  0x000000010d4d54a1 -[XVimWindow handleXVimString:] at /Users/eyuelt/code/XVim/XVim/XVimWindow.m:217 (in XVim)
  7  0x000000010d4d4fcd -[XVimWindow handleKeyEvent:] at /Users/eyuelt/code/XVim/XVim/XVimWindow.m:155 (in XVim)
  8  0x000000010d4bcc88 -[DVTSourceTextView(XVim) xvim_keyDown:] at /Users/eyuelt/code/XVim/XVim/DVTSourceTextView+XVim.m:102 (in XVim)
  9  0x00007fff8d8a20fb -[NSWindow _reallySendEvent:isDelayedEvent:] (in AppKit)
 10  0x00007fff8d233c86 -[NSWindow sendEvent:] (in AppKit)
 11  0x000000010370f5d8 -[IDEWorkspaceWindow sendEvent:] (in IDEKit)
 12  0x00007fff8d2308b1 -[NSApplication sendEvent:] (in AppKit)
 13  0x00000001034b9064 -[IDEApplication sendEvent:] (in IDEKit)
 14  0x00007fff8d159b68 -[NSApplication run] (in AppKit)
 15  0x00007fff8d0d6244 NSApplicationMain (in AppKit)
 16  0x00007fff8ab935c9 start (in libdyld.dylib)

Backtrace:
  0  0x00007fff88fc4024 __exceptionPreprocess (in CoreFoundation)
  1  0x000000010243ec34 DVTFailureHintExceptionPreprocessor (in DVTFoundation)
  2  0x00007fff89e5d76e objc_exception_throw (in libobjc.A.dylib)
  3  0x00007fff88fc3eed +[NSException raise:format:] (in CoreFoundation)
  4  0x00007fff8c968332 -[NSUndoManager undo] (in Foundation)
  5  0x00000001029d375a __22-[DVTUndoManager undo]_block_invoke187 (in DVTKit)
  6  0x000000010243ea48 DVTInvokeWithLazyFailureHint (in DVTFoundation)
  7  0x00000001029d331b -[DVTUndoManager undo] (in DVTKit)
  8  0x00007fff8bc96cd7 _os_activity_initiate (in libsystem_trace.dylib)
  9  0x00007fff8d327eb1 -[NSApplication sendAction:to:from:] (in AppKit)
 10  0x00000001029c04dd __37-[DVTApplication sendAction:to:from:]_block_invoke (in DVTKit)
 11  0x0000000102888c28 -[DVTApplication sendAction:to:from:] (in DVTKit)
 12  0x00007fff8d327c4e -[NSMenuItem _corePerformAction] (in AppKit)
 13  0x00007fff8d32797c -[NSCarbonMenuImpl performActionWithHighlightingForItemAtIndex:] (in AppKit)
 14  0x00007fff8bc96cd7 _os_activity_initiate (in libsystem_trace.dylib)
 15  0x00007fff8d3268ad -[NSMenu performKeyEquivalent:] (in AppKit)
 16  0x00007fff8d325a6f -[NSApplication _handleKeyEquivalent:] (in AppKit)
 17  0x00007fff8d23083a -[NSApplication sendEvent:] (in AppKit)
 18  0x00000001034b9064 -[IDEApplication sendEvent:] (in IDEKit)
 19  0x00007fff8d159b68 -[NSApplication run] (in AppKit)
 20  0x00007fff8d0d6244 NSApplicationMain (in AppKit)
 21  0x00007fff8ab935c9 start (in libdyld.dylib)

Performing @selector(undo:) from sender NSMenuItem 0x7fa7cdbfa050
abort() called

Application Specific Signatures:
NSInternalInconsistencyException

I think that's the important part of the crash report, but if the rest of it is needed, here it is: https://gist.github.com/eyuelt/eafd5a7389ec7ec541a5

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

martinohman commented 8 years ago

I ran into the same issue today and can reproduce it by going through these steps:

  1. "r"
  2. cmd + z (undo)

I open a project in xcode, select any file, do the 2 steps above and it will crash every time with the same error as above.

UNCAUGHT EXCEPTION (NSInternalInconsistencyException): undo: DVTUndoManager 0x7fc54b3bdda0 is in invalid state, undo was called with too many nested undo groups UserInfo: (null)