oracle/graal · error · IOException
unknown root :
Error message
unknown root :
What it means
parseRoot switches on the root-entry type byte (BEGIN_GROUP, CLOSE_GROUP, GRAPH, STREAM_PROPERTIES, ...). The default branch reports a loading error and throws IOException('unknown root : N') when the tag matches no known root entry, meaning the reader has desynchronized from the stream or the producer used an extension this reader does not know.
Solutions
- Check the numeric tag in the message against the writer's root-entry constants to see if it is a known-but-newer entry type.
- Upgrade the reader to a graphio version >= the writer's.
- Regenerate the dump if corruption is suspected; validate the file digest/size.
Defensive patterns
Strategy: try-catch
Try / catch
try { reader.parse(); } catch (IOException e) { if (e.getMessage().startsWith("unknown root")) { /* parse desync or newer entry type: upgrade reader / re-dump */ } } Prevention
- Upgrade the reader whenever the producer's GraalVM version changes.
- Log the unknown tag value to distinguish corruption from version gaps.
- Verify dump integrity before deep parsing.
When it happens
Trigger: Corruption or truncation earlier in the stream shifting the position so a data byte is read as a root tag; reading a file with root-entry types added by a newer/custom writer; wrong stream offset after skip handling.
Common situations: Mixed-version tooling (new writer, old reader/IGV), damaged files, or spliced streams that lost alignment.
Related errors
- Document properties unexpected in version < 7
- Can not request bytes: buffer capacity is
- Document header not at root level.
- File format version
- File header is missing
AI-assisted analysis of oracle/graal@a66e9ccd1d (2026-08-14).
Data as JSON: /api/errors/d1fd9f836fc3e9af.
Report an issue: GitHub.
Appendix: source
Thrown at compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/graphio/parsing/BinaryReader.java:907
case BEGIN_GRAPH: {
parseGraph();
break;
}
case BEGIN_GROUP: {
beginGroup();
break;
}
case CLOSE_GROUP: {
doCloseGroup();
break;
}
case STREAM_PROPERTIES: {
loadDocumentProperties();
break;
}
default:
reporter.reportLoadingError(ContextStrings.unknownObjectType(type), builder);
throw new IOException("unknown root : " + type);
}
} catch (SkipRootException ex) {
long s = ex.getStart();
long e = ex.getEnd();
long pos = dataSource.getMark();
ConstantPool pool = ex.getConstantPool();
if (e == -1) {
// skip rest of the stream
throw new EOFException();
}
instLog.log(Level.FINE, "Skipping to offset {0}, {1} bytes skipped, using cpool", new Object[]{e, e - pos, Integer.toHexString(pool == null ? 0 : System.identityHashCode(pool))});
assert s < pos && e >= pos;
if (pos < e) {
long count = e - pos;
byte[] scratch = new byte[(int) Math.min(count, 1024 * 1024 * 50)];
while (count > 0) {
int l = (int) Math.min(scratch.length, count);View on GitHub (pinned to a66e9ccd1d)