unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* "no duplicate" in `popen.test'
@ 2008-03-14 10:06 Ludovic Courtès
  2008-03-17 22:55 ` Neil Jerram
  0 siblings, 1 reply; 8+ messages in thread
From: Ludovic Courtès @ 2008-03-14 10:06 UTC (permalink / raw)
  To: guile-devel

[-- 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

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2009-05-20 17:44 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-14 10:06 "no duplicate" in `popen.test' Ludovic Courtès
2008-03-17 22:55 ` 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

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).