{"record":{"id":"ca7f626112be551c","repo":"oracle/graal","slug":"unknown-klass-type","errorCode":null,"errorMessage":"unknown klass type : ","messagePattern":"unknown klass type : ","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/graphio/parsing/BinaryReader.java","lineNumber":662,"sourceCode":"        switch (type) {\n            case POOL_CLASS: {\n                String name = dataSource.readString();\n                String conv = nameTranslator == null ? null : nameTranslator.translate(name);\n                if (conv != null) {\n                    name = conv;\n                }\n                int klasstype = dataSource.readByte();\n                if (klasstype == ENUM_KLASS) {\n                    int len = dataSource.readInt();\n                    String[] values = new String[len];\n                    for (int i = 0; i < len; i++) {\n                        values[i] = readPoolObject(String.class);\n                    }\n                    obj = new EnumKlass(name, values);\n                } else if (klasstype == KLASS) {\n                    obj = new Klass(name);\n                } else {\n                    throw new IOException(\"unknown klass type : \" + klasstype);\n                }\n                break;\n            }\n            case POOL_ENUM: {\n                EnumKlass enumClass = readPoolObject(EnumKlass.class);\n                int ordinal = dataSource.readInt();\n                obj = enumClass.get(ordinal);\n                break;\n            }\n            case POOL_NODE_CLASS: {\n                String className;\n                if (dataSource.getMajorVersion() < 2) {\n                    className = dataSource.readString();\n                } else {\n                    Klass nodeClass = readPoolObject(Klass.class);\n                    className = nodeClass.toString();\n                }\n                String nameTemplate = dataSource.readString();","sourceCodeStart":644,"sourceCodeEnd":680,"githubUrl":"https://github.com/oracle/graal/blob/a66e9ccd1d7bf2552883939aa0788dfd0e294aab/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/graphio/parsing/BinaryReader.java#L644-L680","documentation":"While reading a POOL_CLASS entry, BinaryReader reads a one-byte klass-type discriminator that must be either ENUM_KLASS or KLASS. Any other byte means the reader has lost alignment with the writer's encoding: the stream is corrupt, truncated, or written by an incompatible/buggy producer. The IOException with the offending byte value aborts parsing of the pool.","triggerScenarios":"Parsing a corrupted or byte-shifted BGV file (e.g. a single dropped byte earlier in the stream); reading a file written by a modified GraphProtocol subclass that emits a klass discriminator the standard reader does not know; reading arbitrary non-BGV data that happened to pass earlier checks.","commonSituations":"Truncated dumps after JVM crashes, files damaged in transfer, files produced by experimental forks of the graph writer, or wrong file opened by a viewer.","solutions":["Re-dump the graph with a stock (unmodified) GraalVM producer and retry.","Validate the file starts with the BIGV magic and a supported version before full parse.","If you maintain a custom writer that added a new klass type, teach the reader (BinaryReader) about it or stop emitting it.","Check the numeric value in the message: 0/1 expected; anything else indicates desynchronization earlier in the stream, so inspect preceding pool entries."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { reader.parse(); } catch (IOException e) { if (e.getMessage().startsWith(\"unknown klass type\")) { /* stream desynced; regenerate dump */ } }","preventionTips":["Check the BIGV magic and version header before parsing.","Regenerate dumps rather than repairing damaged ones.","Keep custom writers and readers in lockstep for any new entry encodings."],"tags":["graphio","parsing","corrupt-input","constant-pool"],"backgroundTag":null,"analyzedSha":"a66e9ccd1d7bf2552883939aa0788dfd0e294aab","analyzedAt":"2026-08-14T13:58:47.161Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}