Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

net: {fd:x} throws ReferenceError or triggers libuv assertion #3699

Closed
bnoordhuis opened this Issue · 3 comments

2 participants

@bnoordhuis

v0.8, commit c6bb361.

$ out/Release/node -e 'require("net").createServer(function(){}).listen({fd:1})'

net.js:899
        self.emit('error', errnoException(errno, 'listen'));
                                          ^
ReferenceError: errno is not defined
    at Server._listen2.self._handle.onconnection (net.js:899:43)
    at process.startup.processNextTick.process._tickCallback (node.js:244:9)
$ out/Release/node -e 'require("net").createServer(function(){}).listen({fd:42})'
node: ../src/tty_wrap.cc:108: static v8::Handle<v8::Value> node::TTYWrap::GuessHandleType(const v8::Arguments&): Assertion `0' failed.
Aborted
@isaacs
Owner

The reference error needs to be fixed.

I guess the listen({fd: 42}) should raise EBADF or something?

@bnoordhuis

I guess the listen({fd: 42}) should raise EBADF or something?

Yes.

@bnoordhuis bnoordhuis closed this issue from a commit
@bnoordhuis bnoordhuis net: fix net.Server.listen({fd:x}) error reporting
* don't assert when fd isn't an open file descriptor

* don't die with a ReferenceError when fd isn't a file descriptor
  you can listen() on

Fixes #3699.
3a6314d
@bnoordhuis

Fixed in 3a6314d.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.