oracle/graal · error · VersionMismatchException

File format version

Error message

File format version 

What it means

BinarySource.setVersion rejects any file whose declared format version is newer than the reader's compiled maximum (CURRENT_MAJOR_VERSION.CURRENT_MINOR_VERSION, e.g. 8.0). VersionMismatchException('File format version X.Y unsupported...') means the dump was written by a newer graphio implementation whose encoding this reader cannot safely interpret.

Source

Thrown at compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/graphio/parsing/BinarySource.java:103

        try {
            // Parfait_ALLOW weak-hash
            this.digest = MessageDigest.getInstance("SHA-1"); // NOI18N
        } catch (NoSuchAlgorithmException e) {
            // ignore
        }
    }

    public Object getSourceId() {
        return sourceId;
    }

    public void useDigest(MessageDigest newDigest) {
        this.digest = newDigest;
    }

    private void setVersion(int newMajorVersion, int newMinorVersion) throws IOException {
        if (newMajorVersion > CURRENT_MAJOR_VERSION || (newMajorVersion == CURRENT_MAJOR_VERSION && newMinorVersion > CURRENT_MINOR_VERSION)) {
            throw new VersionMismatchException("File format version " + versionPair(newMajorVersion, newMinorVersion) + " unsupported.  Current version is " + CURRENT_VERSION);
        }
        majorVersion = newMajorVersion;
        minorVersion = newMinorVersion;
    }

    @Override
    public int getMajorVersion() {
        return majorVersion;
    }

    public int getMinorVersion() {
        return minorVersion;
    }

    /**
     * @return Returns absolute position of the source stream
     */
    @Override

View on GitHub (pinned to a66e9ccd1d)

Solutions

  1. Upgrade the reading side (IGV / graphio dependency) to at least the version shown in the message.
  2. Re-dump the graphs using a producer matching the reader's supported version.
  3. Catch VersionMismatchException at the call site and surface a clear 'upgrade your viewer' message instead of a generic failure.

Example fix

// reader side
try {
    new BinaryReader(source, builder).parse();
} catch (VersionMismatchException e) {
    throw new IllegalStateException("Dump written by a newer format; upgrade graphio/IGV: " + e.getMessage(), e);
}
Defensive patterns

Strategy: try-catch

Validate before calling

int[] v = readVersionHeader(file); // parse BIGV + major.minor
if (v[0] > SUPPORTED_MAJOR) { throw new UnsupportedOperationException("Upgrade graphio/IGV to read version " + v[0] + "." + v[1]); }

Try / catch

try { reader.parse(); } catch (VersionMismatchException e) { promptUserToUpgrade(e.getMessage()); }

Prevention

When it happens

Trigger: Opening a BGV file produced by a newer GraalVM/graphio with a viewer or library built against an older version; pinning an old reader for compatibility while producers auto-update.

Common situations: Version skew between a compiler that dumps graphs and the IGV/tooling used to inspect them; CI pipelines reusing cached readers on freshly generated dumps.

Related errors


AI-assisted analysis of oracle/graal@a66e9ccd1d (2026-08-14). Data as JSON: /api/errors/1402e98cc3becca5. Report an issue: GitHub.