You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When ImageLayerLoader#createBaseLayerMethod is loading the layer's methodData it's defining annotations as well, but these annotations seem lacking their attributes.
In some cases not having these values leads to critical failures; for example GraalVM itself makes use of the annotation com.oracle.svm.core.AlwaysInline which strictly requires a value for its main attribute. This is used, for example, in Target_jdk_internal_foreign_SegmentFactories.
The lack of this attribute leads to the annotation being invalid, which in turn results in a critical compilation error:
Fatal error: com.oracle.graal.pointsto.util.AnalysisError$ParsingError: Error encountered while parsing com.oracle.svm.core.foreign.Util_java_lang_foreign_SymbolLookup$1.find(Target_java_lang_foreign_SymbolLookup.java:169)
Parsing context:
at com.oracle.svm.core.foreign.Target_jdk_internal_foreign_SystemLookup.find(Target_jdk_internal_foreign_SystemLookup.java:43)
at root method.(Unknown Source)
at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.util.AnalysisError.parsingError(AnalysisError.java:165)
at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.flow.MethodTypeFlow.createFlowsGraph(MethodTypeFlow.java:189)
at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.flow.MethodTypeFlow.ensureFlowsGraphCreated(MethodTypeFlow.java:152)
at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.flow.MethodTypeFlow.getOrCreateMethodFlowsGraphInfo(MethodTypeFlow.java:110)
at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.typestate.DefaultVirtualInvokeTypeFlow.onObservedUpdate(DefaultVirtualInvokeTypeFlow.java:119)
at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.flow.TypeFlow.update(TypeFlow.java:870)
at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.PointsToAnalysis$1.run(PointsToAnalysis.java:600)
at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.util.CompletionExecutor.executeCommand(CompletionExecutor.java:166)
at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.util.CompletionExecutor.lambda$executeService$0(CompletionExecutor.java:152)
at java.base/java.util.concurrent.ForkJoinTask$RunnableExecuteAction.compute(ForkJoinTask.java:1735)
at java.base/java.util.concurrent.ForkJoinTask$RunnableExecuteAction.compute(ForkJoinTask.java:1726)
at java.base/java.util.concurrent.ForkJoinTask$InterruptibleTask.exec(ForkJoinTask.java:1650)
at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:507)
at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1459)
at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:2035)
at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:191)
Caused by: jdk.graal.compiler.debug.GraalError: Error in record 57 (field -1)
at jdk.graal.compiler/jdk.graal.compiler.util.ObjectCopier$Decoder.decode(ObjectCopier.java:555)
at jdk.graal.compiler/jdk.graal.compiler.util.ObjectCopier.decode(ObjectCopier.java:404)
at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.heap.ImageLayerLoader.getAnalysisParsedGraph(ImageLayerLoader.java:820)
at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.meta.AnalysisMethod.lambda$getBaseLayerGraph$0(AnalysisMethod.java:1003)
at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.meta.AnalysisMethod.setGraph(AnalysisMethod.java:1023)
at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.meta.AnalysisMethod.getBaseLayerGraph(AnalysisMethod.java:1003)
at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.meta.AnalysisMethod.ensureGraphParsedHelper(AnalysisMethod.java:977)
at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.meta.AnalysisMethod.ensureGraphParsed(AnalysisMethod.java:958)
at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.phases.InlineBeforeAnalysisGraphDecoder.lookupEncodedGraph(InlineBeforeAnalysisGraphDecoder.java:181)
at jdk.graal.compiler/jdk.graal.compiler.replacements.PEGraphDecoder.doInline(PEGraphDecoder.java:1215)
at jdk.graal.compiler/jdk.graal.compiler.replacements.PEGraphDecoder.tryInline(PEGraphDecoder.java:1198)
at jdk.graal.compiler/jdk.graal.compiler.replacements.PEGraphDecoder.trySimplifyInvoke(PEGraphDecoder.java:1053)
at jdk.graal.compiler/jdk.graal.compiler.replacements.PEGraphDecoder.handleInvokeWithCallTarget(PEGraphDecoder.java:1005)
at jdk.graal.compiler/jdk.graal.compiler.replacements.PEGraphDecoder.handleInvoke(PEGraphDecoder.java:991)
at jdk.graal.compiler/jdk.graal.compiler.nodes.GraphDecoder.processNextNode(GraphDecoder.java:926)
at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.phases.InlineBeforeAnalysisGraphDecoder.processNextNode(InlineBeforeAnalysisGraphDecoder.java:269)
at jdk.graal.compiler/jdk.graal.compiler.nodes.GraphDecoder.decode(GraphDecoder.java:654)
at jdk.graal.compiler/jdk.graal.compiler.replacements.PEGraphDecoder.decode(PEGraphDecoder.java:895)
at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.phases.InlineBeforeAnalysis.decodeGraph(InlineBeforeAnalysis.java:73)
at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.flow.MethodTypeFlowBuilder.parse(MethodTypeFlowBuilder.java:239)
at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.flow.MethodTypeFlowBuilder.apply(MethodTypeFlowBuilder.java:715)
at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.flow.MethodTypeFlow.createFlowsGraph(MethodTypeFlow.java:167)
... 14 more
Caused by: com.oracle.svm.hosted.annotation.AnnotationMetadata$AnnotationExtractionError: Failed to process '@com.oracle.svm.core.AlwaysInline()': java.lang.reflect.InvocationTargetException
at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.annotation.AnnotationValue.lambda$new$0(AnnotationValue.java:95)
at java.base/java.util.HashMap.forEach(HashMap.java:1430)
at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.annotation.AnnotationValue.<init>(AnnotationValue.java:90)
at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:215)
at java.base/java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:1024)
at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:570)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:560)
at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:636)
at java.base/java.util.stream.AbstractPipeline.evaluateToArrayNode(AbstractPipeline.java:291)
at java.base/java.util.stream.ReferencePipeline.toArray(ReferencePipeline.java:656)
at java.base/java.util.stream.ReferencePipeline.toArray(ReferencePipeline.java:662)
at java.base/java.util.stream.ReferencePipeline.toList(ReferencePipeline.java:667)
at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.annotation.SubstrateAnnotationExtractor.getAnnotationData(SubstrateAnnotationExtractor.java:189)
at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.annotation.SubstrateAnnotationExtractor.hasAnnotation(SubstrateAnnotationExtractor.java:149)
at org.graalvm.nativeimage/org.graalvm.nativeimage.AnnotationAccess.isAnnotationPresent(AnnotationAccess.java:82)
at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.cenum.CEnumCallWrapperSubstitutionProcessor.lookup(CEnumCallWrapperSubstitutionProcessor.java:54)
at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.infrastructure.SubstitutionProcessor$ChainedSubstitutionProcessor.lookup(SubstitutionProcessor.java:121)
at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.infrastructure.SubstitutionProcessor$ChainedSubstitutionProcessor.lookup(SubstitutionProcessor.java:121)
at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.infrastructure.SubstitutionProcessor$ChainedSubstitutionProcessor.lookup(SubstitutionProcessor.java:121)
at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.meta.AnalysisUniverse.lookupAllowUnresolved(AnalysisUniverse.java:417)
at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.meta.AnalysisUniverse.lookup(AnalysisUniverse.java:396)
at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.heap.ImageLayerLoader.createBaseLayerMethod(ImageLayerLoader.java:749)
at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.heap.ImageLayerLoader.loadMethod(ImageLayerLoader.java:709)
at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.heap.ImageLayerLoader.getAnalysisMethod(ImageLayerLoader.java:755)
at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.heap.ImageLayerSnapshotUtil$AnalysisMethodBuiltIn.decode(ImageLayerSnapshotUtil.java:355)
at jdk.graal.compiler/jdk.graal.compiler.util.ObjectCopier$Decoder.decode(ObjectCopier.java:489)
... 35 more
I do also wonder what other problems are likely going to be caused by this, I believe many of our frameworks would need to read the actual annotation attributes; it seems that the current code would fallback to their default values, which is not correct.
Using the latest version of GraalVM can resolve many issues.
openjdk version "24" 2025-03-18
OpenJDK Runtime Environment GraalVM CE 24-dev+23.1 (build 24+23-jvmci-b01)
OpenJDK 64-Bit Server VM GraalVM CE 24-dev+23.1 (build 24+23-jvmci-b01, mixed mode, sharing)
Built from e238132d615da50c4d380c76dbe548caf94e5834
Describe the Issue
When
ImageLayerLoader#createBaseLayerMethod
is loading the layer's methodData it's defining annotations as well, but these annotations seem lacking their attributes.In some cases not having these values leads to critical failures; for example GraalVM itself makes use of the annotation
com.oracle.svm.core.AlwaysInline
which strictly requires a value for its main attribute. This is used, for example, inTarget_jdk_internal_foreign_SegmentFactories
.The lack of this attribute leads to the annotation being invalid, which in turn results in a critical compilation error:
I do also wonder what other problems are likely going to be caused by this, I believe many of our frameworks would need to read the actual annotation attributes; it seems that the current code would fallback to their default values, which is not correct.
Using the latest version of GraalVM can resolve many issues.
GraalVM Version
Built from
e238132d615da50c4d380c76dbe548caf94e5834
Operating System and Version
Fedora Linux 41
Build Command
Core layer preparation:
Failing build:
Expected Behavior
To be able to use annotations as usual.
Actual Behavior
Failed build
Steps to Reproduce
I hope the description I provided is clear enough as I pointed to the specific code which is problematic.
Additional Context
No response
Build Log Output and Error Messages
No response
The text was updated successfully, but these errors were encountered: