Skip to content

Conversation

suztomo
Copy link
Member

@suztomo suztomo commented Mar 17, 2025

This pull request is against the branch 1.52.x. The tip of the branch (https://github.com/googleapis/google-cloud-java/tree/1.52.x) is currently at the 1.52.0 release that was part of java-cloud-bom 26.55.0 release (https://github.com/googleapis/java-cloud-bom/releases/tag/v26.55.0).

@suztomo
Copy link
Member Author

suztomo commented Mar 17, 2025

Running build 2059.

@suztomo suztomo added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Mar 17, 2025
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Mar 17, 2025
@suztomo suztomo force-pushed the test-native-image-b branch from 5c762c6 to 8c91929 Compare March 17, 2025 18:02
@suztomo suztomo added the kokoro:run Add this label to force Kokoro to re-run the tests. label Mar 17, 2025
@yoshi-kokoro yoshi-kokoro removed the kokoro:run Add this label to force Kokoro to re-run the tests. label Mar 17, 2025
@suztomo
Copy link
Member Author

suztomo commented Mar 17, 2025

"Kokoro - Test: GraalVM Native Image B" failed.

Fatal error: com.oracle.graal.pointsto.constraints.UnsupportedFeatureException: An object of type 'jdk.proxy4.$Proxy64' 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 'jdk.proxy4.$Proxy64' are persisted in the image heap, add 

    '--initialize-at-build-time=org.junit.Ignore,java.lang.annotation.Annotation'

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 [org.junit.Ignore, java.lang.annotation.Annotation] 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, please try to infer from the source code how the culprit object got instantiated.

If you are seeing this message after upgrading to a new GraalVM release, 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=org.junit.Ignore,java.lang.annotation.Annotation' 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.

The following detailed trace displays from which field in the code the object was reached.
Object was reached by
  indexing into array java.lang.annotation.Annotation[]@14a411bd: [Ljava.lang.annotation.Annotation;@14a411bd at index 0
  reading field org.junit.runner.Description.fAnnotations of constant 
    org.junit.runner.Description@2bd77e5d: generateContentStream_withByteImage_nonEmptyCandidateList(com.google.cloud.verte...
  reading field org.junit.vintage.engine.descriptor.VintageTestDescriptor.description of constant 
    org.junit.vintage.engine.descriptor.VintageTestDescriptor@800c47a: VintageTestDescriptor: [engine:junit-vintage]/[runner:com.google.cloud.vertexai....
  reading field java.util.HashMap$Node.key of constant 
    java.util.LinkedHashMap$Entry@490671c8: VintageTestDescriptor: [engine:junit-vintage]/[runner:com.google.cloud.vertexai....
  reading field java.util.LinkedHashMap$Entry.before of constant 
    java.util.LinkedHashMap$Entry@29776b11: VintageTestDescriptor: [engine:junit-vintage]/[runner:com.google.cloud.vertexai....
  reading field java.util.LinkedHashMap$Entry.before of constant 
    java.util.LinkedHashMap$Entry@5f497dbd: VintageTestDescriptor: [engine:junit-vintage]/[runner:com.google.cloud.vertexai....

@diegomarquezp
Copy link
Contributor

diegomarquezp commented Mar 18, 2025

FWIW googleapis/sdk-platform-java#3674 will soon be released (next cycle) and contain the necessary config to solve this error.

@suztomo suztomo closed this Mar 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants