NationalSecurityAgency/ghidra · error · IllegalArgumentException

Address '{}' is not in this space: '{}'

Error message

Address '{}' is not in this space: '{}'

What it means

Thrown by DBTraceSpaceBased.assertInSpace(Address) when the address's address space does not match this space object's address space (checked via isMySpace). The optional suffix explainLanguages() appends a hint when the space names match, suggesting the addresses come from different languages/platforms. This guards every per-space operation from cross-space address contamination.

Source

Thrown at Ghidra/Debug/Framework-TraceModeling/src/main/java/ghidra/trace/database/space/DBTraceSpaceBased.java:49

		 * will all be delegated from the manger directly, it doesn't make sense to permit sloppy
		 * access.
		 */
		/*if (space.isRegisterSpace() && space == getAddressSpace().getPhysicalSpace()) {
			return true;
		}*/
		return false;
	}

	default String explainLanguages(AddressSpace space) {
		if (space.getName().equals(getAddressSpace().getName())) {
			return ". It's likely they come from different languages. Check the platform.";
		}
		return "";
	}

	default long assertInSpace(Address addr) {
		if (!isMySpace(addr.getAddressSpace())) {
			throw new IllegalArgumentException(
				"Address '" + addr + "' is not in this space: '" + getAddressSpace() + "'" +
					explainLanguages(addr.getAddressSpace()));
		}
		return addr.getOffset();
	}

	default void assertInSpace(AddressRange range) {
		if (!isMySpace(range.getAddressSpace())) {
			throw new IllegalArgumentException(
				"Address Range '" + range + "' is not in this space: '" + getAddressSpace() + "'" +
					explainLanguages(range.getAddressSpace()));
		}
	}

	default Address toOverlay(Address physical) {
		return getAddressSpace().getOverlayAddress(physical);
	}

View on GitHub (pinned to d5f144c24d)

Solutions

  1. Translate the address to the target space via toOverlay(physical) or space.getAddress(offset).
  2. Ensure you are operating on the space object whose getAddressSpace() matches addr.getAddressSpace().
  3. Verify the platform/language before reusing cached addresses.

Example fix

// before
spaceObj.put(snap, hostAddr, ...);
// after
Address translated = spaceObj.toOverlay(hostAddr.getPhysicalAddress());
spaceObj.put(snap, translated, ...);
Defensive patterns

Strategy: validation

Validate before calling

if (!spaceObj.isMySpace(addr.getAddressSpace())) {
    addr = spaceObj.toOverlay(addr.getPhysicalAddress());
}
spaceObj.assertInSpace(addr);

Prevention

When it happens

Trigger: Passing an address from the host language's memory space into a per-space object that was created for a guest platform's memory space (different language, same nominal name). Passing a register address into a memory-space object.

Common situations: Multi-platform/guest debugging where memory spaces share names but differ by language; copying addresses between trace views backed by different platforms.

Related errors


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