From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Newsgroups: gmane.lisp.guile.bugs Subject: bug#73589: system* does not honor SIGINT restoration in child Date: Sun, 20 Oct 2024 20:58:14 +0200 Message-ID: <875xpmmwjd.fsf@gnu.org> References: <87jzer7djc.fsf@laura> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22898"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 73589-done@debbugs.gnu.org To: Olivier Dion Original-X-From: bug-guile-bounces+guile-bugs=m.gmane-mx.org@gnu.org Sun Oct 20 20:59:03 2024 Return-path: Envelope-to: guile-bugs@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 1t2b8p-0005pW-Hl for guile-bugs@m.gmane-mx.org; Sun, 20 Oct 2024 20:59:03 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t2b8R-0001uo-Sk; Sun, 20 Oct 2024 14:58:40 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t2b8P-0001u8-VI for bug-guile@gnu.org; Sun, 20 Oct 2024 14:58:38 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t2b8P-00064X-N3 for bug-guile@gnu.org; Sun, 20 Oct 2024 14:58:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=BwVoxiPfD2Zh9BlGB7GIa06QPLtlmdQnxpmUCTeJ/9s=; b=M9QKqPHpHYvhuFlPwhSeNN7b2tlnqw0Siw5STbGrlw/SiNhT5DWjcrb8vGuTzuqMwTKbKK9bCs3w7t1qCaLNR7ERqU3mC44A+z937miqT1nYqA/dEdbRDDO6nuF/A3pYmOfgM9vyXyiXKcEnhSIXt07m5TWJ1E2ooWJCaNIMyX+J5c/VIqPd4+Gx7TxTUsKKvbD4xW4vsUXA7AHV2l163Lv9+xzWxJgr4MGoxnc2vLr8Zm02nVLCQN4ZpvnmvgoaJ9ko1W/25tLQEK//4EbGHZRcat4HJdTVKFqvOc4atuTFx9LjfzH2VapUtWS2LLeEaF1hlpZhiT9AlGFI0Bfswg==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1t2b8o-0007Tk-HJ for bug-guile@gnu.org; Sun, 20 Oct 2024 14:59:02 -0400 Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-To: bug-guile@gnu.org Resent-Date: Sun, 20 Oct 2024 18:59:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 73589 X-GNU-PR-Package: guile Mail-Followup-To: 73589@debbugs.gnu.org, ludo@gnu.org, olivier.dion@polymtl.ca Original-Received: via spool by 73589-done@debbugs.gnu.org id=D73589.172945074028736 (code D ref 73589); Sun, 20 Oct 2024 18:59:02 +0000 Original-Received: (at 73589-done) by debbugs.gnu.org; 20 Oct 2024 18:59:00 +0000 Original-Received: from localhost ([127.0.0.1]:48481 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t2b8m-0007TQ-D4 for submit@debbugs.gnu.org; Sun, 20 Oct 2024 14:59:00 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:37856) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t2b8k-0007T9-4B for 73589-done@debbugs.gnu.org; Sun, 20 Oct 2024 14:58:59 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t2b8E-00062G-3F; Sun, 20 Oct 2024 14:58:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=BwVoxiPfD2Zh9BlGB7GIa06QPLtlmdQnxpmUCTeJ/9s=; b=EvzxSP8jEM7pzKvQ8ZYr 02vblnItgPrPkrcRx2g2Pz79DTlrVTSlyQ0tBd9JJVLyw7C0pRkKypJ9TjtzSJoCbVcZZiL0DGmD+ KrCtnMI+y7cbBsDL4fiAnzk4jxwqfL6Oin7XRR+VZ7mJq0hdP8l5q/lP7dHGd4I3V+BA6zZWe7k9a PZHF1OIMqAYKM1BbS1/Ed3paDROir6WunrnH4Xt0Fe8tUJUP1UeVrxVmiGQ1OW93jN7/al2L807Wr NPu3DjnRAiwtefG9Jpt5xOTIRyHd4TrKlRTOfakiqNSGU7MFvQ/4SaehKs+W9AgTLHKYGfWxwpfM0 w7RMvZE6aIMBNg==; In-Reply-To: <87jzer7djc.fsf@laura> (Olivier Dion's message of "Tue, 01 Oct 2024 16:51:03 -0400") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guile@gnu.org List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guile-bounces+guile-bugs=m.gmane-mx.org@gnu.org Original-Sender: bug-guile-bounces+guile-bugs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.lisp.guile.bugs:11045 Archived-At: Hi, Olivier Dion skribis: > and its ouput from various executions: > > 1) $ ./a.out =3D> (nil) 0x1 (nil) > 2) $ guile -c '(system "./a.out")' =3D> (nil) 0x1 (nil) > 3) $ guile -c '(system* "./a.out")' =3D> 0x1 0x1 (nil) > > We can see that 3) does not honor restoration of `SIGINT' to `SIG_DFL' > like `system(3)' does. This seems to be because of the following > sigaction before the creation of the process: > > 1697 scm_dynwind_sigaction (SIGINT, > 1698 scm_from_uintptr_t ((uintptr_t) SIG_IGN), > 1699 SCM_UNDEFINED); > 1700 #ifdef SIGQUIT > 1701 scm_dynwind_sigaction (SIGQUIT, > 1702 scm_from_uintptr_t ((uintptr_t) SIG_IGN), > 1703 SCM_UNDEFINED); > 1704 #endif > 1705 > 1706 err =3D piped_process (&pid, prog, args, > 1707 SCM_UNDEFINED, SCM_UNDEFINED); This was fixed in commit 4ae33f76d6b33ea0bedfa36050d44c88d08c2823, which is included in 3.0.10: --8<---------------cut here---------------start------------->8--- $ cat t.c #include #include int main(void) { struct sigaction act; sigaction(SIGINT, NULL, &act); printf("%p %p %p\n", act.sa_handler, SIG_IGN, SIG_DFL); } $ gcc -Wall t.c $ ./a.out=20 (nil) 0x1 (nil) $ ./meta/guile -c '(system "./a.out")' (nil) 0x1 (nil) $ ./meta/guile -c '(system* "./a.out")' (nil) 0x1 (nil) --8<---------------cut here---------------end--------------->8--- Ludo=E2=80=99.