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#16377: Undo Tree regression: (error "Unrecognized entry in undo list undo-tree-canary") Date: Tue, 7 Jan 2014 04:14:42 +0000 Message-ID: <20140107041442.GA12172@c3po> References: Reply-To: Toby Cubitt NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1389068173 22417 80.91.229.3 (7 Jan 2014 04:16:13 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 7 Jan 2014 04:16:13 +0000 (UTC) Cc: 16377@debbugs.gnu.org To: Barry OReilly Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Jan 07 05:16:19 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 1W0O5Q-0002vY-PA for geb-bug-gnu-emacs@m.gmane.org; Tue, 07 Jan 2014 05:16:16 +0100 Original-Received: from localhost ([::1]:38688 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W0O5Q-0002GQ-6f for geb-bug-gnu-emacs@m.gmane.org; Mon, 06 Jan 2014 23:16:16 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55160) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W0O5J-0002GI-9Z for bug-gnu-emacs@gnu.org; Mon, 06 Jan 2014 23:16:13 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W0O5C-0000J1-Ll for bug-gnu-emacs@gnu.org; Mon, 06 Jan 2014 23:16:09 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:54092) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W0O5C-0000Ix-Hn for bug-gnu-emacs@gnu.org; Mon, 06 Jan 2014 23:16:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1W0O5B-00028R-SP for bug-gnu-emacs@gnu.org; Mon, 06 Jan 2014 23:16:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Toby Cubitt Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 07 Jan 2014 04:16:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 16377 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.13890681058130 (code B ref -1); Tue, 07 Jan 2014 04:16:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 7 Jan 2014 04:15:05 +0000 Original-Received: from localhost ([127.0.0.1]:39878 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1W0O4G-000273-6N for submit@debbugs.gnu.org; Mon, 06 Jan 2014 23:15:04 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:53347) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1W0O4D-00026N-3S for submit@debbugs.gnu.org; Mon, 06 Jan 2014 23:15:02 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W0O48-0008OL-6I for submit@debbugs.gnu.org; Mon, 06 Jan 2014 23:15:00 -0500 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:36067) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W0O48-0008OH-3p for submit@debbugs.gnu.org; Mon, 06 Jan 2014 23:14:56 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55056) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W0O43-00027E-Ng for bug-gnu-emacs@gnu.org; Mon, 06 Jan 2014 23:14:56 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W0O3z-0008NX-Bz for bug-gnu-emacs@gnu.org; Mon, 06 Jan 2014 23:14:51 -0500 Original-Received: from starfish.geekisp.com ([216.168.135.166]:23105) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1W0O3z-0008NT-6n for bug-gnu-emacs@gnu.org; Mon, 06 Jan 2014 23:14:47 -0500 Original-Received: (qmail 9382 invoked by uid 1003); 7 Jan 2014 04:14:46 -0000 Original-Received: from localhost (localhost.geekisp.com [127.0.0.1]) by localhost.geekisp.com (tmda-ofmipd) with ESMTP; Mon, 06 Jan 2014 23:14:43 -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:83086 Archived-At: Hi Barry, Thanks for the bug report and recipe. On Mon, Jan 06, 2014 at 07:32:45PM -0500, Barry OReilly wrote: > Don't know yet if the code change belongs in Undo Tree or Emacs but > the recipe is: > > • Start Emacs in scratch buffer with global-undo-tree-mode enabled > • Go to BOB and insert "xxx" > • Select first line > • undo-tree-undo in region > • undo-tree-redo in region > • undo-tree-visualize > • Navigate down (redo)* > • Navigate up (undo) > > Upon the navigate up, this error occurs: > > Debugger entered--Lisp error: (error "Unrecognized entry in undo list > undo-tree-canary") > signal(error ("Unrecognized entry in undo list undo-tree-canary")) > error("Unrecognized entry in undo list %S" undo-tree-canary) > primitive-undo(1 (undo-tree-canary)) > undo-tree-undo-1(1) > undo-tree-visualize-undo(1) > call-interactively(undo-tree-visualize-undo nil nil) > command-execute(undo-tree-visualize-undo) I also can't reproduce this in current stable Emacs. (Which is odd, as my first guess from the backtrace would have been that this is a bug in the relatively untested undo-tree undo-in-region code, and nothing to do with Emacs.) > * 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) > > Don't know if it's related or not. > > This recipe does not cause a problem with Emacs 24.3. Confirmed. > The following commit is suspicious: > > commit 0c180ea96c022923ef18a255d0492bdb5ad04e02 > Author: Aaron S. Hawley > Date: Tue Jan 8 14:13:31 2013 -0500 > > * lisp/simple.el (primitive-undo): Move from undo.c. > * src/undo.c (Fprimitive_undo): Move to simple.el. > (syms_of_undo): Remove declaration for Sprimitive_undo. > * test/automated/undo-tests.el: New file. > > The commit moved primitive-undo from C to Elisp. In the process, it > added an else condition not present in the C code: > > + (t (error "Unrecognized entry in undo list %S" next))))) OK, who messed with `primitive-undo' without making absolutely sure the elisp implementation was strictly identical to the aeons-old c implementation, and can I shoot them please? ;-) Seriously, from the backtrace, the error does seem to be thrown by the new test. Whether that's an Emacs regression, or just that the new test is catching an existing bug in undo-tree, is harder to tell. I'll play around with it in a fresh vcs Emacs when I have some time. In the meantime, since this *is* a regression of sorts(*), can you bisect to confirm this is the commit that broke things? (*) I'd hope that a key requirement of moving `primitive-undo' to elisp is surely that it not introduce changes in behaviour. > The consequence of this bug is that when using Undo Tree, recent undo > history can become completely inaccessible. > > I should note that if I don't undo in region, Undo Tree has never run > into any problems with the Emacs on trunk. Have you hit other reproducible undo-in-region bugs on trunk? If so, please report them! The undo-tree undo-in-region code is fiendishly complex, hard to test, and under-tested. Best, Toby PS: Sorry if I've broken threading on bug-gnu-emacs and generated a new bug number. I have delivery disabled currently as I don't have time to follow it. But it seems worth copying my reply there. -- 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