From 7dd8165b0be3b3441c2e8216f3a069e0395dbb7d 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 fe3fcc7184205f..f9acb7b1d1618e 100644 --- a/src/node_snapshotable.cc +++ b/src/node_snapshotable.cc @@ -962,6 +962,8 @@ ExitCode BuildSnapshotWithoutCodeCache( } Isolate* isolate = setup->isolate(); + v8::Locker locker(isolate); + { HandleScope scope(isolate); TryCatch bootstrapCatch(isolate);