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

bootstrap: fixup Error.stackTraceLimit for user-land snapshot #44203

Merged
merged 4 commits into from
Aug 18, 2022

Conversation

joyeecheung
Copy link
Member

@joyeecheung joyeecheung commented Aug 10, 2022

It's difficult for V8 to handle Error.stackTraceLimit in the snapshot,
so delete it from the Error constructor if it's present before
snapshot serialization, and re-install it after deserialization.
In addition try not to touch it from our internals during snapshot
building in the first place by updating
isErrorStackTraceLimitWritable().

It's difficult for V8 to handle Error.stackTraceLimit in the snapshot,
so delete it from the Error constructor if it's present before
snapshot serialization, and re-install it after deserialization.
In addition try not to touch it from our internals during snapshot
building in the first place by updating
isErrorStackTraceLimitWritable().
@nodejs-github-bot nodejs-github-bot added errors Issues and PRs related to JavaScript errors originated in Node.js core. needs-ci PRs that need a full CI run. labels Aug 10, 2022
@joyeecheung
Copy link
Member Author

joyeecheung commented Aug 10, 2022

After looking into https://chromium-review.googlesource.com/c/v8/v8/+/3319481 I think that it makes more sense for us to clean it up - there are several constraints in the SnapshotCreator that don't exist from the embedder's side so it's just much simpler to handle this in Node.js. It should be a rare case that only shows up when users actually try to mutate Error.stackTraceLimit themselves in the snapshot script anyway.

@nodejs-github-bot
Copy link
Collaborator

Copy link
Member

@legendecas legendecas left a comment

Choose a reason for hiding this comment

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

👍

@nodejs-github-bot
Copy link
Collaborator

@joyeecheung joyeecheung added the review wanted PRs that need reviews. label Aug 15, 2022
@nodejs-github-bot
Copy link
Collaborator

lib/internal/main/mksnapshot.js Show resolved Hide resolved
lib/internal/main/mksnapshot.js Outdated Show resolved Hide resolved
lib/internal/main/mksnapshot.js Outdated Show resolved Hide resolved
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@joyeecheung joyeecheung removed the review wanted PRs that need reviews. label Aug 17, 2022
@nodejs-github-bot
Copy link
Collaborator

@joyeecheung joyeecheung added commit-queue Add this label to land a pull request using GitHub Actions. commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. labels Aug 18, 2022
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Aug 18, 2022
@nodejs-github-bot nodejs-github-bot merged commit 4f1a9fc into nodejs:main Aug 18, 2022
@nodejs-github-bot
Copy link
Collaborator

Landed in 4f1a9fc

@ruyadorno ruyadorno added the backport-blocked-v18.x PRs that should land on the v18.x-staging branch but are blocked by another PR's pending backport. label Aug 22, 2022
@ruyadorno

This comment was marked as resolved.

@ruyadorno ruyadorno removed the backport-blocked-v18.x PRs that should land on the v18.x-staging branch but are blocked by another PR's pending backport. label Aug 23, 2022
@ruyadorno
Copy link
Member

I managed to land #38905 and retried this one which did land cleanly this time, as such I'm removing the bakcport-blocked-v18.x label 😊

ruyadorno pushed a commit that referenced this pull request Aug 23, 2022
It's difficult for V8 to handle Error.stackTraceLimit in the snapshot,
so delete it from the Error constructor if it's present before
snapshot serialization, and re-install it after deserialization.
In addition try not to touch it from our internals during snapshot
building in the first place by updating
isErrorStackTraceLimitWritable().

PR-URL: #44203
Reviewed-By: Chengzhong Wu <[email protected]>
Reviewed-By: Antoine du Hamel <[email protected]>
Fyko pushed a commit to Fyko/node that referenced this pull request Sep 15, 2022
It's difficult for V8 to handle Error.stackTraceLimit in the snapshot,
so delete it from the Error constructor if it's present before
snapshot serialization, and re-install it after deserialization.
In addition try not to touch it from our internals during snapshot
building in the first place by updating
isErrorStackTraceLimitWritable().

PR-URL: nodejs#44203
Reviewed-By: Chengzhong Wu <[email protected]>
Reviewed-By: Antoine du Hamel <[email protected]>
@juanarbol
Copy link
Member

Looks like this depends on #38905; the v16.x branch is presenting some issues w/ this PR; I will mark this as the presumptuous dependency. Feel free to remove the label if I'm wrong.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. errors Issues and PRs related to JavaScript errors originated in Node.js core. needs-ci PRs that need a full CI run.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants