GNU bug report logs -
#59794
29.0.60; NSport segfaults when a fullscreen frame is being closed
Previous Next
Reported by: Kai Ma <justksqsf <at> gmail.com>
Date: Sat, 3 Dec 2022 08:22:02 UTC
Severity: normal
Merged with 64147
Found in versions 29.0.60, 30.0.50
Done: Daniel MartÃn <mardani29 <at> yahoo.es>
Bug is archived. No further changes may be made.
Full log
Message #38 received at 59794 <at> debbugs.gnu.org (full text, mbox):
Eli Zaretskii <eliz <at> gnu.org> writes:
> Why, cannot you access debbugs?
debbugs-browse-ephemeral-emacs-bug-group only included your reply to
this bug, and not the patch you replied to. That happens once in a
while for me.
> Anyway, attached below.
>
>>From 8ea35a8099f34f482d090ea8068e89f52dcd29ac Mon Sep 17 00:00:00 2001
> From: Kai Ma <justksqsf <at> gmail.com>
> Date: Sat, 3 Dec 2022 18:17:26 +0800
> Subject: [PATCH] Prevent a segfault when deleting a fullscreen frame on
> NextStep.
>
> * nsterm.m ([EmacsView resetCursorRects:]): Be defensive when
> accessing FRAME_OUTPUT_DATA.
> ---
> src/nsterm.m | 12 ++++++++++--
> 1 file changed, 10 insertions(+), 2 deletions(-)
>
> diff --git a/src/nsterm.m b/src/nsterm.m
> index 507f2a9e7d..c09f743ec7 100644
> --- a/src/nsterm.m
> +++ b/src/nsterm.m
> @@ -6703,8 +6703,16 @@ - (BOOL)acceptsFirstResponder
>
> - (void)resetCursorRects
> {
> - NSRect visible = [self visibleRect];
> - NSCursor *currentCursor = FRAME_POINTER_TYPE (emacsframe);
> + NSRect visible;
> + NSCursor *currentCursor;
> +
> + /* On macOS 13, [resetCursorRects:] could be called even after the
> + window is closed. */
> + if (! emacsframe || ! FRAME_OUTPUT_DATA (emacsframe))
> + return;
> +
> + visible = [self visibleRect];
> + currentCursor = FRAME_POINTER_TYPE (emacsframe);
> NSTRACE ("[EmacsView resetCursorRects]");
>
> if (currentCursor == nil)
Thanks. I'm fine with installing this on the release branch, but the
comment should be modified to say:
[resetCursorRects:] can be called from the event loop after the frame
is deleted. When this happens, emacsframe is NULL. This means there
is an underlying leak of the EmacsView object!
also, perhaps it should be omitted on master, at least until before
Emacs 30 is released, to motivate other (hopefully more knowledgeable)
people to provide the necessary information to fix it.
This bug report was last modified 1 year and 335 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.