[Top][All Lists]

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

Re: 1.8 make check failing in popen.test

From: Kevin Ryde
Subject: Re: 1.8 make check failing in popen.test
Date: Fri, 25 Aug 2006 11:16:07 +1000
User-agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux)

Rob Browning <address@hidden> writes:
>>From the output of ps auxf, it looks like the child is probably one of
> these zombies.  There are several zombie sh children:
>       \_ [sh] <defunct>
>       \_ [sh] <defunct>
>       \_ [sh] <defunct>
>       \_ [lt-guile] <defunct>
>       \_ [lt-guile] <defunct>

Actually, I see the signalling pipe is left in the parent, so if the
child has printed nothing it could hang.  Obviously there's something
wrong if the child doesn't print what's expected, but the change below
should at least cause an error instead of a hang in that case.

  ;; After the child closes stdin (which it indicates here by writing
  ;; "closed" to stderr), the parent should see a broken pipe.  We setup to
  ;; see this as EPIPE (rather than SIGPIPE).  In Guile 1.6.4 and earlier a
  ;; duplicate of stdin existed in the child, preventing the broken pipe
  ;; occurring.
  (pass-if "no duplicate"
     (lambda ()
       (let* ((pair (pipe))
              (port (with-error-to-port (cdr pair)
                      (lambda ()
                         "exec 0</dev/null; echo closed 1>&2; exec 2>/dev/null; 
sleep 999")))))
         (close-port (cdr pair))   ;; write side
         (and (char? (read-char (car pair))) ;; wait for child to do its thing
              (catch 'system-error
                (lambda ()
                  (write-char #\x port)
                  (force-output port)
                (lambda (key name fmt args errno-list)
                  (= (car errno-list) EPIPE))))))))

reply via email to

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