GNU bug report logs - #28661
25.3; closing fullscreen frame on macOS 10.13 High Sierra causes crash

Previous Next

Package: emacs;

Reported by: Kevin Lin <lin.kevin.k <at> gmail.com>

Date: Sun, 1 Oct 2017 15:45:02 UTC

Severity: normal

Tags: fixed

Found in version 25.3

Fixed in version 26.1

Done: Alan Third <alan <at> idiocy.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 28661 in the body.
You can then email your comments to 28661 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#28661; Package emacs. (Sun, 01 Oct 2017 15:45:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Kevin Lin <lin.kevin.k <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sun, 01 Oct 2017 15:45:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Kevin Lin <lin.kevin.k <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 25.3; closing fullscreen frame on macOS 10.13 High Sierra causes crash
Date: Sun, 1 Oct 2017 08:43:23 -0700
Dear Emacs maintainers,

Without any init files, I

1. start up Emacs from the Finder

2. open a second frame

3. make either frame fullscreen (by clicking on the
   green button in the title bar or running
   TOGGLE-FRAME-FULLSCREEN)

4. close the frame, either by clicking the red button
   or running DELETE-FRAME

On my machine, this causes Emacs to crash.

My copy of Emacs is the latest release from
https://emacsformacosx.com.  I have also tried this on
the latest nightly ("GNU Emacs 26.0.50 (build 1,
x86_64-apple-darwin13.4.0, NS appkit-1265.21 Version
10.9.5 (Build 13F1911)) of 2017-06-11") from that
site.  The behavior appears to be identical.

I just upgraded to macOS 10.13.  This did not happen
in 10.12.  I do not really view this behavior as a bug
in Emacs, per se, and more as a problem in High
Sierra, but am hoping a work-around can be found in
Emacs more quickly than getting Apple to fix this.

Thanks!




In GNU Emacs 25.3.1 (x86_64-apple-darwin13.4.0, NS appkit-1265.21
Version 10.9.5 (Build 13F1911))
 of 2017-09-12 built on builder10-9.local
Windowing system distributor 'Apple', version 10.3.1561
Configured using:
 'configure --with-ns '--enable-locallisppath=/Library/Application
 Support/Emacs/${version}/site-lisp:/Library/Application
 Support/Emacs/site-lisp' --with-modules'

Configured features:
NOTIFY ACL GNUTLS LIBXML2 ZLIB TOOLKIT_SCROLL_BARS NS MODULES

Important settings:
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Fundamental

Minor modes in effect:
  tooltip-mode: t
  global-eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  buffer-read-only: t
  line-number-mode: t
  transient-mark-mode: t

Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message dired format-spec rfc822 mml
mml-sec password-cache epg epg-config gnus-util mm-decode mm-bodies
mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail
rfc2047 rfc2045 ietf-drums mm-util help-fns help-mode easymenu
cl-loaddefs pcase cl-lib mail-prsvr mail-utils time-date mule-util
tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type
mwheel ns-win ucs-normalize term/common-win tool-bar dnd fontset image
regexp-opt fringe tabulated-list newcomment elisp-mode lisp-mode
prog-mode register page menu-bar rfn-eshadow timer select scroll-bar
mouse jit-lock font-lock syntax facemenu font-core frame cl-generic cham
georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao
korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech
european ethiopic indian cyrillic chinese charscript case-table epa-hook
jka-cmpr-hook help simple abbrev minibuffer cl-preloaded nadvice
loaddefs button faces cus-face macroexp files text-properties overlay
sha1 md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote kqueue cocoa ns multi-tty
make-network-process emacs)

Memory information:
((conses 16 195903 6959)
 (symbols 48 19499 0)
 (miscs 40 77 164)
 (strings 32 14910 5147)
 (string-bytes 1 432258)
 (vectors 16 32840)
 (vector-slots 8 649682 4354)
 (floats 8 160 52)
 (intervals 56 196 0)
 (buffers 976 19))




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#28661; Package emacs. (Sun, 01 Oct 2017 19:35:02 GMT) Full text and rfc822 format available.

Message #8 received at 28661 <at> debbugs.gnu.org (full text, mbox):

From: Alan Third <alan <at> idiocy.org>
To: Kevin Lin <lin.kevin.k <at> gmail.com>
Cc: 28661 <at> debbugs.gnu.org
Subject: Re: bug#28661: 25.3; closing fullscreen frame on macOS 10.13 High
 Sierra causes crash
Date: Sun, 1 Oct 2017 20:33:57 +0100
On Sun, Oct 01, 2017 at 08:43:23AM -0700, Kevin Lin wrote:
> Dear Emacs maintainers,
> 
> Without any init files, I
> 
> 1. start up Emacs from the Finder
> 
> 2. open a second frame
> 
> 3. make either frame fullscreen (by clicking on the
>    green button in the title bar or running
>    TOGGLE-FRAME-FULLSCREEN)
> 
> 4. close the frame, either by clicking the red button
>    or running DELETE-FRAME
> 
> On my machine, this causes Emacs to crash.

