RFR (M): JDK-8159262: Walking PackageEntry Export and ModuleEntry Reads Must Occur Only When Neccessary And Wait Until ClassLoader's Aliveness Determined

Mandy Chung mandy.chung at oracle.com
Wed Jun 22 03:33:39 UTC 2016


Platform class loader [1] is previously known as the extension class loader.  We have deprivileged several Java SE modules to be defined by the platform class loader instead of the boot loader. They are not granted with all permissions by default. The class spec of ClassLoader has a section [2] to describe the built-in class loaders. 

Mandy
[1] http://download.java.net/java/jdk9/docs/api/java/lang/ClassLoader.html#getPlatformClassLoader--
[2] http://download.java.net/java/jdk9/docs/api/java/lang/ClassLoader.html#builtinLoaders

> On Jun 21, 2016, at 5:51 PM, David Holmes <david.holmes at oracle.com> wrote:
> 
> Hi Lois,
> 
> Initial question: what is the platform classloader versus the application classloader?
> 
> Thanks,
> David
> 
> On 22/06/2016 3:59 AM, Lois Foltan wrote:
>> Hello,
>> 
>> Please review the following fix:
>> 
>> Webrev:
>>    http://cr.openjdk.java.net/~lfoltan/bug_jdk8159262/webrev/
>> 
>> Bug: Walking PackageEntry Export and ModuleEntry Reads Must Occur Only
>> When Neccessary And Wait Until ClassLoader's Aliveness Determined
>>    https://bugs.openjdk.java.net/browse/JDK-8159262
>> 
>> Summary:
>> In ClassLoaderDataGraph::do_unloading(), the decision to walk each
>> ClassLoader's PackageEntry exports and ModuleEntry's reads list was
>> occurring too soon, before the aliveness of all class loaders was
>> determined.  The walk has been moved to immediately after and only alive
>> ClassLoader's PackageEntry and ModuleEntry lists are walked.
>> 
>> The other piece to this fix is that the lists themselves were being
>> unnecessarily walked if only modules on any given list were either:
>>    1. defined to the same class loader as either the package being
>> exported or the module that a read edge was being
>>        established from.  Thus both modules in this equation have the
>> same life cycle.
>>    2. or defined to one of the three builtin class loaders (boot,
>> application or platform) which never die
>> 
>> Test:
>> - java/io, java/lang/, java/util, all Hotspot jtreg tests, JCK vm & lang
>> - full hotspot nightly RBT run in progress



More information about the hotspot-dev mailing list