graalvm / graal-js-jdk11-maven-demo

An example project how to run Graal/JavaScript on JDK 11 with Graal as optimizing JIT compiler for best performance.
Universal Permissive License v1.0
177 stars 63 forks source link

not working on jdk 11.0.8 #35

Open frank-dspeed opened 4 years ago

frank-dspeed commented 4 years ago

mvn package

eration: 174
=== Graal.js via org.graalvm.polyglot.Context === 
=== Graal.js via javax.script.ScriptEngine ===
org.graalvm.polyglot.PolyglotException: jdk.vm.ci.common.JVMCIError: VM config values not expected to be present in JDK 11 linux-amd64 (java.home=/usr/lib/jvm/java-11-openjdk-amd64, java.vm.name=OpenJDK 64-Bit Server VM, java.vm.version=11.0.8+10-post-Ubuntu-0ubuntu120.04):
    CodeInstaller::FRAME_COMPLETE at jdk.internal.vm.compiler/org.graalvm.compiler.hotspot.GraalHotSpotVMConfig.<init>(GraalHotSpotVMConfig.java:886) [value: 6]
[ERROR] Tests run: 2, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 5.634 s <<< FAILURE! - in com.mycompany.app.AppTest
[ERROR] testGraalPolyglotSpeed(com.mycompany.app.AppTest)  Time elapsed: 0.498 s  <<< ERROR!
org.graalvm.polyglot.PolyglotException: 
jdk.vm.ci.common.JVMCIError: VM config values not expected to be present in JDK 11 linux-amd64 (java.home=/usr/lib/jvm/java-11-openjdk-amd64, java.vm.name=OpenJDK 64-Bit Server VM, java.vm.version=11.0.8+10-post-Ubuntu-0ubuntu120.04):
    CodeInstaller::FRAME_COMPLETE at jdk.internal.vm.compiler/org.graalvm.compiler.hotspot.GraalHotSpotVMConfig.<init>(GraalHotSpotVMConfig.java:886) [value: 6]

[INFO] 
[INFO] Results:
[INFO] 
[ERROR] Errors: 
[ERROR]   AppTest.testGraalPolyglotSpeed » Polyglot jdk.vm.ci.common.JVMCIError: VM conf...
[INFO] 
[ERROR] Tests run: 2, Failures: 0, Errors: 1, Skipped: 0
[INFO] 
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  9.543 s
[INFO] Finished at: 2020-08-31T19:44:27+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.1:test (default-test) on project my-app: There are test failures.
[ERROR] 
[ERROR] Please refer to /home/frank/graal-js-jdk11-maven-demo/target/surefire-reports for the individual test results.
[ERROR] Please refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream.
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

mvn exec:exec

