Skip to content

v8: fix process.abort() interaction with V8 - #13985

Closed
addaleax wants to merge 2 commits into
nodejs:masterfrom
addaleax:process-abort-v859
Closed

v8: fix process.abort() interaction with V8#13985
addaleax wants to merge 2 commits into
nodejs:masterfrom
addaleax:process-abort-v859

Conversation

@addaleax

@addaleaxaddaleax commented Jun 29, 2017

Copy link
Copy Markdown
Member

Since V8 5.9 V8 installs a default signal handler for some signals
when creating a default platform instance that prints a stack trace.

However, Node already does the same thing, so it would seem like the
two different stack traces would be printed; also, the V8 handler
would lead to a SIGSEGV under some circumstances, rather than
letting the abort continue normally.

Fixes: #13865

@nodejs/v8 I don’t have the time to deal with any upstream concerns regarding this, and probably not to look into the segfault as well, so if we want to report it/have that V8 change reverted, somebody else needs to do it.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines
Affected core subsystem(s)

v8

CI: https://ci.nodejs.org/job/node-test-pull-request/8862/

@nodejs-github-botnodejs-github-bot added the v8 engine Issues and PRs related to the V8 dependency. label Jun 29, 2017
@refack

Copy link
Copy Markdown
Contributor

Maybe also remove the FLAKY marker from https://github.com/nodejs/node/blob/master/test/async-hooks/async-hooks.status (at least the linux one)

@refack

Copy link
Copy Markdown
Contributor

image

Yay, it works.

@bnoordhuis

Copy link
Copy Markdown
Member

See v8/v8@3f45368, it was made configurable upstream. We should probably just cherry-pick that patch.

API/ABI stability is not a concern because libplatform and v8::Platform is not something add-ons use.

