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

src: call Environment::Exit() for fatal exceptions #25472

Closed
wants to merge 2 commits into from

Conversation

addaleax
Copy link
Member

Tests fail without the first commit, so they are in one PR.

src: reset StopTracingAgent() before platform teardown

This makes sure that StopTracingAgent() is always called
before tearing down the tracing::Agent,
since previously its destructor might have tried to access the
agent, which would be destroyed by the (earlier) Dispose() call.

src: call Environment::Exit() for fatal exceptions

Call Environment::Exit() rather than the process-wide
exit() function, since JS exceptions generally only affect
the current JS engine instance.

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

This makes sure that `StopTracingAgent()` is always called
before tearing down the `tracing::Agent`,
since previously its destructor might have tried to access the
agent, which would be destroyed by the (earlier) `Dispose()` call.
Call `Environment::Exit()` rather than the process-wide
`exit()` function, since JS exceptions generally only affect
the current JS engine instance.
@nodejs-github-bot
Copy link
Collaborator

@addaleax sadly an error occured when I tried to trigger a build :(

@nodejs-github-bot nodejs-github-bot added the c++ Issues and PRs that require attention from people who are familiar with C++. label Jan 13, 2019
@addaleax
Copy link
Member Author

@addaleax addaleax added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Jan 14, 2019
Copy link
Member

@joyeecheung joyeecheung left a comment

Choose a reason for hiding this comment

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

Nice work, I believe this resolves an issue I have in a local branch 👍 (it’s possible to trigger the destruction of the global native module loader through exit() from the FatalException handler of a worker thread while
other threads are still active)

@joyeecheung
Copy link
Member

@joyeecheung
Copy link
Member

@joyeecheung
Copy link
Member

Landed in 391f839...8528c21

joyeecheung pushed a commit that referenced this pull request Jan 16, 2019
This makes sure that `StopTracingAgent()` is always called
before tearing down the `tracing::Agent`,
since previously its destructor might have tried to access the
agent, which would be destroyed by the (earlier) `Dispose()` call.

PR-URL: #25472
Reviewed-By: Daniel Bevenius <[email protected]>
Reviewed-By: Minwoo Jung <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Anatoli Papirovski <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
joyeecheung pushed a commit that referenced this pull request Jan 16, 2019
Call `Environment::Exit()` rather than the process-wide
`exit()` function, since JS exceptions generally only affect
the current JS engine instance.

PR-URL: #25472
Reviewed-By: Daniel Bevenius <[email protected]>
Reviewed-By: Minwoo Jung <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Anatoli Papirovski <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
addaleax added a commit that referenced this pull request Jan 23, 2019
This makes sure that `StopTracingAgent()` is always called
before tearing down the `tracing::Agent`,
since previously its destructor might have tried to access the
agent, which would be destroyed by the (earlier) `Dispose()` call.

PR-URL: #25472
Reviewed-By: Daniel Bevenius <[email protected]>
Reviewed-By: Minwoo Jung <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Anatoli Papirovski <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
addaleax added a commit that referenced this pull request Jan 23, 2019
Call `Environment::Exit()` rather than the process-wide
`exit()` function, since JS exceptions generally only affect
the current JS engine instance.

PR-URL: #25472
Reviewed-By: Daniel Bevenius <[email protected]>
Reviewed-By: Minwoo Jung <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Anatoli Papirovski <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
@MylesBorins MylesBorins mentioned this pull request Jan 24, 2019
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. c++ Issues and PRs that require attention from people who are familiar with C++.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants