unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Aaron Jensen <aaronjensen@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: Alan Third <alan@idiocy.org>, 30800@debbugs.gnu.org
Subject: bug#30800: 26.0.91; unknown crash on macos
Date: Wed, 21 Mar 2018 22:35:23 -0700	[thread overview]
Message-ID: <CAHyO48x1TJMaNqC8_+Jr7TUnHSrXJ2=4x8Ejm87+HUpnbsHO0w@mail.gmail.com> (raw)
In-Reply-To: <83d0zxjk5p.fsf@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 627 bytes --]

On Wed, Mar 21, 2018 at 12:36 PM, Eli Zaretskii <eliz@gnu.org> wrote:
>> or just add
>>
>>     if (represented_frame == f)
>>       represented_frame = NULL;
>>
>> to x_destroy_frame as you say.
>
> If that fixes the problem, it's the safest change I can think of, so
> perhaps Aaron could try running Emacs 26.0.91 with it.

It seems to fix it. I'm unable to reproduce the crash with this patch
applied. I tried to represent what was going on in my comments/commit
messages but I'm happy to change them if anyone has a better way to
describe it. That is if you want to apply this instead of fixing it in
another way.

Thanks.

[-- Attachment #2: 0001-Fix-crash-after-frame-is-freed-on-macOS-bug-30800.patch --]
[-- Type: application/octet-stream, Size: 892 bytes --]

From 323740bf0d554fbfc6afc90ed81c68879cd46ece Mon Sep 17 00:00:00 2001
From: Aaron Jensen <aaronjensen@gmail.com>
Date: Wed, 21 Mar 2018 22:30:08 -0700
Subject: [PATCH] Fix crash after frame is freed on macOS (bug#30800)

* src/nsterm.m (x_free_frame_resources): Clear represented_frame.
(bug#30800)
---
 src/nsterm.m | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/nsterm.m b/src/nsterm.m
index 3d58cd5ec6..c8ae31abc0 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -1692,6 +1692,10 @@ -(void)remove
     dpyinfo->x_highlight_frame = 0;
   if (f == hlinfo->mouse_face_mouse_frame)
     reset_mouse_highlight (hlinfo);
+  /* Ensure that sendEvent does not attempt to dereference a freed
+     frame. (bug#30800) */
+  if (represented_frame == f)
+    represented_frame = NULL;
 
   if (f->output_data.ns->miniimage != nil)
     [f->output_data.ns->miniimage release];
-- 
2.16.2


  parent reply	other threads:[~2018-03-22  5:35 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-13 16:18 bug#30800: 26.0.91; unknown crash on macos Aaron Jensen
2018-03-13 16:36 ` Aaron Jensen
2018-03-20 23:39   ` Aaron Jensen
2018-03-21  6:37     ` Eli Zaretskii
2018-03-21 16:25       ` Aaron Jensen
2018-03-21 17:00         ` Eli Zaretskii
2018-03-21 17:09           ` Eli Zaretskii
2018-03-21 17:31             ` Aaron Jensen
2018-03-21 18:22               ` Eli Zaretskii
2018-03-21 18:31                 ` Aaron Jensen
2018-03-21 18:48                   ` Eli Zaretskii
2018-03-21 19:19                     ` Alan Third
2018-03-21 19:36                       ` Eli Zaretskii
2018-03-21 20:12                         ` Alan Third
2018-03-22  5:40                           ` Aaron Jensen
2018-03-22  7:26                             ` Eli Zaretskii
2018-03-22 15:39                               ` Aaron Jensen
2018-03-22 15:57                                 ` Eli Zaretskii
2018-03-23  1:49                                   ` Aaron Jensen
2018-03-23  8:16                                     ` Eli Zaretskii
2018-03-23 19:52                                   ` Alan Third
2018-03-23 20:57                                     ` Aaron Jensen
2018-03-24  7:20                                     ` Aaron Jensen
2018-03-24 10:29                                       ` Alan Third
2018-03-24 14:54                                         ` Eli Zaretskii
2018-03-24 16:18                                           ` Alan Third
2018-03-24 17:48                                             ` Eli Zaretskii
2018-03-25 19:17                                               ` Alan Third
2018-03-24 10:49                                     ` Charles A. Roelli
2018-03-24 14:12                                       ` Alan Third
2018-03-25 20:14                                         ` Charles A. Roelli
2018-03-26 18:37                                           ` Alan Third
2018-03-26 23:03                                             ` Aaron Jensen
2018-03-30 11:37                                               ` Alan Third
2018-03-30 11:57                                                 ` Aaron Jensen
2018-03-22  5:35                         ` Aaron Jensen [this message]
2018-03-22  7:16                           ` Eli Zaretskii

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='CAHyO48x1TJMaNqC8_+Jr7TUnHSrXJ2=4x8Ejm87+HUpnbsHO0w@mail.gmail.com' \
    --to=aaronjensen@gmail.com \
    --cc=30800@debbugs.gnu.org \
    --cc=alan@idiocy.org \
    --cc=eliz@gnu.org \
    /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).