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

cppgc: Do not run stack verification with TSAN

Avoid verifying the stack when running with TSAN as the TSAN runtime
changes stack contents when e.g. working with locks.

Specifically, the marker uses locks in slow path operations which
results in stack changes throughout marking. This means that the
conservative iteration in the verifier may find more objects then the
regular marker. The difference is benign as the delta of objects is
not reachable from user code but it prevents verification.

Bug: chromium:1275581
Change-Id: Ie316ab65a5b90a1b72c09966f72d61af91224091
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3317976
Auto-Submit: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Anton Bikineev <bikineev@chromium.org>
Reviewed-by: 's avatarAnton Bikineev <bikineev@chromium.org>
Cr-Commit-Position: refs/heads/main@{#78260}
parent d3ba88a2
......@@ -45,6 +45,13 @@ void MarkingVerifierBase::Run(
Heap::Config::StackState stack_state, uintptr_t stack_end,
v8::base::Optional<size_t> expected_marked_bytes) {
Traverse(heap_.raw_heap());
// Avoid verifying the stack when running with TSAN as the TSAN runtime changes
// stack contents when e.g. working with locks. Specifically, the marker uses
// locks in slow path operations which results in stack changes throughout
// marking. This means that the conservative iteration below may find more
// objects then the regular marker. The difference is benign as the delta of
// objects is not reachable from user code but it prevents verification.
#if !defined(THREAD_SANITIZER)
if (stack_state == Heap::Config::StackState::kMayContainHeapPointers) {
in_construction_objects_ = &in_construction_objects_stack_;
heap_.stack()->IteratePointersUnsafe(this, stack_end);
......@@ -58,6 +65,7 @@ void MarkingVerifierBase::Run(
in_construction_objects_heap_.find(header));
}
}
#endif // !defined(THREAD_SANITIZER)
if (expected_marked_bytes && verifier_found_marked_bytes_are_exact_) {
CHECK_EQ(expected_marked_bytes.value(), verifier_found_marked_bytes_);
}
......
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