- 
                Notifications
    
You must be signed in to change notification settings  - Fork 1.8k
 
Description
Describe the Issue
Enso is using so called "dual JVM mode". A native image process uses LoadLibraryA to dynamically load HotSpot JVM.
This used to work in graalvm-community-openjdk-24.0.1+9.1 on Linux, Macs, Windows.
It is broken on Windows since graalvm-community-openjdk-25+15.1 (it still works on Linux and Macs).
Analysis has revealed
- the problem is in the linking process.
 - there is too many /EXPORTS in GraalVM 25 version!
 
E.g. the cause is known. However it is not clear what commit has changed the behavior and how to mitigate that.
Using the latest version of GraalVM can resolve many issues.
- I tried with the latest version of GraalVM.
 
GraalVM Version
The behavior is on Windows since graalvm-community-openjdk-25+15.1. Previous version  graalvm-community-openjdk-24.0.1+9.1 used to work fine.
Operating System and Version
Windows 11
Troubleshooting Confirmation
- I tried the suggestions in the troubleshooting guide.
 
Run Command
I have prepared a sample project pull request demonstrating the failure. Get the source, checkout UseNio branch and then:
$ mvn -Pnative package
$  ./target/LaunchJdkViaJni.exe org/apidesign/demo/launchjdkviajni/DumpDisk
we seem to be green on old GraalVM versions, but red on GraalVM 25:
Expected Behavior
- the sample project works as it used to work on GraalVM for JDK21 and GraalVM for JDK24
 - on a deeper level we have to convince the linker
 - to link the JNI method to the dynamically loaded 
nio.dlland not to global symbol from native image 
Actual Behavior
$ mvn -Pnative package
$  ./target/LaunchJdkViaJni.exe org/apidesign/demo/launchjdkviajni/DumpDisk
we seem to be green on old GraalVM versions, but red on GraalVM 25:
Steps to Reproduce
I have prepared a sample project pull request demonstrating the failure. Get the source, checkout UseNio branch and then:
$ export JAVA_HOME=/path/to/graalvm
$ mvn -Pnative package
$  ./target/LaunchJdkViaJni.exe org/apidesign/demo/launchjdkviajni/DumpDisk
this command succeeds with graalvm-community-openjdk-24.0.1+9.1 it  is broken on Windows since graalvm-community-openjdk-25+15.1
Additional Context
No response
Run-Time Log Output and Error Messages
No response