From: Po Lu via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Kai Ma <justksqsf@gmail.com>
Cc: 59794@debbugs.gnu.org
Subject: bug#59794: 29.0.60; NSport segfaults when a fullscreen frame is being closed
Date: Sat, 03 Dec 2022 18:08:56 +0800 [thread overview]
Message-ID: <87r0xgre87.fsf@yahoo.com> (raw)
In-Reply-To: <m2mt865810.fsf@gmail.com> (Kai Ma's message of "Fri, 02 Dec 2022 20:01:31 +0800")
Kai Ma <justksqsf@gmail.com> writes:
> Emacs segfaults when a fullscreen frame is being deleted.
>
> Steps to reproduce on emacs -Q:
>
> 1. Launch an emacs instance. The default frame should be in the window
> mode for now.
>
> 2. C-x 5 2
>
> 3. In the new frame, M-x toggle-frame-fullscreen.
>
> 4. In the new frame, C-x 5 0 to delete the frame.
>
> Emacs then segfaults.
>
> LLDB trace:
>
> * thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0xc0)
> frame #0: 0x0000000100238ed5 emacs`-[EmacsView resetCursorRects](self=0x0000000102e3ddd0, _cmd=<unavailable>) at nsterm.m:6707:29 [opt]
> 6704 - (void)resetCursorRects
> 6705 {
> 6706 NSRect visible = [self visibleRect];
> -> 6707 NSCursor *currentCursor = FRAME_POINTER_TYPE (emacsframe);
> 6708 NSTRACE ("[EmacsView resetCursorRects]");
> 6709
> 6710 if (currentCursor == nil)
> Target 0: (emacs) stopped.
> warning: emacs was compiled with optimization - stepping may behave oddly; variables may not be available.
> (lldb) bt
> * thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0xc0)
> * frame #0: 0x0000000100238ed5 emacs`-[EmacsView resetCursorRects](self=0x0000000102e3ddd0, _cmd=<unavailable>) at nsterm.m:6707:29 [opt]
> frame #1: 0x00007ff819be1b95 AppKit`-[_NSTrackingAreaAKViewHelper updateTrackingAreasWithInvalidCursorRects:] + 357
> frame #2: 0x00007ff819e520f0 AppKit`_NSViewSubViewMutationSafeApply + 227
> frame #3: 0x00007ff819be1c53 AppKit`-[_NSTrackingAreaAKViewHelper updateTrackingAreasWithInvalidCursorRects:] + 547
> frame #4: 0x00007ff819e520f0 AppKit`_NSViewSubViewMutationSafeApply + 227
> frame #5: 0x00007ff819be1c53 AppKit`-[_NSTrackingAreaAKViewHelper updateTrackingAreasWithInvalidCursorRects:] + 547
> frame #6: 0x00007ff819bdfddf AppKit`-[_NSTrackingAreaAKManager displayCycleUpdateStructuralRegions] + 227
> frame #7: 0x00007ff8195f4a84 AppKit`__NSWindowGetDisplayCycleObserverForUpdateStructuralRegions_block_invoke + 390
> frame #8: 0x00007ff8195ef701 AppKit`NSDisplayCycleObserverInvoke + 142
> frame #9: 0x00007ff8195ef331 AppKit`NSDisplayCycleFlush + 878
> frame #10: 0x00007ff81de68f46 QuartzCore`CA::Transaction::run_commit_handlers(CATransactionPhase) + 98
> frame #11: 0x00007ff81de67a10 QuartzCore`CA::Transaction::commit() + 380
> frame #12: 0x00007ff81968cedf AppKit`__62+[CATransaction(NSCATransaction) NS_setFlushesWithDisplayLink]_block_invoke + 285
> frame #13: 0x00007ff819ea3513 AppKit`___NSRunLoopObserverCreateWithHandler_block_invoke + 41
> frame #14: 0x00007ff81640d0e2 CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23
> frame #15: 0x00007ff81640d00a CoreFoundation`__CFRunLoopDoObservers + 482
> frame #16: 0x00007ff81640c590 CoreFoundation`__CFRunLoopRun + 870
> frame #17: 0x00007ff81640bbb0 CoreFoundation`CFRunLoopRunSpecific + 560
> frame #18: 0x00007ff81fcedbd6 HIToolbox`RunCurrentEventLoopInMode + 292
> frame #19: 0x00007ff81fced9e6 HIToolbox`ReceiveNextEventCommon + 679
> frame #20: 0x00007ff81fced723 HIToolbox`_BlockUntilNextEventMatchingListInModeWithFilter + 70
> frame #21: 0x00007ff81952eb37 AppKit`_DPSNextEvent + 909
> frame #22: 0x00007ff81952d9b8 AppKit`-[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 1219
> frame #23: 0x00007ff81951fff3 AppKit`-[NSApplication run] + 586
> frame #24: 0x000000010023680d emacs`-[EmacsApp run](self=0x0000000102e09540, _cmd=<unavailable>) at nsterm.m:5818:7 [opt]
> frame #25: 0x0000000100235395 emacs`ns_select_1(nfds=0, readfds=0x00007ff7bfefdcb0, writefds=0x00007ff7bfefdc00, exceptfds=0x0000000000000000, timeout=0x00007ff7bfefddb0, sigmask=0x0000000000000000, run_loop_only=NO) at nsterm.m:4833:3 [opt]
> frame #26: 0x0000000100234f54 emacs`ns_select(nfds=<unavailable>, readfds=<unavailable>, writefds=<unavailable>, exceptfds=<unavailable>, timeout=<unavailable>, sigmask=<unavailable>) at nsterm.m:4885:10 [opt]
This time I cannot reproduce the bug on GNUstep.
It looks as if a reference to the EmacsFrame is being kept even after
the frame has been destroyed. Would someone who knows what
`NSView resetCursorRects' does in Mac OS speak up?
next prev parent reply other threads:[~2022-12-03 10:08 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-02 12:01 bug#59794: 29.0.60; NSport segfaults when a fullscreen frame is being closed Kai Ma
2022-12-03 10:08 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2022-12-03 10:27 ` Eli Zaretskii
2022-12-03 11:44 ` Gerd Möllmann
2022-12-03 13:03 ` Kai Ma
2022-12-03 13:53 ` Gerd Möllmann
2022-12-03 20:51 ` Kai Ma
[not found] ` <handler.59794.B.167005568724588.ack@debbugs.gnu.org>
2022-12-03 10:48 ` bug#59794: Acknowledgement (29.0.60; NSport segfaults when a fullscreen frame is being closed) Kai Ma
2022-12-04 6:54 ` bug#59794: 29.0.60; " Eli Zaretskii
2022-12-04 9:10 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-12-04 10:24 ` Eli Zaretskii
2022-12-04 11:59 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-12-04 12:21 ` Eli Zaretskii
2022-12-04 12:23 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-12-04 12:45 ` Kai Ma
2022-12-04 12:53 ` Eli Zaretskii
2022-12-04 13:53 ` Daniel Martín via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-12-04 14:04 ` Kai Ma
2022-12-05 1:10 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-01-10 20:35 ` Steven E. Harris
2023-01-11 1:14 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-01-11 4:38 ` Gerd Möllmann
2023-01-17 21:37 ` Steven E. Harris
2023-01-18 5:06 ` Gerd Möllmann
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=87r0xgre87.fsf@yahoo.com \
--to=bug-gnu-emacs@gnu.org \
--cc=59794@debbugs.gnu.org \
--cc=justksqsf@gmail.com \
--cc=luangruo@yahoo.com \
/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).