Hmm, we had this exact issue before and it disappeared when I did some
work on undecorated frames, etc.

> My copy of Emacs is the latest release from
> https://emacsformacosx.com.  I have also tried this on
> the latest nightly ("GNU Emacs 26.0.50 (build 1,
> x86_64-apple-darwin13.4.0, NS appkit-1265.21 Version
> 10.9.5 (Build 13F1911)) of 2017-06-11") from that
> site.  The behavior appears to be identical.

Is it possible for you to try building a newer version? If you use
homebrew I think you can do so with:

    $ brew install emacs --HEAD

Alternatively, is there anyone else out there using 10.13 and a recent
version of Emacs who can confirm? I’m still on 10.12 and will be for
the foreseeable future.

-- 
Alan Third




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#28661; Package emacs. (Sun, 01 Oct 2017 22:08:02 GMT) Full text and rfc822 format available.

Message #11 received at 28661 <at> debbugs.gnu.org (full text, mbox):

From: Kevin Lin <lin.kevin.k <at> gmail.com>
To: Alan Third <alan <at> idiocy.org>
Cc: 28661 <at> debbugs.gnu.org
Subject: Re: bug#28661: 25.3; closing fullscreen frame on macOS 10.13 High
 Sierra causes crash
Date: Sun, 1 Oct 2017 15:07:12 -0700
Hi,

Thanks for the quick response!

> Is it possible for you to try building a newer version? If you use
> homebrew I think you can do so with:
>
>     $ brew install emacs --HEAD

I tried, but my installation of homebrew is broken right now (probably
because of the 10.13 upgrade), and I don't have time to fix it right
at this moment.  I'll try building emacs on 10.13 in the next day or
two.

I did find that if I turned off fullscreen before deleting a frame,
then I don't get a crash.  Not that I'm proposing this as a solution
(though it can be automated via delete-frame-functions, as I have
done), but perhaps the information is useful.

Cheers,
Kevin




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#28661; Package emacs. (Sun, 01 Oct 2017 22:57:02 GMT) Full text and rfc822 format available.

Message #14 received at 28661 <at> debbugs.gnu.org (full text, mbox):

From: John Mastro <john.b.mastro <at> gmail.com>
To: Alan Third <alan <at> idiocy.org>
Cc: 28661 <at> debbugs.gnu.org, Kevin Lin <lin.kevin.k <at> gmail.com>
Subject: Re: bug#28661: 25.3; closing fullscreen frame on macOS 10.13 High
 Sierra causes crash
Date: Sun, 1 Oct 2017 15:56:31 -0700
Alan Third <alan <at> idiocy.org> wrote:
> On Sun, Oct 01, 2017 at 08:43:23AM -0700, Kevin Lin wrote:
>> Dear Emacs maintainers,
>>
>> Without any init files, I
>>
>> 1. start up Emacs from the Finder
>>
>> 2. open a second frame
>>
>> 3. make either frame fullscreen (by clicking on the
>>    green button in the title bar or running
>>    TOGGLE-FRAME-FULLSCREEN)
>>
>> 4. close the frame, either by clicking the red button
>>    or running DELETE-FRAME
>>
>> On my machine, this causes Emacs to crash.

[snip]

> Alternatively, is there anyone else out there using 10.13 and a recent
> version of Emacs who can confirm? I’m still on 10.12 and will be for
> the foreseeable future.

I see the crash on 10.13 at commit ee3024c (today)

        John




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#28661; Package emacs. (Sun, 01 Oct 2017 23:02:02 GMT) Full text and rfc822 format available.

Message #17 received at 28661 <at> debbugs.gnu.org (full text, mbox):

From: Alan Third <alan <at> idiocy.org>
To: John Mastro <john.b.mastro <at> gmail.com>
Cc: 28661 <at> debbugs.gnu.org, Kevin Lin <lin.kevin.k <at> gmail.com>
Subject: Re: bug#28661: 25.3; closing fullscreen frame on macOS 10.13 High
 Sierra causes crash
Date: Mon, 2 Oct 2017 00:01:40 +0100
On Sun, Oct 01, 2017 at 03:56:31PM -0700, John Mastro wrote:
> Alan Third <alan <at> idiocy.org> wrote:
> > Alternatively, is there anyone else out there using 10.13 and a recent
> > version of Emacs who can confirm? I’m still on 10.12 and will be for
> > the foreseeable future.
> 
> I see the crash on 10.13 at commit ee3024c (today)

Thanks.

