-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
tls: unconsume stream on destroy #17478
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// Flags: --expose-gc | ||
'use strict'; | ||
|
||
// Regression test for https://github.com/nodejs/node/issues/17475 | ||
// Unfortunately, this tests only "works" reliably when checked with valgrind or | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just for clarity: I assume "works" in this context means "doesn't raise memory leak errors"..? And properly running the test is just using the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @jkrems Yeah – it complains about accessing released memory when run with valgrind. “Unfortunately”, most of the time that doesn’t lead to crashes… Running the test file with |
||
// a similar tool. | ||
|
||
const common = require('../common'); | ||
if (!common.hasCrypto) | ||
common.skip('missing crypto'); | ||
|
||
const { TLSSocket } = require('tls'); | ||
const makeDuplexPair = require('../common/duplexpair'); | ||
|
||
let { clientSide } = makeDuplexPair(); | ||
|
||
let clientTLS = new TLSSocket(clientSide, { isServer: false }); | ||
// eslint-disable-next-line no-unused-vars | ||
let clientTLSHandle = clientTLS._handle; | ||
|
||
setImmediate(() => { | ||
clientTLS = null; | ||
global.gc(); | ||
clientTLSHandle = null; | ||
global.gc(); | ||
setImmediate(() => { | ||
clientSide = null; | ||
global.gc(); | ||
}); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would add a comment before this block linking to the issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I’ve added a reference to the test and a quick explanation, the test contains a link to the issue.