-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Segfault with nodejs 0.12.6 and 0.12.7 using SSL and pool connection #1149
Comments
If you are getting a segmentation fault, the issue is in Node.js itself. Have you opened an issue over at Node.js? We can use |
You may very well be hitting this issue: nodejs/node-v0.x-archive#25648 |
Actually, most likely, if it has to do with TLS, you are probably hitting the bug nodejs/node-v0.x-archive#8780 which has been fixed in io.js, but not backported to Node.js 0.12. Can you verify if you can reproduce with the latest io.js? |
Hi, The fact is that everything worked fine in nodejs v0.12.4. In the changelog, it said that they updated openssl in v0.12.6 and v0.12.7. I try some new test without pool connection (on nodejs v 0.12.7), and the callback for connection.query are never called... Here my example : try {
var connection = mysql.createConnection({
host : 'host',
user : 'user',
password : 'password',
database : 'database',
ssl : {
rejectUnauthorized: false,
ca: fs.readFileSync('./ca-file')
}
});
connection.query("SELECT * FROM TABLE", function(err, rows) {
if (err)
console.log(err);
else
console.log(rows);
});
} catch(err) {
console.log(err);
} I will try later with io.js. |
Ah, I see. To me, if it worked, then they upgraded OpenSSL and now it doesn't, it sounds like Node.js may have had a regression in their code, no? Have you opened an issue with Node.js yet? |
Ah, I see you did. Please let me know what they say :) |
Hi, I did some new test and this is what I got : nodejs v0.12.4 --> OK |
Thanks for the information :) would you be willing to make the same report using the mysql2 module as well, just to see if there is a difference? The API is identical, so you example code should work with only a change to the require. |
Here is the result with mysql2: nodejs v0.12.4 --> OK For every test, I have this log : "createCredentials() is deprecated, use tls.createSecureContext instead". Here the whole log for the test with nodejs 0.12.7 and pool connection :
|
So the thing is, both io.js and Node.js broke right on a release with an OpenSSL update, and the update includes the following note, which seems to play in with the errors from mysql2:
This leads me to believe the reason I cannot reproduce your issue is because it may be related to your specific SSL configuration and private cert on your MySQL server combined with a change in behavior of OpenSSL in those releases. I'm not sure if we can do anything here, but since you can reproduce, if you can pit together a fix in our module (assuming it's not a Node.js or OpenSSL issue), that may be the only course of action from this point. |
Hey @sidorares are you able to replicate this issue, by chance? |
Thank you for your answer. I upgraded my mysql server to the latest version (v5.7.7-rc) and now everything work fine. Again, thank you for your time. |
thanks @Drazke , could not find time to test node-mysql2 myself |
Hi,
I updated nodejs to version 0.12.6 and now node-mysql with SSL option give me a segmentation fault when I try to get a connexion (getConnection call) for a pool. Everything worked fine in nodejs 0.12.4 with SSL option.
After some test I figured out that it works if I remove the SSL option.
Here an example that segfault :
Today I try to update nodejs to 0.12.7 but there is still no change.
For information, i'm on ubuntu trusty 14.04 LTS.
Regards,
The text was updated successfully, but these errors were encountered: