From: Eli Zaretskii <eliz@gnu.org>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: ari@mbf.ocn.ne.jp, monnier@iro.umontreal.ca, 7496@debbugs.gnu.org
Subject: bug#7496: 23.2; copy recursive keymap cause crash
Date: Sun, 13 Oct 2019 09:58:20 +0300 [thread overview]
Message-ID: <83zhi5ku7n.fsf@gnu.org> (raw)
In-Reply-To: <874l0dh2e2.fsf@gnus.org> (message from Lars Ingebrigtsen on Sun, 13 Oct 2019 03:15:17 +0200)
> 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?
next prev parent reply other threads:[~2019-10-13 6:58 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-27 1:08 bug#7496: 23.2; copy recursive keymap cause crash ARISAWA Akihiro
2010-11-27 3:01 ` Stefan Monnier
2010-11-27 5:10 ` ARISAWA Akihiro
2019-10-13 1:15 ` Lars Ingebrigtsen
2019-10-13 6:58 ` Eli Zaretskii [this message]
2019-10-13 17:56 ` Lars Ingebrigtsen
2019-10-13 18:47 ` Eli Zaretskii
2019-10-13 20:24 ` Stefan Monnier
2019-10-13 20:34 ` Lars Ingebrigtsen
2019-10-13 21:26 ` Stefan Monnier
2019-10-13 21:38 ` Drew Adams
2019-10-14 6:09 ` Eli Zaretskii
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=83zhi5ku7n.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=7496@debbugs.gnu.org \
--cc=ari@mbf.ocn.ne.jp \
--cc=larsi@gnus.org \
--cc=monnier@iro.umontreal.ca \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).