RFR(S): 8040237: nsk/jvmti/RetransformClasses/retransform001 crashed the VM on all platforms when run with with -server -Xcomp
Coleen Phillimore
coleen.phillimore at oracle.com
Thu Jul 10 21:09:23 UTC 2014
This looks good. There's a slight typo in one of the test files.
50 // loader2 must be firt on the list so loader 1 must be used first
Thanks!
Coleen
On 7/10/14, 3:28 PM, Roland Westrelin wrote:
> http://cr.openjdk.java.net/~roland/8040237/webrev.00/
>
> InstanceKlass::purge_previous_versions() is called on every classes of a class loader from ClassLoaderDataGraph::do_unloading() right before free_deallocate_list() for that class loader. Every reference to a method not on_stack() in the MDO is removed. The following call to free_deallocate_list() frees methods that are not on_stack() for that class loader. Every method that is on_stack() is not freed and references to that method are left as is.
> The crash happens because one method’s MDO can reference another method in another class loader. When that happens, the loop in ClassLoaderDataGraph::do_unloading() may call free_deallocate_list() and free redefined method m1 that is not on stack and a subsequent iteration will go over method m2's MDO that references m1 that is gone.
>
> This is fixed by first calling InstanceKlass::purge_previous_versions() on every class of every class loaders in case of class redefinition first and then only iterating again on all class loader data to free metadata.
>
> Coleen recommended the fix to CleanExtraDataMethodClosure::is_live().
>
> I also moved TestSpecTrapClassUnloading.java (test from a previous bug) to the correct subdirectory.
>
> Roland.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/hotspot-compiler-dev/attachments/20140710/8ecd41d3/attachment.html>
More information about the hotspot-compiler-dev
mailing list