{"record":{"id":"c014a2e2446052b0","repo":"NationalSecurityAgency/ghidra","slug":"address-range-is-not-in-this-space","errorCode":null,"errorMessage":"Address Range '{}' is not in this space: '{}'","messagePattern":"Address Range '(.+?)' is not in this space: '(.+?)'","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"Ghidra/Debug/Framework-TraceModeling/src/main/java/ghidra/trace/database/space/DBTraceSpaceBased.java","lineNumber":58,"sourceCode":"\tdefault String explainLanguages(AddressSpace space) {\n\t\tif (space.getName().equals(getAddressSpace().getName())) {\n\t\t\treturn \". It's likely they come from different languages. Check the platform.\";\n\t\t}\n\t\treturn \"\";\n\t}\n\n\tdefault long assertInSpace(Address addr) {\n\t\tif (!isMySpace(addr.getAddressSpace())) {\n\t\t\tthrow new IllegalArgumentException(\n\t\t\t\t\"Address '\" + addr + \"' is not in this space: '\" + getAddressSpace() + \"'\" +\n\t\t\t\t\texplainLanguages(addr.getAddressSpace()));\n\t\t}\n\t\treturn addr.getOffset();\n\t}\n\n\tdefault void assertInSpace(AddressRange range) {\n\t\tif (!isMySpace(range.getAddressSpace())) {\n\t\t\tthrow new IllegalArgumentException(\n\t\t\t\t\"Address Range '\" + range + \"' is not in this space: '\" + getAddressSpace() + \"'\" +\n\t\t\t\t\texplainLanguages(range.getAddressSpace()));\n\t\t}\n\t}\n\n\tdefault Address toOverlay(Address physical) {\n\t\treturn getAddressSpace().getOverlayAddress(physical);\n\t}\n\n\tdefault Address toAddress(long offset) {\n\t\treturn getAddressSpace().getAddress(offset);\n\t}\n\n\tvoid invalidateCache();\n}\n","sourceCodeStart":40,"sourceCodeEnd":74,"githubUrl":"https://github.com/NationalSecurityAgency/ghidra/blob/d5f144c24d6bc53c9cbf4448c6d11143e7696206/Ghidra/Debug/Framework-TraceModeling/src/main/java/ghidra/trace/database/space/DBTraceSpaceBased.java#L40-L74","documentation":"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.","triggerScenarios":"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.","commonSituations":"Range-based memory block import across guest platforms; scripted bulk operations reusing a range from a different trace view.","solutions":["Construct the range in the target space: new AddressRangeImpl(spaceObj.getAddress(start), length).","Translate both endpoints via toOverlay before forming the range.","Pick the space object matching range.getAddressSpace()."],"exampleFix":"// before\nspaceObj.remove(snap, rangeFromOtherPlatform);\n// after\nAddressRange r = new AddressRangeImpl(\n    spaceObj.toOverlay(range.getMin().getPhysicalAddress()),\n    spaceObj.toOverlay(range.getMax().getPhysicalAddress()));\nspaceObj.remove(snap, r);","handlingStrategy":"validation","validationCode":"if (!spaceObj.isMySpace(range.getAddressSpace())) {\n    Address min = spaceObj.toOverlay(range.getMin().getPhysicalAddress());\n    Address max = spaceObj.toOverlay(range.getMax().getPhysicalAddress());\n    range = new AddressRangeImpl(min, max);\n}\nspaceObj.assertInSpace(range);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Build ranges in the target space, not a foreign one.","Translate both endpoints when crossing platforms."],"tags":["address-space","address-range","validation","platform"],"backgroundTag":null,"analyzedSha":"d5f144c24d6bc53c9cbf4448c6d11143e7696206","analyzedAt":"2026-08-14T01:00:57.564Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}