unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eshel Yaron via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: Ruijie Yu <ruijie@netyu.xyz>, 62402@debbugs.gnu.org
Subject: bug#62402: 30.0.50; Emacs crashes on popup menu selection
Date: Thu, 23 Mar 2023 15:18:41 +0200	[thread overview]
Message-ID: <m15yarppvy.fsf@eshelyaron.com> (raw)
In-Reply-To: <83zg834xnd.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 23 Mar 2023 11:36:38 +0200")

Eli Zaretskii <eliz@gnu.org> writes:

>> Cc: 62402@debbugs.gnu.org
>> Date: Thu, 23 Mar 2023 16:56:20 +0800
>> From:  Ruijie Yu via "Bug reports for GNU Emacs,
>>  the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
>> 
>> FTR, I cannot reproduce this issue on PGTK GNU/Linux with 30.0.50
>> (c6bfffa9fe1af7f4f806e5533ba5f3c33476cf9a), so this issue might be OS-
>> or WM-specific.
>
> And I cannot reproduce on MS-Windows, so I think this is indeed macOS
> specific.

Thanks for looking into it.  Indeed it seems to be a problem specific to
MacOS.  To shed some more light I've rebuilt Emacs with CFLAGS="-g3 -O0"
and ran it under lldb, which shows the following backtrace:

* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x3)
  * frame #0: 0x00000001000aebad emacs`AREF(array=0x0000000000000000, idx=0) at lisp.h:1947:10
    frame #1: 0x00000001000af660 emacs`find_and_return_menu_selection(f=0x00000001100dee30, keymaps=true, client_data=0x000000011089b888) at menu.c:985:11
    frame #2: 0x0000000100380f2b emacs`-[EmacsMenu runMenuAt:forFrame:keymaps:](self=0x00006000017007c0, _cmd="runMenuAt:forFrame:keymaps:", p=(x = 2, y = 506), f=0x00000001100dee30, keymaps=true) at nsmenu.m:767:9
    frame #3: 0x0000000100381f00 emacs`ns_menu_show(f=0x00000001100dee30, x=2, y=2, menuflags=1, title=0x0000000000000000, error=0x00007ff7bfefce80) at nsmenu.m:1067:9
    frame #4: 0x00000001000b1203 emacs`x_popup_menu_1(position=0x000000011804dcb3, menu=0x000000011804e003) at menu.c:1410:17
    frame #5: 0x00000001000b15a2 emacs`Fx_popup_menu(position=0x000000011804dcb3, menu=0x000000011804e003) at menu.c:1474:10
    frame #6: 0x0000000100247c58 emacs`eval_sub(form=0x000000011804dd23) at eval.c:2503:15
    ...

It seems that the (MacOS-specific) function
`find_and_return_menu_selection` in menu.c tries to access the global
variable `menu_items` before it's initialized.  I'm not sure when or
where it should be initialized though :(

-- 
Eshel





      reply	other threads:[~2023-03-23 13:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-23  8:43 bug#62402: 30.0.50; Emacs crashes on popup menu selection Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-03-23  8:56 ` Ruijie Yu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-03-23  9:36   ` Eli Zaretskii
2023-03-23 13:18     ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]

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=m15yarppvy.fsf@eshelyaron.com \
    --to=bug-gnu-emacs@gnu.org \
    --cc=62402@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=me@eshelyaron.com \
    --cc=ruijie@netyu.xyz \
    /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).