Original commit message:
d8: Make in process stack dumping optional
Adds a flag (--disable-in-process-stack-traces) to not install
signal handlers so that e.g. ASan signal handlers will work.
This flag mirrors chromium's one.
R=jochen@chromium.org
BUG=chromium:716235
Review-Url: https://codereview.chromium.org/2854173002
Cr-Commit-Position: refs/heads/master@{nodejs#45142}
PR-URL: nodejs#13985
@addaleax
addaleaxforce-pushed the process-abort-v859 branch from e8f4977 to 6f5a794CompareJune 29, 2017 12:16
@addaleax

Copy link
Copy Markdown
MemberAuthor

@bnoordhuis Thanks for the pointer; I’ve updated this.

CI: https://ci.nodejs.org/job/node-test-commit/10814/

@bnoordhuisbnoordhuis left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM with a comment.

Comment threadtest/parallel/test-abort-exitcode.js Outdated

@bnoordhuisbnoordhuisJun 29, 2017

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This should probably go into test/abort. I'm kind of surprised to discover that the test from #12914 went into test/parallel, that seems wrong. (edit: oh wait, that test only runs on Windows.)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Just for context: because of the core dumps taking up storage?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Correct.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Same goes for async_hooks/test-callback-error.js. But it is problematic that we don't have any abort tests running on CI, it is only because we put async_hooks/test-callback-error.js in the wrong directory that we discovered this bug.

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

I’ve moved the file.

@TrottTrottJun 30, 2017

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

But it is problematic that we don't have any abort tests running on CI, it is only because we put async_hooks/test-callback-error.js in the wrong directory that we discovered this bug.

I wonder if @nodejs/build can set up a single machine that is suitable to run those tests. Not sure what is required: That it be configured to not write core dumps? Or that it have a large enough disk to write core dumps and has a clean up task to delete them when the tests are done?

Anyway, if it's possible, maybe CI runs can at least run the tests in abort on a single platform, which is better than not running them at all ever. And it might make a good prototype for also running pummel and maybe even internet tests...

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

That it be configured to not write core dumps?

That would be the easiest, I guess. I don’t see why we wouldn’t be able to just do that in the test runner:

importresourceresource.setrlimit(resource.RLIMIT_CORE, (0,0))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I wonder if @nodejs/build can set up a single machine that is suitable to run those tests.

IMHO it won't be enough... there have been at least 3 abort related fixes in the last couple of weeks, on three different platforms...
An alternative might be a programmatic way to delete the core-dumps from within the test a la common.refreshTmpDir()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@refackrefack mentioned this pull request Jun 29, 2017
2 tasks
Since V8 5.9 V8 installs a default signal handler for some signals
when creating a default platform instance that prints a stack trace.
However, Node already does the same thing, so it would seem like the
two different stack traces would be printed; also, the V8 handler
would lead to a `SIGSEGV` under some circumstances, rather than
letting the abort continue normally.
Resolve this by disabling V8’s signal handler by default.
Fixes: nodejs#13865

@jasnelljasnell left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Largely rubber stamp LGTM

@Trott

Copy link
Copy Markdown
Member

This fixes test/abort/test-abort-backtrace.js, so there's one more reason to believe that running those tests somewhere regularly might be useful.

@TrottTrott mentioned this pull request Jun 30, 2017
2 tasks
@Trott

Trott commented Jul 2, 2017

Copy link
Copy Markdown
Member

Landed in 31349e2 and 4dff05f

@TrottTrott closed this Jul 2, 2017
@Trott

Trott commented Jul 2, 2017

Copy link
Copy Markdown
Member

A @refack-inspired post-land CI run: https://ci.nodejs.org/job/node-test-commit/10894/

@refack

Copy link
Copy Markdown
Contributor

A @refack-inspired post-land CI run: https://ci.nodejs.org/job/node-test-commit/10894/

YAY for the land! With npm-install of PI3 back to passing, we might have a green CI 💃
P.S. for general sanity I just run linuxone (it finished in < 3 minutes 😄), but this one might actualy turn green, and that's totally worth it.

@Trott

Trott commented Jul 2, 2017

Copy link
Copy Markdown
Member

I think #14029 still has to land before we get to green.

addaleax pushed a commit to addaleax/node that referenced this pull request Jul 3, 2017
Original commit message:
d8: Make in process stack dumping optional
Adds a flag (--disable-in-process-stack-traces) to not install
signal handlers so that e.g. ASan signal handlers will work.
This flag mirrors chromium's one.
R=jochen@chromium.org
BUG=chromium:716235
Review-Url: https://codereview.chromium.org/2854173002
Cr-Commit-Position: refs/heads/master@{nodejs#45142}
PR-URL: nodejs#13985
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
addaleax added a commit to addaleax/node that referenced this pull request Jul 3, 2017
Since V8 5.9 V8 installs a default signal handler for some signals
when creating a default platform instance that prints a stack trace.
However, Node already does the same thing, so it would seem like the
two different stack traces would be printed; also, the V8 handler
would lead to a `SIGSEGV` under some circumstances, rather than
letting the abort continue normally.
Resolve this by disabling V8’s signal handler by default.
PR-URL: nodejs#13985Fixes: nodejs#13865
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@addaleaxaddaleax mentioned this pull request Jul 3, 2017
addaleax pushed a commit that referenced this pull request Jul 11, 2017
Original commit message:
d8: Make in process stack dumping optional
Adds a flag (--disable-in-process-stack-traces) to not install
signal handlers so that e.g. ASan signal handlers will work.
This flag mirrors chromium's one.
R=jochen@chromium.org
BUG=chromium:716235
Review-Url: https://codereview.chromium.org/2854173002
Cr-Commit-Position: refs/heads/master@{#45142}
PR-URL: #13985
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
addaleax added a commit that referenced this pull request Jul 11, 2017
Since V8 5.9 V8 installs a default signal handler for some signals
when creating a default platform instance that prints a stack trace.
However, Node already does the same thing, so it would seem like the
two different stack traces would be printed; also, the V8 handler
would lead to a `SIGSEGV` under some circumstances, rather than
letting the abort continue normally.
Resolve this by disabling V8’s signal handler by default.
PR-URL: #13985Fixes: #13865
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
addaleax pushed a commit that referenced this pull request Jul 18, 2017
Original commit message:
d8: Make in process stack dumping optional
Adds a flag (--disable-in-process-stack-traces) to not install
signal handlers so that e.g. ASan signal handlers will work.
This flag mirrors chromium's one.
R=jochen@chromium.org
BUG=chromium:716235
Review-Url: https://codereview.chromium.org/2854173002
Cr-Commit-Position: refs/heads/master@{#45142}
PR-URL: #13985
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
addaleax added a commit that referenced this pull request Jul 18, 2017
Since V8 5.9 V8 installs a default signal handler for some signals
when creating a default platform instance that prints a stack trace.
However, Node already does the same thing, so it would seem like the
two different stack traces would be printed; also, the V8 handler
would lead to a `SIGSEGV` under some circumstances, rather than
letting the abort continue normally.
Resolve this by disabling V8’s signal handler by default.
PR-URL: #13985Fixes: #13865
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
addaleax pushed a commit to targos/node that referenced this pull request Jul 21, 2017
Original commit message:
d8: Make in process stack dumping optional
Adds a flag (--disable-in-process-stack-traces) to not install
signal handlers so that e.g. ASan signal handlers will work.
This flag mirrors chromium's one.
R=jochen@chromium.org
BUG=chromium:716235
Review-Url: https://codereview.chromium.org/2854173002
Cr-Commit-Position: refs/heads/master@{nodejs#45142}
PR-URL: nodejs#13985
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
addaleax added a commit to targos/node that referenced this pull request Jul 21, 2017
Since V8 5.9 V8 installs a default signal handler for some signals
when creating a default platform instance that prints a stack trace.
However, Node already does the same thing, so it would seem like the
two different stack traces would be printed; also, the V8 handler
would lead to a `SIGSEGV` under some circumstances, rather than
letting the abort continue normally.
Resolve this by disabling V8’s signal handler by default.
PR-URL: nodejs#13985Fixes: nodejs#13865
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
addaleax pushed a commit that referenced this pull request Jul 24, 2017
Original commit message:
d8: Make in process stack dumping optional
Adds a flag (--disable-in-process-stack-traces) to not install
signal handlers so that e.g. ASan signal handlers will work.
This flag mirrors chromium's one.
R=jochen@chromium.org
BUG=chromium:716235
Review-Url: https://codereview.chromium.org/2854173002
Cr-Commit-Position: refs/heads/master@{#45142}
PR-URL: #13985
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
addaleax added a commit that referenced this pull request Jul 24, 2017
Since V8 5.9 V8 installs a default signal handler for some signals
when creating a default platform instance that prints a stack trace.
However, Node already does the same thing, so it would seem like the
two different stack traces would be printed; also, the V8 handler
would lead to a `SIGSEGV` under some circumstances, rather than
letting the abort continue normally.
Resolve this by disabling V8’s signal handler by default.
PR-URL: #13985Fixes: #13865
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@addaleaxaddaleax mentioned this pull request Jul 24, 2017
MylesBorins pushed a commit to MylesBorins/node that referenced this pull request Aug 1, 2017
Since V8 5.9 V8 installs a default signal handler for some signals
when creating a default platform instance that prints a stack trace.
However, Node already does the same thing, so it would seem like the
two different stack traces would be printed; also, the V8 handler
would lead to a `SIGSEGV` under some circumstances, rather than
letting the abort continue normally.
Resolve this by disabling V8’s signal handler by default.
PR-URL: nodejs#13985Fixes: nodejs#13865
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
addaleax added a commit that referenced this pull request Aug 2, 2017
Since V8 5.9 V8 installs a default signal handler for some signals
when creating a default platform instance that prints a stack trace.
However, Node already does the same thing, so it would seem like the
two different stack traces would be printed; also, the V8 handler
would lead to a `SIGSEGV` under some circumstances, rather than
letting the abort continue normally.
Resolve this by disabling V8’s signal handler by default.
Backport-PR-URL: #14574
Backport-Reviewed-By: Anna Henningsen <anna@addaleax.net>
Backport-Reviewed-By: Refael Ackermann <refack@gmail.com>
PR-URL: #13985Fixes: #13865
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@addaleaxaddaleax mentioned this pull request Aug 2, 2017
@MylesBorins

Copy link
Copy Markdown
Contributor

assuming this doesn't apply to v6.x and 5.1. LMK if I'm mistaken

@addaleax
addaleax deleted the process-abort-v859 branch August 16, 2017 08:40
hferreiro pushed a commit to brave/node that referenced this pull request Sep 27, 2017
Since V8 5.9 V8 installs a default signal handler for some signals
when creating a default platform instance that prints a stack trace.
However, Node already does the same thing, so it would seem like the
two different stack traces would be printed; also, the V8 handler
would lead to a `SIGSEGV` under some circumstances, rather than
letting the abort continue normally.
Resolve this by disabling V8’s signal handler by default.
PR-URL: nodejs/node#13985Fixes: nodejs/node#13865
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v8 engineIssues and PRs related to the V8 dependency.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants

@addaleax@refack@bnoordhuis@Trott@MylesBorins@jasnell@AndreasMadsen@cjihrig@nodejs-github-bot@oliverchang