joyent/node — Issue #1998: EPIPE when writing to child stdin after closing process.stdin
Author: felixge
Created: 2011-11-03 07:40:05+00:00
State: open
Labels: child_process, process

I recently expired an EPIPE in one of my node 0.4.12 scripts that was reading data from process.stdin, and based on that data, spawned another child process and wrote to that child process' stdin stream.

The test to reproduce this can be found here: https://github.com/felixge/node/commit/ac07d96f017a95429a12f393a49d19cfc7986c05

@ry seems to have encountered this before as he added a comment about it on May 17, 2010:

https://github.com/joyent/node/commit/04c06b91#L2R724

0.5 does not seem to have this bug.

I'm opening this ticket because I couldn't figure out how to fix this. So any comment on this would be appreciated so I can submit a proper patch for fixing this.

--fg