bug#70144: system* affects signal handlers

Josselin Poiret via "Bug reports for GUILE, GNU's Ubiquitous Extension Language" <[email protected]>
Newsgroups gmane.lisp.guile.bugs
Message-ID <[email protected]>
Hi Ludo,

Ludovic Courtès <[email protected]> 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
signature.asc (application/pgp-signature, 682 B)
-----BEGIN PGP SIGNATURE-----

iQHEBAEBCAAuFiEEOSSM2EHGPMM23K8vUF5AuRYXGooFAmY3tsIQHGRldkBqcG9p
cmV0Lnh5egAKCRBQXkC5FhcaildpC/45yKKk5lGLESZTeGEeIJYMBW5ujQPyZ/nH
82n3rlKMD5mabZJkvKM5w8P7fORflPE85twvVPdt3Szs4Rzl8xiO/vevh6Rtxew5
QlaZJVlhQoAnCuwqo8OnADiBZeLI5E42bc6dU03LfEeSD+SwiZ2IQdrQYHJbS8sN
sg/5MjUsKIJtAHouPFtBYUMkphsyGxjembMzmKOV+MjQ0KYN8zj9h5iqdIldjlvR
jnDS2gMJtwQY0RKXN51qK1cT2G7bavV6xlJTv9fr067MXAQLGaF98Nsrl3P9cK7O
Cl5KnnM1uvaHg9RV3quotHkhpQStE50ml9u25CjZqycIzaYzMEgOsJ0HRSj86Fyn
HfYmOVtITPwpcrPYFD47sUfaan2aEF8c3z+a9xh1gG1qQAhZgDL4DDWYJhru+S4c
bvC2W3P1WiDvoDyA5L0aTErOAOXbr9OjlNdRwFGCehHJY3EU+Xgc2cZaBmiwYuFH
e3GJJyPN3c7C4IWtQqabyERHz/DZkuQ=
=RTAu
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.