{"record":{"id":"f1a90fdd890cd79f","repo":"NationalSecurityAgency/ghidra","slug":"address-address-is-not-in-process-proc-getproce","errorCode":null,"errorMessage":"Address {address} is not in process {proc.GetProcessID()}","messagePattern":"Address (.+?) is not in process (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"Ghidra/Debug/Debugger-agent-lldb/src/main/py/src/ghidralldb/arch.py","lineNumber":279,"sourceCode":"def compute_ghidra_lcsp() -> Tuple[str, str]:\n    lang = compute_ghidra_language()\n    comp = compute_ghidra_compiler(lang)\n    return lang, comp\n\n\nclass DefaultMemoryMapper(object):\n\n    def __init__(self, defaultSpace: str) -> None:\n        self.defaultSpace = defaultSpace\n\n    def map(self, proc: lldb.SBProcess, offset: int) -> Tuple[str, Address]:\n        space = self.defaultSpace\n        return self.defaultSpace, Address(space, offset)\n\n    def map_back(self, proc: lldb.SBProcess, address: Address) -> int:\n        if address.space == self.defaultSpace:\n            return address.offset\n        raise ValueError(\n            f\"Address {address} is not in process {proc.GetProcessID()}\")\n\n\nDEFAULT_MEMORY_MAPPER = DefaultMemoryMapper('ram')\n\nmemory_mappers: Dict[str, DefaultMemoryMapper] = {}\n\n\ndef compute_memory_mapper(lang: str) -> DefaultMemoryMapper:\n    if not lang in memory_mappers:\n        return DEFAULT_MEMORY_MAPPER\n    return memory_mappers[lang]\n\n\nclass DefaultRegisterMapper(object):\n\n    def __init__(self, byte_order: str) -> None:\n        if not byte_order in ['big', 'little']:","sourceCodeStart":261,"sourceCodeEnd":297,"githubUrl":"https://github.com/NationalSecurityAgency/ghidra/blob/d5f144c24d6bc53c9cbf4448c6d11143e7696206/Ghidra/Debug/Debugger-agent-lldb/src/main/py/src/ghidralldb/arch.py#L261-L297","documentation":"Raised by DefaultMemoryMapper.map_back in the Ghidra LLDB agent when an Address passed for reverse mapping has an address space that differs from the mapper's configured defaultSpace. map_back translates a Ghidra Address into a target offset; if the address does not belong to the mapper's space, the translation is undefined and the agent refuses it with ValueError. The default mapper uses space 'ram'; language-specific mappers may use other spaces.","triggerScenarios":"Calling map_back(proc, address) with an Address whose .space is not the mapper's defaultSpace — e.g. the client sent an address from a code space while the process mapper expects 'ram', or a language mapper was not registered for the target language so the default 'ram' mapper was used on a multi-space target.","commonSituations":"Multi-space targets (segmented/harvard architectures) where the chosen mapper does not cover the address's space; missing memory_mappers registration for the target language (compute_memory_mapper falls back to DEFAULT_MEMORY_MAPPER); client/UI sending addresses in a different space than the trace was started with.","solutions":["Register a language-specific memory mapper (memory_mappers[lang]) whose defaultSpace covers the addresses you reverse-map.","Before map_back, check address.space == mapper.defaultSpace and route to the correct mapper if not.","Ensure the trace's language and the client's address space agree; start the trace with the language that matches the target.","If single-space, confirm the address was constructed with space='ram' (or the mapper's default)."],"exampleFix":"// before\noffset = mapper.map_back(proc, address)\n// after\nif address.space != mapper.defaultSpace:\n    # route to the mapper for this space, or reject\n    raise ValueError(f\"address space {address.space} not handled\")\noffset = mapper.map_back(proc, address)","handlingStrategy":"validation","validationCode":"mapper = arch.compute_memory_mapper(lang)\nif address.space != mapper.defaultSpace:\n    raise ValueError(f\"space {address.space} not handled by mapper\")\noffset = mapper.map_back(proc, address)","typeGuard":"def address_space_handled(address: Address, mapper) -> bool:\n    return address.space == mapper.defaultSpace","tryCatchPattern":"try:\n    offset = mapper.map_back(proc, address)\nexcept ValueError:\n    # wrong space; route to correct mapper or reject\n    log.warning(\"address %s not in mapper space %s\", address, mapper.defaultSpace)\n    raise","preventionTips":["register language-specific mappers for multi-space targets","validate address.space before reverse-mapping","ensure trace language matches target address spaces"],"tags":["ghidra","lldb","address-space","value-error","memory-mapper"],"backgroundTag":null,"analyzedSha":"d5f144c24d6bc53c9cbf4448c6d11143e7696206","analyzedAt":"2026-08-14T01:00:57.564Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}