{"record":{"id":"8668b830bce7adbe","repo":"oracle/graal","slug":"cannot-link-call-from-s","errorCode":null,"errorMessage":"cannot link call from %s","messagePattern":"cannot link call from (.+?)","errorType":"exception","errorClass":"PermanentBailoutException","httpStatus":null,"severity":"error","filePath":"compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/java/BytecodeParser.java","lineNumber":4805,"sourceCode":"    protected JavaType lookupType(int cpi, int bytecode) {\n        maybeEagerlyResolve(cpi, bytecode);\n        JavaType result = constantPool.lookupType(cpi, bytecode);\n        assert !graphBuilderConfig.unresolvedIsError() || result instanceof ResolvedJavaType : Assertions.errorMessage(result);\n        return result;\n    }\n\n    private JavaMethod lookupMethod(int cpi, int opcode) {\n        maybeEagerlyResolve(cpi, opcode);\n        JavaMethod result = lookupMethodInPool(cpi, opcode);\n        assert !graphBuilderConfig.unresolvedIsError() || result instanceof ResolvedJavaMethod : result.format(\"%H.%n(%P)%R\");\n        return result;\n    }\n\n    protected JavaMethod lookupMethodInPool(int cpi, int opcode) {\n        try {\n            return constantPool.lookupMethod(cpi, opcode, method);\n        } catch (IllegalAccessError e) {\n            throw new PermanentBailoutException(e, \"cannot link call from %s\", method.format(\"%H.%n(%p)\"));\n        }\n    }\n\n    protected JavaField lookupField(int cpi, int opcode) {\n        maybeEagerlyResolve(cpi, opcode);\n        JavaField result = constantPool.lookupField(cpi, method, opcode);\n        return lookupField(result);\n    }\n\n    protected JavaField lookupField(JavaField result) {\n        assert !graphBuilderConfig.unresolvedIsError() || result instanceof ResolvedJavaField : \"Not resolved: \" + result;\n        if (parsingIntrinsic() || eagerInitializing) {\n            if (result instanceof ResolvedJavaField) {\n                ResolvedJavaType declaringClass = ((ResolvedJavaField) result).getDeclaringClass();\n                if (!declaringClass.isInitialized()) {\n                    // Even with eager initialization, superinterfaces are not always initialized.\n                    // See StaticInterfaceFieldTest\n                    assert !eagerInitializing || declaringClass.isInterface() : \"Declaring class not initialized but not an interface? \" + declaringClass;","sourceCodeStart":4787,"sourceCodeEnd":4823,"githubUrl":"https://github.com/oracle/graal/blob/a66e9ccd1d7bf2552883939aa0788dfd0e294aab/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/java/BytecodeParser.java#L4787-L4823","documentation":"Thrown by BytecodeParser.lookupMethodInPool when ConstantPool.lookupMethod fails with IllegalAccessError while resolving a method reference (invokevirtual/invokestatic/invokespecial/invokeinterface) from the compiled method. The underlying linkage failure (e.g. package-private access across a split or renamed package) is wrapped into a permanent bailout naming the caller method.","triggerScenarios":"constantPool.lookupMethod(cpi, opcode, method) throwing IllegalAccessError during graph building — the constant-pool entry for a call cannot be linked because the referenced method is not accessible to the caller (visibility, module boundaries, or package splits).","commonSituations":"Compile-time linking of a method that references a package-private member of another package (broken encapsulation that only fails under Graal's eager resolution); JPMS module boundaries not opened; bytecode transformations that rewrite access flags; multi-release JARs where a different version of a class restricts visibility.","solutions":["Check the caller method named in the message and the access flags of the referenced method; fix visibility (make it public) or the caller.","If module encapsulation is the cause, add the required --add-opens/--add-exports opens.","Verify the correct version of the referenced class is on the classpath/modulepath (no stale duplicate with stricter access)."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"// PermanentBailoutException wrapping IllegalAccessError: fix access, do not catch.\n// The message names the caller method; inspect that method's constant pool refs.","preventionTips":["Keep access modifiers consistent across packages split by builds.","Add required --add-opens/--add-exports when running under JPMS with Graal."],"tags":["graalvm","bytecode-parsing","linkage","illegal-access","bailout"],"backgroundTag":null,"analyzedSha":"a66e9ccd1d7bf2552883939aa0788dfd0e294aab","analyzedAt":"2026-08-14T13:58:47.161Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}