Closed
Description
Describe the issue
After upgrade graalVM jdk 22, native build failed.
Steps to reproduce the issue
Please include both build steps as well as run steps
git clone --single-branch --branch jdk22 git@github.com:optimism-java/hildr.git
//if local is linux
./gradlew buildBinary
//if local is non linux
cd docker
COMPOSE_PROFILES=hildr-node-native,op-geth,metrics docker compose up -d
Describe GraalVM and your environment:
- GraalVM version (latest snapshot builds can be found here), or commit id if built from source: [e.g. EE 19.3, CE 20.0, CE 20.1.0-dev-20200304_0848]
- JDK major version: 22
- OS: ubuntu latest
- Architecture: AMD64
More details
Consider adding the --native-image-info
and --verbose
flags when building your native image and paste output below.
Add any other information about the problem here. Especially important are stack traces or log output. Feel free to link to gists or to screenshots if necessary.
398.0 Error: Detected a FileDescriptor in the image heap. File descriptors opened during image generation are no longer open at image runtime, and the files might not even be present anymore at image runtime. Try avoiding to initialize the class that caused initialization of the FileDescriptor.
398.0 The culprit object has been instantiated by the 'sun.security.provider.SunEntries' class initializer with the following trace:
398.0 at java.io.FileDescriptor.<init>(FileDescriptor.java:127)
398.0 at java.io.FileInputStream.<init>(FileInputStream.java:149)
398.0 at sun.security.provider.FileInputStreamPool.getInputStream(FileInputStreamPool.java:110)
398.0 at sun.security.provider.NativePRNG$RandomIO.<init>(NativePRNG.java:390)
398.0 at sun.security.provider.NativePRNG$1.run(NativePRNG.java:192)
398.0 at sun.security.provider.NativePRNG$1.run(NativePRNG.java:132)
398.0 at java.security.AccessController.executePrivileged(AccessController.java:778)
398.0 at java.security.AccessController.doPrivileged(AccessController.java:319)
398.0 at sun.security.provider.NativePRNG.initIO(NativePRNG.java:131)
398.0 at sun.security.provider.NativePRNG.<clinit>(NativePRNG.java:93)
398.0 at sun.security.provider.SunEntries.<clinit>(SunEntries.java:362)
398.0 The object was probably created by a class initializer and is reachable from a static field. You can request class initialization at image runtime by using the option --initialize-at-run-time=<class-name>. Or you can write your own initialization methods and call them explicitly from your main entry point.
398.0 Trace: Object was reached by
398.0 reading field java.io.FileInputStream.fd of constant
398.0 java.io.FileInputStream@4f24c58e: java.io.FileInputStream@4f24c58e
398.0 reading field java.io.FilterInputStream.in of constant
398.0 sun.security.provider.FileInputStreamPool$UnclosableInputStream@7a7afc35: sun.security.provider.FileInputStreamPool$UnclosableInputStream@7a7afc35
398.0 reading field sun.security.provider.NativePRNG$RandomIO.seedIn of constant
398.0 sun.security.provider.NativePRNG$RandomIO@fefb164: sun.security.provider.NativePRNG$RandomIO@fefb164
398.0 reading static field sun.security.provider.NativePRNG$Blocking.INSTANCE
398.0 at <unknown-location>
398.0 registered as read because: null
398.0 Error: Detected a FileDescriptor in the image heap. File descriptors opened during image generation are no longer open at image runtime, and the files might not even be present anymore at image runtime. Try avoiding to initialize the class that caused initialization of the FileDescriptor.
398.0 The culprit object has been instantiated by the 'sun.security.provider.SunEntries' class initializer with the following trace:
398.0 at java.io.FileDescriptor.<init>(FileDescriptor.java:127)
398.0 at java.io.FileInputStream.<init>(FileInputStream.java:149)
398.0 at sun.security.provider.FileInputStreamPool.getInputStream(FileInputStreamPool.java:110)
398.0 at sun.security.provider.NativePRNG$RandomIO.<init>(NativePRNG.java:391)
398.0 at sun.security.provider.NativePRNG$1.run(NativePRNG.java:192)
398.0 at sun.security.provider.NativePRNG$1.run(NativePRNG.java:132)
398.0 at java.security.AccessController.executePrivileged(AccessController.java:778)
398.0 at java.security.AccessController.doPrivileged(AccessController.java:319)
398.0 at sun.security.provider.NativePRNG.initIO(NativePRNG.java:131)
398.0 at sun.security.provider.NativePRNG.<clinit>(NativePRNG.java:93)
398.0 at sun.security.provider.SunEntries.<clinit>(SunEntries.java:362)
398.0 The object was probably created by a class initializer and is reachable from a static field. You can request class initialization at image runtime by using the option --initialize-at-run-time=<class-name>. Or you can write your own initialization methods and call them explicitly from your main entry point.
398.0 Trace: Object was reached by
398.0 reading field java.io.FileInputStream.fd of constant
398.0 java.io.FileInputStream@22ab7cdd: java.io.FileInputStream@22ab7cdd
398.0 reading field java.io.FilterInputStream.in of constant
398.0 sun.security.provider.FileInputStreamPool$UnclosableInputStream@20043089: sun.security.provider.FileInputStreamPool$UnclosableInputStream@20043089
398.0 reading field sun.security.provider.NativePRNG$RandomIO.seedIn of constant
398.0 sun.security.provider.NativePRNG$RandomIO@58db6c3d: sun.security.provider.NativePRNG$RandomIO@58db6c3d
398.0 reading static field sun.security.provider.NativePRNG$NonBlocking.INSTANCE
398.0 at <unknown-location>
398.0 registered as read because: null
398.0
398.0 com.oracle.svm.driver.NativeImage$NativeImageError
398.0 at org.graalvm.nativeimage.driver/com.oracle.svm.driver.NativeImage.showError(NativeImage.java:2258)
398.0 at org.graalvm.nativeimage.driver/com.oracle.svm.driver.NativeImage.build(NativeImage.java:1871)
398.0 at org.graalvm.nativeimage.driver/com.oracle.svm.driver.NativeImage.performBuild(NativeImage.java:1830)
398.0 at org.graalvm.nativeimage.driver/com.oracle.svm.driver.NativeImage.main(NativeImage.java:1812)
398.0 at java.base@22.0.1/java.lang.invoke.LambdaForm$DMH/sa346b79c.invokeStaticInit(LambdaForm$DMH)
398.1
398.1 FAILURE: Build failed with an exception.
398.1
398.1 * Where:
398.1 Build file '/root/hildr/hildr-node/build.gradle' line: 348
398.1