Skip to content

Commit f294033

Browse files
committed
deps: V8: cherry-pick c21a93ec80d5
Original commit message: [sandbox] Fix JSDispatchTable entry mark-bit erasure A race condition exists in V8's concurrent marking and deoptimization logic where Code::SetMarkedForDeoptimization updates a dispatch table entry without running a write barrier. During concurrent marking, a background thread's CAS mark can be overwritten by the mutator's blind store, leading to a live entry being swept. Fixed: 525686865 Change-Id: I0cebd44b62ad5c16c19d73e5586058b1d2265ee4 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/8074259 Commit-Queue: Olivier Flückiger <olivf@chromium.org> Reviewed-by: Dominik Inführ <dinfuehr@chromium.org> Auto-Submit: Olivier Flückiger <olivf@chromium.org> Cr-Commit-Position: refs/heads/main@{#108583} Refs: v8/v8@c21a93e Signed-off-by: Barath <barathraj048@gmail.com>
1 parent f88c2f8 commit f294033

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

‎common.gypi‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444

4545
# Reset this number to 0 on major V8 upgrades.
4646
# Increment by one for each non-official patch applied to deps/v8.
47-
'v8_embedder_string': '-node.39',
47+
'v8_embedder_string': '-node.40',
4848

4949
##### V8 defaults for Node.js #####
5050

‎deps/v8/src/objects/code.cc‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,10 @@ void Code::SetMarkedForDeoptimization(Isolate* isolate,
226226
} else {
227227
jdt.SetCodeNoWriteBarrier(handle, *BUILTIN_CODE(isolate, CompileLazy));
228228
}
229+
// TODO(olivf, 525686865): Fix the race in dispatch handle marking by
230+
// going back to a CAS loop.
231+
static_assert(JSDispatchTable::kWriteBarrierSetsEntryMarkBit);
232+
jdt.Mark(handle);
229233
}
230234
// Ensure we don't try to patch the entry multiple times.
231235
set_js_dispatch_handle(kNullJSDispatchHandle);

0 commit comments

Comments
 (0)