NationalSecurityAgency/ghidra · warning · DatabaseNonFatalException

Empty signature file

Error message

Empty signature file

What it means

Thrown by FunctionDatabase.checkSettingsForInsert as a DatabaseNonFatalException when the signature file being inserted contains zero functions (manage.numFunctions() == 0). BSim treats an empty signature payload as a non-fatal insertion error so a bulk ingest can skip the file and continue with others, rather than aborting the whole operation.

Source

Thrown at Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/FunctionDatabase.java:238

		}
		if (res == 3) {
			throw new LSHException("Query signature data has no setting information");
		}
		throw new LSHException("Query signature data " +
			getFormattedVersion(manage.getMajorVersion(), manage.getMinorVersion(),
				manage.getSettings()) +
			" does not match database " +
			getFormattedVersion(info.major, info.minor, info.settings));
	}

	private static String getFormattedVersion(int maj, int min, int settings) {
		return String.format("%d.%d:0x%02x", maj, min, settings);
	}

	public static boolean checkSettingsForInsert(DescriptionManager manage,
			DatabaseInformation info) throws LSHException, DatabaseNonFatalException {
		if (manage.numFunctions() == 0) {
			throw new DatabaseNonFatalException("Empty signature file");
		}
		int res = info.checkSignatureSettings(manage.getMajorVersion(), manage.getMinorVersion(),
			manage.getSettings());
		if (res == 0) {
			return false;
		}
		if (res == 1) {
			throw new LSHException(
				"Trying to insert signature data with slight differences in settings");
		}
		if (res == 4) {
			return true; // This apparently is the first insert
		}
		if (res == 3) {
			throw new LSHException("Trying to insert signature data with no setting information");
		}
		throw new LSHException("Trying to insert signature data " +
			getFormattedVersion(manage.getMajorVersion(), manage.getMinorVersion(),

View on GitHub (pinned to d5f144c24d)

Solutions

  1. Verify the source program actually contains functions before generating signatures (check getFunctionManager().getFunctionCount()).
  2. Loosen or remove filters (address ranges, category exclusions) that may be stripping out all functions.
  3. Check the decompile log for earlier errors that produced no signatures.
  4. Skip empty files in the ingest loop since this is a non-fatal, skippable condition.

Example fix

// before
if (manage.numFunctions() == 0) { /* still attempt insert */ }
FunctionDatabase.checkSettingsForInsert(manage, info);
// after
if (manage.numFunctions() == 0) {
    log.warn("Skipping empty signature file");
    continue;
}
FunctionDatabase.checkSettingsForInsert(manage, info);
Defensive patterns

Strategy: try-catch

Validate before calling

// Skip empty signature files before insert
if (manage.numFunctions() == 0) {
    log.warn("Skipping empty signature file during ingest");
    // skip this file in the ingest loop
} else {
    FunctionDatabase.checkSettingsForInsert(manage, info);
}

Try / catch

try {
    FunctionDatabase.checkSettingsForInsert(manage, info);
} catch (DatabaseNonFatalException e) {
    if (e.getMessage().equals("Empty signature file")) {
        log.warn("Empty signature file skipped: {}", sourceFile);
        continue; // non-fatal, move to next file in ingest loop
    }
    throw e;
}

Prevention

When it happens

Trigger: Calling checkSettingsForInsert with a DescriptionManager that has no loaded functions. This occurs when a signature-generation step produced no functions (e.g. the program had none, or filtering removed all of them) and the resulting file is then submitted for insertion.

Common situations: Running BSim ingest on a program with no recognized functions. Applying a filter (address range, category, exclude list) that eliminates all functions. A decompiler failure that silently produced an empty output file. Submitting an accidentally-created empty .gsim file.

Related errors


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