NationalSecurityAgency/ghidra · critical · RuntimeException

Base space for overlay not found: {}

Error message

Base space for overlay not found: {}

What it means

isCompatibleOverlay reads a stored DBTraceOverlaySpaceEntry and resolves its baseSpace name through the program address factory. If factory.getAddressSpace(ent.baseSpace) returns null, the stored overlay references an address space that no longer exists in the (possibly updated) processor language, and a RuntimeException is thrown. The inline comment admits this should be handled better. It is a data-integrity failure surfaced while opening or migrating a trace.

Source

Thrown at Ghidra/Debug/Framework-TraceModeling/src/main/java/ghidra/trace/database/address/DBTraceOverlaySpaceAdapter.java:245

				DBTraceOverlaySpaceEntry ent = keyToRecordMap.get(key);
				String spaceName = ent.name;
				AddressSpace baseSpace = factory.getAddressSpace(ent.baseSpace);
				factory.addOverlaySpace(key, spaceName, baseSpace);
			}
		}
		catch (IllegalArgumentException | DuplicateNameException e) {
			throw new AssertionError("Unexpected error updating overlay address spaces", e);
		}

		factory.refreshStaleOverlayStatus();
	}

	private boolean isCompatibleOverlay(ProgramOverlayAddressSpace os, DBTraceOverlaySpaceEntry ent,
			ProgramAddressFactory factory) {
		AddressSpace baseSpace = factory.getAddressSpace(ent.baseSpace);
		if (baseSpace == null) {
			// Error condition should be handled better - language may have dropped original base space
			throw new RuntimeException("Base space for overlay not found: " + ent.baseSpace);
		}
		return baseSpace == os.getOverlayedSpace();
	}

	protected AddressSpace doCreateOverlaySpace(String name, AddressSpace base)
			throws DuplicateNameException {
		TraceAddressFactory factory = trace.getInternalAddressFactory();

		if (!factory.isValidOverlayBaseSpace(base)) {
			throw new IllegalArgumentException(
				"Invalid address space for overlay: " + base.getName());
		}

		if (factory.getAddressSpace(name) != null) {
			throw new DuplicateNameException(
				"Overlay space '" + name + "' duplicates name of another address space");
		}

View on GitHub (pinned to d5f144c24d)

Solutions

  1. Install/register the same processor language (with the original base space name) that was present when the trace was created.
  2. Re-open the trace on the original Ghidra/language configuration that produced it.
  3. If the space is genuinely gone, treat the trace as needing repair: recreate the overlay against a space that still exists, or rebuild the trace.
Defensive patterns

Strategy: validation

Validate before calling

// before opening, confirm every stored overlay's base space still resolves
for (String base : storedOverlayBaseSpaces) {
    if (factory.getAddressSpace(base) == null) {
        // abort open or migrate: missing language space
    }
}

Try / catch

try { trace.open(...); }
catch (RuntimeException e) {
    if (e.getMessage().startsWith("Base space for overlay not found")) { /* require original language */ }
    else throw e;
}

Prevention

When it happens

Trigger: Opening a saved trace after the underlying processor language definition changed and dropped/renamed the base address space an overlay was built on; the DB refresh/load path calling isCompatibleOverlay during open; cross-version trace migration where the new language pack lacks the original base space.

Common situations: Upgrading Ghidra or processor-language definitions between versions; importing a trace from another install with different language packs; manually editing or partially corrupting the trace DB.

Related errors


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