NationalSecurityAgency/ghidra · critical · IOException

Data table is corrupt. Missing platform

Error message

Data table is corrupt. Missing platform: {platformKey}

What it means

Thrown by DBTraceData.fresh() when loading a data unit record from the database and the stored platformKey does not resolve to a known platform via platformManager.getPlatformByKey(). This indicates database corruption — a data unit record references a platform that no longer exists in the trace's platform manager. The IOException signals that the persisted trace is internally inconsistent and cannot be reliably loaded.

Solutions

  1. Restore the trace from a known-good backup.
  2. If the platform was legitimately removed, re-add the guest platform with the same key before opening.
  3. Report the corruption — this is a data integrity issue that should not occur under normal operation; check for concurrent-write or crash scenarios.
  4. Ensure you are using the same (or compatible) Ghidra version that created the trace.

Example fix

// before — trace opens with corrupted data records
// throws IOException: Missing platform: 3

// after — re-add the platform or restore backup
// Re-register the guest platform that has key 3:
trace.getPlatformManager().addGuestPlatform(language); // if API allows
// Otherwise: restore from backup trace file
Defensive patterns

Strategy: try-catch

Validate before calling

// Before opening, verify the trace file is not corrupt (limited pre-check)
// This is a deserialization-time error; pre-validation requires
// checking the platform table integrity:
// (platform repair must happen at the trace/platform level, not per-record)

Try / catch

try {
    trace = dbTrace.openForReading(path);
} catch (IOException e) {
    if (e.getMessage().contains("Missing platform")) {
        Msg.error(MyClass.class, "Trace is corrupt: " + e.getMessage());
        // Attempt recovery: restore from backup or skip affected records
    } else {
        throw e;
    }
}

Prevention

When it happens

Trigger: Loading/opening a trace database where a DBTraceData record has a platformKey column value that has no corresponding entry in the platform manager's platform table. This happens during deserialization of trace data units (the fresh(false) path).

Common situations: Trace file corruption from incomplete writes, crashes, or concurrent access without proper locking; manual editing of the underlying database; trace created with a guest platform that was later removed or whose key allocation changed; version incompatibility between the writer and reader of the trace format.

Related errors


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

Appendix: source

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

	 * @param tree the storage R*-Tree
	 * @param store the object store
	 * @param record the record
	 */
	public DBTraceData(DBTraceCodeSpace space,
			DBTraceAddressSnapRangePropertyMapTree<DBTraceData, ?> tree,
			DBCachedObjectStore<?> store, DBRecord record) {
		super(space, tree, store, record);
	}

	@Override
	protected void fresh(boolean created) throws IOException {
		super.fresh(created);
		if (created) {
			return;
		}
		platform = space.manager.platformManager.getPlatformByKey(platformKey);
		if (platform == null) {
			throw new IOException("Data table is corrupt. Missing platform: " + platformKey);
		}
		dataType = platform.getDataTypeManager().getDataType(dataTypeID);
		if (dataType == null) {
			throw new IOException("Data table is corrupt. Missing datatype: " + dataTypeID);
		}
		baseDataType = getBaseDataType(dataType);
		final int dtLen = getDataTypeLength();
		if (dtLen != range.getLength() && dtLen != -1) {
			throw new IOException(
				"Data table is corrupt. Data unit and its datatype disagree on length.");
		}
		defaultSettings = dataType.getDefaultSettings();
	}

	@Override
	protected void setRecordValue(DBTraceData value) {
		// Nothing. Entry is the value
	}

View on GitHub (pinned to d5f144c24d)