Skip to content

node exits with error: getWindowSize EINTR #5737

Description

@jkryl
  • Version: v4.3.0
  • Platform: SunOS with 32bit userland

Occasionally (happens once a month or so) the node process exits with following message on screen:

Error: getWindowSize EINTR
    at exports._errnoException (util.js:870:11)
    at WriteStream._refreshSize (tty.js:82:24)
    at process.<anonymous> (node.js:638:18)
    at emitNone (events.js:72:20)
    at process.emit (events.js:166:7)
    at Signal.wrap.onsignal (node.js:802:46)

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 (

this.emit('error', errnoException(err, 'getWindowSize'));
) and makes the program to exit. I have no reproducible test case or proof that my assumptions are correct. Also I have seen a couple of places in nodejs code where EINTR is explicitly checked and function call repeated if that's the case. Perhaps something similar could be done for this piece of code as well.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    libuvIssues and PRs related to the libuv dependency or the uv binding.smartosIssues and PRs related to the SmartOS platform.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions