NationalSecurityAgency/ghidra · error · RuntimeError

Usage: ghidra trace tx-commit

Error message

Usage: ghidra trace tx-commit

What it means

`ghidra trace tx-commit` commits the currently open transaction and takes no arguments. Any extra token aborts before the commit, leaving the transaction open.

Source

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

        raise RuntimeError("Usage: ghidra trace tx-start DESCRIPTION")
    description = args[0]

    STATE.require_no_tx()
    STATE.tx = STATE.require_trace().start_tx(description, undoable=False)


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

    Usage: ghidra trace tx-commit
    """

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

    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)

View on GitHub (pinned to d5f144c24d)

Solutions

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

Example fix

// before
ghidra trace tx-commit force
// after
ghidra trace tx-commit
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_txcommit(debugger, command, result, internal_dict)
except RuntimeError as e:
    if str(e).startswith('Usage: ghidra trace tx-commit'):
        # drop arguments and retry
        ...
    raise

Prevention

When it happens

Trigger: `ghidra trace tx-commit now`; `ghidra trace tx-commit force`.

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/efc90124f605cbf3. Report an issue: GitHub.