From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Toby Cubitt Newsgroups: gmane.emacs.bugs Subject: bug#16523: Undo Tree regression: (error "Unrecognized entry in undo list undo-tree-canary") Date: Wed, 22 Jan 2014 17:08:44 +0000 Message-ID: <20140122170844.GA1898@c3po> References: Reply-To: Toby Cubitt NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1390412091 17850 80.91.229.3 (22 Jan 2014 17:34:51 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 22 Jan 2014 17:34:51 +0000 (UTC) Cc: 16523@debbugs.gnu.org To: Barry OReilly Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Jan 22 18:34:56 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1W61hY-0004o1-CD for geb-bug-gnu-emacs@m.gmane.org; Wed, 22 Jan 2014 18:34:56 +0100 Original-Received: from localhost ([::1]:36765 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W61hX-0003Cy-W7 for geb-bug-gnu-emacs@m.gmane.org; Wed, 22 Jan 2014 12:34:56 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44388) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W61hP-0003BD-S4 for bug-gnu-emacs@gnu.org; Wed, 22 Jan 2014 12:34:52 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W61hL-0005iO-6l for bug-gnu-emacs@gnu.org; Wed, 22 Jan 2014 12:34:47 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:46878) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W61hL-0005iK-3k for bug-gnu-emacs@gnu.org; Wed, 22 Jan 2014 12:34:43 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1W61JS-0004b4-CP for bug-gnu-emacs@gnu.org; Wed, 22 Jan 2014 12:10:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Toby Cubitt Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 22 Jan 2014 17:10:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 16523 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-Cc: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.139041055017603 (code B ref -1); Wed, 22 Jan 2014 17:10:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 22 Jan 2014 17:09:10 +0000 Original-Received: from localhost ([127.0.0.1]:60893 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1W61Ib-0004Zq-2t for submit@debbugs.gnu.org; Wed, 22 Jan 2014 12:09:09 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:35409) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1W61IX-0004Zg-Sq for submit@debbugs.gnu.org; Wed, 22 Jan 2014 12:09:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W61IT-0005aq-0x for submit@debbugs.gnu.org; Wed, 22 Jan 2014 12:09:05 -0500 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:38986) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W61IS-0005am-UI for submit@debbugs.gnu.org; Wed, 22 Jan 2014 12:09:00 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37066) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W61IO-0002Dz-JN for bug-gnu-emacs@gnu.org; Wed, 22 Jan 2014 12:09:00 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W61II-0005Yg-IL for bug-gnu-emacs@gnu.org; Wed, 22 Jan 2014 12:08:56 -0500 Original-Received: from starfish.geekisp.com ([216.168.135.166]:28035) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1W61II-0005YR-Eu for bug-gnu-emacs@gnu.org; Wed, 22 Jan 2014 12:08:50 -0500 Original-Received: (qmail 3636 invoked by uid 1003); 22 Jan 2014 17:08:49 -0000 Original-Received: from localhost (localhost.geekisp.com [127.0.0.1]) by localhost.geekisp.com (tmda-ofmipd) with ESMTP; Wed, 22 Jan 2014 12:08:46 -0500 Content-Disposition: inline In-Reply-To: X-PGP-Key: http://www.dr-qubit.org/gpg-toby-pub.asc User-Agent: Mutt/1.5.22 (2013-10-16) X-Delivery-Agent: TMDA/1.1.11 (Ladyburn) X-Primary-Address: toby@dr-qubit.org X-detected-operating-system: by eggs.gnu.org: OpenBSD 4.x-5.x [fuzzy] X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:83895 Archived-At: On Tue, Jan 21, 2014 at 10:23:37PM -0500, Barry OReilly wrote: > > * Sometimes the navigate down hangs with backtrace: > > > > Debugger entered--Lisp error: (quit) > > undo-tree-copy-list((nil)) > > undo-tree-redo-1(1) > > undo-tree-visualize-redo(1) > > call-interactively(undo-tree-visualize-redo nil nil) > > command-execute(undo-tree-visualize-redo) > > In a reproduction of this, at the start of undo-tree-copy-list, > undo-list is: > > (nil (undo-tree-id3 . -2)) > > Then in this while loop: > > (while (null copy) > (setq copy > (undo-tree-restore-GC-elts-from-pool (pop undo-list)))) > > undo-tree-restore-GC-elts-from-pool returns nil for both elements, so > the while loop never ends. Perhaps you want instead (ignore-whitespace > diff): Could well be. Thanks a lot for the patch! I need to step through the minimal example and remember what this code is supposed to be doing, and then either apply your patch or figure out what the correct fix is (to this, and the other undo-list-pop-changeset issue you pointed out, which at the moment seem to be separate issues). Cheers, Toby > --- a/emacs/lisp/undo-tree.el Fri Jan 17 19:18:15 2014 -0500 > +++ b/emacs/lisp/undo-tree.el Tue Jan 21 22:17:50 2014 -0500 > @@ -1690,13 +1690,13 @@ > (defun undo-tree-copy-list (undo-list) > ;; Return a deep copy of first changeset in `undo-list'. Object id's are > ;; replaced by corresponding objects from `buffer-undo-tree' object-pool. > - (when undo-list > (let (copy p) > ;; if first element contains an object id, replace it with object > from > ;; pool, discarding element entirely if it's been GC'd > - (while (null copy) > + (while (and undo-list (null copy)) > (setq copy > (undo-tree-restore-GC-elts-from-pool (pop undo-list)))) > + (when copy > (setq copy (list copy) > p copy) > ;; copy remaining elements, replacing object id's with objects from -- Dr T. S. Cubitt Royal Society University Research Fellow and Fellow of Churchill College, Cambridge Centre for Quantum Information DAMTP, University of Cambridge email: tsc25@cantab.net web: www.dr-qubit.org