{"record":{"id":"88791bad7c332a32","repo":"oracle/graal","slug":"unknown-replay-marker-kind","errorCode":null,"errorMessage":"Unknown replay marker kind","messagePattern":"Unknown replay marker kind","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/hotspot/replaycomp/BinaryReplayCodec.java","lineNumber":885,"sourceCode":"                for (int i = 0; i < length; i++) {\n                    list.add(readValue(in, state));\n                }\n                yield list;\n            }\n            case BYTE_ARRAY_TAG -> in.readByteArrayValue();\n            case DOUBLE_ARRAY_TAG -> {\n                double[] doubles = new double[in.readPackedUnsignedInt()];\n                for (int i = 0; i < doubles.length; i++) {\n                    doubles[i] = in.readDoublePrimitive();\n                }\n                yield doubles;\n            }\n            case RESULT_MARKER_TAG -> switch (in.readPackedUnsignedInt()) {\n                case RESULT_NO_RESULT -> SpecialResultMarker.NO_RESULT_MARKER;\n                case RESULT_NULL -> SpecialResultMarker.NULL_RESULT_MARKER;\n                case RESULT_EXCEPTION ->\n                    new SpecialResultMarker.ExceptionThrownMarker((Throwable) readValue(in, state));\n                default -> throw new IOException(\"Unknown replay marker kind\");\n            };\n            case STACK_TRACE_ELEMENT_TAG ->\n                new StackTraceElement(readStringReference(in, state), readStringReference(in, state),\n                                readStringReference(in, state), requireNonNullString(readStringReference(in, state), \"stack trace holder\"),\n                                requireNonNullString(readStringReference(in, state), \"stack trace method\"), readStringReference(in, state), in.readPackedSignedInt());\n            case REGISTER_TAG -> findRegister(state.registerArchitecture(), in.readPackedUnsignedInt());\n            case FIELD_TAG -> {\n                Class<?> holder = ReplayTypeSupport.classCast(ReplayTypeSupport.decodeClass(requireNonNullString(readStringReference(in, state), \"field holder\")));\n                String name = requireNonNullString(readStringReference(in, state), \"field name\");\n                try {\n                    if (holder == String.class) {\n                        if (\"coder\".equals(name)) {\n                            yield String.class.getDeclaredField(\"coder\");\n                        } else if (\"value\".equals(name)) {\n                            yield String.class.getDeclaredField(\"value\");\n                        }\n                    }\n                    yield holder.getDeclaredField(name);","sourceCodeStart":867,"sourceCodeEnd":903,"githubUrl":"https://github.com/oracle/graal/blob/a66e9ccd1d7bf2552883939aa0788dfd0e294aab/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/hotspot/replaycomp/BinaryReplayCodec.java#L867-L903","documentation":"Thrown when decoding a RESULT_MARKER_TAG payload: the nested packed int (the marker kind) is not one of RESULT_NO_RESULT, RESULT_NULL, or RESULT_EXCEPTION. The codec therefore cannot map the kind to a SpecialResultMarker and throws IOException 'Unknown replay marker kind'. It almost always indicates stream corruption or a format-version mismatch rather than a runtime condition.","triggerScenarios":"Decoding a replay file whose RESULT_MARKER_KIND constants differ from the reader's (newer writer added a kind); bit-level corruption or truncation causing the packed-int read to land on the wrong offset.","commonSituations":"Replaying files written by a different (usually newer) GraalVM version that extended the marker kinds; hand-editing or partially copying binary replay files.","solutions":["Regenerate the replay file with the exact GraalVM build used for replay","Confirm the replay file version header matches the reader's VERSION (see verifyHeader) before decoding","If writing a custom extension of the marker kinds, add the corresponding read case for the new kind"],"exampleFix":"// before\ncase RESULT_MARKER_TAG -> switch (in.readPackedUnsignedInt()) {\n    ...\n    default -> throw new IOException(\"Unknown replay marker kind\");\n};\n\n// after\n// when the writer knows a kind the reader lacks, bump VERSION so old readers fail fast at verifyHeader","handlingStrategy":"validation","validationCode":"// validate the version header before decoding any payload\nstatic void checkVersion(java.io.DataInput in, int expectedVersion) throws IOException {\n    int v = in.readInt();\n    if (v != expectedVersion) throw new IOException(\"Unsupported replay file version \" + v);\n}","typeGuard":null,"tryCatchPattern":"try {\n    result = codec.readReplay(in);\n} catch (IOException e) {\n    if (\"Unknown replay marker kind\".equals(e.getMessage())) {\n        // reject the file: writer/reader format mismatch\n    } else throw e;\n}","preventionTips":["Always regenerate replay files when the codec format (tags/kinds) changes","Bump the binary VERSION constant whenever a new marker kind is added"],"tags":["graalvm","replay-compilation","deserialization","corruption","version-skew"],"backgroundTag":null,"analyzedSha":"a66e9ccd1d7bf2552883939aa0788dfd0e294aab","analyzedAt":"2026-08-14T13:58:47.161Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}