NationalSecurityAgency/ghidra · error · IllegalArgumentException

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

Error message

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

What it means

Thrown by DBTraceSpaceBased.assertInSpace(AddressRange) when the range's address space does not match this space object's address space. Identical in cause to the Address variant (507) but triggered by range-scoped operations (bulk puts, reads over a range). The explainLanguages hint applies identically.

Source

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

	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);
	}

	default Address toAddress(long offset) {
		return getAddressSpace().getAddress(offset);
	}

	void invalidateCache();
}

View on GitHub (pinned to d5f144c24d)

Solutions

  1. Construct the range in the target space: new AddressRangeImpl(spaceObj.getAddress(start), length).
  2. Translate both endpoints via toOverlay before forming the range.
  3. Pick the space object matching range.getAddressSpace().

Example fix

// before
spaceObj.remove(snap, rangeFromOtherPlatform);
// after
AddressRange r = new AddressRangeImpl(
    spaceObj.toOverlay(range.getMin().getPhysicalAddress()),
    spaceObj.toOverlay(range.getMax().getPhysicalAddress()));
spaceObj.remove(snap, r);
Defensive patterns

Strategy: validation

Validate before calling

if (!spaceObj.isMySpace(range.getAddressSpace())) {
    Address min = spaceObj.toOverlay(range.getMin().getPhysicalAddress());
    Address max = spaceObj.toOverlay(range.getMax().getPhysicalAddress());
    range = new AddressRangeImpl(min, max);
}
spaceObj.assertInSpace(range);

Prevention

When it happens

Trigger: Passing an AddressRange constructed in one language's memory space into a space object bound to another language/platform's space; mixing register ranges with memory spaces.

Common situations: Range-based memory block import across guest platforms; scripted bulk operations reusing a range from a different trace view.

Related errors


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