From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#32487: 26.1.50; keyboard-quit while main thread blocked crashes Emacs Date: Tue, 21 Aug 2018 18:22:19 +0300 Message-ID: <83o9dvd9sk.fsf@gnu.org> References: <876004r6ij.fsf@runbox.com> NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1534865604 10159 195.159.176.226 (21 Aug 2018 15:33:24 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 21 Aug 2018 15:33:24 +0000 (UTC) Cc: 32487@debbugs.gnu.org To: Gemini Lasswell Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Aug 21 17:33:20 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fs8eh-0002PG-Jh for geb-bug-gnu-emacs@m.gmane.org; Tue, 21 Aug 2018 17:33:15 +0200 Original-Received: from localhost ([::1]:54412 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fs8go-0002ao-4X for geb-bug-gnu-emacs@m.gmane.org; Tue, 21 Aug 2018 11:35:26 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53956) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fs8gF-0000Dm-2S for bug-gnu-emacs@gnu.org; Tue, 21 Aug 2018 11:34:52 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fs8Up-0001rW-3o for bug-gnu-emacs@gnu.org; Tue, 21 Aug 2018 11:23:09 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:51909) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fs8Uo-0001r1-H1 for bug-gnu-emacs@gnu.org; Tue, 21 Aug 2018 11:23:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fs8Uo-0007jD-Ch for bug-gnu-emacs@gnu.org; Tue, 21 Aug 2018 11:23:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 21 Aug 2018 15:23:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 32487 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 32487-submit@debbugs.gnu.org id=B32487.153486495629642 (code B ref 32487); Tue, 21 Aug 2018 15:23:02 +0000 Original-Received: (at 32487) by debbugs.gnu.org; 21 Aug 2018 15:22:36 +0000 Original-Received: from localhost ([127.0.0.1]:56925 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fs8UN-0007i1-Uw for submit@debbugs.gnu.org; Tue, 21 Aug 2018 11:22:36 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:58563) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fs8UL-0007ho-Sf for 32487@debbugs.gnu.org; Tue, 21 Aug 2018 11:22:34 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fs8UA-0001IM-4J for 32487@debbugs.gnu.org; Tue, 21 Aug 2018 11:22:27 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:35408) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fs8U9-0001I3-AX; Tue, 21 Aug 2018 11:22:22 -0400 Original-Received: from [176.228.60.248] (port=3484 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1fs8U8-0001k7-UX; Tue, 21 Aug 2018 11:22:21 -0400 In-reply-to: <876004r6ij.fsf@runbox.com> (message from Gemini Lasswell on Mon, 20 Aug 2018 15:57:08 -0700) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] 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:149643 Archived-At: > From: Gemini Lasswell > Date: Mon, 20 Aug 2018 15:57:08 -0700 > > In both emacs-26 and master, it's possible to hang or crash Emacs with > Lisp code which uses threads and is buggy in ways which cause the main > thread to be blocked, combined with keyboard-quit. That's ample punishment for a buggy program, don't you think? > To reproduce, copy the code listed below into a buffer and evaluate it > (with emacs -Q if you wish). Then choose one of: > > M-x my-hang-1 RET > M-x my-hang-2 RET > M-x my-hang-3 RET > > Result: Emacs will stop responding to keyboard input. Repeated use of > C-g will do nothing when running under X11 and will cause Emacs to crash > when running in a terminal. Doing nothing is fine when a program is buggy. On a TTY, the 1st and the 3rd example are not crashes: they are the "emergency escape" feature of Emacs. You can read about it in the manual. It is triggered when more than one C-g is pressed without Emacs being able to process the first one. Due to the way we process input nowadays, you cannot see this in action except on a Unix TTY, where C-g triggers a SIGINT. The 2nd example seems to be caused by a non-main thread entering redisplay (I think). Or something like that.