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

deps: backport IsValid changes from 4e8736d in V8 (v4.x) #6669

Closed
wants to merge 2 commits into from

Conversation

targos
Copy link
Member

@targos targos commented May 10, 2016

Checklist
  • tests and code linting passes
  • the commit message follows commit guidelines
Affected core subsystem(s)

v8

Description of change

Cherry-pick changes from #6544 to v4.x-staging.
I added another commit to make a similar fix to FrameStateDescriptor::GetTotalSize (some of our tests were crashing before it). The tests now pass but I could also change GetFrameCount and GetJSFrameCount for more safety ?

R= @bnoordhuis
CC @nodejs/v8

V8 erroneously did null pointer checks on `this`.
It can lead to a SIGSEGV crash if node is compiled with GCC 6.
Backport relevant changes from [1] that fix this issue.

[1]: https://codereview.chromium.org/1900423002

Fixes: nodejs#6272
@targos targos added the v8 engine Issues and PRs related to the V8 dependency. label May 10, 2016
@@ -869,6 +869,8 @@ class FrameStateDescriptor : public ZoneObject {
MaybeHandle<SharedFunctionInfo> shared_info,
FrameStateDescriptor* outer_state = nullptr);

static size_t GetTotalSize(FrameStateDescriptor* desc);
Copy link
Member

@bnoordhuis bnoordhuis May 10, 2016

Choose a reason for hiding this comment

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

const FrameStateDescriptor*?

EDIT: Existing V8 code plays fast and loose with const correctness so I suppose it doesn't matter too much.

Copy link
Member Author

Choose a reason for hiding this comment

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

changed

@bnoordhuis
Copy link
Member

The tests now pass but I could also change GetFrameCount and GetJSFrameCount for more safety ?

Sounds like a good idea.

@MylesBorins
Copy link
Contributor

MylesBorins commented May 10, 2016

@MylesBorins
Copy link
Contributor

CI is green @bnoordhuis is there anything else for you to give an LGTM?


size_t FrameStateDescriptor::GetTotalSize() const {
size_t FrameStateDescriptor::GetTotalSize(const FrameStateDescriptor* desc) {
if (desc == NULL) return 0;
Copy link
Member

Choose a reason for hiding this comment

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

This nullptr check is not strictly necessary. Same for the corresponding checks in the other methods.

@targos
Copy link
Member Author

targos commented May 11, 2016

@bnoordhuis I addressed your comments, PTAL.

@targos
Copy link
Member Author

targos commented May 11, 2016

@bnoordhuis
Copy link
Member

LGTM

1 similar comment
@jasnell
Copy link
Member

jasnell commented May 11, 2016

LGTM

MylesBorins pushed a commit that referenced this pull request May 11, 2016
V8 erroneously did null pointer checks on `this`.
It can lead to a SIGSEGV crash if node is compiled with GCC 6.
Backport relevant changes from [1] that fix this issue.

[1]: https://codereview.chromium.org/1900423002

Fixes: #6272

PR-URL: #6669
Reviewed-By: Myles Borins <[email protected]>
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: James M Snell <[email protected]>
MylesBorins pushed a commit that referenced this pull request May 11, 2016
fix null pointer checks in V8's FrameStateDescriptor

PR-URL: #6669
Reviewed-By: Myles Borins <[email protected]>
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: James M Snell <[email protected]>
@MylesBorins
Copy link
Contributor

landed in 53d33a4...14013d8

MylesBorins pushed a commit that referenced this pull request May 18, 2016
V8 erroneously did null pointer checks on `this`.
It can lead to a SIGSEGV crash if node is compiled with GCC 6.
Backport relevant changes from [1] that fix this issue.

[1]: https://codereview.chromium.org/1900423002

Fixes: #6272

PR-URL: #6669
Reviewed-By: Myles Borins <[email protected]>
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: James M Snell <[email protected]>
MylesBorins pushed a commit that referenced this pull request May 18, 2016
fix null pointer checks in V8's FrameStateDescriptor

PR-URL: #6669
Reviewed-By: Myles Borins <[email protected]>
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: James M Snell <[email protected]>
@MylesBorins MylesBorins mentioned this pull request May 18, 2016
gibfahn pushed a commit to ibmruntimes/node that referenced this pull request May 25, 2016
V8 erroneously did null pointer checks on `this`.
It can lead to a SIGSEGV crash if node is compiled with GCC 6.
Backport relevant changes from [1] that fix this issue.

[1]: https://codereview.chromium.org/1900423002

Fixes: nodejs/node#6272

PR-URL: nodejs/node#6669
Reviewed-By: Myles Borins <[email protected]>
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: James M Snell <[email protected]>
gibfahn pushed a commit to ibmruntimes/node that referenced this pull request May 25, 2016
fix null pointer checks in V8's FrameStateDescriptor

PR-URL: nodejs/node#6669
Reviewed-By: Myles Borins <[email protected]>
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: James M Snell <[email protected]>
@targos targos deleted the fix2-6272-v4 branch June 1, 2017 09:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
v8 engine Issues and PRs related to the V8 dependency.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants