Download Reference Manual
The Developer's Library for D
About Wiki Forums Source Search Contact

Ticket #1865 (closed defect: invalid)

Opened 14 years ago

Last modified 14 years ago

Process.wait hangs with too much output on Stdout

Reported by: larsivi Assigned to: schveiguy
Priority: major Milestone: 1.0
Component: Tango Version: 0.99.9 Kai
Keywords: Cc:

Description

I didn't investigate this very thouroughly, but it appears that if the child process outputs a lot on stdout, then wait will not complete within reasonable time (strace shows that it hangs on waitpid).

It is quite possible that this is more an issue with the user rather than Process, but it would be good to clarify in any case.

This is with trunk on 32 bit linux, btw, and DMD 1.051.

Change History

02/20/10 20:32:48 changed by schveiguy

You mean you redirect stdout of the child process to a pipe, then don't read the pipe, and simply wait for the child to exit? If this is the case, what's happening is the child is filling up the kernel buffer for the pipe, and cannot write any more data. Since the parent isn't reading, you have deadlock.

If this is the case, then I don't think it warrants any changes, documentation or otherwise. I don't think Tango needs to encompass all aspects of programming. When redirecting output, one is expected to know that using pipes requires that you read what the other side is writing to avoid deadlock (this is basic producer/consumer 101). A good place for this may be a tutorial, but it's such a fundamental requirement, I don't think it belongs in the documentation.

If this is a different issue, let me know.

02/20/10 22:08:55 changed by larsivi

  • status changed from new to closed.
  • resolution set to invalid.

Yeah, that's probably it. I believe the pipe is read afterwards. I may remember wrong, but I think that is what the main example used to do in the past. Thanks for the clarification.