RFR (s): JDK-8013136 NPG: Parallel class loading tests fail after fix for JDK-8011802

Coleen Phillimore coleen.phillimore at oracle.com
Wed Apr 24 16:38:01 UTC 2013


The copy constructor of dependencies into the ClassLoaderData 
constructor looks odd to me but it's correct.  I did review this better 
this time and it looks good.

Thanks,
Coleen

On 4/24/2013 12:01 PM, Mikael Gerdin wrote:
> Hi,
> here we go again...
>
> Problem:
> My attempt at fixing JDK-8011802 was flawed since the ClassLoaderData 
> constructor saves the raw class loader oop.
> Since my fix called init_dependencies() after constructing the 
> ClassLoaderData the j.l.ClassLoader may have moved and we would crash 
> later on when trying to look at the _class_loader field.
>
> Suggested fix:
> I suggest that we move the initialization of the Dependencies object 
> to before we create the ClassLoaderData and pass the Dependencies 
> object by value to the ClassLoaderData constructor (it only contains 
> one pointer so there should be no additional overhead in this copy).
>
> This way we also get rid of the need to delete the CLD if we got an 
> exception allocating the Dependencies.
>
> I moved the No_Safepoint_Verifier to before we allocate the 
> ClassLoaderData so that it protects the _class_loader oop as well.
>
> Since we no longer need an explicit initialization of dependencies in 
> the general case I added some assertions to init_dependencies() since 
> it's only needed for the boot class loader now.
>
> I also took the liberty to remove the left-over
> "if (cld_addr != NULL)" check since that was used to determine if we 
> were dealing with a CLD for an anonymous class. Since the check for 
> is_anonymous is right before this and we only read the cld_addr we are 
> dealing with a normal class loader the check is unnecessary.
>
> Webrev: http://cr.openjdk.java.net/~mgerdin/8013136/webrev.0/
> jbs: https://jbs.oracle.com/bugs/browse/JDK-8013136
> bugs.sun.com (bug not visible yet): 
> http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8013136
>
> Testing:
> nashorn test262parallel and parallel class loading tests
>
> /Mikael




More information about the hotspot-gc-dev mailing list