Skip to content

Commit

Permalink
src: lock the thread properly in snapshot builder
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
joyeecheung authored and aduh95 committed Feb 3, 2025
1 parent 98d3474 commit 6eec5e7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/node_snapshotable.cc
Original file line number Diff line number Diff line change
Expand Up @@ -962,6 +962,8 @@ ExitCode BuildSnapshotWithoutCodeCache(
}

Isolate* isolate = setup->isolate();
v8::Locker locker(isolate);

{
HandleScope scope(isolate);
TryCatch bootstrapCatch(isolate);
Expand Down

0 comments on commit 6eec5e7

Please sign in to comment.