On Sun, 8 Sep 2024 15:30:21 GMT, SendaoYan <s...@openjdk.org> wrote:

> Hi all,
>   The newly added testcase 
> `serviceability/jvmti/vthread/TestPinCaseWithCFLH/TestPinCaseWithCFLH.java` 
> fails with `-Xcomp` jvm option. The jvm option `-Xcomp` will make 
> `BackgroundCompilation` false. In this test, disable `BackgroundCompilation` 
> will make `instrumentation` in `premain` throw 
> `java.util.MissingResourceException` in some test  environments. If I add 
> `Thread.sleep(1000)` or `System.gc();` before 
> `instrumentation.addTransformer`, this test also passed with `-Xcomp`.
>    So, I think it's necessary add `-XX:+BackgroundCompilation` option for 
> this test to make this test more robustness, to make this test run passed 
> with `-Xcomp` option.
>   Test-fix only, no risk.

I assume the sleep or System.gc is just delaying the install of the 
transformer. I think this issue will require more investigation. The "main" 
method hasn't run so I assume the issue is nothing to do with virtual threads 
and the diagnostic option, instead it's the transformer being invoked for 
launcher classes and this seems to be racing with other initialization, leading 
to the ClassCircularityError.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/20906#issuecomment-2337582370

Reply via email to