NationalSecurityAgency/ghidra · error · ValueError

Address {address} is not in process {proc.GetProcessID()}

Error message

Address {address} is not in process {proc.GetProcessID()}

What it means

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.

Source

Thrown at Ghidra/Debug/Debugger-agent-lldb/src/main/py/src/ghidralldb/arch.py:279

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: lldb.SBProcess, offset: int) -> Tuple[str, Address]:
        space = self.defaultSpace
        return self.defaultSpace, Address(space, offset)

    def map_back(self, proc: lldb.SBProcess, address: Address) -> int:
        if address.space == self.defaultSpace:
            return address.offset
        raise ValueError(
            f"Address {address} is not in process {proc.GetProcessID()}")


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']:

View on GitHub (pinned to d5f144c24d)

Solutions

  1. Register a language-specific memory mapper (memory_mappers[lang]) whose defaultSpace covers the addresses you reverse-map.
  2. Before map_back, check address.space == mapper.defaultSpace and route to the correct mapper if not.
  3. Ensure the trace's language and the client's address space agree; start the trace with the language that matches the target.
  4. If single-space, confirm the address was constructed with space='ram' (or the mapper's default).

Example fix

// before
offset = mapper.map_back(proc, address)
// after
if address.space != mapper.defaultSpace:
    # route to the mapper for this space, or reject
    raise ValueError(f"address space {address.space} not handled")
offset = mapper.map_back(proc, address)
Defensive patterns

Strategy: validation

Validate before calling

mapper = arch.compute_memory_mapper(lang)
if address.space != mapper.defaultSpace:
    raise ValueError(f"space {address.space} not handled by mapper")
offset = mapper.map_back(proc, address)

Type guard

def address_space_handled(address: Address, mapper) -> bool:
    return address.space == mapper.defaultSpace

Try / catch

try:
    offset = mapper.map_back(proc, address)
except ValueError:
    # wrong space; route to correct mapper or reject
    log.warning("address %s not in mapper space %s", address, mapper.defaultSpace)
    raise

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


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