GNU bug report logs - #62334
Guile's "sleep pipe" can leak into processes created by 'spawn'

Previous Next

Package: guix;

Reported by: Greg Hogan <code <at> greghogan.com>

Date: Tue, 21 Mar 2023 14:18:02 UTC

Severity: important

Merged with 62765, 63024

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #58 received at 62334 <at> debbugs.gnu.org (full text, mbox):

From: Josselin Poiret <dev <at> jpoiret.xyz>
To: Ludovic Courtès <ludo <at> gnu.org>,
 Josselin Poiret <dev <at> jpoiret.xyz>
Cc: 63024 <at> debbugs.gnu.org, 62334 <at> debbugs.gnu.org,
 Greg Hogan <code <at> greghogan.com>, Simon Tournier <zimon.toutoune <at> gmail.com>
Subject: [PATCH 3/3] tests: Test that system* works if stdin/out/err isn't
 backed by fdes
Date: Fri,  5 May 2023 15:39:24 +0200
From: Ludovic Courtès <ludo <at> gnu.org>

* test-suite/tests/posix.test: New test for https://bugs.gnu.org/63024.
---
 test-suite/tests/posix.test | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/test-suite/tests/posix.test b/test-suite/tests/posix.test
index d5cf47cda..18dad8902 100644
--- a/test-suite/tests/posix.test
+++ b/test-suite/tests/posix.test
@@ -374,7 +374,17 @@
                     (system* "sh" "-c" "echo bong >&2"))))))))
 
       (and (zero? (status:exit-val status))
-           (call-with-input-file file get-string-all)))))
+           (call-with-input-file file get-string-all))))
+
+  (pass-if-equal "https://bugs.gnu.org/63024"
+      0
+    (if (file-exists? "/proc/self/fd/0")          ;on GNU/Linux?
+        (parameterize ((current-output-port (%make-void-port "w0")))
+          (system* "guile" "-c"
+                   (object->string
+                    '(exit (string=? "/dev/null"
+                                     (readlink "/proc/self/fd/1"))))))
+        (throw 'unresolved))))
 
 ;;
 ;; spawn
-- 
2.39.2





This bug report was last modified 255 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.