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

Issue 704606 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner: ----
Closed: Jun 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 3
Type: Bug
Hotlist-MemoryInfra

Blocked on:
issue 581778



Sign in to add a comment

Memory UMA on Android is broken from M

Project Member Reported by ssid@chromium.org, Mar 23 2017

Issue description

I realized that Memory.Renderer.Large2 is broken from Android M and above.
Android M introduced some SELinux policy that prevents the browser from reading the /proc folder of renderer. I cannot trace back what change this is. On doing "setenforce 0" the metrics are recorded correctly. I think this is because my local build is an untrusted app. But lot of phones do not record Memory.Renderer.
UMA links: 
Nexus 5 
https://uma.googleplex.com/p/chrome/histograms/?endDate=20170319&dayCount=1&histograms=Memory.Browser.Large2%2CMemory.Renderer.Large2&fixupData=true&showMax=true&filters=channel%2Ceq%2C4%2Cplatform%2Ceq%2CA%2Cosflavor%2Ceq%2CAndroid_Marshmallow%2Chw_class%2Cone_of%2CNEXUS%205%7CNexus%205%7CNexus%205%20CAF%7CNexus%205%20SkyDragon%20Rom%7CNexus%205%20SkyDragonRom%7Cnexus%205%7CGoogle%20Nexus%205%7CLG%20NEXUS%205%2Cisofficial%2Ceq%2CTrue&implicitFilters=isofficial
M Nexus 6P
https://uma.googleplex.com/p/chrome/histograms/?endDate=20170319&dayCount=14&histograms=Memory.Browser.Large2%2CMemory.Renderer.Large2&fixupData=true&showMax=true&filters=channel%2Ceq%2C4%2Cplatform%2Ceq%2CA%2Cosflavor%2Ceq%2CAndroid_Marshmallow%2Chw_class%2Ceq%2CNexus%206P%2Cisofficial%2Ceq%2CTrue&implicitFilters=isofficial
M Samsung M (it works).
https://uma.googleplex.com/p/chrome/histograms/?endDate=20170319&dayCount=14&histograms=Memory.Browser.Large2%2CMemory.Renderer.Large2&fixupData=true&showMax=true&filters=channel%2Ceq%2C4%2Cplatform%2Ceq%2CA%2Cosflavor%2Ceq%2CAndroid_Marshmallow%2Chw_class%2Cregex%2CSAMSUNG%2Cisofficial%2Ceq%2CTrue&implicitFilters=isofficial
My belief: I always thought browser cannot read other processes /proc directory because of uid isolation. But magically it works on Samsung?

On Android N I think this restriction got stricter and even the trusted apps cannot read the renderer /proc files. This leaves us with NO phones recording Memory.Renderer metrics in N and O.
UMA links:
All N
https://uma.googleplex.com/p/chrome/histograms/?endDate=20170319&dayCount=14&histograms=Memory.Browser.Large2%2CMemory.Renderer.Large2&fixupData=true&showMax=true&filters=channel%2Ceq%2C4%2Cplatform%2Ceq%2CA%2Cosflavor%2Ceq%2CAndroid_N%2Cisofficial%2Ceq%2CTrue&implicitFilters=isofficial
Samsung N
https://uma.googleplex.com/p/chrome/histograms/?endDate=20170319&dayCount=14&histograms=Memory.Browser.Large2%2CMemory.Renderer.Large2&fixupData=true&showMax=true&filters=channel%2Ceq%2C4%2Cplatform%2Ceq%2CA%2Cosflavor%2Ceq%2CAndroid_N%2Chw_class%2Cregex%2CSAMSUNG%2Cisofficial%2Ceq%2CTrue&implicitFilters=isofficial

Given the facts above Memory.Total is pretty much garbage since it records just browser and gpu on some cases and renderers on some cases.

Related bugs and discussions: 
issue 581517
issue 581517

Do we wait till Memory-Infra UMA to fix this?

Primiano:
We solved this problem back then in memory-infra ( crbug.com/461788 ) by having logic that, on Android, dumps these stats from within each process, but we don't have something similar in the current UMA.
Given the current ongoing work, not sure how prioritary is to fix the existing UMA memory reporting pipeline, given that we have been in this state for a while now (however, if whoever maintains that wants to go ahead and fix it, I don't have any objection)
 

Comment 1 by ssid@chromium.org, Mar 23 2017

Blockedon: 581778
Cc: rsch...@chromium.org asvitk...@chromium.org tdres...@chromium.org
>  I think this is because my local build is an untrusted app
Just to clarify, this is not about "local" vs official build.

Almost every app (even if signed) is untrusted from a selinux viewpoint (trusted in this context means few core system processes). 
I think the bummer is that the browser process is in the untrusted_app domain, the renderer process is inside the isolated_app domain (even more restricted than untrusted) and SELinux forbids different domains from reading each other procs

Comment 3 by ssid@chromium.org, Jun 20 2017

Status: Fixed (was: Untriaged)
Fixed with the new UMA
Maybe you want to have a separate bug of the form "move memory.experimental uma to be the default ones" (or something along those lines) and dupe this bug against that.
Without too much context, if I am a generic person that lands on this bug, I would assume that "great, it has been fixed." and then look at the conventional Memory.Renderer.Large2 uma and be puzzled to discover that it wasn't the case.

Sign in to add a comment