-
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
spawn's stdio can result in stderr being closed in child #862
spawn's stdio can result in stderr being closed in child #862
Comments
I believe that's still not fixed. This is the closest open issue I could find: joyent/libuv#923 |
I think this asks for a two-pronged approach: libuv probably has a bug or two that need to be addressed but io.js could reopen fds 0-2 as /dev/null if they aren't valid file descriptors. |
@bnoordhuis can you also comment on #831 ? |
Opening fd 2 on /dev/null would avoid the EBADF, and probably is a good idea, so fd 2 doesn't become some random open file, but wouldn't avoid the underlying problem, that I dug up the last time I saw this: |
@saghul I think I've fixed this, as well as some related bugs. I'm putting together some node tests, then I'll PR the fix to libuv. |
Great! Thanks Sam.
|
If a descriptor was being copied to an fd that *was not its current value*, it should get closed after being copied. But the existing code would close the fd, even when it no longer referred to the original descriptor. Don't do this, only close fds that are not in the desired range for the child process. See nodejs/node#862
If a descriptor was being copied to an fd that *was not its current value*, it should get closed after being copied. But the existing code would close the fd, even when it no longer referred to the original descriptor. Don't do this, only close fds that are not in the desired range for the child process. See nodejs/node#862
If a descriptor was being copied to an fd that *was not its current value*, it should get closed after being copied. But the existing code would close the fd, even when it no longer referred to the original descriptor. Don't do this, only close fds that are not in the desired range for the child process. See nodejs/node#862
If a descriptor was being copied to an fd that *was not its current value*, it should get closed after being copied. But the existing code would close the fd, even when it no longer referred to the original descriptor. Don't do this, only close fds that are not in the desired range for the child process. See nodejs/node#862 PR-URL: libuv#309 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Saúl Ibarra Corretgé <[email protected]>
Should be fixed by 04cc03b. Closing, holler if I should reopen it. |
Fixes: nodejs#1397 Fixes: nodejs#1512 Fixes: nodejs#1621 Fixes: nodejs#862 PR-URL: nodejs#1646 Reviewed-By: Ben Noordhuis <[email protected]>
I'm seeing a failure like this frequently from |
Result: 'ERROR' is not printed.
Excerpt from strace:
This likely a bug in libuv, but reporting it here because that's where I saw it.
Affects node v0.10 and io.js.
/cc @saghul @bnoordhuis I think we tried to fix a variant of this a year or so ago.
The text was updated successfully, but these errors were encountered: