Intermittent failure of Hazelcast integration test native build due to InetAddress found in the image heap
- Dominant language
- Java
- Stars
- 302
- Forks
- 232
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 108
Description
### Bug description
Seen these errors pop up a few times on CI (maybe also for other extensions in the past)
Build logs
```
Error: Unsupported features in 2 methods
Detailed message:
Error: An object of type 'java.net.Inet4Address' was found in the image heap. This type, however, is marked for initialization at image run time for the following reason: classes are initialized at run time by default.
This is not allowed for correctness reasons: All objects that are stored in the image heap must be initialized at build time.
You now have two options to resolve this:
1) If it is intended that objects of type 'java.net.Inet4Address' are persisted in the image heap, add
'--initialize-at-build-time=java.net.Inet4Address'
to the native-image arguments. Note that initializing new types can store additional objects to the heap. It is advised to check the static fields of 'java.net.Inet4Address' to see if they are safe for build-time initialization, and that they do not contain any sensitive data that should not become part of the image.
2) If these objects should not be stored in the image heap, you can use
'--trace-object-instantiation=java.net.Inet4Address'
to find classes that instantiate these objects. Once you found such a class, you can mark it explicitly for run time initialization with
'--initialize-at-run-time='
to prevent the instantiation of the object.
If you are seeing this message after enabling '--strict-image-heap', this means that some objects ended up in the image heap without their type being marked with --initialize-at-build-time.
To fix this, include '--initialize-at-build-time=java.net.Inet4Address' in your configuration. If the classes do not originate from your code, it is advised to update all library or framework dependencies to the latest version before addressing this error.
Please address this problem to be prepared for future releases of GraalVM.
The following detailed trace displays from which field in the code the object was reached.
Trace: Object was reached by
trying to constant fold static field io.quarkus.runtime.graal.InetRunTime.INET4_ANY
at io.quarkus.runtime.graal.Inet4AnyAccessor.get(InetRunTime.java:19)
parsing method io.quarkus.runtime.graal.Inet4AnyAccessor.get(InetRunTime.java:19) reachable via the parsing context
at static root method.(Unknown Source)
Error: An object of type 'java.net.Inet6Address' was found in the image heap. This type, however, is marked for initialization at image run time for the following reason: classes are initialized at run time by default.
This is not allowed for correctness reasons: All objects that are stored in the image heap must be initialized at build time.
You now have two options to resolve this:
1) If it is intended that objects of type 'java.net.Inet6Address' are persisted in the image heap, add
'--initialize-at-build-time=java.net.Inet6Address'
to the native-image arguments. Note that initializing new types can store additional objects to the heap. It is advised to check the static fields of 'java.net.Inet6Address' to see if they are safe for build-time initialization, and that they do not contain any sensitive data that should not become part of the image.
2) If these objects should not be stored in the image heap, you can use
'--trace-object-instantiation=java.net.Inet6Address'
to find classes that instantiate these objects. Once you found such a class, you can mark it explicitly for run time initialization with
'--initialize-at-run-time='
to prevent the instantiation of the object.
If you are seeing this message after enabling '--strict-image-heap', this means that some objects ended up in the image heap without their type being marked with --initialize-at-build-time.
To fix this, include '--initialize-at-build-time=java.net.Inet6Address' in your configuration. If the classes do not originate from your code, it is advised to update all library or framework dependencies to the latest version before addressing this error.
Please address this problem to be prepared for future releases of GraalVM.
The following detailed trace displays from which field in the code the object was reached.
Trace: Object was reached by
trying to constant fold static field io.quarkus.runtime.graal.InetRunTime.INET6_ANY
at io.quarkus.runtime.graal.Inet6AnyAccessor.get(InetRunTime.java:37)
parsing method io.quarkus.runtime.graal.Inet6AnyAccessor.get(InetRunTime.java:37) reachable via the parsing context
at static root method.(Unknown Source)
Caused by: com.oracle.graal.pointsto.constraints.UnsupportedFeatureException: Unsupported features in 2 methods
Detailed message:
Error: An object of type 'java.net.Inet4Address' was found in the image heap. This type, however, is marked for initialization at image run time for the following reason: classes are initialized at run time by default.
This is not allowed for correctness reasons: All objects that are stored in the image heap must be initialized at build time.
You now have two options to resolve this:
1) If it is intended that objects of type 'java.net.Inet4Address' are persisted in the image heap, add
'--initialize-at-build-time=java.net.Inet4Address'
to the native-image arguments. Note that initializing new types can store additional objects to the heap. It is advised to check the static fields of 'java.net.Inet4Address' to see if they are safe for build-time initialization, and that they do not contain any sensitive data that should not become part of the image.
2) If these objects should not be stored in the image heap, you can use
'--trace-object-instantiation=java.net.Inet4Address'
to find classes that instantiate these objects. Once you found such a class, you can mark it explicitly for run time initialization with
'--initialize-at-run-time='
to prevent the instantiation of the object.
If you are seeing this message after enabling '--strict-image-heap', this means that some objects ended up in the image heap without their type being marked with --initialize-at-build-time.
To fix this, include '--initialize-at-build-time=java.net.Inet4Address' in your configuration. If the classes do not originate from your code, it is advised to update all library or framework dependencies to the latest version before addressing this error.
Please address this problem to be prepared for future releases of GraalVM.
The following detailed trace displays from which field in the code the object was reached.
Trace: Object was reached by
trying to constant fold static field io.quarkus.runtime.graal.InetRunTime.INET4_ANY
at io.quarkus.runtime.graal.Inet4AnyAccessor.get(InetRunTime.java:19)
parsing method io.quarkus.runtime.graal.Inet4AnyAccessor.get(InetRunTime.java:19) reachable via the parsing context
at static root method.(Unknown Source)
Error: An object of type 'java.net.Inet6Address' was found in the image heap. This type, however, is marked for initialization at image run time for the following reason: classes are initialized at run time by default.
This is not allowed for correctness reasons: All objects that are stored in the image heap must be initialized at build time.
You now have two options to resolve this:
1) If it is intended that objects of type 'java.net.Inet6Address' are persisted in the image heap, add
'--initialize-at-build-time=java.net.Inet6Address'
to the native-image arguments. Note that initializing new types can store additional objects to the heap. It is advised to check the static fields of 'java.net.Inet6Address' to see if they are safe for build-time initialization, and that they do not contain any sensitive data that should not become part of the image.
2) If these objects should not be stored in the image heap, you can use
'--trace-object-instantiation=java.net.Inet6Address'
to find classes that instantiate these objects. Once you found such a class, you can mark it explicitly for run time initialization with
'--initialize-at-run-time='
to prevent the instantiation of the object.
If you are seeing this message after enabling '--strict-image-heap', this means that some objects ended up in the image heap without their type being marked with --initialize-at-build-time.
To fix this, include '--initialize-at-build-time=java.net.Inet6Address' in your configuration. If the classes do not originate from your code, it is advised to update all library or framework dependencies to the latest version before addressing this error.
Please address this problem to be prepared for future releases of GraalVM.
The following detailed trace displays from which field in the code the object was reached.
Trace: Object was reached by
trying to constant fold static field io.quarkus.runtime.graal.InetRunTime.INET6_ANY
at io.quarkus.runtime.graal.Inet6AnyAccessor.get(InetRunTime.java:37)
parsing method io.quarkus.runtime.graal.Inet6AnyAccessor.get(InetRunTime.java:37) reachable via the parsing context
at static root method.(Unknown Source)
at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.constraints.UnsupportedFeatures.report(UnsupportedFeatures.java:129)
at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGenerator.runPointsToAnalysis(NativeImageGenerator.java:809)
at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGenerator.doRun(NativeImageGenerator.java:592)
at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGenerator.run(NativeImageGenerator.java:550)
at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.buildImage(NativeImageGeneratorRunner.java:538)
at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.build(NativeImageGeneratorRunner.java:727)
at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.start(NativeImageGeneratorRunner.java:142)
at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.main(NativeImageGeneratorRunner.java:97)
Internal exception: com.oracle.svm.core.util.UserError$UserException: Unsupported features in 2 methods
Detailed message:
Error: An object of type 'java.net.Inet4Address' was found in the image heap. This type, however, is marked for initialization at image run time for the following reason: classes are initialized at run time by default.
This is not allowed for correctness reasons: All objects that are stored in the image heap must be initialized at build time.
You now have two options to resolve this:
1) If it is intended that objects of type 'java.net.Inet4Address' are persisted in the image heap, add
'--initialize-at-build-time=java.net.Inet4Address'
to the native-image arguments. Note that initializing new types can store additional objects to the heap. It is advised to check the static fields of 'java.net.Inet4Address' to see if they are safe for build-time initialization, and that they do not contain any sensitive data that should not become part of the image.
2) If these objects should not be stored in the image heap, you can use
'--trace-object-instantiation=java.net.Inet4Address'
to find classes that instantiate these objects. Once you found such a class, you can mark it explicitly for run time initialization with
'--initialize-at-run-time='
to prevent the instantiation of the object.
If you are seeing this message after enabling '--strict-image-heap', this means that some objects ended up in the image heap without their type being marked with --initialize-at-build-time.
To fix this, include '--initialize-at-build-time=java.net.Inet4Address' in your configuration. If the classes do not originate from your code, it is advised to update all library or framework dependencies to the latest version before addressing this error.
Please address this problem to be prepared for future releases of GraalVM.
The following detailed trace displays from which field in the code the object was reached.
Trace: Object was reached by
trying to constant fold static field io.quarkus.runtime.graal.InetRunTime.INET4_ANY
at io.quarkus.runtime.graal.Inet4AnyAccessor.get(InetRunTime.java:19)
parsing method io.quarkus.runtime.graal.Inet4AnyAccessor.get(InetRunTime.java:19) reachable via the parsing context
at static root method.(Unknown Source)
Error: An object of type 'java.net.Inet6Address' was found in the image heap. This type, however, is marked for initialization at image run time for the following reason: classes are initialized at run time by default.
This is not allowed for correctness reasons: All objects that are stored in the image heap must be initialized at build time.
You now have two options to resolve this:
1) If it is intended that objects of type 'java.net.Inet6Address' are persisted in the image heap, add
'--initialize-at-build-time=java.net.Inet6Address'
to the native-image arguments. Note that initializing new types can store additional objects to the heap. It is advised to check the static fields of 'java.net.Inet6Address' to see if they are safe for build-time initialization, and that they do not contain any sensitive data that should not become part of the image.
2) If these objects should not be stored in the image heap, you can use
'--trace-object-instantiation=java.net.Inet6Address'
to find classes that instantiate these objects. Once you found such a class, you can mark it explicitly for run time initialization with
'--initialize-at-run-time='
to prevent the instantiation of the object.
If you are seeing this message after enabling '--strict-image-heap', this means that some objects ended up in the image heap without their type being marked with --initialize-at-build-time.
To fix this, include '--initialize-at-build-time=java.net.Inet6Address' in your configuration. If the classes do not originate from your code, it is advised to update all library or framework dependencies to the latest version before addressing this error.
Please address this problem to be prepared for future releases of GraalVM.
The following detailed trace displays from which field in the code the object was reached.
Trace: Object was reached by
trying to constant fold static field io.quarkus.runtime.graal.InetRunTime.INET6_ANY
at io.quarkus.runtime.graal.Inet6AnyAccessor.get(InetRunTime.java:37)
parsing method io.quarkus.runtime.graal.Inet6AnyAccessor.get(InetRunTime.java:37) reachable via the parsing context
at static root method.(Unknown Source)
at org.graalvm.nativeimage.builder/com.oracle.svm.core.util.UserError.abort(UserError.java:85)
at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.FallbackFeature.reportAsFallback(FallbackFeature.java:248)
at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGenerator.runPointsToAnalysis(NativeImageGenerator.java:814)
at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGenerator.doRun(NativeImageGenerator.java:592)
at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGenerator.run(NativeImageGenerator.java:550)
at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.buildImage(NativeImageGeneratorRunner.java:538)
at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.build(NativeImageGeneratorRunner.java:727)
at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.start(NativeImageGeneratorRunner.java:142)
at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.main(NativeImageGeneratorRunner.java:97)
Caused by: com.oracle.graal.pointsto.constraints.UnsupportedFeatureException: Unsupported features in 2 methods
Detailed message:
Error: An object of type 'java.net.Inet4Address' was found in the image heap. This type, however, is marked for initialization at image run time for the following reason: classes are initialized at run time by default.
This is not allowed for correctness reasons: All objects that are stored in the image heap must be initialized at build time.
You now have two options to resolve this:
1) If it is intended that objects of type 'java.net.Inet4Address' are persisted in the image heap, add
'--initialize-at-build-time=java.net.Inet4Address'
to the native-image arguments. Note that initializing new types can store additional objects to the heap. It is advised to check the static fields of 'java.net.Inet4Address' to see if they are safe for build-time initialization, and that they do not contain any sensitive data that should not become part of the image.
2) If these objects should not be stored in the image heap, you can use
'--trace-object-instantiation=java.net.Inet4Address'
to find classes that instantiate these objects. Once you found such a class, you can mark it explicitly for run time initialization with
'--initialize-at-run-time='
to prevent the instantiation of the object.
If you are seeing this message after enabling '--strict-image-heap', this means that some objects ended up in the image heap without their type being marked with --initialize-at-build-time.
To fix this, include '--initialize-at-build-time=java.net.Inet4Address' in your configuration. If the classes do not originate from your code, it is advised to update all library or framework dependencies to the latest version before addressing this error.
Please address this problem to be prepared for future releases of GraalVM.
The following detailed trace displays from which field in the code the object was reached.
Trace: Object was reached by
trying to constant fold static field io.quarkus.runtime.graal.InetRunTime.INET4_ANY
at io.quarkus.runtime.graal.Inet4AnyAccessor.get(InetRunTime.java:19)
parsing method io.quarkus.runtime.graal.Inet4AnyAccessor.get(InetRunTime.java:19) reachable via the parsing context
at static root method.(Unknown Source)
Error: An object of type 'java.net.Inet6Address' was found in the image heap. This type, however, is marked for initialization at image run time for the following reason: classes are initialized at run time by default.
This is not allowed for correctness reasons: All objects that are stored in the image heap must be initialized at build time.
You now have two options to resolve this:
1) If it is intended that objects of type 'java.net.Inet6Address' are persisted in the image heap, add
'--initialize-at-build-time=java.net.Inet6Address'
to the native-image arguments. Note that initializing new types can store additional objects to the heap. It is advised to check the static fields of 'java.net.Inet6Address' to see if they are safe for build-time initialization, and that they do not contain any sensitive data that should not become part of the image.
2) If these objects should not be stored in the image heap, you can use
'--trace-object-instantiation=java.net.Inet6Address'
to find classes that instantiate these objects. Once you found such a class, you can mark it explicitly for run time initialization with
'--initialize-at-run-time='
to prevent the instantiation of the object.
If you are seeing this message after enabling '--strict-image-heap', this means that some objects ended up in the image heap without their type being marked with --initialize-at-build-time.
To fix this, include '--initialize-at-build-time=java.net.Inet6Address' in your configuration. If the classes do not originate from your code, it is advised to update all library or framework dependencies to the latest version before addressing this error.
Please address this problem to be prepared for future releases of GraalVM.
The following detailed trace displays from which field in the code the object was reached.
Trace: Object was reached by
trying to constant fold static field io.quarkus.runtime.graal.InetRunTime.INET6_ANY
at io.quarkus.runtime.graal.Inet6AnyAccessor.get(InetRunTime.java:37)
parsing method io.quarkus.runtime.graal.Inet6AnyAccessor.get(InetRunTime.java:37) reachable via the parsing context
at static root method.(Unknown Source)
at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.constraints.UnsupportedFeatures.report(UnsupportedFeatures.java:129)
at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGenerator.runPointsToAnalysis(NativeImageGenerator.java:809)
... 6 more
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the Hazelcast integration test's native build and the reported trace through io.quarkus.runtime.graal.InetRunTime, especially Inet4AnyAccessor.get at line 19 and Inet6AnyAccessor.get at line 37. Reproduce the CI failure and investigate the Inet4Address and Inet6Address image-heap initialization conflict. Done means the native build completes reliably without the reported unsupported-feature errors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- build-system, ci-cd, testing-qa
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100