Commit f4fb979b authored by Michael Lippautz's avatar Michael Lippautz Committed by V8 LUCI CQ

heap: ArrayBufferSweeper: Fix freed counter overflow

The array buffer sweeper has its own freed counter which is migrated
back to a global counter. There exist two paths for finalizing array
buffer sweeping which both need to merge back the counters. If we miss
out on merging back the counter, the freed counter may overflow in the
next cycle.

Bug: chromium:1241332
Change-Id: Ic985f72414198de2eaf900b8e2e9b39bed24d87e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3121905Reviewed-by: 's avatarHannes Payer <hpayer@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#76503}
parent a56874d3
......@@ -113,9 +113,10 @@ void ArrayBufferSweeper::MergeBackExtensionsWhenSwept() {
if (job_->state_ == SweepingState::kDone) {
Merge();
sweeping_in_progress_ = false;
} else {
UpdateCountersForConcurrentlySweptExtensions();
}
// Update freed counters either way. It is necessary to update the counter
// in case sweeping is done to avoid counter overflows.
UpdateCountersForConcurrentlySweptExtensions();
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment