-
-
Couldn't load subscription status.
- Fork 33.6k
Open
Labels
streamIssues and PRs related to the stream subsystem.Issues and PRs related to the stream subsystem.
Description
- Version:
13.11.0(tried on8.3.0too, same result) - Platform: Linux
- Subsystem: Ubuntu
19.10
What steps will reproduce the bug?
foo.c
#include <stdio.h>
int main() {
char str[100];
gets(str);
puts(str);
return 0;
}Compile it:
$ gcc -o foo foo.cindex.js:
const { spawn } = require('child_process')
const child = spawn('./foo')
process.stdin.pipe(child.stdin)
child.on('exit', () => {
console.log('done')
process.stdin.unpipe(child.stdin)
})Launch index.js:
$ node index.js
input
done
After entering some input, the child process exits and done is printed. However the main process does not exit (although it should). It looks like process.stdin has a left handle. After entering newline again on stdin, the process now exits.
How often does it reproduce?
Always
What is the expected behavior?
See above.
What do you see instead?
See above.
sindresorhus, rivertam, tHBp, antonmedv, robsonos and 2 more
Metadata
Metadata
Assignees
Labels
streamIssues and PRs related to the stream subsystem.Issues and PRs related to the stream subsystem.