oracle/graal · error · GraalError

Plugin failed:%s

Error message

Plugin failed:%s

What it means

During partial-evaluation graph decoding, PEGraphDecoder gives nodes implementing PluginReplacementInterface a chance to replace themselves via their replace() callback (PEGraphDecoder.java:1820). In decoder configurations where pluginReplacementMustSucceed() is true, a false return value is an internal invariant violation and throws GraalError naming the node.

Source

Thrown at compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/replacements/PEGraphDecoder.java:1820

                ResolvedJavaType elementType = newArrayNode.type();
                ValueNode[] dimensions = newArrayNode.dimensions().toArray(ValueNode.EMPTY_ARRAY);
                for (NodePlugin nodePlugin : nodePlugins) {
                    if (nodePlugin.handleNewMultiArray(graphBuilderContext, elementType, dimensions)) {
                        replacedNode = graphBuilderContext.pushedNode;
                        break;
                    }
                }
            }
        }
        if (node instanceof PluginReplacementInterface) {
            PluginReplacementInterface pluginReplacementNode = (PluginReplacementInterface) node;
            PEPluginGraphBuilderContext graphBuilderContext = new PEPluginGraphBuilderContext(methodScope,
                            pluginReplacementNode.asFixedNode());
            boolean success = pluginReplacementNode.replace(graphBuilderContext, providers.getReplacements());
            if (success) {
                replacedNode = graphBuilderContext.pushedNode;
            } else if (pluginReplacementMustSucceed()) {
                throw new GraalError("Plugin failed:" + node);
            }
        }

        return super.canonicalizeFixedNode(methodScope, loopScope, replacedNode);
    }

    protected boolean pluginReplacementMustSucceed() {
        return false;
    }

    @Override
    protected Node handleFloatingNodeBeforeAdd(MethodScope s, LoopScope loopScope, Node n) {
        PEMethodScope methodScope = (PEMethodScope) s;

        Node node = n;
        if (node instanceof ParameterNode) {
            ParameterNode param = (ParameterNode) node;
            if (methodScope.isInlinedMethod()) {

View on GitHub (pinned to a66e9ccd1d)

Solutions

  1. If you own the node: make replace() succeed for all inputs reached during decoding, or return true only when it fully handles replacement
  2. Attach -Dgraal.Dump and -Dgraal.TraceInlining/-Dgraal.Log level context to identify which node and plugin are involved
  3. If you do not own the node, report a GraalVM issue with the failing compilation's dump and the exact node toString from the message
Defensive patterns

Strategy: try-catch

Try / catch

try {
    snippetTemplate.snippet(...);
} catch (GraalError e) {
    if (e.getMessage().contains("Plugin failed")) { /* capture dump, report upstream with node toString */ }
    throw e;
}

Prevention

When it happens

Trigger: A PluginReplacementInterface node (e.g., a snippet/intrinsic template node) whose replace() returns false while being decoded in a context that requires replacement to succeed. Typically triggered by a custom node plugin or a compiler change, not by end-user Java code.

Common situations: Developing custom Graal nodes/intrinsics whose replace() bails out under specific graph shapes; version skew between a node's plugin and the decoder; bugs in snippet template caches.

Related errors


AI-assisted analysis of oracle/graal@a66e9ccd1d (2026-08-14). Data as JSON: /api/errors/fb160b543bd3b564. Report an issue: GitHub.