-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
error "write EINVAL" #16141
Comments
Couldn't reproduce on MacOS with v8.6.0 either. This is likely a Windows-specific issue |
Can reproduce on Windows 7 x64 with Node.js 4.8.4, 6.11.3, 8.7.0, 9.0.0 (last Nightly of 2017-10-11) |
cc @nodejs/platform-windows |
Windows 10 x64 - doesn't fail on 8.4.0, but throws on 8.6.0. |
This was introduced by #14791. It does not look related at all though. |
Moving the "instantiate eagerly" part to the end of |
It does reproduce on 8.7.0, 8ce0e9a and master |
This does not reproduce on neither Win 2012 nor 2008. It also does not happen on Win10 build 14393 |
The issue seems to be here: Lines 1450 to 1458 in 8485a7c
An event is created and assigned to Line 1250 in 8485a7c
RegisterWaitForSingleObject will always fail.
|
But why is the Lines 303 to 308 in 8485a7c
|
The reason this worked before #14791 is because Why does Moving |
Here's a similar case that should fail with all Node.js versions: index.js const spawn = require('child_process').spawn
const path = require('path')
let dir = path.join(__dirname, 'child.js')
let server = spawn(process.argv0, [`"${dir}"`], {
stdio: ['ipc', 'pipe', 'pipe'],
shell: true,
})
server.stderr.pipe(process.stderr) child.js process.stdin.on('data', console.log); I'm not sure this is something that can be fixed on Node.js/libuv's side at all. |
Initializing IOCP on the same fd twice can fail on Windows. Consequently, if the IPC channel uses fd 1 or 2 and the console is setup first, writing to the IPC channel will fail. PR-URL: #16562 Fixes: #16141 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: James M Snell <[email protected]>
Initializing IOCP on the same fd twice can fail on Windows. Consequently, if the IPC channel uses fd 1 or 2 and the console is setup first, writing to the IPC channel will fail. PR-URL: #16562 Fixes: #16141 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: James M Snell <[email protected]>
Initializing IOCP on the same fd twice can fail on Windows. Consequently, if the IPC channel uses fd 1 or 2 and the console is setup first, writing to the IPC channel will fail. PR-URL: #16562 Fixes: #16141 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: James M Snell <[email protected]>
Initializing IOCP on the same fd twice can fail on Windows. Consequently, if the IPC channel uses fd 1 or 2 and the console is setup first, writing to the IPC channel will fail. PR-URL: nodejs/node#16562 Fixes: nodejs/node#16141 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: James M Snell <[email protected]>
Initializing IOCP on the same fd twice can fail on Windows. Consequently, if the IPC channel uses fd 1 or 2 and the console is setup first, writing to the IPC channel will fail. PR-URL: nodejs/node#16562 Fixes: nodejs/node#16141 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: James M Snell <[email protected]>
It's not wholly clear what commit introduced the regression but between v8.4.0 and v8.5.0 the 'resize' event stopped getting emitted when the tty was resized. The SIGWINCH event listener apparently was being installed before the support code for `process.on('SIGWINCH', ...)` was. Fix that by moving said support code to real early in the bootstrap process. This commit also seems to fix a Windows-only "write EINVAL" error for reasons even less well-understood... Fixes: nodejs#16141 Fixes: nodejs#16194 PR-URL: nodejs#16225 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Jeremiah Senkpiel <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: Yuta Hiroto <[email protected]>
Initializing IOCP on the same fd twice can fail on Windows. Consequently, if the IPC channel uses fd 1 or 2 and the console is setup first, writing to the IPC channel will fail. PR-URL: nodejs/node#16562 Fixes: nodejs/node#16141 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: James M Snell <[email protected]>
It's not wholly clear what commit introduced the regression but between v8.4.0 and v8.5.0 the 'resize' event stopped getting emitted when the tty was resized. The SIGWINCH event listener apparently was being installed before the support code for `process.on('SIGWINCH', ...)` was. Fix that by moving said support code to real early in the bootstrap process. This commit also seems to fix a Windows-only "write EINVAL" error for reasons even less well-understood... Fixes: #16141 Fixes: #16194 PR-URL: #16225 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Jeremiah Senkpiel <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: Yuta Hiroto <[email protected]>
It's not wholly clear what commit introduced the regression but between v8.4.0 and v8.5.0 the 'resize' event stopped getting emitted when the tty was resized. The SIGWINCH event listener apparently was being installed before the support code for `process.on('SIGWINCH', ...)` was. Fix that by moving said support code to real early in the bootstrap process. This commit also seems to fix a Windows-only "write EINVAL" error for reasons even less well-understood... Fixes: #16141 Fixes: #16194 PR-URL: #16225 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Jeremiah Senkpiel <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: Yuta Hiroto <[email protected]>
while using child_process/spawn for ipc mode, child process will emit an error. it didn't appear in v8.4.0 or ubuntu
file index.js
file child.js
The text was updated successfully, but these errors were encountered: