cygwin 1.5.18-1 + Perl + open-pipe + native executable

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

cygwin 1.5.18-1 + Perl + open-pipe + native executable

PPC Hacker
Hi --

I've hit a problem with 1.5.18-1 and the Perl open pipe command:

open(SRC, "| $prog")

If $prog is a cygwin executable, everything works fine.

If $prog implies a shell-exec (rather than an exec), e.g., by including
quoting characters so that /bin/sh is called as a wrapper, everything works
fine.

If $prog is a native windows executable and a shell isn't required (i.e.,
Perl does a direct fork/exec), the open hangs.

Attached is a small test case (tar/gzip) showing the problem.  "sh run"
shows the problem.

Also attached is the output of cygserver as requested and "Perl -V" for good
measure.

-- Rick

_________________________________________________________________
Don’t just search. Find. Check out the new MSN Search!
http://search.msn.click-url.com/go/onm00200636ave/direct/01/

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

cygcheck.out (24K) Download Attachment
perl.ver (2K) Download Attachment
bug1.tar.gz (8K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: cygwin 1.5.18-1 + Perl + open-pipe + native executable

Brian Dessent
PPC Hacker wrote:

> If $prog is a native windows executable and a shell isn't required (i.e.,
> Perl does a direct fork/exec), the open hangs.
>
> Attached is a small test case (tar/gzip) showing the problem.  "sh run"
> shows the problem.

Your test case works fine with the current CVS build of Cygwin, so
whatever was causing this has probably already been fixed.

Brian

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

Reply | Threaded
Open this post in threaded view
|

Re: cygwin 1.5.18-1 + Perl + open-pipe + native executable

René Berber-2
In reply to this post by PPC Hacker
PPC Hacker wrote:
[snip]
> If $prog is a native windows executable and a shell isn't required
> (i.e., Perl does a direct fork/exec), the open hangs.
[snip]

The open doesn't hang, it's the windows executable that keeps waiting for input
on the pipe... and the pipe is not connected.

The reason and some explanation is on the User guide:

  http://cygwin.com/cygwin-ug-net/using-effectively.html#id4750591

HTH
--
René Berber


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

Reply | Threaded
Open this post in threaded view
|

Re: cygwin 1.5.18-1 + Perl + open-pipe + native executable

PPC Hacker
In reply to this post by PPC Hacker
Brian wrote:
>Your test case works fine with the current CVS build of Cygwin, so
>whatever was causing this has probably already been fixed.

Thanks, that's good to know.  I should have tried it myself.

Using the snaphot 12/13/2005 build of cygwin1.dll it indeed works.



Rene wrote:
>>If $prog is a native windows executable and a shell isn't required
>>(i.e., Perl does a direct fork/exec), the open hangs.

>The open doesn't hang, it's the windows executable that keeps waiting for
>input
>on the pipe... and the pipe is not connected.

I believe this analysis is incorrect.  If you examine the Perl script in the
example you will see that the call to open() never returns.  Yes, the
windows executable is waiting for input (on a connected pipe), but it never
receives this input because the Perl script never advances past the open.

For what it's worth, this "used to work", at least on a very ancient cygwin
(1.5.3) / Perl (5.0.8) combination.  Something along the way broke it, but
as reported above, it has apparently been fixed again.

Thanks for the feedback!

-- Rick

_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today - it's FREE!
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/