-
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
[GR-63337] [Native Image] GraalVM 24 deadlocks building with two jar files in the class path when only one CPU is available #10891
Comments
@puni073 thanks you for your reproducer. The moment there is more than one classpath-entry on |
As expected, using diff --git a/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/NativeImageClassLoaderSupport.java b/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/NativeImageClassLoaderSupport.java
--- a/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/NativeImageClassLoaderSupport.java (revision Staged)
+++ b/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/NativeImageClassLoaderSupport.java (date 1742469424089)
@@ -817,7 +817,7 @@
initModule(moduleReference, true);
}
- classpath().parallelStream().forEach(this::loadClassesFromPath);
+ classpath().stream().forEach(this::loadClassesFromPath);
} finally {
scheduledExecutor.shutdown();
} makes the issue go away. But this is not a proper fix. I will look into the root cause and let you know. |
Hi @puni073, Thank you for reaching out to us and for sharing the reproducer. I tested things on my end and as you said on the new release we do notice the error you mentioned unlike testing on an older release (23.0.2) |
If I replace I assume |
Describe the Issue
GraalVM 24
taskset -c 0 native-image -cp Main.jar:HelloWorld.jar Main -o MainApp
deadlocks.GraalVM 23.0.2 works.
taskset -c 0,1
or-cp Main.jar
works.Using the latest version of GraalVM can resolve many issues.
GraalVM Version
openjdk version "24" 2025-03-18
OpenJDK Runtime Environment GraalVM CE 24+36.1 (build 24+36-jvmci-b01)
OpenJDK 64-Bit Server VM GraalVM CE 24+36.1 (build 24+36-jvmci-b01, mixed mode, sharing)
Operating System and Version
DISTRIB_ID=Ubuntu DISTRIB_RELEASE=24.04 DISTRIB_CODENAME=noble DISTRIB_DESCRIPTION="Ubuntu 24.04.2 LTS"
Build Command
taskset -c 0 native-image -cp Main.jar:HelloWorld.jar Main -o MainApp
Expected Behavior
Building starts.
Actual Behavior
Building never started and was aborted by the watchdog.
Steps to Reproduce
cat Main.java
cat HelloWorld.java
javac Main.java
javac HelloWorld.java
jar cf Main.jar Main.class
jar cf HelloWorld.jar HelloWorld.class
taskset -c 0 native-image -cp Main.jar:HelloWorld.jar Main -o MainApp
Additional Context
No response
Build Log Output and Error Messages
The text was updated successfully, but these errors were encountered: