-
Notifications
You must be signed in to change notification settings - Fork 30k
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
bootstrap: fixup Error.stackTraceLimit for user-land snapshot #44203
Conversation
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().
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. |
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
Landed in 4f1a9fc |
This comment was marked as resolved.
This comment was marked as resolved.
I managed to land #38905 and retried this one which did land cleanly this time, as such I'm removing the |
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 <legendecas@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
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 <legendecas@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
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. |
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().