From: Josselin Poiret via "Bug reports for GUILE, GNU's Ubiquitous Extension Language" <bug-guile@gnu.org>
To: "Ludovic Courtès" <ludo@gnu.org>,
"Mikael Djurfeldt" <mikael@djurfeldt.com>
Cc: 70144@debbugs.gnu.org, Christopher Baines <mail@cbaines.net>
Subject: bug#70144: system* affects signal handlers
Date: Sun, 05 May 2024 18:41:38 +0200 [thread overview]
Message-ID: <871q6g5hz1.fsf@jpoiret.xyz> (raw)
In-Reply-To: <877cgcxppu.fsf@gnu.org>
[-- Attachment #1: Type: text/plain, Size: 2066 bytes --]
Hi Ludo,
Ludovic Courtès <ludo@gnu.org> writes:
> Unless I’m mistaken, we can remove the ‘scm_dynwind_sigaction’ calls
> from ‘scm_system_star’: now that we use ‘posix_spawn’, this is all taken
> care of.
>
> This can be seen by running:
>
> strace -o /tmp/log.strace -f guile -c '(system* "/bin/sh" "-c" "echo foo $$")'
>
> … which shows pre-fork signal blocking (this is
> ‘internal_signal_block_all’ in spawni.c in glibc) followed, in the child
> (PID 28592 here), by a long series of ‘sigaction’ calls to reset
> handlers to their default behavior:
>
> --8<---------------cut here---------------start------------->8---
> 28586 rt_sigprocmask(SIG_BLOCK, ~[], [], 8) = 0
> 28586 clone3({flags=CLONE_VM|CLONE_VFORK, exit_signal=SIGCHLD, stack=0x7f73b39b2000, stack_size=0x9000}, 88 <unfinished ...>
> 28592 rt_sigprocmask(SIG_BLOCK, NULL, ~[KILL STOP], 8) = 0
> 28592 rt_sigaction(SIGHUP, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0
> 28592 rt_sigaction(SIGHUP, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=SA_RESTORER, sa_restorer=0x7f73b432d2a0}, NULL, 8) = 0
> 28592 rt_sigaction(SIGINT, NULL, {sa_handler=SIG_IGN, sa_mask=[], sa_flags=SA_RESTORER, sa_restorer=0x7f73b432d2a0}, 8) = 0
> 28592 rt_sigaction(SIGQUIT, NULL, {sa_handler=SIG_IGN, sa_mask=[], sa_flags=SA_RESTORER, sa_restorer=0x7f73b432d2a0}, 8) = 0
> 28592 rt_sigaction(SIGILL, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0
> 28592 rt_sigaction(SIGILL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=SA_RESTORER, sa_restorer=0x7f73b432d2a0}, NULL, 8) = 0
> 28592 rt_sigaction(SIGTRAP, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0
> 28592 rt_sigaction(SIGTRAP, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=SA_RESTORER, sa_restorer=0x7f73b432d2a0}, NULL, 8) = 0
> --8<---------------cut here---------------end--------------->8---
>
> Josselin, can you confirm?
Yes, I believe this is all taken care of by our use of posix_spawn
(which was the point in the first place :) ).
Best,
--
Josselin Poiret
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 682 bytes --]
next prev parent reply other threads:[~2024-05-05 16:41 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-02 14:22 bug#70144: system* affects signal handlers Christopher Baines
2024-04-03 8:28 ` Mikael Djurfeldt
2024-05-02 14:17 ` Ludovic Courtès
2024-05-05 16:41 ` Josselin Poiret via Bug reports for GUILE, GNU's Ubiquitous Extension Language [this message]
2024-05-06 10:00 ` Ludovic Courtès
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=871q6g5hz1.fsf@jpoiret.xyz \
--to=bug-guile@gnu.org \
--cc=70144@debbugs.gnu.org \
--cc=dev@jpoiret.xyz \
--cc=ludo@gnu.org \
--cc=mail@cbaines.net \
--cc=mikael@djurfeldt.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).