[MacPorts] #68706: Emacs Mac App Locks Up When Raising Context Menu

MacPorts noreply at macports.org
Wed Nov 15 05:15:41 UTC 2023


#68706: Emacs Mac App Locks Up When Raising Context Menu
--------------------------+--------------------
 Reporter:  kickingvegas  |      Owner:  (none)
     Type:  defect        |     Status:  new
 Priority:  Normal        |  Milestone:
Component:  ports         |    Version:
 Keywords:                |       Port:
--------------------------+--------------------
 == Title
 Emacs Mac App Locks Up When Raising Context Menu

 == Description
 I am able to intermittently lock up the Emacs Mac App when using context-
 menu mode (described in
 [[https://www.gnu.org/software/emacs/manual/html_node/emacs/Menu-Mouse-
 Clicks.html|Menu Mouse Clicks (GNU Emacs Manual)]]).

 == Environment
 OS: 14.1.1 (23B81) MacPorts: 2.8.1  HW: Apple M1 Pro

 == Steps to Reproduce
 # Launch Emacs Mac App from command line using -Q argument to bypass any
 user configuration.
 # Turn on context menu mode (`M-x context-menu-mode`)
 # Repeatedly invoke/raise the context menu by right-mouse button (button
 3) clicking on the current buffer and moving the mouse cursor over a menu
 item and pulling it away to //not// invoke a menu command.

 == Expected Result
 No action should be taken by Emacs as no command from the context menu is
 selected.

 == Actual Result
 Emacs Mac App locks up. The following message was emitted on the console:

 {{{
 ┏━ cchoi at bingsu:/Applications/MacPorts/EmacsMac.app/Contents/MacOS
 ┗━━ $ ./Emacs.sh  -Q
 2023-11-14 20:24:24.764 Emacs[36346:246906] TSM
 AdjustCapsLockLEDForKeyTransitionHandling -
 _ISSetPhysicalKeyboardCapsLockLED Inhibit
 *** Terminating app due to uncaught exception
 'NSInvalidArgumentException', reason: '-[_NSServiceEntry
 getBytes:length:]: unrecognized selector sent to instance 0x600001e60700'
 *** First throw call stack:
 (
         0   CoreFoundation                      0x00000001869ce800
 __exceptionPreprocess + 176
         1   libobjc.A.dylib                     0x00000001864c5eb4
 objc_exception_throw + 60
         2   CoreFoundation                      0x0000000186a803bc
 -[NSObject(NSObject) __retain_OA] + 0
         3   CoreFoundation                      0x0000000186938a84
 ___forwarding___ + 1572
         4   CoreFoundation                      0x00000001869383a0
 _CF_forwarding_prep_0 + 96
         5   Emacs                               0x00000001046e1c8c
 -[EmacsController(Menu) menu:willHighlightItem:] + 76
         6   AppKit                              0x000000018a3da664
 -[NSMenu _informDelegateOfHighlightedItem:] + 140
         7   AppKit                              0x000000018a9310a8
 -[NSCocoaMenuImpl _addHighlightForView:] + 356
         8   AppKit                              0x000000018a930cf8
 __60-[NSCocoaMenuImpl
 _highlightMenuItemView:shouldOpenSubmenu:]_block_invoke + 224
         9   AppKit                              0x000000018a930958
 -[NSCocoaMenuImpl _highlightMenuItemView:shouldOpenSubmenu:] + 300
         10  AppKit                              0x000000018a92fedc
 -[NSCocoaMenuImpl _routeEventIfNeeded:toSubview:] + 564
         11  AppKit                              0x000000018a92fa5c
 -[NSCocoaMenuImpl handleMouseEvent:] + 232
         12  AppKit                              0x000000018a7122e0
 -[NSContextMenuImpl handleMovedDraggedEvent:] + 168
         13  AppKit                              0x000000018a758720
 -[NSMenuTrackingSession _sendMouseMovedDragged:] + 96
         14  AppKit                              0x000000018a757cf8
 -[NSMenuTrackingSession _mouseMovedDraggedEventHandler:] + 1956
         15  AppKit                              0x000000018a7558d4
 -[NSMenuTrackingSession handleEvent:] + 180
         16  AppKit                              0x000000018a75504c
 -[NSMenuTrackingSession startRunningMenuEventLoop:] + 420
         17  AppKit                              0x000000018ae8685c
 -[NSContextMenuTrackingSession startMonitoringEventsInMode:] + 76
         18  AppKit                              0x000000018a70e508
 +[NSContextMenuImpl presentPopup:fromView:withContext:animated:] + 640
         19  AppKit                              0x000000018a933fc4
 _NSPopUpMenu + 1988
         20  AppKit                              0x000000018a93857c
 -[NSCocoaMenuImpl _popUpContextMenu:withEvent:forView:withFont:] + 304
         21  AppKit                              0x000000018a4579d8
 -[NSMenu _popUpContextMenu:withEvent:forView:withFont:] + 188
         22  Emacs                               0x00000001046e2420
 -[EmacsFrameController(Menu) popUpMenu:atLocationInEmacsView:] + 232
         23  Emacs                               0x00000001046e2e4c
 __create_and_show_popup_menu_block_invoke_2 + 44
         24  Emacs                               0x00000001046f11c4
 __mac_within_gui_allowing_inner_lisp_block_invoke + 28
         25  Emacs                               0x00000001046effa4
 mac_gui_loop + 88
         26  Emacs                               0x00000001047097ec
 main.cold.1 + 16
         27  Emacs                               0x00000001046efc98 main +
 616
         28  dyld                                0x00000001865010e0 start +
 2360
 )
 libc++abi: terminating due to uncaught exception of type NSException
 Killed: 9
 }}}

 At this point, force quitting the app is the only available option,
 opening the risk to loss of state that is not persisted.

-- 
Ticket URL: <https://trac.macports.org/ticket/68706>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list