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

Issue 679952 link

Starred by 1 user

Issue metadata

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



Sign in to add a comment

Presenting with null source while already presenting causes renderer crash

Project Member Reported by bsheedy@chromium.org, Jan 11 2017

Issue description

Reproduction steps on Android Canary:
1. Access https://webvr.info/samples/03-vr-presentation.html in Canary
2. Attach device to workstation and inspect the Canary tab (F12 -> Remote devices)
3. Run the following Javascript in the console:

var disp; var can = document.getElementById("webgl-canvas");
navigator.getVRDisplays().then( (displays) => {disp = displays[0];});
disp.requestPresent([{ source: can}]);
<< complete DON flow >>
disp.requestPresent([{ source: null}]);

4. The renderer crashes
 
This seems to be caused by the use of canvas->document() here: https://cs.chromium.org/chromium/src/third_party/WebKit/Source/modules/vr/VRDisplay.cpp?l=518

Since canvas is now null, trying to access its document function causes a segfault. Adding a simple null check would fix that, but I'm not sure if we still need to exit fullscreen and such on the previously presenting, valid canvas.
I try to use Pixel XL to reproduce this issue but cannot reproduce.
Instead of renderer crashes, I got an exception named "Uncaught (in promise) DOMException: Invalid layer source."
Here is my reproduction steps on Android Canary:
1. Access https://webvr.info/samples/03-vr-presentation.html in Canary
2. Attach device to workstation and inspect the Canary tab (chrome://inspect)
3. Run the following Javascript in the console:
var disp; var can = document.getElementById("webgl-canvas");
navigator.getVRDisplays().then( (displays) => {disp = displays[0];});
disp.requestPresent([{ source: can}]);
The display entered full screen mode due to no Daydream Viewer.
disp.requestPresent([{ source: null}]);

But the renderer not crashes, it report an exception "Uncaught (in promise) DOMException: Invalid layer source.".

Any steps wrong? thx.

BR,
Yan,Shaobo


Components: -UI>Browser>VR
Labels: M-57
Those steps look correct to me, and I can still reproduce it with the viewer set to Cardboard. When you say full screen mode, do you mean the VR rendering with two views, or is it just fullscreening the canvas? The latter shouldn't be happening.
FYI, a fix for this is included in https://codereview.chromium.org/2624263003/ as well as a layout test for it.
Owner: bsheedy@chromium.org
Status: Started (was: Available)
Thanks, bsheedy.
Project Member

Comment 7 by bugdroid1@chromium.org, Jan 13 2017

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

commit b7f90cae827044cfb2280c8382d993848ef33340
Author: bsheedy <bsheedy@chromium.org>
Date: Fri Jan 13 04:14:43 2017

Add more WebVR layout tests and fix small issues they found

Adds several additional WebVR layout tests.

Refactors the WebVR Mojo mocking to more closely emulate the actual
actual implementation.

Fixes several issues in the WebVR source code that were encountered by these
tests.

BUG= 679952 , 679288 

Review-Url: https://codereview.chromium.org/2624263003
Cr-Commit-Position: refs/heads/master@{#443485}

[add] https://crrev.com/b7f90cae827044cfb2280c8382d993848ef33340/third_party/WebKit/LayoutTests/vr/events_vrdisplayactivate.html
[add] https://crrev.com/b7f90cae827044cfb2280c8382d993848ef33340/third_party/WebKit/LayoutTests/vr/events_vrdisplayconnect.html
[add] https://crrev.com/b7f90cae827044cfb2280c8382d993848ef33340/third_party/WebKit/LayoutTests/vr/events_vrdisplaypresentchange.html
[modify] https://crrev.com/b7f90cae827044cfb2280c8382d993848ef33340/third_party/WebKit/LayoutTests/vr/getLayers_presenting.html
[add] https://crrev.com/b7f90cae827044cfb2280c8382d993848ef33340/third_party/WebKit/LayoutTests/vr/getLayers_presenting_nondefaultbounds.html
[add] https://crrev.com/b7f90cae827044cfb2280c8382d993848ef33340/third_party/WebKit/LayoutTests/vr/getLayers_update.html
[add] https://crrev.com/b7f90cae827044cfb2280c8382d993848ef33340/third_party/WebKit/LayoutTests/vr/requestPresent_resolve_then_reject.html
[modify] https://crrev.com/b7f90cae827044cfb2280c8382d993848ef33340/third_party/WebKit/LayoutTests/vr/resources/fake-vr-displays.js
[modify] https://crrev.com/b7f90cae827044cfb2280c8382d993848ef33340/third_party/WebKit/LayoutTests/vr/resources/mock-vr-service.js
[modify] https://crrev.com/b7f90cae827044cfb2280c8382d993848ef33340/third_party/WebKit/Source/modules/vr/NavigatorVR.cpp
[modify] https://crrev.com/b7f90cae827044cfb2280c8382d993848ef33340/third_party/WebKit/Source/modules/vr/VRDisplay.cpp

Status: Fixed (was: Started)

Comment 9 by hdodda@chromium.org, Jan 17 2017

Cc: hdodda@chromium.org
Labels: Needs-Feedback
Tested on Windows 7 using chrome M57 #57.0.2970.0 and followed the steps :

1. Navigated to https://webvr.info/samples/03-vr-presentation.html in chrome.
2. Attached nexus 5 device to windows 7 and inspected the page "https://webvr.info/samples/03-vr-presentation.html" from Chrome://inspect
3. Verified that device is connected remotely in chrome dev tools and pasted the code given in comment #0 in web console.
4. No crash is seen .

Attached screencast for reference.

@bsheedy-- Could you please check the attacehd screencast and help us in verifying the issue by providing more steps to reproduce the issue . 

Thanks!
679952.mp4
2.3 MB View Download
You seem to be mixing testing for desktop (currently does not support WebVR) and Android, and copy-pasting the entire blob into the console won't work since there's some non-code text in there indicating what the user should be doing (completing the DON flow). Copy-paste each of the lines of code individually, and it should work.

To test on Windows, you don't need to attach an android device, just access the page's console. However, it isn't expected that anything will happen - the navigator.getVRDisplays call should fail since WebVR support hasn't been added to desktop.

To test on Android, you need to open the page on the Android device and inspect the page under the "Devices" section of chrome://inspect.
Components: Blink>WebXR

Sign in to add a comment