{"record":{"id":"e0aa814c2f77e913","repo":"oracle/graal","slug":"invalid-replay-string-definition-index","errorCode":null,"errorMessage":"Invalid replay string definition index ","messagePattern":"Invalid replay string 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":259,"sourceCode":"        @SuppressWarnings(\"unchecked\") private final EconomicMap<Integer, Object>[] instanceProxies = (EconomicMap<Integer, Object>[]) new EconomicMap<?, ?>[registrations.length];\n\n        private Architecture architecture = hostTarget.arch;\n\n        private ReadState(CompilationProxies.ProxyFactory proxyFactory) {\n            this.proxyFactory = proxyFactory;\n            stringTable.add(null);\n        }\n\n        private String stringAt(int index) throws IOException {\n            if (index < 0 || index >= stringTable.size()) {\n                throw new IOException(\"Invalid replay string table index \" + index);\n            }\n            return stringTable.get(index);\n        }\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","sourceCodeStart":241,"sourceCodeEnd":277,"githubUrl":"https://github.com/oracle/graal/blob/a66e9ccd1d7bf2552883939aa0788dfd0e294aab/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/hotspot/replaycomp/BinaryReplayCodec.java#L241-L277","documentation":"IOException thrown by BinaryReplayCodec.ReadState.defineString when a string-definition record's index does not equal the string table's current size. Definitions must append strictly sequentially (index == size) so lookups stay dense; a gap or repeat means the stream is malformed or out of sync with the codec that wrote it.","triggerScenarios":"Decoding a replay stream whose next DEFINE_STRING record carries an index other than table.size() — e.g. after a truncated prefix (missing earlier definitions) or a codec-version mismatch that changed record ordering.","commonSituations":"Replay files recorded and replayed with different compiler builds; partially downloaded or appended-to files; concurrent/corrupted writes during profile capture.","solutions":["Re-record the replay data on the same build you replay with.","Discard and re-transfer the file to rule out truncation/corruption.","Keep replay artifacts pinned to the compiler version that produced them."],"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 string definition index\")) {\n        // stream out of sync: regenerate with matching build\n    }\n    throw e;\n}","preventionTips":["Never hand-edit or append to binary replay files.","Freeze the compiler build between record and replay steps."],"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"}