NationalSecurityAgency/ghidra · error · IllegalArgumentException

Must specify an output directory

Error message

Must specify an output directory

What it means

Thrown by BSimLaunchable.doDumpSigs when the command-line params list is empty. 'dumpsigs' exports an executable's function signatures to XML in a local folder, and that destination folder is the one mandatory positional argument, so the call is rejected before any work begins. It is a plain IllegalArgumentException (not an IOException/LSHException) because it fails input validation, not I/O or a query error.

Source

Thrown at Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/ingest/BSimLaunchable.java:990

		}

		String functionTag = params.get(0);

		try (BulkSignatures bsim = getBulkSignatures()) {
			bsim.installTags(functionTag);
		}
	}

	/**
	 * Exports exe signature to local folder in XML format.
	 * 
	 * @param params the command-line params
	 * @throws IOException if there's an error establishing the database connection
	 * @throws LSHException if there's an error issuing the query
	 */
	private void doDumpSigs(List<String> params) throws IOException, LSHException {
		if (params.size() < 1) {
			throw new IllegalArgumentException("Must specify an output directory");
		}
		File resultFolder = new File(params.get(0));

		QueryName query = new QueryName();
		fillinSingleExeSpecifier(query.spec);
		query.maxfunc = 0; // all functions

		try (BulkSignatures bsim = getBulkSignatures()) {
			bsim.doDumpSigs(resultFolder, query);
		}
	}

	private static void printMaxMemory() {
		// division is used since default case may not use even multiples of 1024
		long maxMemoryBytes = Runtime.getRuntime().maxMemory();
		float maxMem = maxMemoryBytes / (1024 * 1024); // MBytes
		String units = " MBytes";
		if (maxMem >= 1024) {

View on GitHub (pinned to d5f144c24d)

Solutions

  1. Re-run the command supplying exactly one output directory as the first positional argument, e.g. 'bsim dumpsigs /path/to/outdir'.
  2. If scripting, verify the params list is non-empty before calling doDumpSigs and pass the directory as params.get(0).
  3. Check that any shell variable used for the directory is exported and non-empty.

Example fix

// before
launcher.doDumpSigs(params);  // params is []

// after
params.add(outputDir.getAbsolutePath());
launcher.doDumpSigs(params);
Defensive patterns

Strategy: validation

Validate before calling

// before calling doDumpSigs
if (params == null || params.isEmpty() || StringUtils.isBlank(params.get(0))) {
    throw new IllegalArgumentException("Output directory required for dumpsigs");
}
File outDir = new File(params.get(0));

Prevention

When it happens

Trigger: Running the headless BSim 'dumpsigs' command with no directory argument (params.size() < 1). Also reached if a calling layer invokes doDumpSigs(List) with an empty list.

Common situations: Typo or omission in a bsim command line (e.g. 'bsim dumpsigs' with the path missing), a shell script variable that expanded to empty ($OUT unset), or programmatic dispatch that forgets to push the output path into the params list.

Related errors


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