{"record":{"id":"f734fd368d4e8928","repo":"oracle/graal","slug":"unknown-replay-register-config-kind-kind","errorCode":null,"errorMessage":"Unknown replay register config kind ${kind}","messagePattern":"Unknown replay register config kind (.+?)","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/hotspot/replaycomp/BinaryReplayCodec.java","lineNumber":1212,"sourceCode":"    }\n\n    @SuppressWarnings(\"unchecked\")\n    private static RegisterConfig readRegisterConfig(ObjectCopierInputStream in, ReadState state) throws IOException {\n        int kind = in.readPackedUnsignedInt();\n        TargetDescription targetDescription = (TargetDescription) readValue(in, state);\n        List<Register> allocatable = (List<Register>) readValue(in, state);\n        return switch (kind) {\n            case AMD64_ARCHITECTURE ->\n                new AMD64HotSpotRegisterConfig(targetDescription, allocatable, readBooleanFlag(in));\n            case RISCV64_ARCHITECTURE -> {\n                readBooleanFlag(in);\n                yield new RISCV64HotSpotRegisterConfig(targetDescription, allocatable);\n            }\n            case AARCH64_ARCHITECTURE -> {\n                readBooleanFlag(in);\n                yield new AArch64HotSpotRegisterConfig(targetDescription, allocatable);\n            }\n            default -> throw new IOException(\"Unknown replay register config kind \" + kind);\n        };\n    }\n\n}\n","sourceCodeStart":1194,"sourceCodeEnd":1217,"githubUrl":"https://github.com/oracle/graal/blob/a66e9ccd1d7bf2552883939aa0788dfd0e294aab/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/hotspot/replaycomp/BinaryReplayCodec.java#L1194-L1217","documentation":"BinaryReplayCodec throws this IOException while decoding a replay register config from a binary replay file. The file encodes an architecture kind byte and the decoder only knows AMD64, RISCV64, and AARCH64. Any other kind value means the replay was produced by an unsupported or newer GraalVM version, or the file is corrupt/truncated so the kind field reads garbage.","triggerScenarios":"Calling the binary replay decoding path (ReplayDecoder / BinaryReplayCodec.readValue on a register config record) with a replay file that was recorded on a machine whose Architecture.nameId does not map to AMD64_ARCHITECTURE, RISCV64_ARCHITECTURE, or AARCH64_ARCHITECTURE, or with a file whose bytes are misaligned from an incompatible codec version.","commonSituations":"Replaying a file recorded with a different/newer GraalVM build that added a new architecture kind; mixing replay files between JVM versions; hand-editing or truncating a .rep file; recording on an exotic architecture not yet in the switch.","solutions":["Re-record the replay file on the same GraalVM version and same architecture you replay on","Verify the replay file was not modified in transit (checksum it) and re-generate it","If you maintain a fork/new architecture, add a case to the switch in BinaryReplayCodec.java:1212 and a matching write path","Confirm the target architecture of the replaying JVM matches the recording one (e.g. not replaying an x86_64 recording on arm64)"],"exampleFix":"// before: replay recorded on JVM A into file recorded on JVM B\n// after: re-record and replay with the identical build\n// java -XX:+UnlockExperimentalVMOptions -XX:DumpReplay=true ... on the same JVM/image version","handlingStrategy":"validation","validationCode":"// Before decoding, confirm producer/consumer agree on architecture set\nString recordedArch = System.getProperty(\"graal.replay.arch\"); // or parse header\nif (!Set.of(\"AMD64\", \"riscv64\", \"aarch64\").contains(recordedArch)) {\n    throw new IllegalArgumentException(\"Replay arch not supported by this codec: \" + recordedArch);\n}","typeGuard":null,"tryCatchPattern":"try {\n    codec.readRegisterConfig(in);\n} catch (IOException e) {\n    if (e.getMessage().startsWith(\"Unknown replay register config kind\")) {\n        // reject the file early, request a re-record on a supported architecture\n    } else { throw e; }\n}","preventionTips":["Always record and replay binary replay files with the identical GraalVM build","Treat replay files as build artifacts: tag them with the JVM version and architecture and refuse mismatches before decoding","Checksum replay files after recording so corruption is detected before parse errors surface"],"tags":["graalvm","replay","architecture","io"],"backgroundTag":null,"analyzedSha":"a66e9ccd1d7bf2552883939aa0788dfd0e294aab","analyzedAt":"2026-08-14T13:58:47.161Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}