guix shell changes default sigaction for SIGPIPE

  • Open
  • quality assurance status badge
Details
One participant
  • Tomas Volf
Owner
unassigned
Submitted by
Tomas Volf
Severity
normal

Debbugs page

Tomas Volf wrote 5 months ago
(address . bug-guix@gnu.org)
87zfmz10ev.fsf@wolfsden.cz
Guix shell changes the default handler for SIGPIPE for the command it
runs. Can be demonstrated using the following:

Toggle snippet (8 lines)
$ guix shell guile -- guile -c '(pk (sigaction SIGPIPE))'

;;; ((1 . 0))
$ guile -c '(pk (sigaction SIGPIPE))'

;;; ((0 . 0))

Have a nice day,
Tomas Volf

--
There are only two hard things in Computer Science:
cache invalidation, naming things and off-by-one errors.
-----BEGIN PGP SIGNATURE-----

iQJCBAEBCgAsFiEEt4NJs4wUfTYpiGikL7/ufbZ/wakFAmcU6KgOHH5Ad29sZnNk
ZW4uY3oACgkQL7/ufbZ/wan2+A//XYQsBwTlbujxlEv0TRHJO1RkwqK6QHKkhyDy
hWsus9ZkzMXPj6gsjPfjxu1omuz/RcyNBhFtYyjZUgHoR+sfBYwbGyTu9TcRLS79
0mriRl67l31hGWrs2zFHnoB6X4HLM4/lUpKwKydgFE5HZwjOQLkGngHpHDlIpt3v
wl/pYspPZoNjDuxWkHM/xkmDdaAMqiInEIIMLUfucBbzjuYBba+I+ZNbqe6M54/i
Rln6lb2KbkIfk6V3QXL/X0tSJoRlnaDnJVWsibC1a09F3FI2Pi2+6EfgiFOhk5hX
67Zck4Ru3o5wXml2TUVedhAy1La53qqZPvazAzQ1P9pzCXJNYfd/ZAQDoI2TINi7
kFy4S9uV/WNWxwSOhvmLX1V+XNA1mV6ZWMG2+N07ypZjaZx9zKOCt2V6k/v4mq2K
7NiMDqw1qZfQq0OtRCWjPP9/MI0YNn5Nmvn/44LlH+WRHdZrMsd+shKBJ0+nlOTi
iAPn27sF+yko2B7kzZA+b9PhwonkfKTYahBveobEFlaEBZsHCHBy3Xjx4+PXsrvK
HenI0ePU3YU6FckZU4/HC4VWlSXsB+Me5Foj7m9m5GtCHvaAxVnYO4SESdWcGssa
XqOaMXCPFJH0EQeDIymYQ0Kni8VmIXL4HFHqWRA+Ut0dc9ONkhS/w3I/ZGsDG+iS
7OxtNCo=
=SZgM
-----END PGP SIGNATURE-----

Tomas Volf wrote 5 months ago
[PATCH] environment: Restore action for SIGPIPE.
(address . 73905@debbugs.gnu.org)(name . Tomas Volf)(address . ~@wolfsden.cz)
79a4bbdc99c864e8e562845963493126fd701c52.1729435433.git.~@wolfsden.cz
Code in `ui.scm' in `initialize-guix' procedure changes the handling of
SIGPIPE to SIG_IGN. So restore the handling to SIG_DFL so that process
executed will have the usual action. Technically we should record what the
handling was, and restore it to the previous value, but that would be much
more invasive change.

Always setting it to SIG_DFL is at least less surprising than always setting
to SIG_IGN.

* guix/scripts/environment.scm (launch-environment): Restore default action
for SIGPIPE.

Change-Id: Ifabae1d3e71aa44e63078cea5bd3824b8f61ba14
---
guix/scripts/environment.scm | 2 ++
1 file changed, 2 insertions(+)

Toggle diff (15 lines)
diff --git a/guix/scripts/environment.scm b/guix/scripts/environment.scm
index a219b2ac89..79eb7f3f30 100644
--- a/guix/scripts/environment.scm
+++ b/guix/scripts/environment.scm
@@ -499,6 +499,8 @@ (define* (launch-environment command profile manifest
;; Properly handle SIGINT, so pressing C-c in an interactive terminal
;; application works.
(sigaction SIGINT SIG_DFL)
+ ;; Restore original action for SIGPIPE.
+ (sigaction SIGPIPE SIG_DFL)
(load-profile profile manifest
#:pure? pure? #:white-list-regexps white-list)
--
2.46.0
Tomas Volf wrote 5 months ago
control message for bug #73905
(address . control@debbugs.gnu.org)
1733353512b1a50e9f685c796f124673@wolfsden.cz
tags 73905 + patch
quit
?
Your comment

Commenting via the web interface is currently disabled.

To comment on this conversation send an email to 73905@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 73905
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch
You may also tag this issue. See list of standard tags. For example, to set the confirmed and easy tags
mumi command -t +confirmed -t +easy
Or, remove the moreinfo tag and set the help tag
mumi command -t -moreinfo -t +help