Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8309974

some JVMCI tests fail when VM options include -XX:+EnableJVMCI

    XMLWordPrintable

Details

    • b03

    Backports

      Description

        make LOG=info TEST="compiler/jvmci" TEST_OPTS=VM_OPTIONS="-XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI" test

        results in these tests failing:

        compiler/jvmci/events/JvmciShutdownEventTest.java
        compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/HotSpotConstantReflectionProviderTest.java
        compiler/jvmci/meta/StableFieldTest.java

        Adding TEST_MODE=othervm makes the tests pass:

        make LOG=info TEST="compiler/jvmci" TEST_OPTS=VM_OPTIONS="-XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI" JTREG=TEST_MODE=othervm test

        As far as I can tell, this has something to do with these tests using the ClassFileInstaller to install a JVMCI specific test class AND requiring JVMCI modules to be exported. For example:

        /**
         * @test
         * @bug 8151664
         * @requires vm.jvmci
         * @library /test/lib /
         * @modules java.base/jdk.internal.misc
         * @modules java.base/jdk.internal.vm.annotation
         * jdk.internal.vm.ci/jdk.vm.ci.hotspot
         * jdk.internal.vm.ci/jdk.vm.ci.meta
         * jdk.internal.vm.ci/jdk.vm.ci.runtime
         *
         * @compile StableFieldTest.java
         * @run driver jdk.test.lib.helpers.ClassFileInstaller compiler.jvmci.meta.StableFieldTest
         * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -XX:-UseJVMCICompiler -Xbootclasspath/a:. compiler.jvmci.meta.StableFieldTest
         */

        I think what happens is that `TEST_OPTS=VM_OPTIONS="-XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI"` causes `@requires vm.jvmci` to evaluate to true but when ` jdk.test.lib.helpers.ClassFileInstaller compiler.jvmci.meta.StableFieldTest` is run, the java subprocess does not inherit the `-XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI` options and so it fails when trying to export the JVMCI modules:

        ACTION: driver -- Error. Can't init module exports: module not found: jdk.internal.vm.ci
        REASON: User specified action: run driver jdk.test.lib.helpers.ClassFileInstaller compiler.jvmci.meta.StableFieldTest
        TIME: 0.213 seconds
        messages:
        command: driver jdk.test.lib.helpers.ClassFileInstaller compiler.jvmci.meta.StableFieldTest
        reason: User specified action: run driver jdk.test.lib.helpers.ClassFileInstaller compiler.jvmci.meta.StableFieldTest
        started: Tue Jun 13 22:47:43 CEST 2023
        Mode: agentvm
        Agent id: 2
        Additional exports to unnamed modules from @modules: java.base/jdk.internal.misc java.base/jdk.internal.vm.annotation jdk.internal.vm.ci/jdk.vm.ci.hotspot jdk.internal.vm.ci/jdk.vm.ci.meta jdk.internal.vm.ci/jdk.vm.ci.runtime
        finished: Tue Jun 13 22:47:44 CEST 2023
        elapsed time (seconds): 0.213

        Attachments

          Issue Links

            Activity

              People

                dnsimon Douglas Simon
                dnsimon Douglas Simon
                Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: