-
Notifications
You must be signed in to change notification settings - Fork 129
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
nan.h error on node v0.10.22 #67
Comments
thanks for report, I'll take a look this weekend. |
@ashleybrener What the version of |
@ashleybrener I've push some code in new |
Not repeatable, Closing. |
For the ones having the issue, it can happen simply because the given IP is not a string, as said in the error message. For example null, a number, an object, a function, etc. if (ip != null) && typeof ip === 'string' But even with this check, I'm still having the issue randomly on geoip 0.5.0 to 0.5.2 and nodejs 0.8.18 and 0.10.21. |
Actually, some days ago, I've merged a pull request to try to solved this issue. In short words, what this patch did is, if the given parameter is not a string, it just throw an error. You can clone the repo and give it a try. Also, since you mention, you've experienced some issues, can you give me some examples? I'd live add them in the unit tests. |
@kuno Thanks for the answer. I tried the pull request, which does more or less what I did by hand, and I still have crashes. It happens approximatively once per minute, in a system that handles several thousands requests per second. I think it would be easier for me to patch nan.h to make it (by the way, it would be nice explaining why using synchronous methods is the recommended way, in usage.md) |
Context: I still have the C++ assert (& abort) even with the last commits, the ones that check that the given ip or domain is a string with the function So here is what I did to prevent my nodejs processes to crash: nfo@7c2330c Apparently |
Thanks for you comments, I'll definitely implement your idea into code. |
BTW, can you offer some details about the difference between
|
@kuno Perhaps you should call the Also I did not take the time trying to find which kind of value would make IsString() return false. |
good idea, I think we can expose a c++ function in js land to validate inputs. Thanks. |
By default, if the given input is not a string, it will throw an error or call the callback with the first argument is the error object. But if you created the instance with a extra var city = new geoip.City('/path/to/db', {silent: true});
city.lookupSync(null) === null;
city.lookup(null, function(err, data) {
// err is null
// data is null
}); |
We are experiencing a new error (very infrequently) since upgrading to node v0.10.22. The following message is displayed and the process exits immediately.
I suspect it may have something to do with the infamous WalMart memory leak on closed handles fix.
The text was updated successfully, but these errors were encountered: