NationalSecurityAgency/ghidra · error · LSHException

Trying to insert signature data with no setting information

Error message

Trying to insert signature data with no setting information

What it means

Thrown by FunctionDatabase.checkSettingsForInsert when checkSignatureSettings returns 3, meaning the insert payload itself has no setting information (its major version is 0 or its settings value is 0). BSim rejects inserting signatures that carry no settings metadata because they could not be validated against or consistently merged into the database.

Source

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

	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(),
				manage.getSettings()) +
			" with settings that don't match database " +
			getFormattedVersion(info.major, info.minor, info.settings));
	}

	public static String constructFatalError(int flags, ExecutableRecord newrec,
			ExecutableRecord orig) {
		String res = null;
		if ((flags & ExecutableRecord.METADATA_ARCH) != 0) {
			res = newrec.getNameExec() + " already ingested with different architecture field: " +
				orig.getArchitecture();
		}
		else if ((flags & ExecutableRecord.METADATA_COMP) != 0) {
			res = newrec.getNameExec() + " already ingested with different compiler field: " +
				orig.getNameCompiler();

View on GitHub (pinned to d5f144c24d)

Solutions

  1. Ensure GenSignatures.setVectorFactory is called with a factory whose getSettings() is non-zero before generating signatures (see error 730).
  2. Regenerate the signature file with current BSim tooling so the header carries a non-zero major version and settings.
  3. Inspect the file header to confirm the version/settings fields are populated.

Example fix

// before
// factory.getSettings() == 0 when generating
FunctionDatabase.checkSettingsForInsert(manage, info);
// after
genSignatures.setVectorFactory(vectorFactory); // getSettings() != 0
// regenerate, then insert
FunctionDatabase.checkSettingsForInsert(manage, info);
Defensive patterns

Strategy: validation

Validate before calling

// Ensure insert payload has settings metadata
if (manage.getMajorVersion() == 0 || manage.getSettings() == 0) {
    throw new IllegalStateException(
        "Signature payload has no setting information; regenerate with an initialized vector factory");
}
FunctionDatabase.checkSettingsForInsert(manage, info);

Try / catch

try {
    FunctionDatabase.checkSettingsForInsert(manage, info);
} catch (LSHException e) {
    if (e.getMessage().contains("no setting information")) {
        log.error("Insert payload lacks settings; factory not initialized", e);
    }
    throw e;
}

Prevention

When it happens

Trigger: Inserting a signature file whose major version or settings field is 0. This happens when signatures were generated without a properly configured LSHVectorFactory (settings left at 0), or the file's header metadata is missing/corrupt.

Common situations: Generating signatures before calling setVectorFactory with a valid factory (factory.getSettings()==0). Loading a signature file produced by an incomplete or older export tool. A truncated file where the settings header was not written.

Related errors


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