From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Daniel =?UTF-8?Q?Mart=C3=ADn?= via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#63495: 28.2; menu crashes on macos Date: Mon, 10 Jul 2023 23:00:49 +0200 Message-ID: References: Reply-To: Daniel =?UTF-8?Q?Mart=C3=ADn?= Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8090"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (darwin) Cc: alan@idiocy.org, obriendavid1@gmail.com, me@eshelyaron.com To: 63495@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Jul 10 23:02:11 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qIy1K-0001up-Pm for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 10 Jul 2023 23:02:10 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qIy1F-0002UN-L8; Mon, 10 Jul 2023 17:02:05 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qIy1C-0002SP-Tn for bug-gnu-emacs@gnu.org; Mon, 10 Jul 2023 17:02:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qIy1C-0002u7-Lt for bug-gnu-emacs@gnu.org; Mon, 10 Jul 2023 17:02:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qIy1C-0006TC-HW for bug-gnu-emacs@gnu.org; Mon, 10 Jul 2023 17:02:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Daniel =?UTF-8?Q?Mart=C3=ADn?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 10 Jul 2023 21:02:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63495 X-GNU-PR-Package: emacs X-Debbugs-Original-To: Eshel Yaron via "Bug reports for GNU Emacs, the Swiss army knife of text editors" X-Debbugs-Original-Cc: alan@idiocy.org, obriendavid1@gmail.com, Eshel Yaron , 63495@debbugs.gnu.org Original-Received: via spool by 63495-submit@debbugs.gnu.org id=B63495.168902286524786 (code B ref 63495); Mon, 10 Jul 2023 21:02:02 +0000 Original-Received: (at 63495) by debbugs.gnu.org; 10 Jul 2023 21:01:05 +0000 Original-Received: from localhost ([127.0.0.1]:49242 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qIy0G-0006Rh-Ku for submit@debbugs.gnu.org; Mon, 10 Jul 2023 17:01:05 -0400 Original-Received: from sonic314-20.consmr.mail.ir2.yahoo.com ([77.238.177.146]:45822) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qIy0D-0006R6-CR for 63495@debbugs.gnu.org; Mon, 10 Jul 2023 17:01:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.es; s=s2048; t=1689022855; bh=FyCtp6omu9aTR4/Kg3zZmrKT9P2cvgX6zAit+RiMSPs=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From:Subject:Reply-To; b=s63baedoAVsOBf4sViye/N4j6x9NQQ3Qe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rbGtM0ZacWiCtAnn4OfbiJ9kWHk6_0vn5WC4Q 1B0Ac.J9RpbC5eEs6NnypEevzDqiJPGHbicyxpLva3fWDQrIRjT3yx9y8GGSLf9wrtOQRwftCdfh KWlRodrdf2SHU8cnA2SuNb1Yg0cO23krmyTNqDDjd.kIkVXNKoSP5yznOfhQQi6BXddXHH9.KR78 9nus_KE1bwvL5CFRj570Fo9eFcJL8yNEJYk3j2U1YaQ.QPWRL2v57e5k12PUclwx037BoyCLuNwP jwa15..YllIM3Vs2HL3qaS5jUvFqHAf8NXwZtp7gYPezAO9SWJsACzXwoE4BDtvM783F6aKV.tnz ihLCuO3sqTEP1AdTTxCj1IyrFGKYUf_nwrkx9zvabszFaYp1dv5tjfq78thUVOOFPfYQWszEX4zs uleGQ6nubxkkXWbnSyRi.aCDv7q01BdFWvF_EuMoR7wzgjjqVOt88nFXFqpfma28y2cWWqJHzfqG 3e3QJV8fY1rMhcKQFmqJekRPDZXwBKaPMdpmiMdruEKg9XfxsducEUOKCIapBx8FNonKUiZEutIo u493dmEHuryWq7R42ofF45wPfHVO9WkJLu_wBzhvHa X-Sonic-MF: X-Sonic-ID: 812816f2-beab-4d43-9a12-d49f894a496a Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic314.consmr.mail.ir2.yahoo.com with HTTP; Mon, 10 Jul 2023 21:00:55 +0000 Original-Received: by hermes--production-ir2-7858d959bd-hmv8h (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 73d82f6f1065b5f2c39a0eace3bb350a; Mon, 10 Jul 2023 21:00:50 +0000 (UTC) In-Reply-To: (Eshel Yaron via's message of "Sun, 09 Jul 2023 10:29:58 +0300") X-Mailer: WebService/1.1.21638 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:264906 Archived-At: Eshel Yaron via "Bug reports for GNU Emacs, the Swiss army knife of text editors" writes: >>> When using the menu - I can call up and see the menu, but if I try to >>> select a menu item this always results in emacs crashing. >> >> I can't reproduce this bug on Emacs 29. Could you try to reproduce it >> on this version? I remember fixing some problems with the macOS menu >> bar recently, so perhaps this bug is already fixed. > > FWIW this seems very similar to Bug#62402. At least over here (macOS > 13.4, Emacs master), Emacs still reliably crashes when selecting an item > in a popup menu. Thanks, I can reproduce the issue with the recipe in Bug#62402. I see that this is a regression in Emacs 28 and Emacs 29. I can't reproduce the bug in Emacs 27. A bisect shows that this is the first commit that introduced the bug: commit c9b37634b131f3617314bd5a38090e96d0b465cf Author: Alan Third Date: Wed Dec 23 20:12:02 2020 +0000 Remove NS menu synthesized events (bug#44333) Remove the frame tracking stuff as it's not used for anything, and move the update tracking into the EmacsMenu class. * src/nsmenu.m (ns_update_menubar): Copy the parsing code from xmenu.c and rework the NS specific code around to update the existing menus instead of rebuilding them completely. (ns_activate_menubar): ([EmacsMenu trackingNotification:]): ([EmacsMenu menuWillOpen:]): ([EmacsMenu menuDidClose:]): Remove unused functions. ([EmacsMenu menuNeedsUpdate:]): Remove menu tracking code and add code to check whether an update is required. ([EmacsMenu fillWithWidgetValue:]): ([EmacsMenu addSubmenuWithTitle:]): ([EmacsMenu initWithTitle:]): Remove references to frame. ([EmacsMenu setFrame:]): Remove method. ([EmacsMenu clear]): Rename to removeAllItems. ([EmacsMenu removeAllItems]): Use built-in removeAllItems, if available. (syms_of_nsmenu): Remove tracking code. * src/nsterm.m (ns_check_menu_open): (ns_check_pending_open_menu): (ns_create_terminal): Remove unused functions. (ns_term_init): Get rid of menu tracking. * src/nsterm.h (EmacsMenu): Remove frame, add needsUpdate and update method definitions. One notable thing in that patch is that, in menuNeedsUpdate:, ns_update_menubar is now called, if needed, in the Cocoa and the GNUstep build. If I put the call to ns_update_menubar inside the #ifdef NS_IMPL_GNUSTEP (so that it's not run in the Cocoa build), I can't reproduce the crash anymore. But I don't know if there are any side effects or what motivated the change in the first place. I've copied Alan, just in case he has any comments about how we can fix this issue.