-
Notifications
You must be signed in to change notification settings - Fork 30.1k
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
node exits with error: getWindowSize EINTR #5737
Comments
bnoordhuis
added
the
libuv
Issues and PRs related to the libuv dependency or the uv binding.
label
Mar 16, 2016
That sounds plausible. It's probably Solaris-specific because I don't think the other Unixes return EINTR from ioctl(TIOCGWINSZ). This patch should help. I'll get it upstreamed in libuv: diff --git a/deps/uv/src/unix/tty.c b/deps/uv/src/unix/tty.c
index 7cc5b71..f62b59f 100644
--- a/deps/uv/src/unix/tty.c
+++ b/deps/uv/src/unix/tty.c
@@ -185,8 +185,13 @@ int uv_tty_set_mode(uv_tty_t* tty, uv_tty_mode_t mode) {
int uv_tty_get_winsize(uv_tty_t* tty, int* width, int* height) {
struct winsize ws;
+ int err;
+
+ do
+ err = ioctl(uv__stream_fd(tty), TIOCGWINSZ, &ws);
+ while (err == -1 && errno == EINTR);
- if (ioctl(uv__stream_fd(tty), TIOCGWINSZ, &ws))
+ if (err)
return -errno;
*width = ws.ws_col; |
Thanks for quick response and the patch! |
bnoordhuis
added a commit
to bnoordhuis/libuv
that referenced
this issue
Mar 20, 2016
Some platforms (notably Solaris) can fail in this ioctl() if interrupted by a signal. Retry the system call when that happens. Fixes: nodejs/node#5737
bnoordhuis
added a commit
to bnoordhuis/libuv
that referenced
this issue
Mar 20, 2016
Some platforms (notably Solaris) can fail in this ioctl() if interrupted by a signal. Retry the system call when that happens. Fixes: nodejs/node#5737
bnoordhuis
added a commit
to bnoordhuis/libuv
that referenced
this issue
Mar 20, 2016
Some platforms (notably Solaris) can fail in this ioctl() if interrupted by a signal. Retry the system call when that happens. Fixes: nodejs/node#5737 PR-URL: libuv#772 Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
saghul
added a commit
to saghul/node
that referenced
this issue
Apr 7, 2016
Fixes: nodejs#5737 Fixes: nodejs#4643 Fixes: nodejs#4291 Fixes: nodejs/node-v0.x-archive#8960 Refs: nodejs#3594 PR-URL: nodejs#5994
saghul
added a commit
to saghul/node
that referenced
this issue
Jul 11, 2016
Fixes: nodejs#5737 Fixes: nodejs#4643 Fixes: nodejs#4291 Fixes: nodejs/node-v0.x-archive#8960 Refs: nodejs#3594 PR-URL: nodejs#5994 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Occasionally (happens once a month or so) the node process exits with following message on screen:
What I think that happens is that the node is trying to get new size of screen after receiving SIGWINCH signal and the call to getWindowSize is interrupted by another signal and because SA_RESTART flag for sigaction() is not set by default on solaris unlike on other platforms, the interrupted syscall is not repeated and EINTR error is emitted on stream (
node/lib/tty.js
Line 71 in fdeb862
The text was updated successfully, but these errors were encountered: