Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

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

Closed
bnoordhuis opened this Issue Jul 12, 2012 · 3 comments

Comments

Projects
None yet
2 participants
Owner

bnoordhuis commented Jul 12, 2012

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 commented Jul 12, 2012

The reference error needs to be fixed.

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

Owner

bnoordhuis commented Jul 12, 2012

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

Yes.

Owner

bnoordhuis commented Jul 12, 2012

Fixed in 3a6314d.

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