X Tutup
The Wayback Machine - https://web.archive.org/web/20220423125229/https://github.com/nodejs/node/pull/32207
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

report: handle on-fatalerror better #32207

Closed

Conversation

Copy link
Member

@HarshithaKP HarshithaKP commented Mar 11, 2020

--report-on-fatalerror was not honored properly, as there was no
way to check the value which was stored in the Environment pointer
which can be inaccessible under certain fatal error situations.

Move the flag out of Environment pointer so that this is doable.

Co-authored-by: Shobhit Chittora schittora@paypal.com

Fixes: #31576
Refs: #29881

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines

@nodejs-github-bot nodejs-github-bot added c++ lib / src labels Mar 11, 2020
@HarshithaKP HarshithaKP changed the title report: handle on-fatalerror better report: handle on-fatalerror better[WIP] Mar 11, 2020
src/node_report_module.cc Outdated Show resolved Hide resolved
@HarshithaKP HarshithaKP force-pushed the diagnostic_report_fatal_error branch from ae976b0 to a0df730 Compare Mar 12, 2020
errors->push_back("--report-on-fatalerror option is valid only when "
"--experimental-report is set");
}

Copy link
Member Author

@HarshithaKP HarshithaKP Mar 12, 2020

Choose a reason for hiding this comment

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

This is one extra change I am doing than #29881, to fix the issue mentioned in #29881 (comment)

@HarshithaKP HarshithaKP changed the title report: handle on-fatalerror better[WIP] report: handle on-fatalerror better Mar 12, 2020
src/node_options.cc Outdated Show resolved Hide resolved
@gireeshpunathil
Copy link
Member

@gireeshpunathil gireeshpunathil commented Mar 13, 2020

This PR complements #32242 (though there will be many conflicts to resolve) , to make it stable with the last known bug being addressed. Request reviews, so that it can land along side before v14 d-cut!

@nodejs-github-bot
Copy link
Contributor

@nodejs-github-bot nodejs-github-bot commented Mar 15, 2020

@@ -86,6 +86,11 @@ void PerIsolateOptions::CheckOptions(std::vector<std::string>* errors) {
return;
}

