Open utgheith opened 3 weeks ago
I am facing the same issue, but the method in question is java.time.LocalDateTime.now()
.
Calling it from a virtual thread produces the same error:
Suppressed: java.lang.IllegalThreadStateException: StackValue must not be used in a virtual thread unless the method is annotated @Uninterruptible.
at org.graalvm.nativeimage.builder/com.oracle.svm.core.graal.stackvalue.StackValueSnippets.throwNewException(StackValueSnippets.java:103)
at java.base@21.0.2/jdk.internal.misc.VM.getNanoTimeAdjustment(VM.java:42)
at java.base@21.0.2/java.time.Clock.currentInstant(Clock.java:498)
at java.base@21.0.2/java.time.Clock$SystemClock.instant(Clock.java:614)
at java.base@21.0.2/java.time.LocalDateTime.now(LocalDateTime.java:213)
at java.base@21.0.2/java.time.LocalDateTime.now(LocalDateTime.java:182)
Describe the Issue
This program works with GraalVM:21 but fails with GraalVM:22 and GraalVM:23
Using the latest version of GraalVM can resolve many issues.
GraalVM Version
openjdk version "23.0.1" 2024-10-15 OpenJDK Runtime Environment GraalVM CE 23.0.1+11.1 (build 23.0.1+11-jvmci-b01) OpenJDK 64-Bit Server VM GraalVM CE 23.0.1+11.1 (build 23.0.1+11-jvmci-b01, mixed mode, sharing)
Operating System and Version
Darwin ags-imac.lan 22.6.0 Darwin Kernel Version 22.6.0: Mon Jun 24 01:25:37 PDT 2024; root:xnu-8796.141.3.706.2~1/RELEASE_X86_64 x86_64
Diagnostic Flag Confirmation
-H:ThrowMissingRegistrationErrors=
flag.Run Command
Expected Behavior
Actual Behavior
Steps to Reproduce
(1) put the graalvm binaries in your path (2) create a file named Bad.java and put the code above in it (3)
javac Bad.jva
(4)native-image -cp . Bad
(5) ./badAdditional Context
Tried on different Ubuntu releases, same problem
Run-Time Log Output and Error Messages