all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Robert Pluim <rpluim@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 58288@debbugs.gnu.org, larsi@gnus.org, ajd2195@columbia.edu
Subject: bug#58288: 29.0.50; (flyspell-correct-word-before-point) followed by <down> crashes emacs
Date: Wed, 05 Oct 2022 12:01:03 +0200	[thread overview]
Message-ID: <87k05e8u8w.fsf@gmail.com> (raw)
In-Reply-To: <83fsg3v9fb.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 04 Oct 2022 19:30:00 +0300")

>>>>> On Tue, 04 Oct 2022 19:30:00 +0300, Eli Zaretskii <eliz@gnu.org> said:

    >> Itʼs being set up, but menu_items is ending up as Qnil for some reason
    >> (I suspect something is going wrong with save_menu_items).

    Eli> GC, perhaps?

No, not GC.

frame #1: 0x00000001000754e0 emacs`find_and_return_menu_selection(f=0x00006210000c1530, keymaps=false, client_data=0x00006210006854e8) at menu.c:989:11
   986
   987 	  while (i < menu_items_used)
   988 	    {
-> 989 	      if (NILP (AREF (menu_items, i)))
   990 	        {
   991 	          subprefix_stack[submenu_depth++] = prefix;
   992 	          prefix = entry;
(lldb) p menu_items_used
(int) $36 = 59
(lldb) p menu_items
(Lisp_Object) $37 = NULL

So the code is assuming that menu_items_used > 0 means that menu_items
is valid, but we have this in menu.c:

    void
    save_menu_items (void)
    {
      Lisp_Object saved = list4 (menu_items_inuse ? menu_items : Qnil,
                                 make_fixnum (menu_items_used),
                                 make_fixnum (menu_items_n_panes),
                                 make_fixnum (menu_items_submenu_depth));
      record_unwind_protect (restore_menu_items, saved);
      menu_items_inuse = false;
      menu_items = Qnil;
    }

This fixes it, but it seems a bit dodgy to me, why has no other
platform ever run into this?

diff --git a/src/menu.c b/src/menu.c
index eeb0c9a7e5..a368da373b 100644
--- a/src/menu.c
+++ b/src/menu.c
@@ -147,7 +147,7 @@ restore_menu_items (Lisp_Object saved)
 void
 save_menu_items (void)
 {
-  Lisp_Object saved = list4 (menu_items_inuse ? menu_items : Qnil,
+  Lisp_Object saved = list4 (menu_items,
 			     make_fixnum (menu_items_used),
 			     make_fixnum (menu_items_n_panes),
 			     make_fixnum (menu_items_submenu_depth));


Robert
-- 





  reply	other threads:[~2022-10-05 10:01 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-03 21:20 bug#58288: 29.0.50; (flyspell-correct-word-before-point) followed by <down> crashes emacs Andrew John De Angelis
2022-10-04 11:19 ` Lars Ingebrigtsen
2022-10-04 12:32   ` Eli Zaretskii
2022-10-04 13:16     ` Robert Pluim
2022-10-04 13:47       ` Eli Zaretskii
2022-10-04 15:14         ` Robert Pluim
2022-10-04 16:30           ` Eli Zaretskii
2022-10-05 10:01             ` Robert Pluim [this message]
2022-10-05 10:06               ` Eli Zaretskii
2022-10-05 10:29                 ` Robert Pluim
2022-10-05 10:46                   ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-10-05 13:53                     ` Robert Pluim
2022-10-06  2:35                     ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87k05e8u8w.fsf@gmail.com \
    --to=rpluim@gmail.com \
    --cc=58288@debbugs.gnu.org \
    --cc=ajd2195@columbia.edu \
    --cc=eliz@gnu.org \
    --cc=larsi@gnus.org \
    /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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.