oracle/graal · error · DeserializationException

Invalid marker type.

Error message

Invalid marker type.

What it means

Deserialization counterpart of 146: the 'type' string of a result-marker JSON object must be 'noResult', 'null', or 'exception'. The case null, default branch throws DeserializationException('Invalid marker type.'), attaching this serializer and the offending JSON map for diagnostics.

Source

Thrown at compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/hotspot/replaycomp/JsonReplayCodec.java:534

            } else {
                throw new IllegalArgumentException("Cannot serialize result marker " + instance);
            }
            objectBuilder.append("type", type);
        }

        @Override
        public Object deserialize(EconomicMap<String, Object> json, RecursiveDeserializer deserializer, CompilationProxies.ProxyFactory proxyFactory) throws DeserializationException {
            switch ((String) json.get("type")) {
                case "noResult" -> {
                    return SpecialResultMarker.NO_RESULT_MARKER;
                }
                case "null" -> {
                    return SpecialResultMarker.NULL_RESULT_MARKER;
                }
                case "exception" -> {
                    return new SpecialResultMarker.ExceptionThrownMarker((Throwable) deserializer.deserialize(json.get("throwable"), proxyFactory));
                }
                case null, default -> throw new DeserializationException(this, json, "Invalid marker type.");
            }
        }
    }

    private static final class EnumSerializer implements ObjectSerializer {
        @Override
        public boolean serializesSubclasses() {
            return true;
        }

        @Override
        public Class<?> clazz() {
            return Enum.class;
        }

        @Override
        public String tag() {
            return "enum";

View on GitHub (pinned to a66e9ccd1d)

Solutions

  1. Open the replay JSON and locate the entry with the bad 'type' (the DeserializationException context includes the map)
  2. Re-record with the same build you replay on
  3. If you extended the writer (error 146), add the matching case here
Defensive patterns

Strategy: try-catch

Validate before calling

static final Set<String> VALID_MARKER_TYPES = Set.of("noResult", "null", "exception");

if (!VALID_MARKER_TYPES.contains(json.get("type"))) {
    throw new DeserializationException(this, json, "Invalid marker type: " + json.get("type"));
}

Try / catch

catch (DeserializationException e) {
    // e carries the offending map; extract json.get("type") for a precise error report
}

Prevention

When it happens

Trigger: Replaying a JSON replay file whose result-marker object has a type string that is missing, misspelled, or from a newer codec (e.g. 'myMarker' written by an extended writer).

Common situations: Hand-edited JSON; replay-file written by a newer GraalVM with extra marker types; version skew between record and replay builds.

Related errors


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