From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eshel Yaron 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: Thu, 13 Jul 2023 09:16:51 +0300 Message-ID: References: <87bkgjatup.fsf@eshelyaron.com> <87r0pdc9ej.fsf@eshelyaron.com> Reply-To: Eshel Yaron Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="40396"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: obriendavid1@gmail.com, 63495@debbugs.gnu.org, Daniel =?UTF-8?Q?Mart=C3=ADn?= To: Alan Third Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jul 13 08:17:24 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 1qJpdk-000AGT-1Z for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 13 Jul 2023 08:17:24 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qJpdS-0008GP-4d; Thu, 13 Jul 2023 02:17:06 -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 1qJpdO-0008F9-FY for bug-gnu-emacs@gnu.org; Thu, 13 Jul 2023 02:17: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 1qJpdO-0006L6-6T for bug-gnu-emacs@gnu.org; Thu, 13 Jul 2023 02:17:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qJpdO-0007rR-1w for bug-gnu-emacs@gnu.org; Thu, 13 Jul 2023 02:17:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eshel Yaron Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 13 Jul 2023 06:17:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63495 X-GNU-PR-Package: emacs Original-Received: via spool by 63495-submit@debbugs.gnu.org id=B63495.168922901830204 (code B ref 63495); Thu, 13 Jul 2023 06:17:02 +0000 Original-Received: (at 63495) by debbugs.gnu.org; 13 Jul 2023 06:16:58 +0000 Original-Received: from localhost ([127.0.0.1]:53238 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qJpdK-0007r6-D8 for submit@debbugs.gnu.org; Thu, 13 Jul 2023 02:16:58 -0400 Original-Received: from mail.eshelyaron.com ([107.175.124.16]:60384 helo=eshelyaron.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qJpdI-0007qy-A9 for 63495@debbugs.gnu.org; Thu, 13 Jul 2023 02:16:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eshelyaron.com; s=mail; t=1689229015; bh=xBtI//GGvRz9lUwFiZFCAYLwSLN4zDExDaVmrVzcbjw=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=aHsG0CeYX0mehpUgdNbNYVC0mwGIReqOa765ayzX7h+C1VZ58EDQTpd5lYiDOk6q3 GSagR9luUGyOh4eidwme/r8v080KrxPDho6awtgyFeqkTQhUA+axwQZZ2s4fePjN3t wU1nnPWK7shz+jsthowgSnxX7R2MK09D2dH9dnUtyOOyCDxcLaVTme6gUOa2PSlq4F XnscatduoqLpiI2h8P8p6CiDCRXfuODJHUS9M9FaOx4Po5edDMc3643JEvmJaZMCHt d9nlQbnWtzli212RG4eXnFU1oxz/OY5NByjG3CXX7GrsAFaTsfIXoJeWsd4Jfvskqj xCm+HyOIv8k5g== In-Reply-To: (Alan Third's message of "Wed, 12 Jul 2023 20:37:16 +0100") 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:265003 Archived-At: Alan Third writes: > Can you please try this: > > modified src/nsmenu.m > @@ -746,6 +746,8 @@ - (Lisp_Object)runMenuAt: (NSPoint)p forFrame: (struct frame *)f > NSEvent *e, *event; > long retVal; > > + needsUpdate = NO; > + > /* p = [view convertPoint:p fromView: nil]; */ > p.y = NSHeight ([view frame]) - p.y; > e = [[view window] currentEvent]; > > At a guess, when the menu opens the first thing AppKit does is check if > it needs updated, and since a new menu starts with needsUpdate=YES, it > goes ahead and tries to do it, which overwrites some important > variables from the original "build" of the menu. > > The context menu is built and then displayed, as opposed to the > top-menu that is partially built, then when it's to be displayed is > updated and filled in. I tried it, unfortunately, that doesn't seem to solve the issue. Emacs still crashes with a similar backtrace: --8<---------------cut here---------------start------------->8--- * thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x3) frame #0: 0x00000001000af1fd emacs`AREF(array=0x0000000000000000, idx=0) at lisp.h:1941:10 1938 AREF (Lisp_Object array, ptrdiff_t idx) 1939 { 1940 eassert (0 <= idx && idx < gc_asize (array)); -> 1941 return XVECTOR (array)->contents[idx]; 1942 } 1943 1944 INLINE Lisp_Object * Target 0: (emacs) stopped. (lldb) bt * thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x3) * frame #0: 0x00000001000af1fd emacs`AREF(array=0x0000000000000000, idx=0) at lisp.h:1941:10 frame #1: 0x00000001000b079e emacs`find_and_return_menu_selection(f=0x00000001030b0c30, keymaps=true, client_data=0x0000000110277e60) at menu.c:985:11 frame #2: 0x000000010037cc1a emacs`-[EmacsMenu runMenuAt:forFrame:keymaps:](self=0x000060000179c9c0, _cmd="runMenuAt:forFrame:keymaps:", p=(x = 2, y = 411), f=0x00000001030b0c30, keymaps=true) at nsmenu.m:769:9 frame #3: 0x0000000100380ac0 emacs`ns_menu_show(f=0x00000001030b0c30, x=2, y=97, menuflags=1, title=0x0000000102416284, error=0x00007ff7bfefcef0) at nsmenu.m:1069:9 frame #4: 0x00000001000b23f7 emacs`x_popup_menu_1(position=0x0000000118583f83, menu=0x0000000118587313) at menu.c:1410:17 frame #5: 0x00000001000b27d2 emacs`Fx_popup_menu(position=0x0000000118583f83, menu=0x0000000118587313) at menu.c:1474:10 frame #6: 0x000000010024e7d7 emacs`funcall_subr(subr=0x0000000100403c28, numargs=2, args=0x0000000118028188) at eval.c:3049:15 --8<---------------cut here---------------end--------------->8--- -- Best, Eshel