{"record":{"id":"58351b5f3ed27295","repo":"oracle/graal","slug":"document-properties-unexpected-in-version-7","errorCode":null,"errorMessage":"Document properties unexpected in version < 7","messagePattern":"Document properties unexpected in version < 7","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/graphio/parsing/BinaryReader.java","lineNumber":1138,"sourceCode":"                parseProperties(builder::setNodeProperty);\n                reporter.setDetail(ContextStrings::edges);\n                createEdges(id, preds, nodeClass.inputs, builder::inputEdge);\n                createEdges(id, 0, nodeClass.sux, builder::successorEdge);\n                builder.setNodeName(nodeClass);\n                builder.endNode(id);\n                reporter.popContext();\n            }\n        } finally {\n            // graph does NOT contain terminator byte, in case we encounter a SkipRootException or\n            // EOF\n            // we have to finish the graph.\n            builder.makeGraphEdges();\n        }\n    }\n\n    protected void loadDocumentProperties() throws IOException {\n        if (dataSource.getMajorVersion() < 7) {\n            throw new IllegalStateException(\"Document properties unexpected in version < 7\");\n        }\n        try {\n            builder.startDocumentHeader();\n            parseProperties();\n        } finally {\n            builder.endDocumentHeader();\n        }\n    }\n\n    @Override\n    public final ConstantPool getConstantPool() {\n        return constantPool;\n    }\n\n    /**\n     * Used during reading, to compact, reset or change constant pool. Use with great care, wrong\n     * constant pool may damage the rest of reading process.\n     */","sourceCodeStart":1120,"sourceCodeEnd":1156,"githubUrl":"https://github.com/oracle/graal/blob/a66e9ccd1d7bf2552883939aa0788dfd0e294aab/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/graphio/parsing/BinaryReader.java#L1120-L1156","documentation":"Document-level (stream) properties were introduced in protocol version 7. BinaryReader.loadDocumentProperties throws IllegalStateException when a STREAM_PROPERTIES root entry is encountered but the file declared a major version below 7. This combination cannot come from a conforming writer: it signals a corrupted stream, a hand-patched version header, or a producer that emits stream properties while announcing an old version.","triggerScenarios":"A file whose version header says < 7 but whose body contains a STREAM_PROPERTIES root entry; manually downgraded version bytes; a custom writer emitting stream properties without bumping the negotiated version.","commonSituations":"Attempting to make new dumps loadable in old viewers by editing the version header; forks of the writer that added features without version negotiation; damaged files.","solutions":["Re-dump with a producer that writes a consistent header (version >= 7 whenever stream properties are emitted).","If a custom writer adds STREAM_PROPERTIES, make sure it initializes the protocol version to at least 7.","Do not hand-edit version headers; instead upgrade the reader side."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"if (dataSource.getMajorVersion() < 7) { /* do not expect or emit STREAM_PROPERTIES */ }","typeGuard":null,"tryCatchPattern":"try { reader.parse(); } catch (IllegalStateException e) { if (e.getMessage().contains(\"Document properties unexpected\")) { /* header/body version mismatch: regenerate dump */ } }","preventionTips":["Never hand-edit version headers to fake compatibility.","Custom writers must negotiate version >= 7 before emitting stream properties.","Treat header/body inconsistency as corruption."],"tags":["graphio","parsing","versioning","corrupt-input","properties"],"backgroundTag":null,"analyzedSha":"a66e9ccd1d7bf2552883939aa0788dfd0e294aab","analyzedAt":"2026-08-14T13:58:47.161Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}