Open xuwang-zuora opened 1 month ago
Hi @xuwang-zuora, Thanks for reaching out to us. We'll take a look into this as soon as possible.
I followed the steps provided in your reproducer but encountered a different error when running the command mvn clean package.
The error message indicates that the Maven Surefire Plugin failed due to the forked VM terminating unexpectedly.
[ERROR]
[ERROR] Please refer to the individual test results in the surefire-reports directory.
[ERROR] The forked VM terminated without properly saying goodbye. VM crash or System.exit called?
[ERROR] Command was: java -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI --upgrade-module-path=target/graalvm -Xmx512m -jar target/surefire/surefirebooter-20240627152117393_3.jar target/surefire 2024-06-27T15-21-17_353-jvmRun1 surefire-20240627152117393_1tmp surefire_0-20240627152117393_2tmp
[ERROR] Error occurred in starting fork, check output in log
[ERROR] Process Exit Code: 1
[ERROR] org.apache.maven.surefire.booter.SurefireBooterForkException: The forked VM terminated without properly saying goodbye. VM crash or System.exit called?
[ERROR] Command was: java -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI --upgrade-module-path=target/graalvm -Xmx512m -jar target/surefire/surefirebooter-20240627152117393_3.jar target/surefire 2024-06-27T15-21-17_353-jvmRun1 surefire-20240627152117393_1tmp surefire_0-20240627152117393_2tmp
[ERROR] Error occurred in starting fork, check output in log
[ERROR] Process Exit Code: 1
Can you double check the provided reproducer please?
@selhagani thanks for responding, I'm not sure which version of maven you're using, what's why I provided the maven wrapper which is pointing to 3.9.7 which is the version I'm using.
You can bypass the test when building by using mvn clean package -DskipTests
and then run the unit test DemoAppTest
separately, pls be aware that I've already included a run configuration for IntelliJ IDEA, if you're using another IDE, you might need to add additional VM options when running, something like -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI --upgrade-module-path=$PROJECT_DIR$/target/graalvm
to enable the compiler for js which I believe you should be familiar with, the path $PROJECT_DIR$/target/graalvm
is where depended jar files are downloaded, you should be able to find them after a successful maven build.
This looks like version mismatch where a JDK version is being used with an incompatible version of Graal. Can you reproduce this on a GraalVM build from https://github.com/graalvm/graalvm-ce-dev-builds/releases?
@dougxc could you pls provide some instruction about how to use those dev releases in a maven project?
I don't know how to do that but @chumer might be able to help you.
I didn't get a chance to try the dev build, but I've checked the released 24.0.1, it gave me an error says: Module jdk.graal.compiler does not read a module that exports jdk.vm.ci.services
, after added VM option --add-export jdk.vm.ci.services
to the argument, the error changed to Module jdk.vm.ci.services not found
.
I did some digging, and found https://github.com/oracle/graal/issues/7651#issuecomment-2007941934 which bring me to https://bugs.openjdk.org/browse/JDK-8318027, it seems jdk.vm.ci.services is only available for jdk version higher than 22, so I believe version 24.0.1 is not compatible with jdk 17 which I'm currently using.
Since I can not upgrade the jdk I'm using in the project to 22 which is a not a TLS version, for this particular issue, I need it to be fixed in a JDK 17 compatible version which might be the 23.x.x, latest dev builds won't help on this issue.
after added VM option --add-export jdk.vm.ci.services to the argument
From java -X
:
--add-exports <module>/<package>=<target-module>(,<target-module>)*
updates <module> to export <package> to <target-module>,
regardless of module declaration.
<target-module> can be ALL-UNNAMED to export to all
unnamed modules.
So the correct format is --add-export=jdk.internal.vm.ci/jdk.vm.ci.services=jdk.graal.compiler
You can download GraalVM for JDK 17 at https://www.graalvm.org/downloads.
You need polyglot version 23.0.4 to work with GraalVM for JDK17 (current version JDK 17.0.11). I can see you have the version 23.1.3 specified in your pom.xml. For that you would need GraalVM for JDK21 (current version JDK 21.0.3).
Also please note that there were major changes between GraalVM for JDK17 and GraalVM for JDK21. This is explained in the blogpost https://medium.com/graalvm/truffle-unchained-13887b77b62c. Your project seems to be a mixture of the old and the new setup. The old setup is documented here: https://www.graalvm.org/jdk17/reference-manual/embed-languages/
Describe GraalVM and your environment :
java -Xinternalversion
:Have you verified this issue still happens when using the latest snapshot? You can find snapshot builds here: https://github.com/graalvm/graalvm-ce-dev-builds/releases
Describe the issue Hit
Internal GraalVM error, please report at https://github.com/oracle/graal/issues/.
when running js using polyglot api.Code snippet or code repository that reproduces the issue https://github.com/xuwang-zuora/polyglot-bug-report
Steps to reproduce the issue Please include both build steps as well as run steps
git clone --depth 1 https://github.com/xuwang-zuora/polyglot-bug-report
./mvnw clean package -DskipTests
DemoAppTest
Expected behavior I expect the unit test should always pass, but the odd thing is, sometime the first run after build works, but if you re-run it several times, it starts to fail and stays that way until another round of mvn clean package.
Additional context Add any other context about the problem here. Specially important are stack traces or log output. Feel free to link to gists or to screenshots if neccesary