-
Notifications
You must be signed in to change notification settings - Fork 7.3k
[CRASH] Assertion failed: cb->IsFunction() in async-wrap-inl.h at line 230 #7691
Comments
Self assigned. @branneman any chance you could produce a backtrace with this error? |
@trevnorris I'd love to, but how to I produce one if I'm not getting one? It's not a Node.js error from JS code, more like a C/C++ crash, so that one message is all I get. Could you explain how I can make it generate a stack trace? |
@branneman does it reproduce for you without external dependencies? What if you would replace |
I was able to reproduce the error with the following source. But, since the chance that the error occurs is very small, I used JMeter to bombard this little localhost:3000 server, it crashed after about 2k requests. const cluster = require('cluster');
const numCPUs = require('os').cpus().length;
const http = require('http');
if (cluster.isMaster) {
var forks = {};
for (var i = 0; i < numCPUs; i++) {
forks[i] = cluster.fork();
forks[i].on('message', function(msg) {
console.log('Message from worker', msg.worker + ':', msg.msg, 'on', +new Date);
});
}
console.log('Cluster started with', numCPUs, 'nodes.');
}
if (cluster.isWorker) {
http.createServer(function(req, res) {
process.send({
worker: cluster.worker.id,
msg: 'request'
});
res.end('Hello World from worker ' + cluster.worker.id);
}).listen(3000, '127.0.0.1', function() {
console.log('Worker', cluster.worker.id, 'started.');
});
} |
@branneman Thanks for the reduced test case. I'll work on reproducing the issue. Hopefully I can on my Linux box because I have no idea how to debug this crap from Windows. |
Need help on Windows ? I can have a look if needed. |
c:\temp>node test.js With siege on my linux box, I can reproduce. Switching to debug mode.
I will investigate more tomorrow: inline v8::Handle<v8::Value> AsyncWrap::MakeCallback(
const v8::Handle<v8::String> symbol,
int argc,
v8::Handle<v8::Value>* argv) {
v8::Local<v8::Value> cb_v = object()->Get(symbol);
v8::Local<v8::Function> cb = cb_v.As<v8::Function>();
assert(cb->IsFunction()); <== ## !!!! cb is not a function !!!!
return MakeCallback(cb, argc, argv);
} |
First, this issue doesn't seem to have anything directly related to the Honestly this shouldn't be possible because the the @orangemocha The only commit I can find that introduces |
@migounette Thanks. The debugging information you're providing is very useful. |
@trevnorris if this only repros on Windows feel free to assign to me. However I won't be able to look into it for another two weeks as I am working on another high-priority task. |
i have encountered the same issue on Windows 2008r2 running on VMware and ec2. it seems related to cluster only. Everything works fine in linux or not in cluster. |
I'm investigating... |
This is the Node side of the fix for Node's cluster module on Windows. #7691 The other required part is joyent/libuv#1384 Windows and Unix return certain socket errors (i.e. EADDRINUSE) at different times: bind on Windows, and listen on Unix. In an effort to hide this difference, libuv on Windows stores such errors in the bind_error field of uv_tcp_t, to defer raising it at listen time. This worked fine except for the case in which a socket is shared in a Node cluster and a bind error occurs. A previous attempt to fix this ( joyent/libuv@d1e6be1 3da36fe ) was flawed becaused in an attempt to relay the error at the JS level it caused the master to start accepting connections. With this new approach, libuv itself is relaying the bind errors, providing for a uniform behavior of uv_tcp_listen. Reviewed-By: Fedor Indutny <fedor@indutny.com>
This is the Node side of the fix for Node's cluster module on Windows. #7691 The other required part is joyent/libuv#1384 Windows and Unix return certain socket errors (i.e. EADDRINUSE) at different times: bind on Windows, and listen on Unix. In an effort to hide this difference, libuv on Windows stores such errors in the bind_error field of uv_tcp_t, to defer raising it at listen time. This worked fine except for the case in which a socket is shared in a Node cluster and a bind error occurs. A previous attempt to fix this ( joyent/libuv@d1e6be1 3da36fe ) was flawed becaused in an attempt to relay the error at the JS level it caused the master to start accepting connections. With this new approach, libuv itself is relaying the bind errors, providing for a uniform behavior of uv_tcp_listen. Reviewed-By: Fedor Indutny <fedor@indutny.com>
Fixed with 7ca4fa5 |
@orangemocha Thanks. :) |
Will there be v0.10.31 or v0.10.32 where this is fixed, or is this going to be in v0.11.x, and thus v0.12? |
This fix is in v0.12, which presumably will get integrated into v0.11. |
So there's a 0.12 branch where work is done without it having first been in 0.11? Hm, I was under the impression that the latest 0.11 will become 0.12 eventually, that all the work was done in 0.11. When will 0.12 be there btw? Not looking for exact dates of course, but will it be this year? Any big features still need to be done, or just bug fixing and building a release? |
We forked the 0.12 branch last week. Fixes going into 0.12 will be integrated into master (whose version number is currently 0.11). We are one PR away from being feature-complete for 0.12. After that it's all bug fixes. So yes, it should definitely happen this year. |
Awesome! |
This is the Node side of the fix for Node's cluster module on Windows. nodejs/node-v0.x-archive#7691 The other required part is joyent/libuv#1384 Windows and Unix return certain socket errors (i.e. EADDRINUSE) at different times: bind on Windows, and listen on Unix. In an effort to hide this difference, libuv on Windows stores such errors in the bind_error field of uv_tcp_t, to defer raising it at listen time. This worked fine except for the case in which a socket is shared in a Node cluster and a bind error occurs. A previous attempt to fix this ( joyent/libuv@d1e6be1 nodejs/node-v0.x-archive@3da36fe ) was flawed becaused in an attempt to relay the error at the JS level it caused the master to start accepting connections. With this new approach, libuv itself is relaying the bind errors, providing for a uniform behavior of uv_tcp_listen. Reviewed-By: Fedor Indutny <fedor@indutny.com>
This is the Node side of the fix for Node's cluster module on Windows. nodejs/node-v0.x-archive#7691 The other required part is joyent/libuv#1384 Windows and Unix return certain socket errors (i.e. EADDRINUSE) at different times: bind on Windows, and listen on Unix. In an effort to hide this difference, libuv on Windows stores such errors in the bind_error field of uv_tcp_t, to defer raising it at listen time. This worked fine except for the case in which a socket is shared in a Node cluster and a bind error occurs. A previous attempt to fix this ( joyent/libuv@d1e6be1 nodejs/node-v0.x-archive@3da36fe ) was flawed becaused in an attempt to relay the error at the JS level it caused the master to start accepting connections. With this new approach, libuv itself is relaying the bind errors, providing for a uniform behavior of uv_tcp_listen. Reviewed-By: Fedor Indutny <fedor@indutny.com>
Exact error
Assertion failed: cb->IsFunction(), file g:\jenkins\workspace\nodejs-msi\d73b0901\src\async-wrap-inl.h, line 230
And that's here: src/async-wrap-inl.h#L230
My system
winver
: Version 6.2 (Build 9200)My application
--harmony
flagcluster.js
: a straightforward recluster configurationnode.js
: an example webserver, copy-pasted from nodejs.org, tweaked a tiny bitTo reproduce
File 'cluster.js':
File 'node.js':
Run:
node --harmony cluster
http://localhost:3000/
, which will time outAssertion failed: cb->IsFunction(), file g:\jenkins\workspace\nodejs-msi\d73b0901\src\async-wrap-inl.h, line 230
The bad news? It doesn't always crash. I hope you guys can reproduce. If further environment info is needed, or I should run some other tests, let me know.
The text was updated successfully, but these errors were encountered: