From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alan Third Newsgroups: gmane.emacs.bugs Subject: bug#11049: [PATCH] Block input to prevent crash on SIGHUP (bug#11049) Date: Sat, 28 May 2016 00:01:38 +0100 Message-ID: <20160527230138.GA22000@breton.holly.idiocy.org> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1464390144 25648 80.91.229.3 (27 May 2016 23:02:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 27 May 2016 23:02:24 +0000 (UTC) To: 11049@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat May 28 01:02:15 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1b6Qlh-0001QM-Ol for geb-bug-gnu-emacs@m.gmane.org; Sat, 28 May 2016 01:02:13 +0200 Original-Received: from localhost ([::1]:48162 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b6Qlg-0008Rs-Pp for geb-bug-gnu-emacs@m.gmane.org; Fri, 27 May 2016 19:02:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38775) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b6Qla-0008Qj-KP for bug-gnu-emacs@gnu.org; Fri, 27 May 2016 19:02:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b6QlW-0000Bh-CQ for bug-gnu-emacs@gnu.org; Fri, 27 May 2016 19:02:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:58835) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b6QlW-0000Bd-7q for bug-gnu-emacs@gnu.org; Fri, 27 May 2016 19:02:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1b6QlV-0001rt-P3 for bug-gnu-emacs@gnu.org; Fri, 27 May 2016 19:02:01 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: Resent-From: Alan Third Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 27 May 2016 23:02:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 11049 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: confirmed Original-Received: via spool by 11049-submit@debbugs.gnu.org id=B11049.14643901087158 (code B ref 11049); Fri, 27 May 2016 23:02:01 +0000 Original-Received: (at 11049) by debbugs.gnu.org; 27 May 2016 23:01:48 +0000 Original-Received: from localhost ([127.0.0.1]:42939 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b6QlI-0001rO-H0 for submit@debbugs.gnu.org; Fri, 27 May 2016 19:01:48 -0400 Original-Received: from mail-wm0-f65.google.com ([74.125.82.65]:35760) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b6QlH-0001rC-1H for 11049@debbugs.gnu.org; Fri, 27 May 2016 19:01:47 -0400 Original-Received: by mail-wm0-f65.google.com with SMTP id e3so2771415wme.2 for <11049@debbugs.gnu.org>; Fri, 27 May 2016 16:01:46 -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:mime-version :content-disposition:user-agent; bh=SVi9oRSLSqQ/14QLOVM0us9InweQsytjQf9jldemflo=; b=hbbqtE+415Huoh41rXdWPT8TTP54J0Yqom8R/ixHzISBYd122/M1pnfNszjruIy1tD jdRixTOPJZe5gXrxIRi3GeYVy5uBQ3TncqRga58z0UOKmHy0n5N2aRWS5Buecf+xjRj6 Xr2L5ErSDSnAzD085VHyUoPX0jiqlwSW+2SDSmO0OC8bEGEbsPQicUaYyr++1p8omMMq ZcMpZGvbFE8bVqeRbKvaSP98aCLUiNRnIsHXeJw8bfE8eRIIEO9oLleUacS4e4WJiwhU YFBZki99xCngJUC0a5d9A//ye0Q9DRg2/IuBEH7I42G26NWPG2vy6LeZyJI2OubNrzqg x5WA== 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 :mime-version:content-disposition:user-agent; bh=SVi9oRSLSqQ/14QLOVM0us9InweQsytjQf9jldemflo=; b=CiXQQk+6eLcHbqb7OemjxQxfBLzJxHHmFzahQfBz5iPKS57zde137ZF8a27rnH9rqc 6UJf6FHnI8UJG/r1bfIbXrdAKJjM8LY92Yp4uUAQ1xqMRLmN+8QQdeif247GmLWeEuYu tahX3y3373drr+r+KZLUcu5SyI3b5Uyp8m8TOGOs1fbmbT09jxvzgPwcFGRQ3zuai1qP hf/wKpPLRJuNlLulIPfC5q/oe2U0O2IFjOm/KxxleBxaXAvvtnMBW0E9ck5I0zCOSh5k dm3S2HslT+4HT41+7m0ck5Z7yTk9GwAQoIXCBeuWicy996kjFeNNNoWSwGVFA9SKNOmG QFkg== X-Gm-Message-State: ALyK8tLsaaE2ZEfksl1g0qNv/l/ftefaQMHtOvW3vanZo0lwjgBXRenQdgkJImVJFHsA4g== X-Received: by 10.194.233.5 with SMTP id ts5mr18630091wjc.109.1464390100842; Fri, 27 May 2016 16:01:40 -0700 (PDT) Original-Received: from breton.holly.idiocy.org (ip6-2001-08b0-03f8-8129-20c5-ff51-aaec-eb15.holly.idiocy.org. [2001:8b0:3f8:8129:20c5:ff51:aaec:eb15]) by smtp.gmail.com with ESMTPSA id gk4sm21410615wjd.7.2016.05.27.16.01.39 for <11049@debbugs.gnu.org> (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 27 May 2016 16:01:40 -0700 (PDT) Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:118792 Archived-At: * src/emacs.c (Fkill-emacs): Block input while exiting. --- src/emacs.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/emacs.c b/src/emacs.c index 3e0cf59..fa678b0 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -1941,6 +1941,13 @@ all of which are called before Emacs is actually killed. */ x_clipboard_manager_save_all (); #endif +#ifdef HAVE_NS + /* Crashes trying to process input while quitting. I'm not bothering + to unblock input since, well, we're quitting. If an unblock_input + is required it will have to go after Fexpand_file_name below. */ + block_input(); +#ENDIF + shut_down_emacs (0, (STRINGP (arg) && !feof (stdin)) ? arg : Qnil); #ifdef HAVE_NS -- I believe this fixes the SIGABRT that occurs when Emacs receives a SIGHUP. The problem appears to be that OS X likes to send input to Emacs while it's in the middle of doing things that it really doesn't appreciate receiving input while doing. Like minimizing, or shutting down. -- Alan Third