frank@frank-MS-7821:~/graal-js-jdk11-maven-demo$ mvn exec:exec
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.google.inject.internal.cglib.core.$ReflectUtils$1 (file:/usr/share/maven/lib/guice.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
WARNING: Please consider reporting this to the maintainers of com.google.inject.internal.cglib.core.$ReflectUtils$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
[INFO] Scanning for projects...
[INFO] 
[INFO] ----------------------< com.mycompany.app:my-app >----------------------
[INFO] Building my-app 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- exec-maven-plugin:1.6.0:exec (default-cli) @ my-app ---
=== Graal.js via org.graalvm.polyglot.Context === 
Exception in thread "main" org.graalvm.polyglot.PolyglotException: jdk.vm.ci.common.JVMCIError: VM config values not expected to be present in JDK 11 linux-amd64 (java.home=/usr/lib/jvm/java-11-openjdk-amd64, java.vm.name=OpenJDK 64-Bit Server VM, java.vm.version=11.0.8+10-post-Ubuntu-0ubuntu120.04):
    CodeInstaller::FRAME_COMPLETE at jdk.internal.vm.compiler/org.graalvm.compiler.hotspot.GraalHotSpotVMConfig.<init>(GraalHotSpotVMConfig.java:886) [value: 6]
    at jdk.internal.vm.compiler/org.graalvm.compiler.hotspot.GraalHotSpotVMConfigAccess.reportErrors(GraalHotSpotVMConfigAccess.java:224)
    at jdk.internal.vm.compiler/org.graalvm.compiler.hotspot.GraalHotSpotVMConfig.<init>(GraalHotSpotVMConfig.java:67)
    at jdk.internal.vm.compiler/org.graalvm.compiler.hotspot.HotSpotGraalRuntime.<init>(HotSpotGraalRuntime.java:161)
    at jdk.internal.vm.compiler/org.graalvm.compiler.hotspot.HotSpotGraalCompilerFactory.createCompiler(HotSpotGraalCompilerFactory.java:156)
    at jdk.internal.vm.compiler/org.graalvm.compiler.hotspot.HotSpotGraalCompilerFactory.createCompiler(HotSpotGraalCompilerFactory.java:134)
    at jdk.internal.vm.compiler/org.graalvm.compiler.hotspot.HotSpotGraalCompilerFactory.createCompiler(HotSpotGraalCompilerFactory.java:52)
    at jdk.internal.vm.ci/jdk.vm.ci.hotspot.HotSpotJVMCIRuntime.getCompiler(HotSpotJVMCIRuntime.java:425)
    at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.compiler.hotspot.HotSpotTruffleCompilerImpl.getCompiler(HotSpotTruffleCompilerImpl.java:138)
    at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.compiler.hotspot.HotSpotTruffleCompilerImpl.create(HotSpotTruffleCompilerImpl.java:115)
    at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.hotspot.java.HotSpotTruffleRuntime.newTruffleCompiler(HotSpotTruffleRuntime.java:95)
    at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.hotspot.AbstractHotSpotTruffleRuntime.initializeTruffleCompiler(AbstractHotSpotTruffleRuntime.java:241)
    at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.hotspot.AbstractHotSpotTruffleRuntime.access$100(AbstractHotSpotTruffleRuntime.java:86)
    at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.hotspot.AbstractHotSpotTruffleRuntime$1.execute(AbstractHotSpotTruffleRuntime.java:207)
    at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.BackgroundCompileQueue$RequestImpl.call(BackgroundCompileQueue.java:188)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    at java.base/java.lang.Thread.run(Thread.java:834)
    at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.BackgroundCompileQueue$TruffleCompilerThreadFactory$1.run(BackgroundCompileQueue.java:230)
Original Internal Error: 
jdk.vm.ci.common.JVMCIError: VM config values not expected to be present in JDK 11 linux-amd64 (java.home=/usr/lib/jvm/java-11-openjdk-amd64, java.vm.name=OpenJDK 64-Bit Server VM, java.vm.version=11.0.8+10-post-Ubuntu-0ubuntu120.04):
    CodeInstaller::FRAME_COMPLETE at jdk.internal.vm.compiler/org.graalvm.compiler.hotspot.GraalHotSpotVMConfig.<init>(GraalHotSpotVMConfig.java:886) [value: 6]
    at jdk.internal.vm.compiler/org.graalvm.compiler.hotspot.GraalHotSpotVMConfigAccess.reportErrors(GraalHotSpotVMConfigAccess.java:224)
    at jdk.internal.vm.compiler/org.graalvm.compiler.hotspot.GraalHotSpotVMConfig.<init>(GraalHotSpotVMConfig.java:67)
    at jdk.internal.vm.compiler/org.graalvm.compiler.hotspot.HotSpotGraalRuntime.<init>(HotSpotGraalRuntime.java:161)
    at jdk.internal.vm.compiler/org.graalvm.compiler.hotspot.HotSpotGraalCompilerFactory.createCompiler(HotSpotGraalCompilerFactory.java:156)
    at jdk.internal.vm.compiler/org.graalvm.compiler.hotspot.HotSpotGraalCompilerFactory.createCompiler(HotSpotGraalCompilerFactory.java:134)
    at jdk.internal.vm.compiler/org.graalvm.compiler.hotspot.HotSpotGraalCompilerFactory.createCompiler(HotSpotGraalCompilerFactory.java:52)
    at jdk.internal.vm.ci/jdk.vm.ci.hotspot.HotSpotJVMCIRuntime.getCompiler(HotSpotJVMCIRuntime.java:425)
    at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.compiler.hotspot.HotSpotTruffleCompilerImpl.getCompiler(HotSpotTruffleCompilerImpl.java:138)
    at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.compiler.hotspot.HotSpotTruffleCompilerImpl.create(HotSpotTruffleCompilerImpl.java:115)
    at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.hotspot.java.HotSpotTruffleRuntime.newTruffleCompiler(HotSpotTruffleRuntime.java:95)
    at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.hotspot.AbstractHotSpotTruffleRuntime.initializeTruffleCompiler(AbstractHotSpotTruffleRuntime.java:241)
    at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.hotspot.AbstractHotSpotTruffleRuntime.access$100(AbstractHotSpotTruffleRuntime.java:86)
    at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.hotspot.AbstractHotSpotTruffleRuntime$1.execute(AbstractHotSpotTruffleRuntime.java:207)
    at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.BackgroundCompileQueue$RequestImpl.call(BackgroundCompileQueue.java:188)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    at java.base/java.lang.Thread.run(Thread.java:834)
    at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.BackgroundCompileQueue$TruffleCompilerThreadFactory$1.run(BackgroundCompileQueue.java:230)
Caused by: Attached Guest Language Frames (0)
[ERROR] Command execution failed.
org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit value: 1)
    at org.apache.commons.exec.DefaultExecutor.executeInternal (DefaultExecutor.java:404)
    at org.apache.commons.exec.DefaultExecutor.execute (DefaultExecutor.java:166)
    at org.codehaus.mojo.exec.ExecMojo.executeCommandLine (ExecMojo.java:804)
    at org.codehaus.mojo.exec.ExecMojo.executeCommandLine (ExecMojo.java:751)
    at org.codehaus.mojo.exec.ExecMojo.execute (ExecMojo.java:313)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:566)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  1.112 s
