Skip to content

Commit 7dd8165

Browse files
joyeecheungaduh95
authored andcommitted
src: lock the thread properly in snapshot builder
Otherwise it can crash DCHECK when V8 expects that at least someone is locking the current thread. PR-URL: #56327 Fixes: nodejs/node-v8#294 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: Minwoo Jung <nodecorelab@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
1 parent 2a0fbd8 commit 7dd8165

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/node_snapshotable.cc

+2
Original file line numberDiff line numberDiff line change
@@ -962,6 +962,8 @@ ExitCode BuildSnapshotWithoutCodeCache(
962962
}
963963

964964
Isolate* isolate = setup->isolate();
965+
v8::Locker locker(isolate);
966+
965967
{
966968
HandleScope scope(isolate);
967969
TryCatch bootstrapCatch(isolate);

0 commit comments

Comments
 (0)