Skip to content

Conversation

@legendecas
Copy link
Member

@legendecaslegendecas commented Aug 19, 2019

If terminating the process with ctrl-c / SIGINT, prints a JS stack trace leading up to the currently executing code.

The feature would be enabled under option --trace-sigint.

Conditions of no stacktrace on sigint:

  1. has (an) active sigint listener(s);
  2. main thread is idle (i.e. uv polling), a message instead of stacktrace would be printed.

Related: #24937

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-botnodejs-github-bot added the c++ Issues and PRs that require attention from people who are familiar with C++. label Aug 19, 2019
@mscdex
Copy link
Contributor

mscdex commented Aug 19, 2019

Maybe we should only print a stack trace if stdin is a TTY (especially if it's meant to only happen when pressing ctrl-c)?

@devsnekdevsnek added the wip Issues and PRs that are still a work in progress. label Aug 19, 2019
Copy link
Member

@bnoordhuisbnoordhuis left a comment

Choose a reason for hiding this comment

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

Left some comments but nice work!

@legendecaslegendecasforce-pushed the issue-24937 branch 3 times, most recently from 503aca6 to f175639CompareAugust 24, 2019 13:14
@legendecaslegendecas changed the title cli: make ^C print a JS stack tracereport: make ^C print a JS stack traceAug 24, 2019
Copy link
Member

@addaleaxaddaleax left a comment

Choose a reason for hiding this comment

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

report: is the subsystem for the node-report feature, i.e. node --experimental-report … this touches a related topic, but I think it might be confusing to name it that way

@legendecas
Copy link
MemberAuthor

report: is the subsystem for the node-report feature, i.e. node --experimental-report … this touches a related topic, but I think it might be confusing to name it that way

Yes, this work doesn't touch report specifically in codebase. Yet I don't find a more proper subsystem here https://github.com/nodejs/core-validate-commit/blob/master/lib/rules/subsystem.js . Since both src and lib are touched in this work, neither of those one might be appropriate IMO.

@addaleax
Copy link
Member

@legendecas You can also use src,lib: .... 🙂 Honestly, I don’t have a better idea than that either.

@legendecaslegendecas changed the title report: make ^C print a JS stack tracesrc,lib: make ^C print a JS stack traceAug 24, 2019
@legendecaslegendecasforce-pushed the issue-24937 branch 2 times, most recently from 3797e8e to 822e56aCompareAugust 24, 2019 14:13
@legendecaslegendecasforce-pushed the issue-24937 branch 2 times, most recently from 124c8c3 to b7ccab2CompareAugust 24, 2019 16:44
@legendecas
Copy link
MemberAuthor

I think this PR is out of WIP, ready to be reviewed thoroughly :)

@addaleaxaddaleax removed the wip Issues and PRs that are still a work in progress. label Aug 24, 2019
@nodejs-github-bot
Copy link
Collaborator

@addaleax
Copy link
Member

@addaleax
Copy link
Member

@legendecas Looks like there are still issues with the postmortem tests…

@legendecas
Copy link
MemberAuthor

@legendecas Looks like there are still issues with the postmortem tests…

I'll try to fix it :P

@Fishrock123Fishrock123 removed their request for review January 14, 2020 19:49
@Fishrock123
Copy link
Contributor

Fishrock123 commented Jan 14, 2020

I don't have any substantive opinions for this.

@legendecas
Copy link
MemberAuthor

Since there are no objections anymore and multiple approves, I'd tag this as author-ready.

@legendecaslegendecas added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Jan 17, 2020
If terminating the process with ctrl-c / SIGINT, prints a JS stacktrace leading up to the currently executing code. The feature would be enabled under option --trace-sigint. Conditions of no stacktrace on sigint: - has (an) active sigint listener(s); - main thread is idle (i.e. uv polling), a message instead of stacktrace would be printed.
@legendecaslegendecas removed the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Jan 25, 2020
@legendecas
Copy link
MemberAuthor

Rebased to resolve conflicts.

@nodejs-github-bot

This comment has been minimized.

@nodejs-github-bot

This comment has been minimized.

@nodejs-github-bot

This comment has been minimized.

@nodejs-github-bot
Copy link
Collaborator

@legendecaslegendecas added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Jan 26, 2020
legendecas added a commit that referenced this pull request Jan 28, 2020
If terminating the process with ctrl-c / SIGINT, prints a JS stacktrace leading up to the currently executing code. The feature would be enabled under option `--trace-sigint`. Conditions of no stacktrace on sigint: - has (an) active sigint listener(s); - main thread is idle (i.e. uv polling), a message instead of stacktrace would be printed. PR-URL: #29207 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: Christopher Hiller <[email protected]> Reviewed-By: Rich Trott <[email protected]>
@legendecas
Copy link
MemberAuthor

Landed with 7b7e7bd 🎉

@legendecaslegendecas deleted the issue-24937 branch January 28, 2020 05:54
@ruyadorno
Copy link
Member

ruyadorno commented Jan 28, 2020

/cc @nodejs/tooling this landed 🎉 yay! we might want to talk about it in the next tooling WG meeting

codebytere pushed a commit that referenced this pull request Feb 17, 2020
If terminating the process with ctrl-c / SIGINT, prints a JS stacktrace leading up to the currently executing code. The feature would be enabled under option `--trace-sigint`. Conditions of no stacktrace on sigint: - has (an) active sigint listener(s); - main thread is idle (i.e. uv polling), a message instead of stacktrace would be printed. PR-URL: #29207 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: Christopher Hiller <[email protected]> Reviewed-By: Rich Trott <[email protected]>
@codebyterecodebytere mentioned this pull request Feb 17, 2020
@targostargos removed the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Apr 25, 2020
targos pushed a commit to targos/node that referenced this pull request Apr 25, 2020
If terminating the process with ctrl-c / SIGINT, prints a JS stacktrace leading up to the currently executing code. The feature would be enabled under option `--trace-sigint`. Conditions of no stacktrace on sigint: - has (an) active sigint listener(s); - main thread is idle (i.e. uv polling), a message instead of stacktrace would be printed. PR-URL: nodejs#29207 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: Christopher Hiller <[email protected]> Reviewed-By: Rich Trott <[email protected]>
targos pushed a commit that referenced this pull request Apr 28, 2020
If terminating the process with ctrl-c / SIGINT, prints a JS stacktrace leading up to the currently executing code. The feature would be enabled under option `--trace-sigint`. Conditions of no stacktrace on sigint: - has (an) active sigint listener(s); - main thread is idle (i.e. uv polling), a message instead of stacktrace would be printed. PR-URL: #29207 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: Christopher Hiller <[email protected]> Reviewed-By: Rich Trott <[email protected]>
@targostargos mentioned this pull request May 2, 2020
@orgads
Copy link
Contributor

Is it possible to extend this also for sigterm (with a separate flag)?

Sign up for freeto 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++.semver-minorPRs that contain new features and should be released in the next minor version.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

20 participants

@legendecas@mscdex@addaleax@nodejs-github-bot@mcollina@Fishrock123@boneskull@benjamingr@joyeecheung@bnoordhuis@mhdawson@jasnell@sam-github@targos@MylesBorins@yorkie@cclauss@coreyfarrell@antsmartian@psmarshall