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 — src: store pointer to Environment on DestroyParam by apapirovski · Pull Request #21099 · nodejs/node

Conversation

@apapirovski

@apapirovski apapirovski commented Jun 2, 2018 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor

To avoid a potential segfault when inside WeakCallback, store a reference to Environment inside DestroyParam. (Talk to @hashseed for more info.)

Without this patch, node will fail on one of our tests when run as node --stress-compaction test/parallel/test-async-hooks-recursive-stack.js.

Co-authored-by: Yang Guo [email protected]
Co-authored-by: Michaël Zasso [email protected]

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines

Sorry, something went wrong.

Uh oh!

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

All reactions
@apapirovski @hashseed @targos
src: store pointer to Environment on DestroyParam
eb2a97a
To avoid a potential segfault when inside WeakCallback, store a reference
to Environment inside DestroyParam.

Co-authored-by: Yang Guo <[email protected]>
Co-authored-by: Michaël Zasso <[email protected]>
@nodejs-github-bot nodejs-github-bot added the c++ Issues and PRs that require attention from people who are familiar with C++. label Jun 2, 2018
@apapirovski

apapirovski commented Jun 2, 2018

Copy link
Copy Markdown
Contributor Author

CI: https://ci.nodejs.org/job/node-test-pull-request/15231/

All reactions

Sorry, something went wrong.

Uh oh!

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

hashseed
hashseed approved these changes Jun 2, 2018
View reviewed changes
addaleax
addaleax approved these changes Jun 2, 2018
View reviewed changes
Comment thread src/async_wrap.cc Outdated
Isolate* isolate = args.GetIsolate();
DestroyParam* p = new DestroyParam();
p->asyncId = args[1].As<Number>()->Value();
p->env = Environment::GetCurrent(isolate);

@addaleax addaleax Jun 2, 2018

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.

nit: isolate → args

Sorry, something went wrong.

Uh oh!

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

All reactions

@apapirovski apapirovski Jun 3, 2018

Copy link
Copy Markdown
Contributor 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.

Done. Thanks!

Sorry, something went wrong.

Uh oh!

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

All reactions
jasnell
jasnell approved these changes Jun 3, 2018
View reviewed changes
@apapirovski
fixup: addaleax nit
b3a86f3
TimothyGu
TimothyGu approved these changes Jun 3, 2018
View reviewed changes
@apapirovski

apapirovski commented Jun 5, 2018

Copy link
Copy Markdown
Contributor Author

Landed in 0300f7c

All reactions

Sorry, something went wrong.

Uh oh!

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

@apapirovski apapirovski closed this Jun 5, 2018
@apapirovski
apapirovski deleted the fix-weak-callback branch June 5, 2018 09:15
apapirovski added a commit that referenced this pull request Jun 5, 2018
@apapirovski @hashseed @targos
src: store pointer to Environment on DestroyParam
0300f7c
To avoid a potential segfault when inside WeakCallback, store a
reference to Environment inside DestroyParam.

PR-URL: #21099
Reviewed-By: Yang Guo <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Tiancheng "Timothy" Gu <[email protected]>

Co-authored-by: Yang Guo <[email protected]>
Co-authored-by: Michaël Zasso <[email protected]>
MylesBorins pushed a commit that referenced this pull request Jun 6, 2018
@apapirovski @hashseed
@targos @MylesBorins
src: store pointer to Environment on DestroyParam
8862f0a
To avoid a potential segfault when inside WeakCallback, store a
reference to Environment inside DestroyParam.

PR-URL: #21099
Reviewed-By: Yang Guo <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Tiancheng "Timothy" Gu <[email protected]>

Co-authored-by: Yang Guo <[email protected]>
Co-authored-by: Michaël Zasso <[email protected]>
@MylesBorins MylesBorins mentioned this pull request Jun 6, 2018
v10.4.0 proposal #21167
Merged
@addaleax addaleax added the backport-requested-v8.x label Jul 2, 2018
@addaleax

addaleax commented Jul 2, 2018

Copy link
Copy Markdown
Member

@apapirovski Could you backport this to v8.x?

All reactions

Sorry, something went wrong.

Uh oh!

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

@snyk-bot snyk-bot mentioned this pull request Mar 18, 2020
[Snyk] Upgrade: gatsby, gatsby-image, gatsby-plugin-catch-links, gatsby-plugin-manifest, gatsby-plugin-no-sourcemaps, gatsby-plugin-offline, gatsby-plugin-react-helmet, gatsby-plugin-sharp, gatsby-plugin-styled-components, gatsby-remark-autolink-headers, gatsby-remark-prismjs, gatsby-source-filesystem, gatsby-transformer-remark O330oei/node#3
Open
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@jasnell jasnell jasnell approved these changes
@addaleax addaleax addaleax approved these changes
+2 more reviewers
@TimothyGu TimothyGu TimothyGu approved these changes
@hashseed hashseed hashseed approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

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

Assignees

No one assigned

Labels

c++ Issues and PRs that require attention from people who are familiar with C++.

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.

6 participants

@apapirovski @addaleax @jasnell @TimothyGu @hashseed @nodejs-github-bot
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.