-
Notifications
You must be signed in to change notification settings - Fork 298
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
Strange Segfault with SSL/TLS #162
Comments
Ok, let's see...
'use strict';
const Promise = require('bluebird');
- const request = require('request-promise');
+ const request = require('request');
function thenHandler(options) {
- return request(options)
+ return new Promise((resolve, reject) => {
+ request(options, (error, response, body) => {
+ if (error) {
+ reject(error);
+ } else {
+ resolve(body);
+ }
+ });
+ });
}
let options = {
url: '/sdgasdnasodgnkn',
method: 'GET',
baseUrl: 'https://google.com'
};
Promise.resolve(options)
.then(thenHandler)
.catch(error => {
- console.log(error.response.socket);
throw error;
}); |
@analog-nico The error randomly varies between: We tried replacing |
@pameck Ok, using the right code you would be able to reproduce it with Since your |
We're seeing this manifest because we were logging the error using a logging library. The library we are using happens to do a deep copy of the error object in certain situations, which causes it to crash. Just the simplest way to reproduce it was this |
Alright, makes sense @wiggzz . Then do either:
Anything else I can help you with? |
No, thanks! I guess the next step if we want to figure out where the bug is is to dig deeper into the Node request library. But your idea of removing the buggy error property is probably the workaround. |
Alright. To verify your assumption that the deep clone of your logging library is the culprit you may use |
Just out of curiosity, I dug a bit more. It's definitely a Node 4.3 bug. The following will cause a segfault. Don't ask me why there have to be three
|
Very interesting. Just a wild guess, but maybe because the socket gets closed after a few event loop cycles. Anyways, that's a perfect test case to report to the node.js project since you stripped it down to core functionality only. However, if it does not crash in v4.6.2 they will probably just ask you update. |
Yea. Would love to update but AWS Lambda is only supporting v4.3.2 and v0.10, so we're kinda stuck on 4.3.2 until AWS decide to upgrade. |
For future reference, it looks like this is the same issue which is fixed by this commit. Also, in order to patch in that change to 4.3, it seems possible to do something like:
|
We are experiencing a segfault with Node 4.3.2 under certain conditions.
The following code replicates it:
Interestingly, removing
thenHandler
or using HTTP, not HTTPS, does not cause the error.The text was updated successfully, but these errors were encountered: