RFR: 8038468: java/lang/instrument/ParallelTransformerLoader.sh fails with ClassCircularityError

Karen Kinnear karen.kinnear at oracle.com
Wed Nov 26 22:55:38 UTC 2014


Yumin,

Looks good. thanks very much,
Karen

On Nov 26, 2014, at 5:36 PM, Yumin Qi wrote:

> Hi, please review again for new change for fixing the ClassCircularityError (CCE) in this test case.
> 
> More debug tails revealed that the CCE always happened at the beginning of the loop, before the real loading of TestClass[1-3] loaded, transform is called against system classes too (though they did not get loaded by agent). The check for loader which passed to transform is done before calling loading 'TestClass3', if it is null skip loading. This can prevent from loading loader itself before loading 'TestClass3', thus avoid seeing $JarLoader$2 twice on PlaceHolderTable. Meanwhile remove the block 'sleep' which is used to workaround deadlock at the beginning of transform. With the change which only loads class TestClass3 when loader is not null, this workaround is not needed. It is the loader loading caused both the issues here.
> 
> new URL:
> http://cr.openjdk.java.net/~minqi/8038468/webrev02/
> 
> 
> On 10/13/14, 3:58 PM, Yumin Qi wrote:
>> bug: https://bugs.openjdk.java.net/browse/JDK-8038468
>> webrev:*http://cr.openjdk.java.net/~minqi/8038468/webrev00/
>> 
>> the bug marked as confidential so post the webrev internally.
>> 
>> Problem: The test case tries to load a class from the same jar via agent in the middle of loading another class from the jar via same class loader in same thread. The call happens in transform which is a rare case --- in middle of loading class, loading another class. The result is a CircularityError. When first class is in loading, in vm we put JarLoader$2 on place holder table, then we start the defineClass, which calls transform, begins loading the second class so go along the same routine for loading JarLoader$2 first, found it already in placeholder table. A CircularityError is thrown.
>> Fix: The test case should not call loading class with same class loader in same thread from same jar in 'transform' method. I modify it loading with system class loader and we expect see ClassNotFoundException. Detail see bug comments.
>> 
>> Thanks
>> Yumin *



More information about the jdk9-dev mailing list