Issue #11 resolved

endless loop during [HGRevision descendsFrom:] loop

Dominik Wagner
created an issue

Steps to reproduce: hg clone -r 19 https://bitbucket.org/emonk/twitterjunkie/ do some local changes - e.g. insert a newline somwhere in the info.plist file open repo with murky pull using the file->pull menu entry while selection is on the current entry * pulling works fine - but after that the update of the table view hangs in this bt: {{{ 0 0x0000d732 in -[HgRevision descendsFrom:] (self=0x101f070, _cmd=0x923f25a8, ancestor=0x103e9f0) at /Users/dom/Data/Coding/murky/Source/HgRevision.m:139 1 0x000047e7 in -[RepoController tableView:willDisplayCell:forTableColumn:row:] (self=0x1066eb0, _cmd=0x923eee8c, tableView=0x10670c0, cell=0x1021d80, tableColumn=0x102d9b0, row=2) at /Users/dom/Data/Coding/murky/Source/RepoController.m:463 2 0x90f5b864 in -[NSTableView _delegateWillDisplayCell:forColumn:row:] () 3 0x90eddd7d in -[NSTableView preparedCellAtColumn:row:] () 4 0x90edd87c in -[NSTableView _drawContentsAtRow:column:withCellFrame:] () 5 0x90edcdb2 in -[NSTableView drawRow:clipRect:] () 6 0x90e821a0 in -[NSTableView drawRowIndexes:clipRect:] () 7 0x90e80c84 in -[NSTableView drawRect:] () 8 0x90f1129c in -[NSView _drawRect:clip:] () 9 0x90f0fd93 in -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:] () 10 0x90f1012a in -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:] () 11 0x90f0e6e9 in -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] () 12 0x90f0f543 in -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] () 13 0x90f0f543 in -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] () 14 0x90f0f543 in -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] () 15 0x90f0f543 in -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] () 16 0x90f0e02b in -[NSThemeFrame _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] () 17 0x90f0ab4f in -[NSView _displayRectIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:] () 18 0x90e4b523 in -[NSView displayIfNeeded] () 19 0x90e4b0d1 in -[NSWindow displayIfNeeded] () 20 0x90e4aef4 in _handleWindowNeedsDisplay () 21 0x939759a2 in __CFRunLoopDoObservers () 22 0x93976cfc in CFRunLoopRunSpecific () 23 0x93977cd8 in CFRunLoopRunInMode () 24 0x91fbd2c0 in RunCurrentEventLoopInMode () 25 0x91fbd0d9 in ReceiveNextEventCommon () 26 0x91fbcf4d in BlockUntilNextEventMatchingListInMode () 27 0x90e48d7d in _DPSNextEvent () 28 0x90e48630 in -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] () 29 0x90e4166b in -[NSApplication run] () 30 0x90e0e8a4 in NSApplicationMain () 31 0x00014c4a in main (argc=1, argv=0xbffff7e8) at /Users/dom/Data/Coding/murky/Source/main.m:12 }}}

Comments (5)

  1. Jens Alfke repo owner

    Yup -- looks like the top pulled revision incorrectly got made a child of the magic 'current' revision. I wonder if this is related to the uninitialized-variable fix I made in the pull code yesterday?

    (gdb) po rev
    #21: Adding a sanity checks to follow import. Preventing duplicate imports. Changed sheet layout.
    (gdb) po rev->_parent
    #current: --locally modified--
    (gdb) po rev->_parent->_parent
    #21: Adding a sanity checks to follow import. Preventing duplicate imports. Changed sheet layout.
    
  2. Jens Alfke repo owner

    I added some assertions to HgRevision's 'parent' and 'parent2' setters. Here's where the loop gets created:

    3  0x0000d402 in -[HgRevision setParent:] (self=0x12ef050, _cmd=0x91623bc4, parent=0x123a800) at /Code/Murky/Source/HgRevision.m:145
    4  0x0000c3b5 in -[HgLogOperation _updateRevision:numbered:fromChangeset:] (self=0x12bf100, _cmd=0x1dec8, revision=0x12ef050, revNo=21, changeset=0x12ebc20) at /Code/Murky/Source/HgLogOperation.m:263
    5  0x0000c7d5 in -[HgLogOperation _parseFullXML] (self=0x12bf100, _cmd=0x1def0) at /Code/Murky/Source/HgLogOperation.m:308
    6  0x0000b700 in -[HgLogOperation finished] (self=0x12bf100, _cmd=0x91696f94) at /Code/Murky/Source/HgLogOperation.m:119
    ...
    17 0x00010818 in -[HgTask _waitTillFinishedInMode:] (self=0x12bf100, _cmd=0x1ec4c, runLoopMode=0x2195c) at /Code/Murky/Source/HgTask.m:339
    18 0x00010932 in -[HgTask run] (self=0x12bf100, _cmd=0x9168da24) at /Code/Murky/Source/HgTask.m:353
    19 0x00006711 in -[HgRepository _checkRevisions] (self=0x10f4a80, _cmd=0x1c9ae) at /Code/Murky/Source/HgRepository.m:286
    20 0x00006013 in -[HgRepository _updateChangedDirs] (self=0x10f4a80, _cmd=0x1c919) at /Code/Murky/Source/HgRepository.m:168
    

    HgLogOperation looks for revision #20 and somehow gets the UncommittedRevision. Bad.

    Ah: _revisionWithNumber: 20 sees that there's a revision with index 20 in _repository.revisions, so it uses that, even though it's the UncommittedRevision. It needs to check for that case and use a newly-fetched revision instead.

  3. Log in to comment