question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Strange Segfault with SSL/TLS

See original GitHub issue

We are experiencing a segfault with Node 4.3.2 under certain conditions.

The following code replicates it:

'use strict';

const Promise = require('bluebird');
const request = require('request-promise');

function thenHandler(options) {
  return request(options)
}

let options = {
  url: '/sdgasdnasodgnkn',
  method: 'GET',
  baseUrl: 'https://google.com'
};

Promise.resolve(options)
.then(thenHandler)
.catch(error => {
  console.log(error.response.socket);
  throw error;
});

Interestingly, removing thenHandler or using HTTP, not HTTPS, does not cause the error.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
wiggzzcommented, Nov 11, 2016

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:

const tls_wrap = process.binding('tls_wrap');
const old_close = tls_wrap.TLSWrap.prototype.close;
tls_wrap.TLSWrap.prototype.close = function(cb) {
  if (this.owner)
    this.owner.ssl = null;

  return old_close.apply(this, cb);
}
0reactions
wiggzzcommented, Nov 11, 2016

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Strange segfaults in vsftpd using SSL - LinuxQuestions.org
I've set up my vsftpd server to use SSL/TLS encryption. Sometimes, I get this error in my logfiles: Mar 13 20:02:07 server1 kernel: ......
Read more >
Windows 10 TLS/SSL weird issues (BAD_MAC_READ ...
Windows 10 TLS/SSL weird issues (BAD_MAC_READ, programs queries interupted, . ... corrupted WebCache database, segfault for writting logs, ...
Read more >
Mbedtls_ssl_handshake() segfault after ~1000 iterations
Hello, I have a class EchoClient which essentially wraps mbedtls into a encryption enabled client object thing. Then in main() I create such ......
Read more >
PHP 5 ChangeLog
Fixed bug #65911 (scope resolution operator - strange behavior with $this). CLI server: Fixed bug #65818 (Segfault with built-in webserver and chunked ...
Read more >
Strange segfault in unique_ptr - c++ - Stack Overflow
std::unique_ptr<UCHAR> padded = std::make_unique<UCHAR>(paddedLen + 1); <-- Added +1 here std::unique_ptr<UCHAR> buffer ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found