{"record":{"id":"fdc952ab9bd6f841","repo":"oracle/graal","slug":"invalid-replay-registration-index","errorCode":null,"errorMessage":"Invalid replay registration index ","messagePattern":"Invalid replay registration index ","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/hotspot/replaycomp/BinaryReplayCodec.java","lineNumber":280,"sourceCode":"        }\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) {\n                proxy = proxyFactory.createProxy(registration);\n                singletonProxies[registrationIndex] = proxy;\n            }\n            return proxy;\n        }\n\n        private Object instanceProxy(int registrationIndex, int id) throws IOException {","sourceCodeStart":262,"sourceCodeEnd":298,"githubUrl":"https://github.com/oracle/graal/blob/a66e9ccd1d7bf2552883939aa0788dfd0e294aab/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/hotspot/replaycomp/BinaryReplayCodec.java#L262-L298","documentation":"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.","triggerScenarios":"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.","commonSituations":"Replaying profiles captured on another Graal revision whose compiler-interface registrations differ; truncated or edited replay files.","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."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Compare registration counts before decoding: reader's registrations must match writer's\nint readers = CompilerInterfaceDeclarations.getRegistrations().length; // reader side\nif (readers != recordedRegistrationCount) {\n    throw new IOException(\"Replay file written against a different CompilerInterface set\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    replayCodec.decode(input);\n} catch (IOException e) {\n    if (e.getMessage().startsWith(\"Invalid replay registration index\")) {\n        // build mismatch: regenerate replay data on this build\n    }\n    throw e;\n}","preventionTips":["Store the producing build id inside replay metadata and reject foreign builds up front.","Do not share replay corpora across compiler revisions."],"tags":["graalvm","replay","io","serialization","versioning"],"backgroundTag":null,"analyzedSha":"a66e9ccd1d7bf2552883939aa0788dfd0e294aab","analyzedAt":"2026-08-14T13:58:47.161Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}