GNU bug report logs - #15907
24.3; Emacs crash due to substitute-command-keys and after-change-functions

Previous Next

Package: emacs;

Reported by: Artur Malabarba <bruce.connor.am <at> gmail.com>

Date: Fri, 15 Nov 2013 22:06:01 UTC

Severity: normal

Found in version 24.3

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #13 received at 15907-done <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: bruce.connor.am <at> gmail.com
Cc: 15907-done <at> debbugs.gnu.org
Subject: Re: bug#15907: 24.3;
 Emacs crash due to substitute-command-keys and after-change-functions
Date: Sat, 16 Nov 2013 12:29:36 +0200
> Date: Sat, 16 Nov 2013 11:31:16 +0200
> From: Eli Zaretskii <eliz <at> gnu.org>
> Cc: 15907 <at> debbugs.gnu.org
> 
> > 1. Start `emacs -Q';
> > 2. Evaluate the following two statements:
> >        (add-hook 'after-change-functions (lambda (&rest a) (format "%s" 1)))
> >        (substitute-command-keys "\\{emacs-lisp-mode-map}")
> > 3. That's it. Emacs crashes.
> > 
> > The crash doesn't happen if you replace the number 1 with a string or
> > a symbol, but it does also happen if you replace it with a list.
> 
> It no longer crashes after changes in trunk revision 115119.
> 
> > This is most annoying as it causes a crash whenever `describe-mode' is
> > invoked.
> 
> Since you didn't show any real-life use cases, I'm not sure that the
> result is what you wanted, please do check.

Actually, I think you will like revision 115120 much better.  The
underlying problem was that substitute-command-keys sometimes uses an
internal buffer, whose changes would trigger your after-change
function, which would invoke 'format', which uses the same internal
buffer...

As I now think I know what was your real-life problem, and it is now
fixed, I'm closing this bug report.  Feel free to re-open if there are
some leftovers.

Thanks.




This bug report was last modified 11 years and 245 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.