NationalSecurityAgency/ghidra · error · ValueError
Address {address} is not in process {proc}
Error message
Address {address} is not in process {proc} What it means
Thrown by DefaultMemoryMapper.map_back() when the Address object's space does not match the mapper's defaultSpace. During reverse-mapping (from Ghidra address space back to debugger offset), the address belongs to a different address space than expected, so the offset cannot be extracted. This ValueError signals an address-space mismatch in the debugger bridge.
Source
Thrown at Ghidra/Debug/Debugger-agent-dbgeng/src/main/py/src/ghidradbg/arch.py:220
def compute_ghidra_lcsp() -> Tuple[str, str]:
lang = compute_ghidra_language()
comp = compute_ghidra_compiler(lang)
return lang, comp
class DefaultMemoryMapper(object):
def __init__(self, defaultSpace: str) -> None:
self.defaultSpace = defaultSpace
def map(self, proc: int, offset: int) -> Tuple[str, Address]:
space = self.defaultSpace
return self.defaultSpace, Address(space, offset)
def map_back(self, proc: int, address: Address) -> int:
if address.space == self.defaultSpace:
return address.offset
raise ValueError(f"Address {address} is not in process {proc}")
DEFAULT_MEMORY_MAPPER = DefaultMemoryMapper('ram')
memory_mappers: Dict[str, DefaultMemoryMapper] = {}
def compute_memory_mapper(lang: str) -> DefaultMemoryMapper:
if not lang in memory_mappers:
return DEFAULT_MEMORY_MAPPER
return memory_mappers[lang]
class DefaultRegisterMapper(object):
def __init__(self, byte_order: str) -> None:
if not byte_order in ['big', 'little']:
raise ValueError("Invalid byte_order: {}".format(byte_order))View on GitHub (pinned to d5f144c24d)
Solutions
- Register a custom memory mapper for the target language in the memory_mappers dictionary that handles the correct spaces.
- Ensure addresses passed to map_back are from the expected address space.
- Check that compute_memory_mapper(lang) returns the right mapper for the target architecture.
- If the architecture needs multi-space support, subclass DefaultMemoryMapper and override map_back.
Example fix
# Before: default mapper only handles 'ram' space
# arch.memory_mappers['x86:LE:64:default'] = MyMultiSpaceMapper(['ram', 'code'])
#
# class MyMultiSpaceMapper(arch.DefaultMemoryMapper):
# def map_back(self, proc, address):
# if address.space in self.valid_spaces:
# return address.offset
# raise ValueError(f"Address {address} not in known spaces") Defensive patterns
Strategy: validation
Validate before calling
# Before calling map_back, check the address space:
if address.space == mapper.defaultSpace:
offset = mapper.map_back(proc, address)
else:
# handle alternative space or use correct mapper Type guard
# Check if address is in the mapper's space before reverse-mapping
def is_in_default_space(address: Address, mapper: DefaultMemoryMapper) -> bool:
return address.space == mapper.defaultSpace Try / catch
try:
offset = mapper.map_back(proc, address)
except ValueError as e:
if 'is not in process' in str(e):
# address is in a different space; handle or use space-specific mapper
else:
raise Prevention
- Register architecture-specific memory mappers in arch.memory_mappers for multi-space targets.
- Validate address.space against the mapper's defaultSpace before calling map_back.
- Understand the target architecture's address space model before debugging.
- Use the correct mapper returned by compute_memory_mapper(lang) for each language.
When it happens
Trigger: DefaultMemoryMapper.map_back(proc, address) checks address.space == self.defaultSpace; if they differ, ValueError is raised. The default mapper is initialized with 'ram' as the space, so any address in a different space (e.g., 'register', 'stack', a segment space) triggers the error. Called when the debugger bridge tries to translate a Ghidra-space address back to a debugger offset.
Common situations: The target architecture uses multiple address spaces (e.g., Harvard architecture with separate code/data spaces). The memory mapper wasn't configured for the correct language — the default 'ram' mapper is used when no architecture-specific mapper is registered in memory_mappers. An address from the register space or a custom space is passed to the memory mapper.
Related errors
- Cannot convert {}'s value: '{}', type: '{}'
- Invalid byte_order: {}
- No memory mapper
- No register mapper
- Not connected
AI-assisted analysis of NationalSecurityAgency/ghidra@d5f144c24d (2026-08-14).
Data as JSON: /api/errors/20a43b53292a758b.
Report an issue: GitHub.