NationalSecurityAgency/ghidra · error · RuntimeError

Usage: ghidra trace tx-abort

Error message

Usage: ghidra trace tx-abort

What it means

`ghidra trace tx-abort` aborts the current transaction (emergency use only; it may leave the trace inconsistent) and takes no arguments. Any extra token aborts before the abort.

Source

Thrown at Ghidra/Debug/Debugger-agent-lldb/src/main/py/src/ghidralldb/commands.py:560

    STATE.require_tx()[1].commit()
    STATE.reset_tx()


@convert_errors
def ghidra_trace_txabort(debugger: lldb.SBDebugger, command: str,
                         result: lldb.SBCommandReturnObject,
                         internal_dict: Dict[str, Any]) -> None:
    """Abort the current transaction.

    Usage: ghidra trace tx-abort

    Use only in emergencies. This may not always succeed, and it may leave the
    trace in an inconsistent state.
    """

    args = shlex.split(command)
    if len(args) != 0:
        raise RuntimeError("Usage: ghidra trace tx-abort")

    trace, tx = STATE.require_tx()
    print("Aborting trace transaction!")
    tx.abort()
    STATE.reset_tx()


@contextmanager
def open_tracked_tx(description: str) -> Generator[Transaction, None, None]:
    with STATE.require_trace().open_tx(description) as tx:
        STATE.tx = tx
        yield tx
    STATE.reset_tx()


@convert_errors
def ghidra_trace_txopen(debugger: lldb.SBDebugger, command: str,
                        result: lldb.SBCommandReturnObject,

View on GitHub (pinned to d5f144c24d)

Solutions

  1. Call it with no arguments: `ghidra trace tx-abort`

Example fix

// before
ghidra trace tx-abort now
// after
ghidra trace tx-abort
Defensive patterns

Strategy: validation

Validate before calling

import shlex
def no_args(command: str) -> bool:
    return len(shlex.split(command)) == 0

Try / catch

try:
    ghidra_trace_txabort(debugger, command, result, internal_dict)
except RuntimeError as e:
    if str(e).startswith('Usage: ghidra trace tx-abort'):
        # drop arguments and retry
        ...
    raise

Prevention

When it happens

Trigger: `ghidra trace tx-abort now`; `ghidra trace tx-abort yes`.

Common situations: Appending a confirmation keyword this command does not recognize.

Related errors


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