[INFO] Finished at: 2020-08-31T19:53:05+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.6.0:exec (default-cli) on project my-app: Command execution failed.: Process exited with an error: 1 (Exit value: 1) -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

Related es4x vertx issue

We got the same error with es4x that we have with mvn package and install

Exception in thread "main" org.graalvm.polyglot.PolyglotException: jdk.vm.ci.common.JVMCIError: VM config values not expected to be present in JDK 11 linux-amd64 (java.home=/usr/lib/jvm/java-11-openjdk-amd64, java.vm.name=OpenJDK 64-Bit Server VM, java.vm.version=11.0.8+10-post-Ubuntu-0ubuntu120.04):

wirthi commented 4 years ago

Hi,

thanks for bringing this up. We seem to have too strict checks for certain arguments ("VM config values" in the error message) that keep changing across JDK versions. We thought we had this fixed but it seems to be creeping up again. We are working on a fix to be shipped in GraalVM 20.3.0.

It seems to work fine on JDK-11.0.6, but is broken on 11.0.7 and 11.0.8.

(internally tracked as GR-25899)

Best, Christian

dougxc commented 4 years ago

Tracked by GR-25899.

ee08b397 commented 8 months ago

GraalVM doesn't work with one of the unit tests and gives AppTest.testGraalPolyglotSpeed:59 » NoClassDefFound Could not initialize class.... Need to switch to the "stock JDK" as mentioned in the https://github.com/graalvm/graal-js-jdk11-maven-demo/blob/master/README.md#running-graaljs-on-stock-jdk11.

E.g., this won't work Java version: 11.0.18, vendor: GraalVM Community, runtime: /Library/Java/JavaVirtualMachines/graalvm-ce-java11-22.3.1/Contents/Home

This works Java version: 11.0.11, vendor: AdoptOpenJDK, runtime: /Library/Java/JavaVirtualMachines/adoptopenjdk-11.jdk/Contents/Home

frank-dspeed commented 8 months ago

@ee08b397 overall your observation is correct the main focus is now on stock jdk as most parts of GraalVM eg: the jdk-cfi (compiler feedback interface) got implemented directly into upstream stock jdk and it is planned that stock jdk get stable without additional graal patches.