stream_wrap: add HandleScope's in uv callbacks#1078
Closed
indutny wants to merge 4 commits intonodejs:v1.xfrom
Closed
stream_wrap: add HandleScope's in uv callbacks#1078indutny wants to merge 4 commits intonodejs:v1.xfrom
indutny wants to merge 4 commits intonodejs:v1.xfrom
Conversation
Ensure that no handles will leak into global HandleScope by adding HandleScope's in all JS-calling libuv callbacks in `stream_wrap.cc`. Fix: nodejs#1075
Don't forget to call `MakeWeak` to ensure that instance objects are garbage collectable.
Hold non-persistent reference in JS, rather than in C++ to avoid cycles.
Ensure no persistent-induced loops in C++-land by storing `SecureContext` reference in JS-land.
Member
Author
|
Seems to be fixing the issue, cc @bnoordhuis |
Member
Author
|
cc @iojs/crypto |
Member
There was a problem hiding this comment.
What does this HandleScope do?
Member
Author
There was a problem hiding this comment.
Captures all handles in this libuv callback? OnReadCommon calls OnRead() which might create handles.
Member
|
LGTM with comments. I don't have time to test right now but this fixes all the test failures when you throw an |
Member
Author
|
Yep, it fixes all handle leaks. |
indutny
added a commit
that referenced
this pull request
Mar 6, 2015
Don't forget to call `MakeWeak` to ensure that instance objects are garbage collectable. PR-URL: #1078 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
indutny
added a commit
that referenced
this pull request
Mar 6, 2015
Hold non-persistent reference in JS, rather than in C++ to avoid cycles. PR-URL: #1078 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Member
Author
|
Landed in 583a868, dccb69a, c09c90c. Thank you! |
rvagg
added a commit
that referenced
this pull request
Mar 6, 2015
Notable changes: * buffer: New `Buffer#indexOf()` method, modelled off `Array#indexOf()`. Accepts a String, Buffer or a Number. Strings are interpreted as UTF8. (Trevor Norris) #561 * fs: `options` object properties in `'fs'` methods no longer perform a `hasOwnProperty()` check, thereby allowing options objects to have prototype properties that apply. (Jonathan Ong) #635 * tls: A likely TLS memory leak was reported by PayPal. Some of the recent changes in stream_wrap appear to be to blame. The initial fix is in #1078, you can track the progress toward closing the leak at #1075 (Fedor Indutny). * npm: Upgrade npm to 2.7.0. See npm CHANGELOG.md: https://github.com/npm/npm/blob/master/CHANGELOG.md#v270-2015-02-26 for details including why this is a semver-minor when it could have been semver-major. * TC: Colin Ihrig (@cjihrig) resigned from the TC due to his desire to do more code and fewer meetings.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ensure that no handles will leak into global HandleScope by adding
HandleScope's in all JS-calling libuv callbacks in
stream_wrap.cc.Fix: #1075
NOTE: WIP