oracle/graal · error · IllegalArgumentException
Failed to copy into
Error message
Failed to copy into
What it means
Error "Failed to copy into " thrown in oracle/graal.
Source
Thrown at espresso-compiler-stub/src/com.oracle.truffle.espresso.vmaccess/src/com/oracle/truffle/espresso/vmaccess/EspressoExternalVMAccess.java:1032
}
public boolean hasAnnotations(Value metaObject) {
return invokeJVMCIHelper("hasAnnotations", metaObject).asBoolean();
}
@Override
public void copyMemory(JavaConstant src, int srcFrom, int srcTo, byte[] dst, int dstFrom) {
if (!(src instanceof EspressoExternalObjectConstant objectConstant)) {
throw new IllegalArgumentException("Expected an EspressoExternalObjectConstant, got " + safeGetClass(src));
}
EspressoResolvedObjectType arrayType = objectConstant.getType();
if (!(arrayType.isArray() && arrayType.getComponentType().isPrimitive())) {
throw new IllegalArgumentException("Source should be a primitive array, got " + arrayType);
}
try {
objectConstant.getValue().readBuffer(srcFrom, dst, dstFrom, srcTo - srcFrom);
} catch (IndexOutOfBoundsException e) {
throw new IllegalArgumentException("Failed to copy into " + src, e);
}
}
/**
* The value is decoded directly from Espresso interop buffer access using native endianness to
* match hosted unaligned read semantics.
*/
@Override
public JavaConstant readPrimitiveArrayUnaligned(JavaConstant array, JavaKind kind, int offset) {
if (kind == null || !kind.isPrimitive() || kind == JavaKind.Void) {
throw new IllegalArgumentException("Expected a non-void primitive kind, got " + kind);
}
if (!(array instanceof EspressoExternalObjectConstant objectConstant)) {
throw new IllegalArgumentException("Expected an EspressoExternalObjectConstant, got " + safeGetClass(array));
}
EspressoResolvedObjectType arrayType = objectConstant.getType();
if (!(arrayType.isArray() && arrayType.getComponentType().isPrimitive())) {
throw new IllegalArgumentException("Source should be a primitive array, got " + arrayType);View on GitHub (pinned to a66e9ccd1d)
Solutions
- Fix the condition reported by the error: Failed to copy into
- Check the throwing call site and ensure its documented preconditions (argument values, types, environment, or configuration) are satisfied before the call.
Example fix
Validate inputs and environment so that the failing condition does not occur: Failed to copy into
When it happens
Trigger: Thrown at espresso-compiler-stub/src/com.oracle.truffle.espresso.vmaccess/src/com/oracle/truffle/espresso/vmaccess/EspressoExternalVMAccess.java:1032 when the library encounters an invalid state.
Common situations: Occurs when a caller violates the contract guarded by this check: Failed to copy into
AI-assisted analysis of oracle/graal@a66e9ccd1d (2026-08-14).
Data as JSON: /api/errors/38d3eef948eb10ef.
Report an issue: GitHub.