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

Issue 651245 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Jan 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android , All
Pri: 1
Type: Bug
Proj-XR



Sign in to add a comment

VRServiceImpl might be leaking

Project Member Reported by dcheng@chromium.org, Sep 28 2016

Issue description

Just filing this to keep track of the issue. I was looking at some of the mojoms, and I noticed that VRService doesn't obey the typical convention (usually mojom structs/interfaces are defined in a nested mojom namespace to avoid naming conflicts).

More problematically, I think VRServiceImpl objects are leaked.

- It's allocated in https://cs.chromium.org/chromium/src/device/vr/vr_service_impl.cc?rcl=0&l=22, when we bind the incoming interface request
- We're not using StrongBinding, and mojo::Binding does not retain ownership of |this|
- The connection error handler does not appear to have any code path by which VRServiceImpl is deleted either: https://cs.chromium.org/chromium/src/device/vr/vr_service_impl.cc?rcl=1475076113&l=32
 

Comment 1 by dcheng@chromium.org, Sep 29 2016

Cc: -bajones@chromium.org
Owner: bajones@chromium.org
Status: Assigned (was: Available)
(Just to make sure this doesn't fall off the radar)
Labels: Proj-VR

Comment 3 by sko...@chromium.org, Oct 11 2016

Labels: -M-55 M-56
Components: Blink>WebVR
Ping Brandon/Klaus, is this something you're able to look at?  Seems like we'd want to merge a fix for this if it's a legit leak.

Comment 6 by dcheng@chromium.org, Dec 13 2016

Any updates? It looks like this is shipping behind an origin trial now: it would be good to address this before M56 is going to hit stable.
Owner: mthiesse@chromium.org
I'll look into this I guess.
Project Member

Comment 8 by bugdroid1@chromium.org, Dec 17 2016

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

commit 7980a0e0ca7f5a6abda7e57ab28fbf8f845bfbf8
Author: mthiesse <mthiesse@chromium.org>
Date: Sat Dec 17 07:35:55 2016

Fix leak in VRServiceImpl

This makes the implicit Strong Binding between the service and clients explicit, and fixes the service leaking when the binding is closed.

No functional changes here.

BUG= 651245 
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_site_isolation
#TBR-ing a simple rename to match style.
TBR=brettw@chromium.org

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

[modify] https://crrev.com/7980a0e0ca7f5a6abda7e57ab28fbf8f845bfbf8/content/browser/frame_host/render_frame_host_impl.cc
[modify] https://crrev.com/7980a0e0ca7f5a6abda7e57ab28fbf8f845bfbf8/device/vr/vr_display_impl.cc
[modify] https://crrev.com/7980a0e0ca7f5a6abda7e57ab28fbf8f845bfbf8/device/vr/vr_service_impl.cc
[modify] https://crrev.com/7980a0e0ca7f5a6abda7e57ab28fbf8f845bfbf8/device/vr/vr_service_impl.h

Labels: Merge-Request-56

Comment 10 by dimu@chromium.org, Dec 20 2016

Labels: -Merge-Request-56 Merge-Approved-56 Hotlist-Merge-Approved
Your change meets the bar and is auto-approved for M56 (branch: 2924)
Owner: bshe@chromium.org
Biao, would you mind merging this while I'm OOO?

Comment 12 by bshe@chromium.org, Dec 20 2016

https://codereview.chromium.org/2590883003 is created.
There were conflict in device/vr/vr_service_impl.cc file. Basically the two removed functions VRServiceImpl::Bind and VRServiceImpl::RemoveFromDeviceManager have different implementation in M56 and TOT. To solve the conflict, I removed them anyway. It looks safe but mthiesse@, can you take a look when you are free.

Comment 13 by bshe@chromium.org, Dec 20 2016

Actually, it is this CL that cause the conflict: https://codereview.chromium.org/2537723002
And there is a interface change from VRDevice::RemoveService to VRDevice::RemoveDisplay which we also need to update. I will do a local build to see if it works.
Project Member

Comment 14 by bugdroid1@chromium.org, Dec 21 2016

Labels: -merge-approved-56 merge-merged-2924
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/225bb8d94ed0a406519a9935c6577a2855aafed1

commit 225bb8d94ed0a406519a9935c6577a2855aafed1
Author: bshe <bshe@chromium.org>
Date: Wed Dec 21 18:49:43 2016

Fix leak in VRServiceImpl

This makes the implicit Strong Binding between the service and clients explicit, and fixes the service leaking when the binding is closed.

No functional changes here.

BUG= 651245 
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_site_isolation
TBR=brettw@chromium.org

Review-Url: https://codereview.chromium.org/2571323002
Cr-Commit-Position: refs/heads/master@{#439333}
(cherry picked from commit 7980a0e0ca7f5a6abda7e57ab28fbf8f845bfbf8)

Review-Url: https://codereview.chromium.org/2590883003 .
Cr-Commit-Position: refs/branch-heads/2924@{#581}
Cr-Branched-From: 3a87aecc31cd1ffe751dd72c04e5a96a1fc8108a-refs/heads/master@{#433059}

[modify] https://crrev.com/225bb8d94ed0a406519a9935c6577a2855aafed1/content/browser/frame_host/render_frame_host_impl.cc
[modify] https://crrev.com/225bb8d94ed0a406519a9935c6577a2855aafed1/device/vr/vr_display_impl.cc
[modify] https://crrev.com/225bb8d94ed0a406519a9935c6577a2855aafed1/device/vr/vr_service_impl.cc
[modify] https://crrev.com/225bb8d94ed0a406519a9935c6577a2855aafed1/device/vr/vr_service_impl.h

Labels: OS-Android
Status: Fixed (was: Assigned)
Thanks Biao, looks good.
Project Member

Comment 16 by bugdroid1@chromium.org, Jan 4 2017

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

commit 49f0745139f12e0a300bba313696a802efbc78cc
Author: mthiesse <mthiesse@chromium.org>
Date: Wed Jan 04 21:27:54 2017

Revert of Fix leak in VRServiceImpl (patchset #2 id:20001 of https://codereview.chromium.org/2590883003/ )

Reason for revert:
Causes crash on Chrome Beta 56.0.2924.51

Original issue's description:
> Fix leak in VRServiceImpl
>
> This makes the implicit Strong Binding between the service and clients explicit, and fixes the service leaking when the binding is closed.
>
> No functional changes here.
>
> BUG= 651245 
> CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_site_isolation
> TBR=brettw@chromium.org
>
> Review-Url: https://codereview.chromium.org/2571323002
> Cr-Commit-Position: refs/heads/master@{#439333}
> (cherry picked from commit 7980a0e0ca7f5a6abda7e57ab28fbf8f845bfbf8)
>
> Committed: https://chromium.googlesource.com/chromium/src/+/225bb8d94ed0a406519a9935c6577a2855aafed1

TBR=brettw@chromium.org,bshe@chromium.org
NOTRY=true
NOPRESUBMIT=true
NOTREECHECKS=true
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG= 651245 

Review-Url: https://codereview.chromium.org/2615723002
Cr-Commit-Position: refs/branch-heads/2924@{#669}
Cr-Branched-From: 3a87aecc31cd1ffe751dd72c04e5a96a1fc8108a-refs/heads/master@{#433059}

[modify] https://crrev.com/49f0745139f12e0a300bba313696a802efbc78cc/content/browser/frame_host/render_frame_host_impl.cc
[modify] https://crrev.com/49f0745139f12e0a300bba313696a802efbc78cc/device/vr/vr_display_impl.cc
[modify] https://crrev.com/49f0745139f12e0a300bba313696a802efbc78cc/device/vr/vr_service_impl.cc
[modify] https://crrev.com/49f0745139f12e0a300bba313696a802efbc78cc/device/vr/vr_service_impl.h

Labels: -Hotlist-Merge-Approved -merge-merged-2924
Status: Started (was: Fixed)
Status: Fixed (was: Started)
Well, this is still fixed in M57, only the backport to M56 broke.

I spent ~half a day trying to get M56 building with no success (build folks are looking into the issues I was having). I'd say this is probably not worth the effort and risk of fixing and backporting to M56. The impact of this leak should be tiny, as it's a small leak that only occurs when leaving or reloading a WebVR page (and WebVR is still gated on origin trial or chrome flag).

Feel free to reopen if you think it's worth me spending more time on.
Labels: -M-56 M-57
Components: -Blink>WebVR -UI>Browser>VR Internals>VR
Components: Internals>XR

Sign in to add a comment