{"record":{"id":"7e572fd9e91df4d7","repo":"oracle/graal","slug":"invalid-replay-string-table-index","errorCode":null,"errorMessage":"Invalid replay string table index ","messagePattern":"Invalid replay string table index ","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/hotspot/replaycomp/BinaryReplayCodec.java","lineNumber":252,"sourceCode":"\n    private final class ReadState {\n        private final CompilationProxies.ProxyFactory proxyFactory;\n        private final ArrayList<String> stringTable = new ArrayList<>();\n        private final ArrayList<CompilationProxy.SymbolicMethod> methodTable = new ArrayList<>();\n        private final Object[] singletonProxies = new Object[registrations.length];\n\n        @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","sourceCodeStart":234,"sourceCodeEnd":270,"githubUrl":"https://github.com/oracle/graal/blob/a66e9ccd1d7bf2552883939aa0788dfd0e294aab/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/hotspot/replaycomp/BinaryReplayCodec.java#L234-L270","documentation":"IOException thrown by BinaryReplayCodec.ReadState.stringAt when a replay data stream references a string table index that is negative or >= the current table size. The binary replay format resolves strings by index into a table built incrementally during decoding; an out-of-range index means the stream is corrupt, truncated, or was written by an incompatible codec version.","triggerScenarios":"Reading a replay file (-Dgraal.ReplayCompilation / replay tooling) where a record refers to a string index not yet defined (or beyond EOF), or the file was produced by a compiler whose BinaryReplayCodec wrote a different table layout.","commonSituations":"Replaying compilation profiles across compiler builds (table order changed); truncated file transfers; bit rot in stored .glog/replay artifacts; hand-editing replay files.","solutions":["Regenerate the replay file with the exact compiler build used for replay.","Verify the file is complete and unmodified (checksum/re-copy) and retry.","If you must replay across versions, re-record profiles on the current build instead of reusing old ones."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Validate replay file before use: writer header/version must match reader build, and file must be complete\nPath p = Paths.get(replayFile);\nlong expected = Long.parseLong(Files.readString(p.resolveSibling(p.getFileName() + \".size\"))); // emitted by capture tooling\nif (Files.size(p) != expected) {\n    throw new IOException(\"Replay file truncated: \" + p);\n}","typeGuard":null,"tryCatchPattern":"try {\n    replayCodec.decode(input);\n} catch (IOException e) {\n    if (e.getMessage().startsWith(\"Invalid replay string table index\")) {\n        // regenerate the replay file on this build; do not retry the same bytes\n    }\n    throw e;\n}","preventionTips":["Record and replay with the identical compiler build.","Checksum replay artifacts at capture time and verify before replay."],"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"}