GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — stream_wrap: add HandleScope's in uv callbacks by indutny · Pull Request #1078 · nodejs/node

Conversation

@indutny

@indutny indutny commented Mar 5, 2015

Copy link
Copy Markdown
Member

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@indutny
stream_wrap: add HandleScope's in uv callbacks
b85f945
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
@indutny indutny mentioned this pull request Mar 5, 2015
Possible memory leak in TLS(Wrap?) #1075
Closed
indutny added 3 commits March 5, 2015 20:26
@indutny
js_stream: fix leak of instances
6866719
Don't forget to call `MakeWeak` to ensure that instance objects are
garbage collectable.
@indutny
tls_wrap: do not hold persistent ref to parent
6879b05
Hold non-persistent reference in JS, rather than in C++ to avoid cycles.
@indutny
tls_wrap: hold secureContext ref in JS-land
2879b03
Ensure no persistent-induced loops in C++-land by storing
`SecureContext` reference in JS-land.
@indutny

indutny commented Mar 6, 2015

Copy link
Copy Markdown
Member Author

Seems to be fixing the issue, cc @bnoordhuis

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@indutny

indutny commented Mar 6, 2015

Copy link
Copy Markdown
Member Author

cc @iojs/crypto

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

bnoordhuis
bnoordhuis reviewed Mar 6, 2015
View reviewed changes
Comment thread src/stream_wrap.cc

@bnoordhuis bnoordhuis Mar 6, 2015

Copy link
Copy Markdown
Member

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.

What does this HandleScope do?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@indutny indutny Mar 6, 2015

Copy link
Copy Markdown
Member Author

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.

Captures all handles in this libuv callback? OnReadCommon calls OnRead() which might create handles.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@bnoordhuis

bnoordhuis commented Mar 6, 2015

Copy link
Copy Markdown
Member

LGTM with comments. I don't have time to test right now but this fixes all the test failures when you throw an CHECK_EQ(number_of_handles, HandleScope::NumberOfHandles(isolate)) in the main loop?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@indutny

indutny commented Mar 6, 2015

Copy link
Copy Markdown
Member Author

Yep, it fixes all handle leaks.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Fishrock123 Fishrock123 mentioned this pull request Mar 6, 2015
Release proposal: v1.5.0 #1060
Closed
indutny added a commit that referenced this pull request Mar 6, 2015
@indutny
stream_wrap: add HandleScope's in uv callbacks
583a868
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
PR-URL: #1078
Reviewed-By: Ben Noordhuis <[email protected]>
indutny added a commit that referenced this pull request Mar 6, 2015
@indutny
js_stream: fix leak of instances
dccb69a
Don't forget to call `MakeWeak` to ensure that instance objects are
garbage collectable.

PR-URL: #1078
Reviewed-By: Ben Noordhuis <[email protected]>
indutny added a commit that referenced this pull request Mar 6, 2015
@indutny
tls_wrap: do not hold persistent ref to parent
c09c90c
Hold non-persistent reference in JS, rather than in C++ to avoid cycles.

PR-URL: #1078
Reviewed-By: Ben Noordhuis <[email protected]>
@indutny

indutny commented Mar 6, 2015

Copy link
Copy Markdown
Member Author

Landed in 583a868, dccb69a, c09c90c. Thank you!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@indutny indutny closed this Mar 6, 2015
@indutny
indutny deleted the fix/gh-1075 branch March 6, 2015 16:06
rvagg added a commit that referenced this pull request Mar 6, 2015
@rvagg
2015-03-06 io.js v1.5.0 Release
25a7fc8
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.
@bnb bnb mentioned this pull request Mar 6, 2015
Evangelism: Weekly Update Mar 6th nodejs/evangelism#16
Closed
@yous yous mentioned this pull request Mar 12, 2015
Added: 2015년 3월 6일 주간 뉴스 nodejs/nodejs-ko#35
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@indutny @bnoordhuis
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.