RFR: 8038468: java/lang/instrument/ParallelTransformerLoader.sh fails with ClassCircularityError
serguei.spitsyn at oracle.com
serguei.spitsyn at oracle.com
Fri Oct 24 20:20:07 UTC 2014
Hi Yumin,
Below is some analysis to make sure I understand the test scenario
correctly.
The ParallelTransformerLoaderApp.main() executes a 1000 iteration loop.
At each iteration it does:
- creates and starts a new TestThread
- loads TestClass1 with the current class loader:
ParallelTransformerLoaderAgent.getClassLoader()
- changes the current class loader with new one:
ParallelTransformerLoaderAgent.generateNewClassLoader()
The TestThread loads the TestClass2 concurrently with the main thread.
At the CFLH events, the ParallelTransformerLoaderAgent does the class
retransformation.
If the thread loading the class is not "main", it loads the class TestClass3
with the current class loader
ParallelTransformerLoaderAgent.getClassLoader().
Sometimes, the TestClass2 and TestClass3 are loaded by the same class
loader recursively.
It happens if the class loader has not been changed between loading
TestClass2 and TestClass3 classes.
I'm not convinced yet the test is incorrect.
And it is not clear why do we get a ClassCircularityError.
Please, let me know if the above understanding is wrong.
I also see the reply from David and share his concerns.
It is not clear if this failure is a regression.
Did we observe this issue before?
If - NOT then when and why had this failure started to appear?
Unfortunately, it is impossible to look at the test run history at the
moment.
The Aurora is at a maintenance.
Thanks,
Serguei
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