From 500f3ccc66fe7477efaceb97545f288125d91fbf Mon Sep 17 00:00:00 2001 From: Joyee Cheung Date: Tue, 7 Jan 2025 17:49:10 +0100 Subject: [PATCH] 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: https://github.com/nodejs/node/pull/56327 Fixes: https://github.com/nodejs/node-v8/issues/294 Reviewed-By: James M Snell Reviewed-By: Chengzhong Wu Reviewed-By: Minwoo Jung Reviewed-By: Anna Henningsen --- src/node_snapshotable.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/node_snapshotable.cc b/src/node_snapshotable.cc index cfd1bcc3d2f..7ea49e74127 100644 --- a/src/node_snapshotable.cc +++ b/src/node_snapshotable.cc @@ -982,6 +982,8 @@ ExitCode BuildSnapshotWithoutCodeCache( } Isolate* isolate = setup->isolate(); + v8::Locker locker(isolate); + { HandleScope scope(isolate); TryCatch bootstrapCatch(isolate);