<div>I am wondering if someone would be willing to assist me in debugging a problem I'm experiencing with my current attempt at an&nbsp;implementation of spawnProcess for the IOCP proactor.</div>
<div>&nbsp;</div>
<div>A patch with my implementation can be found at <a href="http://twistedmatrix.com/bugs/issue1008">http://twistedmatrix.com/bugs/issue1008</a>&nbsp;along with comments and a log file describing my problem.</div>
<div>&nbsp;</div>
<div>The problem occurs sporadically when running twisted.test.test_process.ProcessTestCase.testProcesstwisted.test.test_process.&nbsp; First I create 3 pipes that will be used to write to the child process's stdin and read its stdout and stderr.&nbsp; Then I initiate a read on all 3 pipes.&nbsp; The reads makes sense for stdout and stderr.&nbsp; The stdin pipe is created in duplex mode and the read attempt on it from the parent&nbsp;is only there so we can detect when the child closes its end of the pipe so the parent can close its end as well.
</div>
<div>&nbsp;</div>
<div>The problem is that occasionally (often, but not consistently) the read operations on stdin (and sometimes&nbsp;stderr) seem to not run at all and FileMon reports their status as CANCELLED when I get to the end of the program.&nbsp; If I run trial run through pdb and step through it, the result of CANCELLED&nbsp;for these 1 or 2 (if stderr fails as well) reads doesn't appear until the very end of the program.&nbsp; The callbacks (
ReadInOp.ovDone and ReadErrOp.ovDone don't get called for either of these when the failure occurs, so FileMon's results seem to accurately reflect what is happening.&nbsp; However, from my print statements it is clear that the reads are initiated (
ReadInOp.initiateOp and ReadErrOp.initiateOp).</div>
<div>&nbsp;</div>
<div>The closest&nbsp;thing I can find to a description of what CANCELLED might mean is at <a href="http://www.cs.princeton.edu/~appel/smlnj/basis/posix-error.html">http://www.cs.princeton.edu/~appel/smlnj/basis/posix-error.html
</a> which says it indicates that the associated asynchronous operation was cancelled before completion.&nbsp; This sounds correct, but doesn't help illuminate *why* this is happening.</div>
<div>&nbsp;</div>
<div>Does anyone have any suggestions as to why this is happening?</div>
<div>&nbsp;</div>
<div>Thanks in advance.</div>
<div>Justin</div>