-
Notifications
You must be signed in to change notification settings - Fork 30k
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
Assertion failed: (uv__stream_fd(stream) >= 0), function uv_read_start, file ../deps/uv/src/unix/stream.c, line 1477. #987
Comments
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 |
workaround;
|
@gnostic do you have a way to reproduce this issue? what you do reverts libuv/libuv@19d3d50 |
@bnoordhuis As @vkurchatkin said, |
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
|
@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:
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)? |
@indutny Is what you are proposing in (1) spiritually equivalent to: if (!socket._handle) {
socket.once('connect', function() {
// continue with tls.connect()?
});
return;
} ? |
Accept `new net.Socket()` as a `socket` option to `tls.connect()` without triggering an assertion error in C++. This is done by wrapping it into a JSStream to ensure that there will be a handle at the time of wrapping the socket into TLSSocket. Fix: nodejs#987
@bnoordhuis like this #1046 |
Accept `new net.Socket()` as a `socket` option to `tls.connect()` without triggering an assertion error in C++. This is done by wrapping it into a JSStream to ensure that there will be a handle at the time of wrapping the socket into TLSSocket. Fix: #987 PR-URL: #1046 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Rod Vagg <[email protected]>
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.
The text was updated successfully, but these errors were encountered: