oracle/graal · error · IOException
Invalid replay symbolic method definition index
Error message
Invalid replay symbolic method definition index
What it means
IOException thrown by BinaryReplayCodec.ReadState.defineMethod when a symbolic-method definition's index != methodTable.size(). Method definitions must append one-by-one in order; any deviation signals the decoded stream no longer matches the encoder's format, i.e. corruption or a codec-version mismatch.
Source
Thrown at compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/hotspot/replaycomp/BinaryReplayCodec.java:273
}
private void defineString(int index, String value) throws IOException {
if (index != stringTable.size()) {
throw new IOException("Invalid replay string definition index " + index);
}
stringTable.add(value);
}
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) {View on GitHub (pinned to a66e9ccd1d)
Solutions
- Re-record the replay file with the same compiler version used for replay.
- Re-obtain an intact copy of the artifact.
- Version-stamp replay artifacts and discard ones from other builds.
Defensive patterns
Strategy: validation
Try / catch
try {
replayCodec.decode(input);
} catch (IOException e) {
if (e.getMessage().startsWith("Invalid replay symbolic method definition index")) {
// record order mismatch: re-record on current build
}
throw e;
} Prevention
- Treat any index-ordering IOException as 'artifact incompatible', not transient.
- Version replay files with the compiler build id and check it before decode.
When it happens
Trigger: Decoding a stream where a DEFINE_METHOD record arrives with a gap/repeat index — after dropped bytes or when reading a file written by a codec that emitted records in a different order.
Common situations: Replaying stale profiles after a compiler upgrade changed the replay encoding; files corrupted in transfer or storage.
Related errors
- Invalid replay string table index
- Invalid replay string definition index
- Invalid replay symbolic method index
- Invalid replay registration index
- Registration is not a singleton
AI-assisted analysis of oracle/graal@a66e9ccd1d (2026-08-14).
Data as JSON: /api/errors/150279b6de735cfd.
Report an issue: GitHub.