Skip to content

[Native Image] Generated .exe file exports way more symbols in GraalVM 25 - compared to GraalVM 24 #12384

@JaroslavTulach

Description

@JaroslavTulach

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

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.

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

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:

image

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.dll and 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:

image

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions