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

lib: fixing isStackOverflowError to account for different JS engines #19705

Conversation

mike-kaufman
Copy link

@mike-kaufman mike-kaufman commented Mar 30, 2018

Assumption that stack overflow exception has name == "RangeError" is
v8-specific. Updated logic to dynamically capture error name when
capturing error message.

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

@nodejs-github-bot nodejs-github-bot added the errors Issues and PRs related to JavaScript errors originated in Node.js core. label Mar 30, 2018
@Trott
Copy link
Member

Trott commented Mar 30, 2018

@Trott Trott added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Mar 30, 2018
@Trott
Copy link
Member

Trott commented Mar 30, 2018

Nit: Should update the comment starting on line 577 to reflect this change.

Trott
Trott previously requested changes Mar 30, 2018
Copy link
Member

@Trott Trott left a comment

Choose a reason for hiding this comment

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

This needs a change to pass the linter. (Use vcbuild lint or make lint to check.)

}
}

return err.name === 'RangeError' && err.message === MAX_STACK_MESSAGE;
return err.name === MAX_STACK_ERROR_NAME && err.message === MAX_STACK_ERROR_MESSAGE;
Copy link
Member

Choose a reason for hiding this comment

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

The linter failed because this line is now longer than 80 characters. You'll need to either split this across two lines or shorten the names of ALL_CAPS variables.

Especially since they're not constants, it may be more stylistically appropriate to camelCase them? That would shave off 6 characters, making the line exactly 80 characters long. Perfect! :-D

Copy link
Author

Choose a reason for hiding this comment

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

Thanks, should be fixed up now.

Copy link
Member

Choose a reason for hiding this comment

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

@Trott Hmm, I'm not sure about this... They are constants -- just lazily loaded constants.

Assumption that stack overflow exception has name == "RangeError" is
v8-specific.  Updated logic to dynamically capture error name when
capturing error message.
@mike-kaufman mike-kaufman force-pushed the mkaufman-fix-is-stack-overflow-for-node-chakracore branch from 9a19c0a to 01b9afb Compare March 30, 2018 18:37
@@ -572,7 +572,8 @@ function dnsException(err, syscall, hostname) {
return ex;
}

let MAX_STACK_MESSAGE;
let MAX_STACK_ERROR_NAME;
let MAX_STACK_ERROR_MESSAGE;
/**
* Returns true if `err` is a `RangeError` with an engine-specific message.
Copy link
Member

Choose a reason for hiding this comment

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

This comment needs to be updated as well.

@Trott Trott dismissed their stale review March 30, 2018 21:22

changes made

@Trott
Copy link
Member

Trott commented Mar 30, 2018

@mike-kaufman
Copy link
Author

not sure why that node-test-commit check is failing. Nothing was obvious in logs. Is there some way to restart just that check?

@Trott
Copy link
Member

Trott commented Mar 30, 2018

@mike-kaufman Yeah, this one is pretty tedious to track down and I can't tell what's wrong either. Certainly build related and not related to this change. From https://ci.nodejs.org/job/node-test-commit/17310/, scroll down to the bottom to see that node-test-commit-plinux is failing. Click through to those results (https://ci.nodejs.org/job/node-test-commit-plinux/16473/) and scroll to the bottom again. ppcle-ubuntu1404 is failing (https://ci.nodejs.org/job/node-test-commit-plinux/16473/nodes=ppcle-ubuntu1404/). From that page, click on Console Output (in the left nav) to go to https://ci.nodejs.org/job/node-test-commit-plinux/16473/nodes=ppcle-ubuntu1404/console and see that...hmmm, something is wrong but it's unclear what. Click "View as plain text" or "Full log" to get different views of the full log of the build. Searching through the results of that (which can take a while to load)...still not sure what went wrong. Ping @nodejs/build

Meanwhile, let's re-run just node-test-commit-plinux: https://ci.nodejs.org/job/node-test-commit-plinux/16474/

@Trott
Copy link
Member

Trott commented Apr 1, 2018

(Re-run of single failing CI task was green so this is ready to land if there are no objections after 72 hours of being open.)

@mike-kaufman
Copy link
Author

Thanks @Trott!

Trott pushed a commit to Trott/io.js that referenced this pull request Apr 2, 2018
Assumption that stack overflow exception has name == "RangeError" is
v8-specific.  Updated logic to dynamically capture error name when
capturing error message.

PR-URL: nodejs#19705
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@Trott
Copy link
Member

Trott commented Apr 2, 2018

Landed in cd5f353

@Trott Trott closed this Apr 2, 2018
targos pushed a commit that referenced this pull request Apr 3, 2018
Assumption that stack overflow exception has name == "RangeError" is
v8-specific.  Updated logic to dynamically capture error name when
capturing error message.

PR-URL: #19705
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@targos targos mentioned this pull request Apr 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. errors Issues and PRs related to JavaScript errors originated in Node.js core.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants