New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 738490 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Jul 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 1
Type: Bug
Proj-VR
Proj-XR
Proj-XR-VR

Blocking:
issue 734611



Sign in to add a comment

VR Browser navigation tests failing due to DCHECK

Project Member Reported by bsheedy@chromium.org, Jun 30 2017

Issue description

Since this group of CLs (https://build.chromium.org/p/chromium.fyi/builders/Android%20VR%20Tests/builds/8769) went in, the VrShellNavigationTest tests have a fairly high chance (~30%) of failing due to this DCHECK https://cs.chromium.org/chromium/src/chrome/browser/android/thumbnail/thumbnail_cache.cc?q=thumbnail_meta_data&dr=C&l=173.

This is easily reproducible by running the end-to-end tests locally with "--test-filter VrShellNavigationTest#*" a few times.

Whether the change to VR is directly causing this or just exposed an existing bug isn't clear at the moment. This looks similar to Issue 592961, but happens much more frequently.
 
Summary: VR Browser navigation tests failing due to DCHECK (was: VR Browser navigation tests failing due to assert)
Cc: mthiesse@chromium.org
Owner: powei@chromium.org
Status: Assigned (was: Available)
Assigning to powei@ since they wrote they originally wrote the code with the failing DCHECK several years ago. Feel free to re-assign to a more appropriate person.

According to mthiesse@, this appears to be caused by a race condition in the thumbnail cache. It updates the metadata, asynchronously reads the thumbnail, then expects the metadata to still be there when it's finished. This might be a pretty safe assumption normally, but with VR, we do some wonky things like disable the compositor while paused.
Cc: powei@chromium.org
Owner: dtrainor@chromium.org
Re-assigning to dtrainor@ since powei@ appears to have stopped working on Chromium a couple of years ago and David was one of the reviewers of the CL. Again, feel free to re-assign to a more appropriate person.
Cc: dtrainor@chromium.org
Labels: M-61
Owner: xingliu@chromium.org
Assigning to xingliu@ to take a look if he has cycles.  Xing if you don't let me know.
These tests are under @Restriction(RESTRICTION_TYPE_VIEWER_DAYDREAM), do we need particular kind of device to run these tests?
RESTRICTION_TYPE_VIEWER_DAYDREAM refers to having the Daydream View headset paired with the device (as opposed to Cardboard), although it also implies that the test is run on a Daydream-ready device (Pixel and Pixel XL for testing purposes).

If you don't have access to one of those, there are several Pixel XL devices available on swarming that you can run tests on - I can send you instructions on how to do that if necessary.

Whether you're testing locally or on swarming, though, the VR tests require passing a few additional arguments to the test runner in order to run properly - I'll ping you with details shortly.

Comment 7 Deleted

out/Debug/bin/run_chrome_public_test_vr_apk --test-filter *VrShellNavigationTest#* --shared-prefs-file chrome/android/shared_preference_files/test/vr_ddview_skipdon_setupcomplete.json --repeat 5

Hit one DCHECK in thumbnail_cache.

Device: Pixel XL, Android O, Google VR Service app version: 1.7.16000338
The logic flow is basically this:

1. The tests pause the activity(ChromeActivity.onPauseWithNative), and ask to cache the tab as thumbnail, which is async and bitmap will arrive later.

2. Then the renderer is still navigating and WebContentObserver propagates didStartNavigation(eventually call TabModelSelectorImpl.onPageLoadStarted), which changes the url of the tab and erase the thumbnail metadata.

3. Then the bitmap of thumbnail arrive, but metadata has been erased. Hit DCHECK.

Does any recent VR CL pause Chrome when during launch?

Probably we can just dump away the thumbnail in this case.
crash.log
2.1 MB View Download
mthiesse@ would probably be a much better person to ask, but AFAIK there hasn't been a recent VR change that causes Chrome to pause during launch. In fact, AFAIK, we've recently moved away from pausing while in VR.
We do pause when entering VR, but this should happen after the website is already loaded and asks to enter VR. We pause to show the Device ON flow, then return to Chrome.

One possible cause is that we pause the compositor while WebVR is active, so you might not get thumbnails during this time? Not sure.
Labels: VR-Test
Project Member

Comment 13 by bugdroid1@chromium.org, Jul 17 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/037c2473223cfc407d40dc54b4fb45eccbff453e

commit 037c2473223cfc407d40dc54b4fb45eccbff453e
Author: Xing Liu <xingliu@chromium.org>
Date: Mon Jul 17 22:23:36 2017

Dump the bitmap of thumbnail if no thumbnail meta data associated.

When we cache the tab as thumbnail. It copies the bitmap from renderer
asynchronously and the bitmap will be put to thumbnail cache later.

But navigation can still happen, if the tab navigates to another URL,
the thumbnail metadata in thumbnail_cache.cc will be removed, if bitmap
arrives after this, we can dump the bitmap instead of assuming the
metadata is still there.

In VR related tests, we cache the thumbnail when ChromeActivity is
paused, and then the WebContent navigates to another URL, which erase
the thumbnail metadata, then the bitmap arrives.

Bug:  738490 
Change-Id: I980d90020170f609c7aa4a17a1e42a18ab553a4a
Reviewed-on: https://chromium-review.googlesource.com/570782
Commit-Queue: Xing Liu <xingliu@chromium.org>
Reviewed-by: David Trainor <dtrainor@chromium.org>
Cr-Commit-Position: refs/heads/master@{#487276}
[modify] https://crrev.com/037c2473223cfc407d40dc54b4fb45eccbff453e/chrome/browser/android/thumbnail/thumbnail_cache.cc

Status: Fixed (was: Assigned)
Labels: VR-Caught-By-Test
Labels: -VR-Caught-By-Test XR-Caught-By-Test

Sign in to add a comment