Are either of you able to provide a backtrace from a debugger?
-- 
Alan Third




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#28661; Package emacs. (Mon, 02 Oct 2017 21:29:02 GMT) Full text and rfc822 format available.

Message #20 received at 28661 <at> debbugs.gnu.org (full text, mbox):

From: John Mastro <john.b.mastro <at> gmail.com>
To: Alan Third <alan <at> idiocy.org>
Cc: 28661 <at> debbugs.gnu.org, Kevin Lin <lin.kevin.k <at> gmail.com>
Subject: Re: bug#28661: 25.3; closing fullscreen frame on macOS 10.13 High
 Sierra causes crash
Date: Mon, 2 Oct 2017 14:27:51 -0700
[Message part 1 (text/plain, inline)]
Alan Third <alan <at> idiocy.org> wrote:
> On Sun, Oct 01, 2017 at 03:56:31PM -0700, John Mastro wrote:
>> Alan Third <alan <at> idiocy.org> wrote:
>> > Alternatively, is there anyone else out there using 10.13 and a recent
>> > version of Emacs who can confirm? I’m still on 10.12 and will be for
>> > the foreseeable future.
>>
>> I see the crash on 10.13 at commit ee3024c (today)
>
> Thanks.
>
> Are either of you able to provide a backtrace from a debugger?

Sure, I've attached a backtrace from lldb. Let me know if any other
info would help.

        John
