From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alan Third Newsgroups: gmane.emacs.devel Subject: Re: Bug#23924 - crashes on next OS X release Date: Mon, 18 Jul 2016 20:03:46 +0100 Message-ID: <20160718190346.GA11206@breton.holly.idiocy.org> References: <83shv70zn5.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1468868688 390 80.91.229.3 (18 Jul 2016 19:04:48 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 18 Jul 2016 19:04:48 +0000 (UTC) To: Eli Zaretskii , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jul 18 21:04:48 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1bPDqR-0002H8-1w for ged-emacs-devel@m.gmane.org; Mon, 18 Jul 2016 21:04:47 +0200 Original-Received: from localhost ([::1]:49815 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bPDqQ-0007S3-0D for ged-emacs-devel@m.gmane.org; Mon, 18 Jul 2016 15:04:46 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51677) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bPDpd-0007PP-6W for emacs-devel@gnu.org; Mon, 18 Jul 2016 15:03:58 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bPDpb-0003PF-4e for emacs-devel@gnu.org; Mon, 18 Jul 2016 15:03:56 -0400 Original-Received: from mail-wm0-x22b.google.com ([2a00:1450:400c:c09::22b]:35534) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bPDpV-0003O6-GZ; Mon, 18 Jul 2016 15:03:49 -0400 Original-Received: by mail-wm0-x22b.google.com with SMTP id f65so114925720wmi.0; Mon, 18 Jul 2016 12:03:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=sender:date:from:to:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=6tgXiFGJ2BatylKL6H4urDQeDAfbEPAA/zJx77VTPEM=; b=KTNP9sYcBP9GdGANj+p3dDKlIsvGiNWrtzpGEiW1o2cMfMoqnpcMq4ODYdOuCchrBP QlamVR9hQPE0NkA08oL+kKQlrtyK+MnqTNilCdiua2FE+6r7nqnLRG3DRdO1qs7xGJnD asmHGww25yEuRE+Z03vcq5ps2M7Npn4ECo2cN+Wl59mfTsNlS4YerGkASY9kTfySntmj w2HpqYDX82FYnERBe5pA/2Va4pM/a4h4MYc/RomaHasgdax/+td9KCe5U9qGo4eehzwP c0Ed2I64zgJIIkZmM43/C3BYpK5VyD4945dfVg4miPlXPliVZcEsmcEoCEmQWQsbiJP5 f+UQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:date:from:to:subject:message-id :references:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=6tgXiFGJ2BatylKL6H4urDQeDAfbEPAA/zJx77VTPEM=; b=ODyTm3KeN0V2TaluL1QP6C97kOMFqkYthrtADRYjpYG4eB/ss+YIdMebreTqW9GVqP qoKdFi1oPFXOZcj+NSVqhJa7nJWP8WQTcmSbaD4jKcTktbNqkjMHMbaywd9S40KNd7Wy mixkFRiaO55uZVLCXrWrI1q4J3tuj8dDsDqGnpWacbC5AuWBv9GzUkYIAI4Yy+AGVvAb 4Eqg1ITwVKTyHlUam+vFP5PnZL3p0hK5I51nIQqm4arQmdUM1nmuIRDFojLt5As4oSZX cw8aunWk3jtRjOWgD3isa4FkALEOX7FsMbc2PCjIj/5Rf8hA39dUYP7ifad0vZ1q/gUa QE9Q== X-Gm-Message-State: ALyK8tIitCWvaesoFa2wI91rBNeJ790quBOBsduPwjUqjRjKJoeUxMmLYcHZGs6LBVj+BA== X-Received: by 10.194.75.71 with SMTP id a7mr2588065wjw.61.1468868628625; Mon, 18 Jul 2016 12:03:48 -0700 (PDT) Original-Received: from breton.holly.idiocy.org (ip6-2001-08b0-03f8-8129-5cc4-ba14-a0d0-bdac.holly.idiocy.org. [2001:8b0:3f8:8129:5cc4:ba14:a0d0:bdac]) by smtp.gmail.com with ESMTPSA id hr8sm2676498wjb.40.2016.07.18.12.03.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 18 Jul 2016 12:03:47 -0700 (PDT) Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:400c:c09::22b X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:205825 Archived-At: On Mon, Jul 18, 2016 at 09:16:09AM -0700, John Wiegley wrote: > >>>>> "EZ" == Eli Zaretskii writes: > > EZ> If you are confident that it won't do any trouble, and that 10.10, and > EZ> only that version, needs this fix, feel free to push to emacs-25. > > Before you do, can you show us the patch here so that I can have a sense of > what it changes? I've been running emacs-25 crash-free on 10.11 for many > months now. I’m not that confident as I couldn’t find anything about the bug in question except what was in the bug report and comment in the code. I tried removing the fix and can’t reproduce the original problem on 10.11. It’s possible it’s actually been fixed in later releases of 10.10 too. We’ve had two reports of crashes on 10.12 which my patch resolves. I haven’t yet found anyone running 10.10 who can test it. The original bug is 18993. * src/nsterm.m (ns_send_appdefined): Limit bugfix for bug#18993 to OS X 10.10. --- src/nsterm.m | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/src/nsterm.m b/src/nsterm.m index a6160ed..a7e2649 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -3942,16 +3942,21 @@ overwriting cursor (usually when cursor on a tab) */ this moment. */ #ifdef NS_IMPL_COCOA - if (! send_appdefined) - { - /* OSX 10.10.1 swallows the AppDefined event we are sending ourselves - in certain situations (rapid incoming events). - So check if we have one, if not add one. */ - NSEvent *appev = [NSApp nextEventMatchingMask:NSApplicationDefinedMask - untilDate:[NSDate distantPast] - inMode:NSDefaultRunLoopMode - dequeue:NO]; - if (! appev) send_appdefined = YES; + if ([[NSProcessInfo processInfo] respondsToSelector:@selector(operatingSystemVersion)]) + { + NSOperatingSystemVersion v = [[NSProcessInfo processInfo] operatingSystemVersion]; + + if (! send_appdefined && v.majorVersion == 10 && v.minorVersion == 10) + { + /* OSX 10.10.1 swallows the AppDefined event we are sending ourselves + in certain situations (rapid incoming events). + So check if we have one, if not add one. */ + NSEvent *appev = [NSApp nextEventMatchingMask:NSApplicationDefinedMask + untilDate:[NSDate distantPast] + inMode:NSDefaultRunLoopMode + dequeue:NO]; + if (! appev) send_appdefined = YES; + } } #endif -- 2.7.4 -- Alan Third