From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 3VQTE8oyuWBCJgAAWB0awg (envelope-from ) for ; Thu, 03 Jun 2021 15:51:38 -0400 Received: by simark.ca (Postfix, from userid 112) id 3E2221F163; Thu, 3 Jun 2021 15:51:38 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-0.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RDNS_DYNAMIC,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 9396E1E01F for ; Thu, 3 Jun 2021 15:51:37 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 247233833031 for ; Thu, 3 Jun 2021 19:51:37 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 247233833031 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1622749897; bh=jQ3Wb7zUItabqoj7jnig4V0yqPawjGKAme1DW1HuPXg=; h=Date:To:In-Reply-To:Subject:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=xaQrDL1RJtCFS2+KkTmx8l6MDgqphgNz/eoWERbTwXH5yeH9qXiYUp2oG4WtTHQqz LQfFvpPVzKjIeY438BiwrWfWTPibjOrBUMtrjNucgygTk/1TUfdIFOkVjwdH8Gp53q IwKjOvKV9cHVgKQBuyz4zfPxgVn/SXauYhkerRkc= Received: from eggs.gnu.org (eggs.gnu.org [IPv6:2001:470:142:3::10]) by sourceware.org (Postfix) with ESMTPS id 5572D386FC05 for ; Thu, 3 Jun 2021 19:51:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 5572D386FC05 Received: from fencepost.gnu.org ([2001:470:142:3::e]:37364) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lotN6-0006y1-50; Thu, 03 Jun 2021 15:51:16 -0400 Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:2582 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 1lotN5-0000mn-Ip; Thu, 03 Jun 2021 15:51:16 -0400 Date: Thu, 03 Jun 2021 22:51:05 +0300 Message-Id: <835yyuwwuu.fsf@gnu.org> To: Pedro Alves In-Reply-To: <20210603190243.2609886-1-pedro@palves.net> (message from Pedro Alves on Thu, 3 Jun 2021 20:02:26 +0100) Subject: Re: [PATCH 00/17] Interrupting programs that block/ignore SIGINT References: <20210603190243.2609886-1-pedro@palves.net> X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Eli Zaretskii via Gdb-patches Reply-To: Eli Zaretskii Cc: gdb-patches@sourceware.org Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" > From: Pedro Alves > Date: Thu, 3 Jun 2021 20:02:26 +0100 > > Currently, on GNU/Linux, it is not possible to interrupt with Ctrl-C > programs that block or ignore SIGINT, with e.g., sigprocmask or > signal(SIGINT, SIG_IGN). You type Ctrl-C, but nothing happens. I'm not sure I understand why this is a problem. If a debuggee blocks or ignores SIGINT, then SIGINT cannot be used to stop it, neither when it runs outside the debugger nor when it runs under a debugger. There are enough other methods to stop such a debuggee (e.g., send it a different signal), but basically such a program clearly tells that it doesn't want to be interrupted by SIGINT, period. Btw, what about programs that install a SIGINT handler that does something when SIGINT is delivered, but don't block or ignore SIGINT? > Similarly, if a program uses sigwait to wait for SIGINT, and the > program receives a SIGINT, the SIGINT is _not_ intercepted by ptrace, > it goes straight to the inferior. This sounds like a more serious issue, but how many programs use this technique? I guess what I'm asking is whether these issues really justify the complications of setting up a separate terminal. The fact that the inferior could be stopped by a different signal, the fact that it could be hit by SIGHUP, the fact that users will need to decide whether or not they use the separate-terminal method (which will be the default, a backward-incompatible change) -- are all these complications really worth the (IMO) minor issues they solve? Thanks.