unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: ludo@gnu.org (Ludovic Courtès)
To: guile-devel@gnu.org
Subject: "no duplicate" in `popen.test'
Date: Fri, 14 Mar 2008 11:06:47 +0100	[thread overview]
Message-ID: <87wso5livc.fsf@gnu.org> (raw)

[-- Attachment #1: Type: text/plain, Size: 1124 bytes --]

Hello,

That "no duplicate" test in `popen.test' leaves a zombie behind it [0].
The fix would be to `waitpid' the process created by `open-input-pipe'
(see attached patch), but that makes it hang, waiting for "sleep 999" to
complete.

I'm not sure whether it's an indication that the bug was caught, or
rather an indication that the test is broken, especially since I don't
fully understand the bug that it's trying to catch.

I found these two relevant threads:

  http://article.gmane.org/gmane.lisp.guile.devel/6010 [1]
  http://article.gmane.org/gmane.lisp.guile.bugs/3560

Apparently, Kevin wasn't too confident in the test but decided to leave
it in the lack of a better replacement.

I didn't find any message explaining why the test came into existence.

I would appreciate feedback on this since it's tempting to remove it
altogether for all the harm it's done.  ;-)

Thanks,
Ludovic.

[0] FWIW, this breaks NixOS builds with test-suite enabled since
    `nix-worker', the deamon that builds things, waits for all child
    processes.

[1] It's this very test that led Debian to build 1.8
    `--without-threads'!


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: The patch --]
[-- Type: text/x-patch, Size: 838 bytes --]

--- guile/test-suite/tests/popen.test	2006-08-25 03:21:39.000000000 +0200
+++ guile/test-suite/tests/popen.test	2008-03-14 10:20:23.000000000 +0100
@@ -1,6 +1,6 @@
 ;;;; popen.test --- exercise ice-9/popen.scm      -*- scheme -*-
 ;;;;
-;;;; Copyright 2003, 2006 Free Software Foundation, Inc.
+;;;; Copyright 2003, 2006, 2008 Free Software Foundation, Inc.
 ;;;;
 ;;;; This library is free software; you can redistribute it and/or
 ;;;; modify it under the terms of the GNU Lesser General Public
@@ -86,7 +86,9 @@
       (close-port (cdr pair))   ;; write side
       (and (char? (read-char (car pair))) ;; wait for child to do its thing
 	   (char-ready? port)
-	   (eof-object? (read-char port))))))
+	   (let ((pass? (eof-object? (read-char port))))
+             (close-pipe port)
+             pass?)))))
 
 ;;
 ;; open-output-pipe

             reply	other threads:[~2008-03-14 10:06 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-14 10:06 Ludovic Courtès [this message]
2008-03-17 22:55 ` "no duplicate" in `popen.test' Neil Jerram
2008-03-18 21:13   ` Ludovic Courtès
2008-05-19  8:53   ` Ludovic Courtès
2008-06-09 20:48     ` Neil Jerram
2009-05-19 23:56       ` Neil Jerram
2009-05-20 11:39         ` Ludovic Courtès
2009-05-20 17:44           ` Neil Jerram

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=87wso5livc.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=guile-devel@gnu.org \
    /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).