NationalSecurityAgency/ghidra · error · ValueError
max out of range of int64
Error message
max out of range of int64
What it means
Thrown by the Python ghidratrace Lifespan dataclass's __post_init__ when the `max` field exceeds LIFESPAN_MAX (2**63 - 1, the largest signed 64-bit value). Snap numbers are int64 on the wire, so the client rejects out-of-range values.
Source
Thrown at Ghidra/Debug/Debugger-rmi-trace/src/main/py/src/ghidratrace/client.py:118
def length(self) -> int:
return self.max - self.min + 1
LIFESPAN_MIN = -1 << 63
LIFESPAN_MAX = (1 << 63) - 1
@dataclass(frozen=True)
class Lifespan:
min: int = LIFESPAN_MIN
max: int = LIFESPAN_MAX
def __post_init__(self) -> None:
if self.min < LIFESPAN_MIN:
raise ValueError("min out of range of int64")
if self.max > LIFESPAN_MAX:
raise ValueError("max out of range of int64")
if self.min > self.max and not (self.min == 0 and self.max == -1):
raise ValueError("min cannot exceed max")
def is_empty(self) -> bool:
return self.min == 0 and self.max == -1
def __str__(self) -> str:
if self.is_empty():
return "(EMPTY)"
min = '(-inf' if self.min == LIFESPAN_MIN else f'[{self.min}'
max = '+inf)' if self.max == LIFESPAN_MAX else f'{self.max}]'
return f'{min},{max}'
def __repr__(self) -> str:
return 'Lifespan' + self.__str__()
@dataclassView on GitHub (pinned to d5f144c24d)
Solutions
- Clamp max to LIFESPAN_MAX (module constant) before constructing the Lifespan.
- If you want an open-ended upper bound, pass LIFESPAN_MAX explicitly instead of a huge computed number.
- Re-check the snap arithmetic for overflow.
Example fix
# before span = Lifespan(min=0, max=base_snap + huge_delta) # after from ghidratrace.client import LIFESPAN_MAX hi = min(base_snap + huge_delta, LIFESPAN_MAX) span = Lifespan(min=0, max=hi)
Defensive patterns
Strategy: validation
Validate before calling
from ghidratrace.client import LIFESPAN_MAX, Lifespan hi = min(value, LIFESPAN_MAX) span = Lifespan(min=LIFESPAN_MIN, max=hi)
Type guard
def valid_max(v: int) -> bool:
from ghidratrace.client import LIFESPAN_MAX
return v <= LIFESPAN_MAX Try / catch
try:
span = Lifespan(min=lo, max=hi)
except ValueError:
hi = min(hi, LIFESPAN_MAX)
span = Lifespan(min=lo, max=hi) Prevention
- Clamp snap values to int64 bounds before constructing Lifespan.
- Pass LIFESPAN_MAX explicitly for open-ended upper bounds.
- Re-check snap arithmetic for overflow.
When it happens
Trigger: Constructing Lifespan(max=...) with a value greater than 9223372036854775807, e.g. from arithmetic that overflows int64 or from an unbounded/very large value.
Common situations: Adding a large delta to a snap that overflows; passing sys.maxsize or a Python arbitrary-precision int that exceeds int64; using a far-future snap.
Related errors
- min out of range of int64
- min cannot exceed max
- {object} is not {err_msg}
- No saved offers to launch {}
- Range [%s:%x+%x] entirely exceeds space min
AI-assisted analysis of NationalSecurityAgency/ghidra@d5f144c24d (2026-08-14).
Data as JSON: /api/errors/63b00cd0d1d360fb.
Report an issue: GitHub.