-
Notifications
You must be signed in to change notification settings - Fork 29.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Crash on windows when passing child process' stdin as other childs stdout #17493
Comments
@mika-fischer I can't reproduce this. I'm trying this with Node 8.9.2 (but also with 8.6.0 and latest nightly) on 64-bit Win 10 Pro and it works. Are you maybe redirecting the script output somewhere or using some other terminal (like ConEmu)? |
I've tried it in plain cmd, cmder, VS2015 x64 Native Command Prompt and cmd inside VSCode. And of course it's best to run it in the debugger. In all those cases it always crashes for me. So if you run it in the debugger with |
I did not test this correctly, it does indeed crash. I've tested, this reproduces back to v6 (on v4 there is a I've made slightly modified version of your code which still reproduces: const writeSize = 1
const spawn = require('child_process').spawn;
const who = process.argv.length <= 2 ? 'parent' : process.argv[2];
switch (who) {
case 'parent':
const consumer = spawn(process.argv0, [process.argv[1], 'consumer'], {
stdio: ['pipe', 'ignore', 'inherit'],
});
const producer = spawn(process.argv0, [process.argv[1], 'producer'], {
stdio: ['pipe', consumer.stdin, 'inherit'],
});
process.stdin.on('data', () => {})
break
case 'producer':
const buffer = Buffer.alloc(writeSize, '.');
const write = () => {
process.stdout.write(buffer, write);
}
write()
break
case 'consumer':
var totalDots = 0;
process.stdin.on('data', (data) => {
totalDots += data.length
console.error(`Got ${data.length} dots! Total: ${totalDots}`)
})
break
} The If you change This looks like a race inside libuv, I'll investigate this further. |
Can't reproduce on master. It was probably fixed in #18260. |
It was fixed in #18019. Maybe we should add this as a test to Node.js? |
@bzoz a regression test is a good idea. |
Test in #18614 |
Add two regression tests for stdio over pipes. test-stdio-pipe-access tests if accessing stdio pipe that is being read by another process does not deadlocks Node.js. This was reported in nodejs#10836 and was fixed in v8.3.0. The deadlock would happen intermittently, so we run the test 5 times. test-stdio-pipe-redirect tests if redirecting one child process stdin to another process stdout does not crash Node as reported in nodejs#17493. It was fixed in nodejs#18019.
Add two regression tests for stdio over pipes. test-stdio-pipe-access tests if accessing stdio pipe that is being read by another process does not deadlocks Node.js. This was reported in nodejs#10836 and was fixed in v8.3.0. The deadlock would happen intermittently, so we run the test 5 times. test-stdio-pipe-redirect tests if redirecting one child process stdin to another process stdout does not crash Node as reported in nodejs#17493. It was fixed in nodejs#18019. PR-URL: nodejs#18614 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Add two regression tests for stdio over pipes. test-stdio-pipe-access tests if accessing stdio pipe that is being read by another process does not deadlocks Node.js. This was reported in #10836 and was fixed in v8.3.0. The deadlock would happen intermittently, so we run the test 5 times. test-stdio-pipe-redirect tests if redirecting one child process stdin to another process stdout does not crash Node as reported in #17493. It was fixed in #18019. PR-URL: #18614 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Add two regression tests for stdio over pipes. test-stdio-pipe-access tests if accessing stdio pipe that is being read by another process does not deadlocks Node.js. This was reported in nodejs#10836 and was fixed in v8.3.0. The deadlock would happen intermittently, so we run the test 5 times. test-stdio-pipe-redirect tests if redirecting one child process stdin to another process stdout does not crash Node as reported in nodejs#17493. It was fixed in nodejs#18019. PR-URL: nodejs#18614 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Add two regression tests for stdio over pipes. test-stdio-pipe-access tests if accessing stdio pipe that is being read by another process does not deadlocks Node.js. This was reported in #10836 and was fixed in v8.3.0. The deadlock would happen intermittently, so we run the test 5 times. test-stdio-pipe-redirect tests if redirecting one child process stdin to another process stdout does not crash Node as reported in #17493. It was fixed in #18019. PR-URL: #18614 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Add two regression tests for stdio over pipes. test-stdio-pipe-access tests if accessing stdio pipe that is being read by another process does not deadlocks Node.js. This was reported in #10836 and was fixed in v8.3.0. The deadlock would happen intermittently, so we run the test 5 times. test-stdio-pipe-redirect tests if redirecting one child process stdin to another process stdout does not crash Node as reported in #17493. It was fixed in #18019. PR-URL: #18614 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Add two regression tests for stdio over pipes. test-stdio-pipe-access tests if accessing stdio pipe that is being read by another process does not deadlocks Node.js. This was reported in #10836 and was fixed in v8.3.0. The deadlock would happen intermittently, so we run the test 5 times. test-stdio-pipe-redirect tests if redirecting one child process stdin to another process stdout does not crash Node as reported in #17493. It was fixed in #18019. PR-URL: #18614 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Add two regression tests for stdio over pipes. test-stdio-pipe-access tests if accessing stdio pipe that is being read by another process does not deadlocks Node.js. This was reported in nodejs#10836 and was fixed in v8.3.0. The deadlock would happen intermittently, so we run the test 5 times. test-stdio-pipe-redirect tests if redirecting one child process stdin to another process stdout does not crash Node as reported in nodejs#17493. It was fixed in nodejs#18019. PR-URL: nodejs#18614 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Add two regression tests for stdio over pipes. test-stdio-pipe-access tests if accessing stdio pipe that is being read by another process does not deadlocks Node.js. This was reported in #10836 and was fixed in v8.3.0. The deadlock would happen intermittently, so we run the test 5 times. test-stdio-pipe-redirect tests if redirecting one child process stdin to another process stdout does not crash Node as reported in #17493. It was fixed in #18019. PR-URL: #18614 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Add two regression tests for stdio over pipes. test-stdio-pipe-access tests if accessing stdio pipe that is being read by another process does not deadlocks Node.js. This was reported in #10836 and was fixed in v8.3.0. The deadlock would happen intermittently, so we run the test 5 times. test-stdio-pipe-redirect tests if redirecting one child process stdin to another process stdout does not crash Node as reported in #17493. It was fixed in #18019. PR-URL: #18614 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Add two regression tests for stdio over pipes. test-stdio-pipe-access tests if accessing stdio pipe that is being read by another process does not deadlocks Node.js. This was reported in #10836 and was fixed in v8.3.0. The deadlock would happen intermittently, so we run the test 5 times. test-stdio-pipe-redirect tests if redirecting one child process stdin to another process stdout does not crash Node as reported in #17493. It was fixed in #18019. PR-URL: #18614 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Add two regression tests for stdio over pipes. test-stdio-pipe-access tests if accessing stdio pipe that is being read by another process does not deadlocks Node.js. This was reported in #10836 and was fixed in v8.3.0. The deadlock would happen intermittently, so we run the test 5 times. test-stdio-pipe-redirect tests if redirecting one child process stdin to another process stdout does not crash Node as reported in #17493. It was fixed in #18019. PR-URL: #18614 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
The following simple test crashes the node process on Windows. It works fine on Linux.
The error is:
It occurs in deps/uv/src/win/core.c:439.
Call stack:
Locals:
I got the stack traces from a self-compiled build, but it also crashes with the official binary.
The text was updated successfully, but these errors were encountered: