Commit f054a191 authored by Tim van der Lippe's avatar Tim van der Lippe Committed by V8 LUCI CQ

Add explanation for DCHECK that can fire with embedder misconfiguration

While debugging, we discovered a Blink misconfiguration in the
navigator.mimeTypes object. We fixed the issue in
https://crrev.com/c/3303674, but let's also document on the V8 side when
you can hit the DCHECK and where to look next.

R=yangguo@chromium.org

Bug: chromium:1262066
Change-Id: I256331ec4296963deb152485d8c6699b75c42e37
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3302804
Auto-Submit: Tim Van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: 's avatarYang Guo <yangguo@chromium.org>
Commit-Queue: Tim Van der Lippe <tvanderlippe@chromium.org>
Cr-Commit-Position: refs/heads/main@{#78154}
parent c6ce0b25
......@@ -109,6 +109,21 @@ v8::Maybe<v8::PropertyAttribute> DebugPropertyIterator::attributes() {
PrototypeIterator::GetCurrent<JSReceiver>(prototype_iterator_);
auto result = JSReceiver::GetPropertyAttributes(receiver, raw_name());
if (result.IsNothing()) return Nothing<v8::PropertyAttribute>();
// This should almost never happen, however we have seen cases where we do
// trigger this check. In these rare events, it typically is a
// misconfiguration by an embedder (such as Blink) in how the embedder
// processes properities.
//
// In the case of crbug.com/1262066 we discovered that Blink was returning
// a list of properties to contain in an object, after which V8 queries each
// property individually. But, Blink incorrectly claimed that the property
// in question did *not* exist. As such, V8 is instructed to process a
// property, requests the embedder for more information and then suddenly the
// embedder claims it doesn't exist. In these cases, we hit this DCHECK.
//
// If you are running into this problem, check your embedder implementation
// and verify that the data from both sides matches. If there is a mismatch,
// V8 will crash.
DCHECK(result.FromJust() != ABSENT);
return Just(static_cast<v8::PropertyAttribute>(result.FromJust()));
}
......
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