[Top][All Lists]

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

bug#7496: 23.2; copy recursive keymap cause crash

From: Stefan Monnier
Subject: bug#7496: 23.2; copy recursive keymap cause crash
Date: Fri, 26 Nov 2010 22:01:28 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

> When I call `copy-keymap' with a keymap which contains recursive binding,
> the emacs crashed.
> I can reproduce it by following sexp.

> (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.
- don't use cyclic keymaps and especially don't copy them.
- don't use copy-keymap, instead: inherit.


reply via email to

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