Skip to content
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

[async_wrap] backport of gc abort on destroy() fix on v4.x #10097

Closed

Conversation

trevnorris
Copy link
Contributor

@trevnorris trevnorris commented Dec 2, 2016

Checklist
  • make -j8 test (UNIX), or vcbuild test nosign (Windows) passes
  • commit message follows commit guidelines
Affected core subsystem(s)

async_wrap

Description of change

This is a backport of 517e3a6, cf5f4b8 and b49b496 to v4.x

There have been no reports yet of abort on v4.x. So I believe this one can run the usual LTS release path before landing.

CI: https://ci.nodejs.org/job/node-test-commit/6341/

The constructor and destructor shouldn't have been placed in the -inl.h
file from the beginning.

Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Ben Noordhuis <[email protected]>
This is how it's done everywhere else in core. Make it follow suit.

Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Ben Noordhuis <[email protected]>
Calling JS during GC is a no-no. So intead create a queue of all ids
that need to have their destroy() callback called and call them later.

Removed checking destroy() in test-async-wrap-uid because destroy() can
be called after the 'exit' callback.

Missing a reliable test to reproduce the issue that caused the
FATAL_ERROR.

Fixes: nodejs#8216
Fixes: nodejs#9465
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Ben Noordhuis <[email protected]>
@trevnorris trevnorris added async_wrap c++ Issues and PRs that require attention from people who are familiar with C++. labels Dec 2, 2016
@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. v4.x labels Dec 2, 2016
@mscdex mscdex changed the title [aysnc_wrap] backport of gc abort on destroy() fix on v4.x [async_wrap] backport of gc abort on destroy() fix on v4.x Dec 2, 2016
Environment* env = Environment::from_destroy_ids_idle_handle(handle);
// None of the V8 calls done outside the HandleScope leak a handle. If this
// changes in the future then the SealHandleScope wrapping the uv_run()
// will catch this can cause the process to abort.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this comment outdated? There's a HandleScope right below it! :-)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

heh. seems to have snuck into patches for other versions. I'll remove it here, and remove it in the other branches in an upcoming patch.

@MylesBorins
Copy link
Contributor

landed in c0c5608...60883de

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ Issues and PRs that require attention from people who are familiar with C++.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants