Skip to content

src: remove preview for heap dump utilities - #31570

Closed
addaleax wants to merge 1 commit into
nodejs:masterfrom
addaleax:heap-snapshot-no-preview
Closed

src: remove preview for heap dump utilities#31570
addaleax wants to merge 1 commit into
nodejs:masterfrom
addaleax:heap-snapshot-no-preview

Conversation

@addaleax

Copy link
Copy Markdown
Member

At least createHeapSnapshotStream() and triggerHeapSnapshot()
do have side effects, and more importantly, they should not be
run transparently. Without this, typing e.g. v8.getHeapSnapshot()
into the REPL will result in a crash or infinite loop while the REPL
evaluates the expression for a preview.

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

At least `createHeapSnapshotStream()` and `triggerHeapSnapshot()`
do have side effects, and more importantly, they should not be
run transparently. Without this, typing e.g. `v8.getHeapSnapshot()`
into the REPL will result in a crash or infinite loop while the REPL
evaluates the expression for a preview.
@nodejs-github-botnodejs-github-bot added the c++ Issues and PRs that require attention from people who are familiar with C++. label Jan 29, 2020
@addaleax

Copy link
Copy Markdown
MemberAuthor

@BridgeAR I assume there is a way to add a test for this, but at least the format of test/parallel/test-repl-preview.js is not easily understandable.

@devsnek

devsnek commented Jan 29, 2020

Copy link
Copy Markdown
Member

@addaleax you'd basically do Runtime.evaluate({ expression: someCode, throwOnSideEffect: true }) and then verify that it returns an EvalError ("EvalError: Possible side-effect in debug-evaluate")

it might be worth making a separate test system from repl that verifies native functions having side effects or not.

@addaleax

Copy link
Copy Markdown
MemberAuthor

@devsnek Right, thanks for the suggestion … tbh, I’d prefer not to have tests for every single binding method, I was just looking for something that would test for the crash/hang in the REPL specifically (and only using the inspector doesn’t seem to suffice…)

@addaleaxaddaleax added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Jan 31, 2020
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@Trott

Trott commented Feb 1, 2020

Copy link
Copy Markdown
Member

Landed in 023ecbc

@TrottTrott closed this Feb 1, 2020
Trott pushed a commit that referenced this pull request Feb 1, 2020
At least `createHeapSnapshotStream()` and `triggerHeapSnapshot()`
do have side effects, and more importantly, they should not be
run transparently. Without this, typing e.g. `v8.getHeapSnapshot()`
into the REPL will result in a crash or infinite loop while the REPL
evaluates the expression for a preview.
PR-URL: #31570
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
codebytere pushed a commit that referenced this pull request Feb 17, 2020
At least `createHeapSnapshotStream()` and `triggerHeapSnapshot()`
do have side effects, and more importantly, they should not be
run transparently. Without this, typing e.g. `v8.getHeapSnapshot()`
into the REPL will result in a crash or infinite loop while the REPL
evaluates the expression for a preview.
PR-URL: #31570
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
@codebyterecodebytere mentioned this pull request Feb 17, 2020
codebytere pushed a commit that referenced this pull request Mar 15, 2020
At least `createHeapSnapshotStream()` and `triggerHeapSnapshot()`
do have side effects, and more importantly, they should not be
run transparently. Without this, typing e.g. `v8.getHeapSnapshot()`
into the REPL will result in a crash or infinite loop while the REPL
evaluates the expression for a preview.
PR-URL: #31570
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
codebytere pushed a commit that referenced this pull request Mar 17, 2020
At least `createHeapSnapshotStream()` and `triggerHeapSnapshot()`
do have side effects, and more importantly, they should not be
run transparently. Without this, typing e.g. `v8.getHeapSnapshot()`
into the REPL will result in a crash or infinite loop while the REPL
evaluates the expression for a preview.
PR-URL: #31570
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
@codebyterecodebytere mentioned this pull request Mar 17, 2020
codebytere pushed a commit that referenced this pull request Mar 30, 2020
At least `createHeapSnapshotStream()` and `triggerHeapSnapshot()`
do have side effects, and more importantly, they should not be
run transparently. Without this, typing e.g. `v8.getHeapSnapshot()`
into the REPL will result in a crash or infinite loop while the REPL
evaluates the expression for a preview.
PR-URL: #31570
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author readyPRs 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

@addaleax@devsnek@nodejs-github-bot@Trott@jasnell@cjihrig@devnexen@richardlau