RFR: 8342295: compiler/jvmci/TestJVMCISavedProperties.java fails due to garbage in output

Doug Simon dnsimon at openjdk.org
Fri Oct 18 14:07:09 UTC 2024


On Fri, 18 Oct 2024 13:54:14 GMT, Tomáš Zezula <duke at openjdk.org> wrote:

> The `compiler/jvmci/TestJVMCISavedProperties` test fails due to overlapping output from the saved system properties. The initialization of `savedProperties` in `jdk.vm.ci.services.Services` is correctly synchronized, the issue suggests that two separate libjvmci compiler isolates are each printing their own set of saved properties.
> 
> In a successful test run, the `CompileBroker` thread aborts the VM before it completes initialization, displaying the error message `Cannot use JVMCI compiler: Value of jvmci.Compiler is “null”` (due to the `-Djvmci.Compiler=null` setting), and the message `DONE IN MAIN` is never printed. However, in the failed test output, the `DONE IN MAIN` message appears, indicating that the VM initialization completed and created the `JVMCIRuntime` instance. The `CompileBroker` thread might have concurrently initialized `JVMCIRuntime` in another isolate. Since each `JVMCIRuntime` initialization outputs system properties, this is likely the cause of the overlapping output.
> 
> The proposed solution is to use the `-XX:+EnableJVMCI` flag instead of `-XX:+UseJVMCICompiler`, to avoid this issue.

Looks good to me - thanks for fixing it.

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

PR Review: https://git.openjdk.org/jdk/pull/21583#pullrequestreview-2378172430


More information about the hotspot-compiler-dev mailing list