From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#58440: 27.2; Exit Code on SIGINT is Zero, But shouldn't Be Date: Wed, 12 Oct 2022 17:23:56 +0300 Message-ID: <83tu49aznn.fsf@gnu.org> References: <87czaxcmmj.fsf@gnus.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="20308"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 58440@debbugs.gnu.org, mwelinder@gmail.com To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Oct 12 16:26:05 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oicgO-00053m-IU for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 12 Oct 2022 16:26:04 +0200 Original-Received: from localhost ([::1]:59380 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oicgN-00078P-DZ for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 12 Oct 2022 10:26:03 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57388) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oicfP-000757-4A for bug-gnu-emacs@gnu.org; Wed, 12 Oct 2022 10:25:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:59083) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oicfO-0004aR-MD for bug-gnu-emacs@gnu.org; Wed, 12 Oct 2022 10:25:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oicfO-0007Eh-Gt for bug-gnu-emacs@gnu.org; Wed, 12 Oct 2022 10:25: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: Wed, 12 Oct 2022 14:25:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58440 X-GNU-PR-Package: emacs Original-Received: via spool by 58440-submit@debbugs.gnu.org id=B58440.166558464427698 (code B ref 58440); Wed, 12 Oct 2022 14:25:02 +0000 Original-Received: (at 58440) by debbugs.gnu.org; 12 Oct 2022 14:24:04 +0000 Original-Received: from localhost ([127.0.0.1]:58156 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oiceS-0007Cg-D0 for submit@debbugs.gnu.org; Wed, 12 Oct 2022 10:24:04 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:56914) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oiceQ-0007C2-AW for 58440@debbugs.gnu.org; Wed, 12 Oct 2022 10:24:02 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:43230) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oiceL-0004N0-0B; Wed, 12 Oct 2022 10:23:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=CRfI7xoGIkR8tjzb+FrLT/2jKXVEip8sCNTzNdXNK88=; b=SDKu8qPfQj0/ 8zsm95Q5sYcC/i245GS/c3xXptsAjUULhL70uusT293ulB/pNsG39QauvduO3eaPyTl5ahUyBug1R Eh9lOwhIpPaQjsVz5j3OS8ffWzRwAKjOfGvsAsgBYnnUS/EdwwA3lYgjWd8ANIhJAM5L9Gz7G6c18 hoSaqZBRinMt2tP+zyGVzloQxUkshzGRW+5vKxRWcaANSzf4y8+kR7N7saS+0DwrkSC+G2WsiMR5+ VIJOq6b8cghNNS9wEOKoX2ZZSLHJc9u/MomgkGTcrMEUc1ubVEh2TmK2JUgnE8QCWMp5lKRqFOb2K sjt6HZ36PS2Ggqsc/CZafg==; Original-Received: from [87.69.77.57] (port=4062 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oiceF-0000HI-Gz; Wed, 12 Oct 2022 10:23:56 -0400 In-Reply-To: <87czaxcmmj.fsf@gnus.org> (message from Lars Ingebrigtsen on Wed, 12 Oct 2022 13:22:28 +0200) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:245214 Archived-At: > From: Lars Ingebrigtsen > Cc: 58440@debbugs.gnu.org, Eli Zaretskii > Date: Wed, 12 Oct 2022 13:22:28 +0200 > > Morten Welinder writes: > > > 1. Create the following perl script named "ttt": > > Or an easier way to reproduce the issue: > > ./src/emacs -Q; echo $? > > and then "kill -INT" the process and observe that it echoes "0". What happens if you say ./src/emacs -Q && echo 'OK' does it say OK when you kill Emacs with SIGINT? > This issue is still present in Emacs 29. > > It does seem like a bug -- I'd expect a non-zero exit code in this case. I very much doubt that the above is the same problem: Morten didn't involve Python without a good reason. And I'm not sure we have anything to do with what Morten reports: how do we know if Python or its 'system' call blocks some signals, or does some other non-trivial stuff with them? Likewise with xterm. > (And... I'm not sure where the action taken for the signal really is > after poking at the > > maybe_fatal_sig (SIGINT); > > code paths a few minutes.) In a GUI session, AFAIU SIGINT is handled as a fatal signal, and should cause Emacs to shut down and return with exit code of 1. Are you saying that you don't see that in a debugger? (I don't have access to a GNU/Linux system where I can run a GUI Emacs session.) By contrast, in a TTY (a.k.a. "-nw") session, SIGINT causes a keyboard quit (we reprogram the keyboard to raise SIGINT when the user preses C-g), so Emacs should not exit at all if SIGINT is delivered to it. And Ctrl-C doesn't cause SIGINT anyway. So I'd appreciate if Morten could explain some more of what he thinks is going on and why he thinks this is an Emacs problem to begin with.