Bug 7017 - closing stdout in a child python process means that process doesn't receive bytes from stdin anymore. I think.
Summary: closing stdout in a child python process means that process doesn't receive b...
Status: NEW
Alias: None
Product: cygwin
Classification: Unclassified
Component: Cygwin Applications (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Reini Urban
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-11-10 23:15 UTC by Zooko O'Whielacronx
Modified: 2009-01-14 04:43 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments
the output from cygcheck -s -v -r (3.93 KB, text/plain)
2008-11-13 13:28 UTC, Zooko O'Whielacronx
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Zooko O'Whielacronx 2008-11-10 23:15:05 UTC
When someone runs "bin/trial --reactor=select 
twisted.internet.test.test_process.ProcessTestsBuilder_PollReactor.test_
childConnectionLost" on cygwin, using the cygwin version of Python, 
either manually (which I've done on two cygwin installations), or from 
the twisted buildbot -- 
http://buildbot.twistedmatrix.com/builders/cygwin-py2.5-select -- then 
once the child process closes its fd #2, it subsequently receives no 
further bytes from its fd #1, even though the parent process has written 
some bytes to that pipe.

I can reproduce this by running the Twisted unit tests, like this:

step 1: get twisted:

svn co svn://svn.twistedmatrix.com/svn/Twisted/trunk twisted

step 2: cd into the top-level directory, and run trial:

cd twisted && python ./bin/trial --reactor=select 
twisted.internet.test.test_process.ProcessTestsBuilder_PollReactor.test_
childConnectionLost

On other platforms that cygwin (see the Twisted buildbot -- 
http://buildbot.twistedmatrix.com/supported?branch=trunk -- then this 
test exits quickly with success. On cygwin, using cygwin python.exe, 
this test instead enter an infinite loop as the child waits to receive 
further bytes on its stdin, and the parent waits for the child to 
respond to those bytes. (This doesn't happen on cygwin with the standard 
Win32 build of python.exe, of course, anymore than it happens on a 
Windows system without cygwin installed when using that executable.)

I've opened a ticket about this on the twisted issue tracker as well: 

http://twistedmatrix.com/trac/ticket/3529 # closing stdout in a child 
process on cygwin means that process doesn't receive bytes from stdin 
anymore. I think.

I've opened a ticket about this on the python issue tracker as well:

http://bugs.python.org/issue4295 # closing stdout in a child process on cygwin 
means that process doesn't receive bytes from stdin anymore. I think.  



The version of the cygwin package of python is 2.5.1-2.
Comment 1 Zooko O'Whielacronx 2008-11-13 13:28:44 UTC
Created attachment 3060 [details]
the output from cygcheck -s -v -r
Comment 2 Zooko O'Whielacronx 2008-11-13 16:10:29 UTC
 Corinna Vinschen of cygwin requests a smaller test case:

http://www.cygwin.com/ml/cygwin/2008-11/msg00166.html
Comment 3 Zooko O'Whielacronx 2009-01-14 04:40:52 UTC
Here is a smaller test case which shows incorrect behavior:
http://twistedmatrix.com/trac/attachment/ticket/3529/demo.4.py

I will also attempt to attach demo.4.py to this ticket.  There are more test
cases along with my notes about the behavior that they exhibited at:

http://twistedmatrix.com/trac/ticket/3529
Comment 4 Zooko O'Whielacronx 2009-01-14 04:43:03 UTC
Oh, I'm sorry, demo.4.py shows correct behavior.  The difference between
demo.4.py -- which behaves correctly -- and "python ./bin/trial --reactor=select 
twisted.internet.test.test_process.ProcessTestsBuilder_PollReactor.test_
childConnectionLost" -- which behaves incorrectly -- is not understood.