NationalSecurityAgency/ghidra · error · IllegalArgumentException
Invalid option use with --config option: --commit
Error message
Invalid option use with --config option: --commit
What it means
Thrown by doGenerateSigs() when the user supplies an XML output directory (params.size()==1) together with both --config and --commit. The --commit flag tells BSim to commit signatures directly to the database, but --config mode is for generating standalone XML files only (no DB commit). These are mutually exclusive: --commit only applies when --bsim points at a live database.
Source
Thrown at Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/ingest/BSimLaunchable.java:600
System.out.println("Database NOT dropped");
return false;
}
private void doGenerateSigs(List<String> params, TaskMonitor monitor)
throws Exception, CancelledException {
// concurrent --bsim and --config option use already checked
if (params.size() > 1) {
throw new IllegalArgumentException("Invalid generatesigs parameter use!");
}
boolean commitOption = booleanOptions.contains(COMMIT_OPTION);
boolean overwriteOption = booleanOptions.contains(OVERWRITE_OPTION);
String configOption = optionValueMap.get(CONFIG_OPTION);
String xmlDirectory = null;
if (params.size() == 1) {
xmlDirectory = params.get(0);
if (configOption != null && commitOption) {
throw new IllegalArgumentException(
"Invalid option use with " + CONFIG_OPTION + " option: " + COMMIT_OPTION);
}
}
else {
if (overwriteOption) {
throw new IllegalArgumentException("Invalid option use: " + OVERWRITE_OPTION);
}
commitOption = true; // assume DB commit using temp XML directory
}
try (BulkSignatures bsim = getBulkSignatures()) {
if (commitOption) {
// Generate and commit signatures to BSim database
bsim.signatureRepo(ghidraURL, xmlDirectory, overwriteOption, monitor);
}
else {
// Generate sig XML files only
bsim.generateSignaturesFromServer(ghidraURL, xmlDirectory, overwriteOption,View on GitHub (pinned to d5f144c24d)
Solutions
- Remove --commit when using --config (XML generation does not commit to a DB).
- Or switch to --bsim <bsimURL> mode if you want direct commit: generatesigs <ghidraURL> <xmldir> --bsim <url> --commit.
- Re-read the usage: line 1033 (--config, no commit) vs line 1034 (--bsim, optional --commit).
Example fix
// before bsim generatesigs ghidra://myhost/Repo /tmp/xml --config medium_64 --commit // after (XML only) bsim generatesigs ghidra://myhost/Repo /tmp/xml --config medium_64 // after (direct commit) bsim generatesigs ghidra://myhost/Repo /tmp/xml --bsim postgresql://myhost/BsimDB --commit
Defensive patterns
Strategy: validation
Validate before calling
// Mutually exclusive: --config and --commit cannot coexist when a directory is given
String config = optionValueMap.get("--config");
boolean commit = booleanOptions.contains("--commit");
if (config != null && commit) {
throw new IllegalArgumentException("--commit is not valid with --config; use --bsim for direct commit");
} Prevention
- Document that --config = XML-only (no commit) and --bsim = direct commit.
- Add a CI check or wrapper script that rejects the --config+--commit combination.
When it happens
Trigger: Command: generatesigs <ghidraURL> <xmldir> --config <template> --commit. At line 599, configOption is non-null AND commitOption is true, triggering the throw at line 600.
Common situations: Mixing the two valid modes (XML-generation mode vs. direct-commit mode) in one invocation; assuming --commit is harmless when writing XML; upgrading and not noticing the option semantics changed.
Related errors
- Invalid option use: --overwrite
- Invalid generatesigs parameter use!
- The --name, --arch, --compiler options are not valid when --
- Unknown command: {}
- Unsupported command: {}
AI-assisted analysis of NationalSecurityAgency/ghidra@d5f144c24d (2026-08-14).
Data as JSON: /api/errors/a0ee1e0423830cf5.
Report an issue: GitHub.