{"record":{"id":"150279b6de735cfd","repo":"oracle/graal","slug":"invalid-replay-symbolic-method-definition-index","errorCode":null,"errorMessage":"Invalid replay symbolic method definition index ","messagePattern":"Invalid replay symbolic method definition index ","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/hotspot/replaycomp/BinaryReplayCodec.java","lineNumber":273,"sourceCode":"        }\n\n        private void defineString(int index, String value) throws IOException {\n            if (index != stringTable.size()) {\n                throw new IOException(\"Invalid replay string definition index \" + index);\n            }\n            stringTable.add(value);\n        }\n\n        private CompilationProxy.SymbolicMethod methodAt(int index) throws IOException {\n            if (index < 0 || index >= methodTable.size()) {\n                throw new IOException(\"Invalid replay symbolic method index \" + index);\n            }\n            return methodTable.get(index);\n        }\n\n        private void defineMethod(int index, CompilationProxy.SymbolicMethod method) throws IOException {\n            if (index != methodTable.size()) {\n                throw new IOException(\"Invalid replay symbolic method definition index \" + index);\n            }\n            methodTable.add(method);\n        }\n\n        private CompilerInterfaceDeclarations.Registration registrationAt(int index) throws IOException {\n            if (index < 0 || index >= registrations.length) {\n                throw new IOException(\"Invalid replay registration index \" + index);\n            }\n            return registrations[index];\n        }\n\n        private Object singletonProxy(int registrationIndex) throws IOException {\n            CompilerInterfaceDeclarations.Registration registration = registrationAt(registrationIndex);\n            if (!registration.singleton()) {\n                throw new IOException(\"Registration \" + registration.clazz().getName() + \" is not a singleton\");\n            }\n            Object proxy = singletonProxies[registrationIndex];\n            if (proxy == null) {","sourceCodeStart":255,"sourceCodeEnd":291,"githubUrl":"https://github.com/oracle/graal/blob/a66e9ccd1d7bf2552883939aa0788dfd0e294aab/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/hotspot/replaycomp/BinaryReplayCodec.java#L255-L291","documentation":"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.","triggerScenarios":"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.","commonSituations":"Replaying stale profiles after a compiler upgrade changed the replay encoding; files corrupted in transfer or storage.","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."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n    replayCodec.decode(input);\n} catch (IOException e) {\n    if (e.getMessage().startsWith(\"Invalid replay symbolic method definition index\")) {\n        // record order mismatch: re-record on current build\n    }\n    throw e;\n}","preventionTips":["Treat any index-ordering IOException as 'artifact incompatible', not transient.","Version replay files with the compiler build id and check it before decode."],"tags":["graalvm","replay","io","serialization"],"backgroundTag":null,"analyzedSha":"a66e9ccd1d7bf2552883939aa0788dfd0e294aab","analyzedAt":"2026-08-14T13:58:47.161Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}