NationalSecurityAgency/ghidra · error · IllegalStateException

Offer requires image, but no program given.

Error message

Offer requires image, but no program given.

What it means

Thrown as IllegalStateException at the very start of launchProgram when the offer's requiresImage() returns true but the program field is null. Some launch offers (e.g., launching a local program under a debugger) intrinsically need a static program image to map against; calling them without one is a programmer/usage error, not a runtime condition.

Source

Thrown at Ghidra/Debug/Debugger-rmi-trace/src/main/java/ghidra/app/plugin/core/debug/gui/tracermi/launcher/AbstractTraceRmiLaunchOffer.java:684

			boolean mapped;
			try {
				mapped = invokeMapper(monitor, mappingService, connection, trace, spec);
			}
			catch (CancelledException ce) {
				throw new CancellationException(e.getMessage());
			}
			if (!mapped) {
				throw new NoStaticMappingException(
					"The resulting target process has no mapping to the static image.");
			}
		}
		monitor.increment();
	}

	@Override
	public LaunchResult launchProgram(TaskMonitor monitor, LaunchConfigurator configurator) {
		if (requiresImage() && program == null) {
			throw new IllegalStateException("Offer requires image, but no program given.");
		}
		InternalTraceRmiService service = tool.getService(InternalTraceRmiService.class);
		DebuggerTraceManagerService traceManager =
			tool.getService(DebuggerTraceManagerService.class);
		final PromptMode mode = configurator.getPromptMode();
		boolean prompt = mode == PromptMode.ALWAYS;

		DefaultTraceRmiAcceptor acceptor = null;
		Map<String, TerminalSession> sessions = new LinkedHashMap<>();
		TraceRmiHandler connection = null;
		Trace trace = null;
		Throwable lastExc = null;

		updateMonitorMax(monitor, null);
		while (true) {
			try {
				monitor.setMessage("Gathering arguments");
				Map<String, ValStr<?>> args = getLauncherArgs(prompt, configurator, lastExc);

View on GitHub (pinned to d5f144c24d)

Solutions

  1. Open and activate the target program in Ghidra before invoking the launch offer.
  2. If invoking programmatically, ensure the Program is passed to the offer at construction time.
  3. Select an offer whose requiresImage() is false if you intend to launch without a static image.
Defensive patterns

Strategy: validation

Validate before calling

if (offer.requiresImage() && program == null) {
    throw new IllegalStateException("Open a program before launching this offer");
}

Prevention

When it happens

Trigger: Invoking launchProgram on an offer that was constructed without a Program, or where the program reference was cleared/null. This typically happens when the launch is triggered from a context that has no active program, or the offer was created for a different purpose.

Common situations: Trying to launch a debugger from the global menu when no program is open; the active program was closed before the launch offer executed; a plugin/automation path created an offer without binding a Program.

Related errors


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