if (per_process::cli_options->report_on_fatalerror) {
Copy link
Contributor

@cjihrig cjihrig Mar 15, 2020

Choose a reason for hiding this comment

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

I think we should omit this, as #32242 makes it unnecessary, as previously noted.

Copy link
Member Author

@HarshithaKP HarshithaKP Mar 16, 2020

Choose a reason for hiding this comment

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

@cjihrig, removed this block. PTAL.

@@ -706,6 +701,13 @@ PerProcessOptionsParser::PerProcessOptionsParser(
"print V8 command line options",
&PerProcessOptions::print_v8_help);

#ifdef NODE_REPORT
Copy link
Contributor

@cjihrig cjihrig Mar 15, 2020

Choose a reason for hiding this comment

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

Again, #32242 will make the #ifdef NODE_REPORT unnecessary.

Copy link
Member Author

@HarshithaKP HarshithaKP Mar 16, 2020

Choose a reason for hiding this comment

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

Removed #ifdef NODE_REPORT.

helper.validate(report);
}));
const spawnSync = require('child_process').spawnSync;
let args = ['--experimental-report',
Copy link
Contributor

@cjihrig cjihrig Mar 15, 2020

Choose a reason for hiding this comment

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

--experimental-report can be dropped due to #32242.

Copy link
Member Author

@HarshithaKP HarshithaKP Mar 16, 2020

Choose a reason for hiding this comment

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

Removed --experimental-report from args list.

const report = reports[0];
helper.validate(report);

args = ['--max-old-space-size=20',
Copy link
Contributor

@cjihrig cjihrig Mar 15, 2020

Choose a reason for hiding this comment

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

Can you add a comment here. Something along the lines of // Verify that reports are not created on fatal error by default.

Copy link
Member Author

@HarshithaKP HarshithaKP Mar 16, 2020

Choose a reason for hiding this comment

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

Added suggested comment in test case. PTAL.

@HarshithaKP HarshithaKP force-pushed the diagnostic_report_fatal_error branch 2 times, most recently from cc0c963 to 8d71449 Compare Mar 16, 2020
@HarshithaKP
Copy link
Member Author

@HarshithaKP HarshithaKP commented Mar 16, 2020

In test/report/test-report-fatal-error.js, linter error saying common is assigned but not used, I couldn't find proper place to use it in test case.

@cjihrig
Copy link
Contributor

@cjihrig cjihrig commented Mar 16, 2020

In test/report/test-report-fatal-error.js, linter error saying common is assigned but not used, I couldn't find proper place to use it in test case.

Instead of const common = require('../common');, you can just do require('../common'); since you aren't using it. You have to require() it though because it has some side effects, and our linting setup checks for its presence.

@HarshithaKP
Copy link
Member Author

@HarshithaKP HarshithaKP commented Mar 16, 2020

@cjihrig, thanks. Fixed the error with your suggestion.

Copy link
Contributor

@sam-github sam-github left a comment

Looks great to me.

@nodejs-github-bot
Copy link
Contributor

@nodejs-github-bot nodejs-github-bot commented Mar 16, 2020

@sam-github
Copy link
Contributor

@sam-github sam-github commented Mar 23, 2020

@HarshithaKP This looks pretty much ready to land, but it needs a trivial rebase before a final CI. Ping me when you've done it and I'll kick that off.

EDIT: Alternatively, give me permissions and I'll do it: https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/allowing-changes-to-a-pull-request-branch-created-from-a-fork#enabling-repository-maintainer-permissions-on-existing-pull-requests

HarshithaKP added 4 commits Mar 24, 2020
--report-on-fatalerror was not honored properly, as there was no
way to check the value which was stored in the Environment pointer
which can be inaccessible under certain fatal error situations.

Move the flag out of Environment pointer so that this is doable.

Co-authored-by: Shobhit Chittora schittora@paypal.com

Fixes: nodejs#31576
Refs: nodejs#29881
@HarshithaKP HarshithaKP force-pushed the diagnostic_report_fatal_error branch from 5e9fdd9 to 7dbc5de Compare Mar 24, 2020
@HarshithaKP
Copy link
Member Author

@HarshithaKP HarshithaKP commented Mar 24, 2020

@sam-github, thanks. Rebased it. PTAL.

addaleax added a commit to addaleax/node that referenced this issue Mar 28, 2020
sam-github added a commit to sam-github/node that referenced this issue Mar 30, 2020
Follow on to nodejs#32207, 3 other options
are also not respected under situations that the isolate is not
available.
sam-github added a commit that referenced this issue Mar 31, 2020
Follow on to #32207, 3 other options
are also not respected under situations that the isolate is not
available.

PR-URL: #32497
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
MylesBorins pushed a commit that referenced this issue Mar 31, 2020
Follow on to #32207, 3 other options
are also not respected under situations that the isolate is not
available.

PR-URL: #32497
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
addaleax added a commit that referenced this issue Apr 2, 2020
Overlooked in 2fa74e3.

Refs: #32207

PR-URL: #32535
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
BethGriggs pushed a commit that referenced this issue Apr 7, 2020
Overlooked in 2fa74e3.

Refs: #32207

PR-URL: #32535
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
targos pushed a commit that referenced this issue Apr 12, 2020
Overlooked in 2fa74e3.

Refs: #32207

PR-URL: #32535
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
@targos targos added backport-blocked-v12.x and removed backport-blocked-v12.x labels Apr 22, 2020
targos pushed a commit to targos/node that referenced this issue Apr 25, 2020
--report-on-fatalerror was not honored properly, as there was no
way to check the value which was stored in the Environment pointer
which can be inaccessible under certain fatal error situations.

Move the flag out of Environment pointer so that this is doable.

Co-authored-by: Shobhit Chittora schittora@paypal.com

PR-URL: nodejs#32207
Fixes: nodejs#31576
Refs: nodejs#29881
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
targos pushed a commit to targos/node that referenced this issue Apr 25, 2020
Follow on to nodejs#32207, 3 other options
are also not respected under situations that the isolate is not
available.

PR-URL: nodejs#32497
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
targos pushed a commit to targos/node that referenced this issue Apr 25, 2020
Overlooked in 2fa74e3.

Refs: nodejs#32207

PR-URL: nodejs#32535
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
targos pushed a commit that referenced this issue Apr 28, 2020
--report-on-fatalerror was not honored properly, as there was no
way to check the value which was stored in the Environment pointer
which can be inaccessible under certain fatal error situations.

Move the flag out of Environment pointer so that this is doable.

Co-authored-by: Shobhit Chittora schittora@paypal.com

PR-URL: #32207
Fixes: #31576
Refs: #29881
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
targos pushed a commit that referenced this issue Apr 28, 2020
Follow on to #32207, 3 other options
are also not respected under situations that the isolate is not
available.

PR-URL: #32497
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
targos pushed a commit that referenced this issue Apr 28, 2020
Overlooked in 2fa74e3.

Refs: #32207

PR-URL: #32535
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
gireeshpunathil added a commit to gireeshpunathil/node that referenced this issue Oct 19, 2020
The property `process.report.reportOnFatalError`
was deemed experimental, as it was not honored
under certain scenarios (for example out of memory
conditions). The report configuration were previously
stored on the `environment` structure which was not
available on these types of fatal error cases.

The referenced PR has addressed this case (sometime
back), and the property is working as intended.

Refs: nodejs#32207
PR-URL: nodejs#35654
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Beth Griggs <bgriggs@redhat.com>
BethGriggs pushed a commit that referenced this issue Dec 8, 2020
The property `process.report.reportOnFatalError`
was deemed experimental, as it was not honored
under certain scenarios (for example out of memory
conditions). The report configuration were previously
stored on the `environment` structure which was not
available on these types of fatal error cases.

The referenced PR has addressed this case (sometime
back), and the property is working as intended.

Refs: #32207
PR-URL: #35654
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Beth Griggs <bgriggs@redhat.com>
targos pushed a commit that referenced this issue Mar 3, 2021
The property `process.report.reportOnFatalError`
was deemed experimental, as it was not honored
under certain scenarios (for example out of memory
conditions). The report configuration were previously
stored on the `environment` structure which was not
available on these types of fatal error cases.

The referenced PR has addressed this case (sometime
back), and the property is working as intended.

Refs: #32207
PR-URL: #35654
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Beth Griggs <bgriggs@redhat.com>
MylesBorins pushed a commit that referenced this issue Apr 6, 2021
The property `process.report.reportOnFatalError`
was deemed experimental, as it was not honored
under certain scenarios (for example out of memory
conditions). The report configuration were previously
stored on the `environment` structure which was not
available on these types of fatal error cases.

The referenced PR has addressed this case (sometime
back), and the property is working as intended.

Refs: #32207
PR-URL: #35654
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Beth Griggs <bgriggs@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ lib / src
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants
X Tutup