unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Alan Third <alan@idiocy.org>
To: Anders Lindgren <andlind@gmail.com>
Cc: 23462@debbugs.gnu.org,
	Ivan Cibrario Bertolotti <ivan.cibrario@polito.it>
Subject: bug#23462: 25.0.93; Crash on OS X when suspending main frame
Date: Wed, 11 May 2016 23:28:24 +0100	[thread overview]
Message-ID: <20160511222824.GA51118@breton.holly.idiocy.org> (raw)
In-Reply-To: <CABr8ebb0nO7_NyX24mhCQV23tckugF_B+j42PcGu1-ZPUP81gQ@mail.gmail.com>

On Tue, May 10, 2016 at 11:57:47PM +0200, Anders Lindgren wrote:
>
> As far as I can tell, I don't see a better location to place the test. (I
> have to include myself in the group who have no idea why drawRect is being
> called when the frame is miniatured.) I would suggest that we add it as you
> originally suggested.
> 
> Alan, what do you say? Have you looked into this?

Right, on a hunch that it's something to do with Emacs receiving and
processing signals or input of some sort during or immediately after
minimization, I tried wrapping

    [[view window] miniaturize: NSApp];

in x_iconify_frame with block_input and unblock_input:

    block_input();
    [[view window] miniaturize: NSApp];
    unblock_input();

which seems to have solved the crash.

I'm not super-happy with this as the error message implies that
something is being created in Objective C, then either clobbered or
released elsewhere, *then* Objective C tries to release it
automatically and it's already clobbered/gone. But I can't trace it
back to find out what's actually going on. It appears to be related to
unblock_input forcing the processing of "pending" signals or input
when drawRect runs, but why is that breaking Objective C's garbage
collection routines?

I guess it probably doesn't matter, as long as it works.
-- 
Alan Third





  parent reply	other threads:[~2016-05-11 22:28 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-05 21:25 bug#23462: 25.0.93; Crash on OS X when suspending main frame Ivan Cibrario Bertolotti
2016-05-08  9:53 ` Alan Third
2016-05-08 15:58   ` Eli Zaretskii
2016-05-08 16:56     ` Ivan Cibrario Bertolotti
2016-05-08 22:41 ` Alan Third
2016-05-09  8:49   ` Ivan Cibrario Bertolotti
2016-05-10 18:56 ` Anders Lindgren
2016-05-10 20:13   ` Ivan Cibrario Bertolotti
2016-05-10 21:57     ` Anders Lindgren
2016-05-10 22:08       ` Alan Third
2016-05-10 23:16       ` Alan Third
2016-05-11 22:28       ` Alan Third [this message]
2016-05-12  5:39         ` Anders Lindgren
2016-05-12 11:52           ` bug#23462: [PATCH] Block input while minimizing on NS (bug#23462) Alan Third
2016-05-12 16:38             ` Ivan Cibrario Bertolotti
2016-05-12 18:28               ` Anders Lindgren
2016-05-16 18:45                 ` Anders Lindgren

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=20160511222824.GA51118@breton.holly.idiocy.org \
    --to=alan@idiocy.org \
    --cc=23462@debbugs.gnu.org \
    --cc=andlind@gmail.com \
    --cc=ivan.cibrario@polito.it \
    /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).