-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Virtual threads and native image fails on NoSuchElementException #7818
Comments
Thank you for reporting, issue reproduced and we are looking into it |
Issue is fixed see #7923 and will be back-ported to 23.1 thanks to @peter-hofer |
Can you please tell me which version of GraalVM this fix is available in?
My app is: Kotlin 1.9.21, Java 21, Spring Boot 3.2 with Virtual Threads, Telegram Client. |
I'm getting the exact same error as well. Seemingly randomly when running Oracle GraalVM 21.0.1+12.1 (build 21.0.1+12-jvmci-23.1-b19). When will the fix be out? |
I apologize for the disturbance, but I believe this issue is critically important for business development. Would it be possible to release a fixed version based on GraalVM CE 21.0.1+12.1 (build 21.0.1+12-jvmci-23.1-b19)? I sincerely appreciate your assistance. Thank you very much. @hamzaGhaissi |
Issue already fixed, and will be released on the next EE/CE release of 23.1.2 on January |
Thank you for information. |
Actually the date for the CE release was update it and will be on the 16th of January ^_^ |
Today I built my application with the latest version of GraalVM - no error. Thanks!
My app is: Kotlin 1.9.22, Java 21, Spring Boot 3.2.1 with Virtual Threads, Telegram Client 6.8.0 |
Describe the issue
Running multithreaded program build to native image using virtual threads and AccessController causes java.util.NoSuchElementException: null
Problem occurs only with virtual threads. 2 virtual threads are enough to cause the problem. Platform threads works as expected see attached replicator.zip.
We found this issue trying to run spring boot application as native build with virtual threads. Our application was using Apache HTTP5 client to create SSL connections. It uses SSLConnectionSocketFactory which works with socket inside AccessController (which is modified during native build).
Steps to reproduce the issue
Build:
Run:
Describe GraalVM and your environment:
Environment used for replication of the issue:
java -version
openjdk version "21" 2023-09-19
OpenJDK Runtime Environment GraalVM CE 21+35.1 (build 21+35-jvmci-23.1-b15)
OpenJDK 64-Bit Server VM GraalVM CE 21+35.1 (build 21+35-jvmci-23.1-b15, mixed mode, sharing)
mvn -v
Apache Maven 3.8.7 (b89d5959fcde851dcb1c8946a785a163f14e1e29)
Maven home: /home/USER/apache-maven-3.8.7
Java version: 21, vendor: GraalVM Community, runtime: /aplikace/USER/graalvm-community-openjdk-21+35.1
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "5.14.0-284.30.1.el9_2.x86_64", arch: "amd64", family: "unix"
uname -a
Linux HOST 5.14.0-284.30.1.el9_2.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Aug 25 09:13:12 EDT 2023 x86_64 x86_64 x86_64 GNU/Linux
More details
Thread name: virtual-0 - 2
Thread name: virtual-0 - 2
Thread name: virtual-0 - 2
Thread name: virtual-0 - 2
Thread name: virtual-0 - 2
Thread name: virtual-0 - 2
Thread name: virtual-0 - 2
Thread name: virtual-0 - 2
Thread name: virtual-0 - 2
Thread name: virtual-0 - 2
Thread name: virtual-1 - 2
Thread name: virtual-0 - 2
Exception in thread "virtual-1" java.util.NoSuchElementException
at java.base@21/java.util.ArrayDeque.removeFirst(ArrayDeque.java:361)
at java.base@21/java.util.ArrayDeque.pop(ArrayDeque.java:592)
at org.graalvm.nativeimage.builder/com.oracle.svm.core.jdk.PrivilegedStack.pop(AccessControllerUtil.java:88)
at java.base@21/java.security.AccessController.executePrivileged(AccessController.java:116)
at java.base@21/java.security.AccessController.doPrivileged(AccessController.java:571)
at org.example.Main.lambda$main$1(Main.java:23)
at java.base@21/java.lang.VirtualThread.runWith(VirtualThread.java:341)
at java.base@21/java.lang.VirtualThread.run(VirtualThread.java:311)
at java.base@21/java.lang.VirtualThread$VThreadContinuation$1.run(VirtualThread.java:192)
Exception in thread "virtual-0" java.util.NoSuchElementException
at java.base@21/java.util.ArrayDeque.removeFirst(ArrayDeque.java:361)
at java.base@21/java.util.ArrayDeque.pop(ArrayDeque.java:592)
at org.graalvm.nativeimage.builder/com.oracle.svm.core.jdk.PrivilegedStack.pop(AccessControllerUtil.java:88)
at java.base@21/java.security.AccessController.executePrivileged(AccessController.java:116)
at java.base@21/java.security.AccessController.doPrivileged(AccessController.java:571)
at org.example.Main.lambda$main$1(Main.java:23)
at java.base@21/java.lang.VirtualThread.runWith(VirtualThread.java:341)
at java.base@21/java.lang.VirtualThread.run(VirtualThread.java:311)
at java.base@21/java.lang.VirtualThread$VThreadContinuation$1.run(VirtualThread.java:192)
The text was updated successfully, but these errors were encountered: