bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#7496: 23.2; copy recursive keymap cause crash


From: Eli Zaretskii
Subject: bug#7496: 23.2; copy recursive keymap cause crash
Date: Sun, 13 Oct 2019 09:58:20 +0300

> From: Lars Ingebrigtsen <larsi@gnus.org>
> Date: Sun, 13 Oct 2019 03:15:17 +0200
> Cc: ARISAWA Akihiro <ari@mbf.ocn.ne.jp>, 7496@debbugs.gnu.org
> 
> >> (let ((map (make-sparse-keymap)))
> >>   (define-key map " " map)
> >>   (copy-keymap map))
> >
> > I'm not surprised.  There are many ways to address it:
> > - try and make sure we better handle the "using up all memory" case
> >   rather than crashing.  This is very difficult.  We already try to do
> >   it, but clearly it's not working that well.
> > - try and detect such cycles and either signal an error or reproduce the
> >   same cycle in the copy.  We have added such things in several other
> >   cases, so we should probably do that.
> 
> While this is a pretty obscure, Emacs shouldn't crash on stuff like
> this.  I first considered whether just to check for EQ in Fcopy_keymap,
> but it's possible to have nested keymaps that are mutually recursive,
> so that won't work.
> 
> So I just added a recursion counter and refuse to copy when we've
> reached level 100.

What happens in the current master without that limitation?  We have
since added stack overflow protection -- doesn't it kick in in this
case?





reply via email to

[Prev in Thread] Current Thread [Next in Thread]