[backtrace.txt (text/plain, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#28661; Package emacs. (Mon, 02 Oct 2017 22:35:01 GMT) Full text and rfc822 format available.

Message #23 received at 28661 <at> debbugs.gnu.org (full text, mbox):

From: Alan Third <alan <at> idiocy.org>
To: John Mastro <john.b.mastro <at> gmail.com>
Cc: 28661 <at> debbugs.gnu.org, Kevin Lin <lin.kevin.k <at> gmail.com>
Subject: Re: bug#28661: 25.3; closing fullscreen frame on macOS 10.13 High
 Sierra causes crash
Date: Mon, 2 Oct 2017 23:34:17 +0100
On Mon, Oct 02, 2017 at 02:27:51PM -0700, John Mastro wrote:
> Sure, I've attached a backtrace from lldb. Let me know if any other
> info would help.

Thank you.

>     frame #0: 0x00000001001b629d Emacs`-[EmacsView windowWillResize:toSize:](self=0x000000010c33a700, _cmd=<unavailable>, sender=<unavailable>, frameSize=(width = 1280, height = 800)) at nsterm.m:6912 [opt]
>    6909
>    6910	  if (! [self isFullscreen])
>    6911	    {
> -> 6912	      extra = FRAME_NS_TITLEBAR_HEIGHT (emacsframe)
>    6913	        + FRAME_TOOLBAR_HEIGHT (emacsframe);
>    6914	    }

Well, that’s just about the last thing I was expecting.

I guess that closing a fullscreen window now results in it being
resized. But is emacsframe already trashed by this point? That would
certainly cause a crash.

Can you please uncomment line 54 in nsterm.h to enable NSTRACE,
recompile, cause the crash and send the output to me?
-- 
Alan Third




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#28661; Package emacs. (Thu, 05 Oct 2017 00:45:01 GMT) Full text and rfc822 format available.

Message #26 received at 28661 <at> debbugs.gnu.org (full text, mbox):

From: John Mastro <john.b.mastro <at> gmail.com>
To: Alan Third <alan <at> idiocy.org>
Cc: 28661 <at> debbugs.gnu.org, Kevin Lin <lin.kevin.k <at> gmail.com>
Subject: Re: bug#28661: 25.3; closing fullscreen frame on macOS 10.13 High
 Sierra causes crash
Date: Wed, 4 Oct 2017 17:44:13 -0700
[Message part 1 (text/plain, inline)]
Alan Third <alan <at> idiocy.org> wrote:
> I guess that closing a fullscreen window now results in it being
> resized. But is emacsframe already trashed by this point? That would
> certainly cause a crash.
>
> Can you please uncomment line 54 in nsterm.h to enable NSTRACE,
> recompile, cause the crash and send the output to me?

I've done so and the trace is attached.

        John
[28661-nstrace.txt (text/plain, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#28661; Package emacs. (Sat, 07 Oct 2017 15:09:02 GMT) Full text and rfc822 format available.

Message #29 received at 28661 <at> debbugs.gnu.org (full text, mbox):

From: Alan Third <alan <at> idiocy.org>
To: John Mastro <john.b.mastro <at> gmail.com>
Cc: 28661 <at> debbugs.gnu.org, Kevin Lin <lin.kevin.k <at> gmail.com>
Subject: Re: bug#28661: 25.3; closing fullscreen frame on macOS 10.13 High
 Sierra causes crash
Date: Sat, 7 Oct 2017 16:08:23 +0100
[Message part 1 (text/plain, inline)]
On Wed, Oct 04, 2017 at 05:44:13PM -0700, John Mastro wrote:
> Alan Third <alan <at> idiocy.org> wrote:
> > I guess that closing a fullscreen window now results in it being
> > resized. But is emacsframe already trashed by this point? That would
> > certainly cause a crash.
> >
> > Can you please uncomment line 54 in nsterm.h to enable NSTRACE,
> > recompile, cause the crash and send the output to me?
> 
> I've done so and the trace is attached.

Thank you!

It looks like it is trying to resize the frame after we’ve already
cleaned it up. Do fullscreen windows animate when they close on 10.13?

Anyway, I’ve attached a patch, can you give it a go and see if it
works?
-- 
Alan Third
[0001-Fix-crash-when-closing-fullscreen-frame-on-macOS-bug.patch (text/plain, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#28661; Package emacs. (Sat, 07 Oct 2017 17:48:01 GMT) Full text and rfc822 format available.

Message #32 received at 28661 <at> debbugs.gnu.org (full text, mbox):

From: John Mastro <john.b.mastro <at> gmail.com>
To: Alan Third <alan <at> idiocy.org>
Cc: 28661 <at> debbugs.gnu.org, Kevin Lin <lin.kevin.k <at> gmail.com>
Subject: Re: bug#28661: 25.3; closing fullscreen frame on macOS 10.13 High
 Sierra causes crash
Date: Sat, 7 Oct 2017 10:46:41 -0700
Alan Third <alan <at> idiocy.org> wrote:
> Thank you!

Glad to help!

> It looks like it is trying to resize the frame after we’ve already
> cleaned it up. Do fullscreen windows animate when they close on 10.13?

The fullscreen Emacs frame/window sort of slides off the screen and the
desktop slides back on.

> Anyway, I’ve attached a patch, can you give it a go and see if it
> works?

That indeed does the trick. With the patch applied, I can repeat the
recipe from the OP and everything works as expected.

Thanks

        John




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#28661; Package emacs. (Sat, 07 Oct 2017 20:58:02 GMT) Full text and rfc822 format available.

Message #35 received at 28661 <at> debbugs.gnu.org (full text, mbox):

From: Alan Third <alan <at> idiocy.org>
To: John Mastro <john.b.mastro <at> gmail.com>
Cc: 28661 <at> debbugs.gnu.org, Kevin Lin <lin.kevin.k <at> gmail.com>
Subject: Re: bug#28661: 25.3; closing fullscreen frame on macOS 10.13 High
 Sierra causes crash
Date: Sat, 7 Oct 2017 21:56:52 +0100
On Sat, Oct 07, 2017 at 10:46:41AM -0700, John Mastro wrote:
> Alan Third <alan <at> idiocy.org> wrote:
> > It looks like it is trying to resize the frame after we’ve already
> > cleaned it up. Do fullscreen windows animate when they close on 10.13?
> 
> The fullscreen Emacs frame/window sort of slides off the screen and the
> desktop slides back on.

Sounds just like 10.12. Oh well, who knows.

> > Anyway, I’ve attached a patch, can you give it a go and see if it
> > works?
> 
> That indeed does the trick. With the patch applied, I can repeat the
> recipe from the OP and everything works as expected.

Thanks. It’s a small change and makes no difference here on 10.12, so
I’ll push it to emacs-26.
-- 
Alan Third




Added tag(s) fixed. Request was from Alan Third <alan <at> idiocy.org> to control <at> debbugs.gnu.org. (Sat, 07 Oct 2017 21:02:03 GMT) Full text and rfc822 format available.

bug marked as fixed in version 26.1, send any further explanations to 28661 <at> debbugs.gnu.org and Kevin Lin <lin.kevin.k <at> gmail.com> Request was from Alan Third <alan <at> idiocy.org> to control <at> debbugs.gnu.org. (Sat, 07 Oct 2017 21:02:03 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#28661; Package emacs. (Sat, 07 Oct 2017 22:52:02 GMT) Full text and rfc822 format available.

Message #42 received at 28661 <at> debbugs.gnu.org (full text, mbox):

From: Kevin Lin <lin.kevin.k <at> gmail.com>
To: Alan Third <alan <at> idiocy.org>
Cc: 28661 <at> debbugs.gnu.org, John Mastro <john.b.mastro <at> gmail.com>
Subject: Re: bug#28661: 25.3; closing fullscreen frame on macOS 10.13 High
 Sierra causes crash
Date: Sat, 7 Oct 2017 15:50:29 -0700
Thank you both!  sorry I haven't been able to help (crazy week at work).
-Kevin




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 05 Nov 2017 12:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 7 years and 226 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.