oracle/graal · error · IOException
Invalid replay registration index
Error message
Invalid replay registration index
What it means
IOException thrown by BinaryReplayCodec.ReadState.registrationAt when a registration index is outside [0, registrations.length). registrations is the fixed CompilerInterfaceDeclarations array for the running build; an out-of-range index means the stream was written against a different set of registered compiler-interface types — i.e. a build/version mismatch or corrupt data.
Source
Thrown at compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/hotspot/replaycomp/BinaryReplayCodec.java:280
}
private CompilationProxy.SymbolicMethod methodAt(int index) throws IOException {
if (index < 0 || index >= methodTable.size()) {
throw new IOException("Invalid replay symbolic method index " + index);
}
return methodTable.get(index);
}
private void defineMethod(int index, CompilationProxy.SymbolicMethod method) throws IOException {
if (index != methodTable.size()) {
throw new IOException("Invalid replay symbolic method definition index " + index);
}
methodTable.add(method);
}
private CompilerInterfaceDeclarations.Registration registrationAt(int index) throws IOException {
if (index < 0 || index >= registrations.length) {
throw new IOException("Invalid replay registration index " + index);
}
return registrations[index];
}
private Object singletonProxy(int registrationIndex) throws IOException {
CompilerInterfaceDeclarations.Registration registration = registrationAt(registrationIndex);
if (!registration.singleton()) {
throw new IOException("Registration " + registration.clazz().getName() + " is not a singleton");
}
Object proxy = singletonProxies[registrationIndex];
if (proxy == null) {
proxy = proxyFactory.createProxy(registration);
singletonProxies[registrationIndex] = proxy;
}
return proxy;
}
private Object instanceProxy(int registrationIndex, int id) throws IOException {View on GitHub (pinned to a66e9ccd1d)
Solutions
- Re-capture replay data on the exact compiler build performing replay.
- Confirm the replay file was not truncated or modified.
- Pin replay workflow (record + replay) to one build in CI.
Defensive patterns
Strategy: validation
Validate before calling
// Compare registration counts before decoding: reader's registrations must match writer's
int readers = CompilerInterfaceDeclarations.getRegistrations().length; // reader side
if (readers != recordedRegistrationCount) {
throw new IOException("Replay file written against a different CompilerInterface set");
} Try / catch
try {
replayCodec.decode(input);
} catch (IOException e) {
if (e.getMessage().startsWith("Invalid replay registration index")) {
// build mismatch: regenerate replay data on this build
}
throw e;
} Prevention
- Store the producing build id inside replay metadata and reject foreign builds up front.
- Do not share replay corpora across compiler revisions.
When it happens
Trigger: Reading a replay file where a proxy reference uses a registration index beyond the current build's registrations array — happens when the producing build registered more/fewer CompilerInterface types than the consuming build.
Common situations: Replaying profiles captured on another Graal revision whose compiler-interface registrations differ; truncated or edited replay files.
Related errors
- Registration is not a singleton
- Registration is a singleton
- Invalid replay string table index
- Invalid replay string definition index
- Invalid replay symbolic method index
AI-assisted analysis of oracle/graal@a66e9ccd1d (2026-08-14).
Data as JSON: /api/errors/fdc952ab9bd6f841.
Report an issue: GitHub.