Skip to content

Intermittent failure of Hazelcast integration test native build due to InetAddress found in the image heap #8005

@jamesnetherton

Description

@jamesnetherton

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=<culprit>'

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=<culprit>'

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=<culprit>'

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=<culprit>'

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=<culprit>'

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=<culprit>'

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=<culprit>'

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=<culprit>'

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

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