Commit bae99d5b authored by Anton Bikineev's avatar Anton Bikineev Committed by V8 LUCI CQ

cppgc: Fix data race in DCHECK between markers

Read of size 2 at 0x7eef001a3666 by main thread (mutexes: write M0):
 0: LoadEncoded
 1: IsMarked<(cppgc::internal::AccessMode)0>
 2: operator()
 3: DrainWorklistWithPredicate
 4: DrainWorklistWithBytesAndTimeDeadline

Previous atomic write of size 2 at 0x7eef001a3666 by thread T8:

 0: __cxx_atomic_compare_exchange_strong<unsigned short>
 1: compare_exchange_strong
 2: TryMarkAtomic
 3: MarkNoPush

Change-Id: I0708516382ea860c877ff76ee02216f6f27c9d04
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3858239
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Auto-Submit: Anton Bikineev <bikineev@chromium.org>
Commit-Queue: Anton Bikineev <bikineev@chromium.org>
Reviewed-by: 's avatarMichael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#82776}
parent a9404887
...@@ -620,7 +620,7 @@ bool MarkerBase::ProcessWorklistsWithDeadline( ...@@ -620,7 +620,7 @@ bool MarkerBase::ProcessWorklistsWithDeadline(
const HeapObjectHeader& header = const HeapObjectHeader& header =
HeapObjectHeader::FromObject(item.base_object_payload); HeapObjectHeader::FromObject(item.base_object_payload);
DCHECK(!header.IsInConstruction<AccessMode::kNonAtomic>()); DCHECK(!header.IsInConstruction<AccessMode::kNonAtomic>());
DCHECK(header.IsMarked<AccessMode::kNonAtomic>()); DCHECK(header.IsMarked<AccessMode::kAtomic>());
mutator_marking_state_.AccountMarkedBytes(header); mutator_marking_state_.AccountMarkedBytes(header);
item.callback(&visitor(), item.base_object_payload); item.callback(&visitor(), item.base_object_payload);
})) { })) {
......
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