NationalSecurityAgency/ghidra · critical · IOException

Instruction table is corrupt. Missing platform: {platformKey

Error message

Instruction table is corrupt. Missing platform: {platformKey}

What it means

Thrown by DBTraceInstruction.fresh() when loading an instruction record and the stored platformKey does not resolve via platformManager.getPlatformByKey(). This is the instruction-table equivalent of error 448 (which is for data) — the persisted instruction references a platform that no longer exists in the platform manager. The IOException indicates trace database corruption or an inconsistent save state.

Source

Thrown at Ghidra/Debug/Framework-TraceModeling/src/main/java/ghidra/trace/database/listing/DBTraceInstruction.java:227

		if (forcedLengthOverride != 0) {
			updateLengthOverride(forcedLengthOverride);
		}

		// TODO: Can there be more in this context than the context register???
		doSetPlatformMapping(platform);
		this.prototype = prototype;
	}

	@Override
	protected void fresh(boolean created) throws IOException {
		super.fresh(created);
		if (created) {
			// Wait for something to set prototype
			return;
		}
		platform = space.manager.platformManager.getPlatformByKey(platformKey);
		if (platform == null) {
			throw new IOException("Instruction table is corrupt. Missing platform: " + platformKey);
		}
		prototype = space.manager.getPrototypeByKey(prototypeKey);
		if (prototype == null) {
			Msg.error(this, "Instruction table is corrupt for address " + getMinAddress() +
				". Missing prototype " + prototypeKey);
			prototype = new InvalidPrototype(getTrace().getBaseLanguage());
		}
		flowOverride =
			FlowOverride.values()[(flags & FLOW_OVERRIDE_SET_MASK) >> FLOW_OVERRIDE_SHIFT];

		lengthOverride = (flags & LENGTH_OVERRIDE_SET_MASK) >> LENGTH_OVERRIDE_SHIFT;
		if (lengthOverride != 0 && lengthOverride < prototype.getLength()) {
			Address minAddr = getMinAddress();
			Address newEndAddr = minAddr.add(lengthOverride - 1);
			doSetRange(new AddressRangeImpl(minAddr, newEndAddr));
		}

		doSetPlatformMapping(platform);

View on GitHub (pinned to d5f144c24d)

Solutions

  1. Restore the trace from a known-good backup.
  2. Re-add the guest platform with the same key before opening the trace.
  3. Verify Ghidra version compatibility and report as a corruption bug if it occurs under normal single-session use.
  4. Ensure no concurrent trace access from multiple processes.

Example fix

// before — trace opens with corrupted instruction records
// throws IOException: Missing platform: 2

// after — restore backup or re-register the guest platform
// Re-add the guest platform that maps to key 2:
trace.getPlatformManager().addGuestPlatform(guestLanguage);
// then reopen the trace
// Alternatively: restore from backup
Defensive patterns

Strategy: try-catch

Validate before calling

// Cannot pre-validate individual instruction records; ensure platform integrity
// at the trace level before opening. This is a deserialization-time corruption error.
// Ensure the same platform set exists when reopening the trace.

Try / catch

try {
    trace = dbTrace.openForReading(path);
} catch (IOException e) {
    if (e.getMessage().contains("Instruction table is corrupt") ||
        e.getMessage().contains("Missing platform")) {
        Msg.error(MyClass.class, "Corrupt trace: " + e.getMessage());
        // Restore from backup or re-register the platform
    } else {
        throw e;
    }
}

Prevention

When it happens

Trigger: Opening a trace database where a DBTraceInstruction record has a platformKey with no matching platform. Occurs during the fresh(false) deserialization path when the instruction record is loaded but its platform cannot be found.

Common situations: Trace corruption from crash/concurrent write; guest platform removed or its key reassigned after the trace was written; version incompatibility between trace writer and reader; manual database editing.

Related errors


AI-assisted analysis of NationalSecurityAgency/ghidra@d5f144c24d (2026-08-14). Data as JSON: /api/errors/28cc2efa86a53bf9. Report an issue: GitHub.