bootstrap: fixup Error.stackTraceLimit for user-land snapshot#44203
bootstrap: fixup Error.stackTraceLimit for user-land snapshot#44203nodejs-github-bot merged 4 commits intonodejs:mainfrom
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>
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().