{"record":{"id":"c6259f9671667d02","repo":"oracle/graal","slug":"file-format-version-unsupported-current-versi","errorCode":null,"errorMessage":"File format version {} unsupported.  Current version is {}","messagePattern":"File format version (.+?) unsupported\\.  Current version is (.+?)","errorType":"exception","errorClass":"VersionMismatchException","httpStatus":null,"severity":"error","filePath":"compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/graphio/parsing/StreamSource.java","lineNumber":149,"sourceCode":"    @Override\n    public byte[] readBytes(int len) throws IOException {\n        return readBytes(new byte[len], len);\n    }\n\n    @Override\n    public byte[] readBytes(byte[] b, int len) throws IOException {\n        in.readFully(b, 0, len);\n        return b;\n    }\n\n    @Override\n    public long getMark() {\n        throw new UnsupportedOperationException(\"getMark\");\n    }\n\n    private void setVersion(int newMajorVersion, int newMinorVersion) throws IOException {\n        if (newMajorVersion > CURRENT_MAJOR_VERSION || (newMajorVersion == CURRENT_MAJOR_VERSION && newMinorVersion > CURRENT_MINOR_VERSION)) {\n            throw new VersionMismatchException(\"File format version \" + versionPair(newMajorVersion, newMinorVersion) + \" unsupported.  Current version is \" + CURRENT_VERSION);\n        }\n        majorVersion = newMajorVersion;\n        minorVersion = newMinorVersion;\n    }\n\n    @Override\n    public int getMajorVersion() {\n        return majorVersion;\n    }\n\n    public int getMinorVersion() {\n        return minorVersion;\n    }\n\n    @Override\n    public void startDigest() {\n    }\n","sourceCodeStart":131,"sourceCodeEnd":167,"githubUrl":"https://github.com/oracle/graal/blob/a66e9ccd1d7bf2552883939aa0788dfd0e294aab/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/graphio/parsing/StreamSource.java#L131-L167","documentation":"setVersion rejects a graph dump (BIGV format) whose major/minor version is newer than the version this StreamSource can parse (currently 8.0). It exists to fail fast instead of misreading a format written by a newer GraalVM.","triggerScenarios":"Reading the version header (readShort/readInt pair after the BIGV magic) of a .bgv file exported by a newer GraalVM whose major version > 8 (or equal-major with larger minor) into an older graphio parser via GraphReader/StreamSource.setVersion.","commonSituations":"Opening a graph dump produced by a newer IDE/plugin or newer graal compiler with an older visualizer/library; mixing GraalVM versions between producer and consumer of -Dgraal.Dump output.","solutions":["Read the file with a graphio version >= the version that produced the dump (upgrade the GraalVM/visualizer doing the reading)","Re-dump the graphs using the same (older) GraalVM version that your reader supports, disabling newer-only dump features","If you control the format, check the version pair before parsing and surface a clear 'file version X vs supported Y' message"],"exampleFix":"// before\nGraphReader r = new GraphReader(new StreamSource(in));\nr.parseDocument(); // VersionMismatchException mid-header\n\n// after (gate on version first)\nDataSource src = new StreamSource(in);\nif (src.getMajorVersion() > StreamSource.CURRENT_MAJOR_VERSION) {\n    throw new IOException(\"dump too new: \" + src.getMajorVersion() + \".\" + src.getMinorVersion());\n}\nnew GraphReader(src).parseDocument();","handlingStrategy":"validation","validationCode":"// after reading the header, before full parse:\nif (src.getMajorVersion() > StreamSourceMajorLimit ||\n    (src.getMajorVersion() == StreamSourceMajorLimit && src.getMinorVersion() > MinorLimit)) {\n    // refuse with a clear message instead of a mid-parse VersionMismatchException\n}","typeGuard":null,"tryCatchPattern":"try { reader.parseDocument(); } catch (VersionMismatchException e) { /* tell user to upgrade reader or re-dump with older version */ }","preventionTips":["Pin producer and consumer Graal versions to the same release","Check the version pair immediately after the BIGV magic","Refuse newer-major files early with an actionable message"],"tags":["graphio","version-mismatch","file-format"],"backgroundTag":null,"analyzedSha":"a66e9ccd1d7bf2552883939aa0788dfd0e294aab","analyzedAt":"2026-08-14T13:58:47.161Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}