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 <[email protected]>
Reviewed-By: Chengzhong Wu <[email protected]>
Reviewed-By: Minwoo Jung <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
  • Loading branch information
joyeecheung authored Jan 7, 2025
1 parent 75b9c1c commit 7c3aa9f
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 7c3aa9f

Please sign in to comment.