guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

"no duplicate" in `popen.test'


From: Ludovic Courtès
Subject: "no duplicate" in `popen.test'
Date: Fri, 14 Mar 2008 11:06:47 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux)

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'!

--- 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 via email to

[Prev in Thread] Current Thread [Next in Thread]