New issue
Advanced search Search tips

Issue 676052 link

Starred by 2 users

Issue metadata

Status: WontFix
Owner:
Closed: Nov 2017
Cc:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 3
Type: Bug

Blocking:
issue 512357



Sign in to add a comment

Prevent non-browser processes from loading classes from secondary dex files

Project Member Reported by estevenson@chromium.org, Dec 20 2016

Issue description

For enabling multidex in release (see issue 512357 for more context), we'll need a way to ensure that non-browser processes don't access secondary dex files. Without this, if any class becomes used by the renderer, all RAM savings will be reversed and then some.

agrieve@ and I discussed several approaches, most of which involved blocking access to classes2.dex in some way which doesn't work since sandboxed processes can't access the file system.
 
One approach that will [most likely] work is hijacking the ClassLoader when Chrome starts and using a custom class loader that will ensure classes to be loaded are on the main dex list. Rough implementation idea for this is:
  - Modify build rules to add the main_dex_list as an asset
  - Subclass dalvik.system.PathListClassLoader and override loadClass() to check the main dex for the class to be loaded. If found, delegate class loading to the actual classloader, crash if not.
  - Don't do this in official builds
Status: Assigned (was: Started)
Not currently working on this.

A couple of hacky prototypes I wrote a while back:

1) Disable access to secondary dex files in isolated processes (https://codereview.chromium.org/2499923003/)

2) Fail when we try to load classes that aren't in the main_dex_list (https://codereview.chromium.org/2845773004/) 
Status: WontFix (was: Assigned)
This likely won't save us any disk space since optimized dex files will still be created with this approach so we're going to take the custom dex loading route.

Sign in to add a comment