NationalSecurityAgency/ghidra · error · RuntimeException

No trace started

Error message

No trace started

What it means

RuntimeException('No trace started') thrown by State.requireTrace() when the trace field is null. Commands that manipulate a trace (snapshots, objects, memory) route through requireTrace() to obtain the RmiTrace; calling them before a trace has been started fails here.

Source

Thrown at Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/rmi/jpda/JdiCommands.java:84

		}
		return client;
	}

	public void requireNoClient() {
		if (client != null) {
			client = null;
			throw new RuntimeException("Already connected");
		}
	}

	public void resetClient() {
		client = null;
		resetTrace();
	}

	public RmiTrace requireTrace() {
		if (trace == null) {
			throw new RuntimeException("No trace started");
		}
		return trace;
	}

	public void requireNoTrace() {
		if (trace != null) {
			throw new RuntimeException("Trace already started");
		}
	}

	public void resetTrace() {
		trace = null;
		resetTx();
	}

	public RmiTransaction requireTx() {
		if (tx == null) {
			throw new RuntimeException("No transaction");

View on GitHub (pinned to d5f144c24d)

Solutions

  1. Run the start-trace command to initialize State.trace before any trace-requiring command.
  2. Guard by checking state.trace != null before invoking, or catch RuntimeException.
  3. After resetTrace/disconnect, start a new trace before continuing.

Example fix

// before
state.requireTrace().recordSnapshot();

// after
if (state.trace == null) {
    throw new IllegalStateException("Start a trace before recording snapshots");
}
state.requireTrace().recordSnapshot();
Defensive patterns

Strategy: validation

Validate before calling

if (state.trace == null) {
    throw new IllegalStateException("Start a trace first");
}
state.requireTrace().recordSnapshot();

Try / catch

try {
    state.requireTrace();
} catch (RuntimeException e) {
    if ("No trace started".equals(e.getMessage())) {
        // run start-trace first
    }
}

Prevention

When it happens

Trigger: Issuing trace-manipulation commands (snapshot, object, memory, stepping that records) that call requireTrace() before State.trace has been created by a start-trace command.

Common situations: Command sequence that skips start trace; trace was reset (resetTrace sets trace=null) and commands continued; running a record/step command before starting the trace session.

Related errors


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