oracle/graal · error · DeserializationException
Register not found
Error message
Register not found
What it means
RegisterSerializer identifies a Register purely by its 'number' field and resolves it by scanning deserializer.getArchitecture().getRegisters() for a matching register.number. DeserializationException('Register not found') means the recorded register number does not exist in the architecture instance the replay session constructed.
Source
Thrown at compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/hotspot/replaycomp/JsonReplayCodec.java:785
public String tag() {
return "register";
}
@Override
public void serialize(Object instance, JsonBuilder.ObjectBuilder objectBuilder, RecursiveSerializer serializer) throws IOException {
Register register = (Register) instance;
objectBuilder.append("number", register.number);
}
@Override
public Object deserialize(EconomicMap<String, Object> json, RecursiveDeserializer deserializer, CompilationProxies.ProxyFactory proxyFactory) throws DeserializationException {
int number = (int) json.get("number");
for (Register register : deserializer.getArchitecture().getRegisters()) {
if (register.number == number) {
return register;
}
}
throw new DeserializationException(this, json, "Register not found");
}
}
private static final class FieldSerializer implements ObjectSerializer {
@Override
public Class<?> clazz() {
return Field.class;
}
@Override
public String tag() {
return "field";
}
@Override
public void serialize(Object instance, JsonBuilder.ObjectBuilder objectBuilder, RecursiveSerializer serializer) throws IOException {
Field field = (Field) instance;View on GitHub (pinned to a66e9ccd1d)
Solutions
- Replay on the same architecture as the recording (AMD64 file on AMD64, etc.)
- Verify the architecture entry in the replay file was deserialized before the register entry (the codec calls setArchitecture when it reads the architecture)
- Re-record the replay file with the same CPU/OS/JVM combination
Defensive patterns
Strategy: validation
Validate before calling
// Verify the register number exists in the replay architecture before use
int number = (int) json.get("number");
boolean found = Arrays.stream(architecture.getRegisters()).anyMatch(r -> r.number == number);
if (!found) throw new DeserializationException(this, json, "Register " + number + " not in " + architecture); Prevention
- Replay register-bearing files only on the same architecture as the recording
- Ensure the architecture section is deserialized (setArchitecture called) before register entries are processed
When it happens
Trigger: Replaying a file recorded on a machine whose register numbering differs from the replaying Architecture object — e.g. an AMD64 file replayed against an AArch64 architecture, or an Architecture constructed with a different feature set that changes the register array.
Common situations: Cross-architecture replay; version skew where register tables changed; the Architecture entry in the replay file was overridden or the architecture was set from the host rather than the file.
Related errors
- Unknown replay register config kind ${kind}
- Unexpected value: ${name}
- Profile file for path %s exists already
- Invalid replay string table index
- Invalid replay string definition index
AI-assisted analysis of oracle/graal@a66e9ccd1d (2026-08-14).
Data as JSON: /api/errors/289ed3c7864c6187.
Report an issue: GitHub.