Repository navigation
Assertion failed: (uv__stream_fd(stream) >= 0), function uv_read_start, file ../deps/uv/src/unix/stream.c, line 1477. #987
Description
Activity
Can you report this to mscdex/node-imap first, please? It might be a bug in that module that flew under the radar until now. If not, @mscdex should holler and I'll reopen the issue. Thanks.
It looks like
node-imapis pure js, so it is probably io.js bug@gnostic do you have a way to reproduce this issue? what you do reverts libuv/libuv@19d3d50
@bnoordhuis As @vkurchatkin said,
imapis pure js, so the error is happening in io.js C++ land.io.js v1.4.2 has the same problem.
@sergenikitin are you on Windows? if so, see #1005 and perhaps #1008 is relevant?
@rvagg no, OS X 10.10.2
/cc @indutny this looks relevant to your stream changes
@gnostic does following patch fix the problem for you?
diff --git a/deps/uv/src/unix/stream.c b/deps/uv/src/unix/stream.c index 518a2fc..ade6b90 100644 --- a/deps/uv/src/unix/stream.c +++ b/deps/uv/src/unix/stream.c @@ -393,10 +393,13 @@ int uv__stream_open(uv_stream_t* stream, int fd, int flags) { #if defined(__APPLE__) enable = 1; - if (setsockopt(fd, SOL_SOCKET, SO_OOBINLINE, &enable, sizeof(enable)) && - errno != ENOTSOCK && - errno != EINVAL) { - return -errno; + if (setsockopt(fd, SOL_SOCKET, SO_OOBINLINE, &enable, sizeof(enable))) { + if (errno != ENOTSOCK && + errno != EINVAL) { + return -errno; + } else { + errno = 0; + } } #endif
@indutny
I checked this patch, it's not fix the problem. Still haveAssertion failed: (uv__stream_fd(stream) >= 0), function uv_read_start, file ../deps/uv/src/unix/stream.c, line 1480. Abort trap: 6@sergenikitin is there any way to reproduce it?
Ok, a test case:
var tls = require('tls'); var net = require('net'); var socket = new net.Socket(); var s = tls.connect({ socket: socket, servername: 'google.com' }, function() { console.log('secure'); }); socket.connect(443, 'google.com');
@bnoordhuis @vkurchatkin @rvagg I have two solutions:
- assume that
net.Socketis aJSStreamif it has yet no_handle(i.e..connect()wasn't called) - allow adding parent socket handle to
TLSSocketafter creating it
The first solution is very easy to implement and should generally get various code like that test case working without any problems, except probably reduced bandwidth.
The second one is a bit complicated and might take some time to implement.
What do you think about doing (1) and then (2)?
- assume that
@indutny Is what you are proposing in (1) spiritually equivalent to:
if (!socket._handle) { socket.once('connect', function() { // continue with tls.connect()? }); return; }
?
- added a commit that references this issue
on Mar 3, 2015 @bnoordhuis like this #1046
- added a commit that references this issue
on Mar 3, 2015 - added a commit that references this issue
on Jun 21, 2026 - added 2 commits that reference this issue
on Jun 22, 2026
It happens when I used https://github.com/mscdex/node-imap on io.js 1.4.1 (on mac os).
On <= 1.3.0 node-imap worked good.