NationalSecurityAgency/ghidra · error · IOException

Program signature generation failure: {e.getMessage()}

Error message

Program signature generation failure: {e.getMessage()}

What it means

Thrown by UpdateRepository.process when GenSignatures throws an LSHException during metadata generation for a program. The original LSHException is caught and re-wrapped as an IOException with a 'Program signature generation failure' prefix. This is the metadata-only path (scanFunctionsMetadata), used for updates rather than full signature generation.

Source

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

				gensig.setVectorFactory(vectorFactory);
				gensig.addExecutableCategories(info.execats);
				gensig.addFunctionTags(info.functionTags);
				gensig.addDateColumnName(info.dateColumnName);
				Msg.info(this, "Generating metadata for: " + program.getDomainFile().getName());
				String path = GenSignatures.getPathFromDomainFile(program);
				gensig.openProgram(program, null, null, null, repo, path);
				gensig.scanFunctionsMetadata(null, null);
				DescriptionManager manager = gensig.getDescriptionManager();
				if (manager.numFunctions() == 0) {
					Msg.warn(this,
						program.getDomainFile().getName() + " contains no functions with bodies");
				}
				try (FileWriter fwrite = new FileWriter(file)) {
					manager.saveXml(fwrite);
				}
			}
			catch (LSHException e) {
				throw new IOException("Program signature generation failure: " + e.getMessage());
			}
		}
	}

	private class SignatureRepository extends IterateRepository {

		private File outdirectory;
		private String repo; // Repository URL to include with signature metadata
		private boolean overwrite; // True if existing signature files should be overwritten
		private DatabaseInformation info; // Database configuration (may affect signature generation)
		private LSHVectorFactory vectorFactory;

		public SignatureRepository(File outdir, String rp, boolean owrite, DatabaseInformation i,
				LSHVectorFactory vFactory) {
			outdirectory = outdir;
			repo = rp;
			overwrite = owrite;
			info = i;

View on GitHub (pinned to d5f144c24d)

Solutions

  1. Open the specific program in the Ghidra GUI and verify analysis completed successfully.
  2. Check that the program's processor/language is supported by the BSim configuration (weight file, language module).
  3. Run auto-analysis on the program before signature generation.
  4. Inspect the original LSHException message (it is in the IOException message after the prefix) for the specific cause.

Example fix

// before
catch (LSHException e) {
    throw new IOException("Program signature generation failure: " + e.getMessage());
}

// after — include program name and preserve cause
catch (LSHException e) {
    throw new IOException("Signature generation failed for " +
        program.getDomainFile().getName() + ": " + e.getMessage(), e);
}
Defensive patterns

Strategy: try-catch

Validate before calling

// Verify the program is analyzed and has functions before signature generation
FunctionManager fman = program.getFunctionManager();
if (fman.getFunctionCount() == 0) {
    throw new IllegalStateException(
        "Program has no functions: " + program.getName() +
        ". Run auto-analysis first.");
}
// Verify the processor is supported by checking against the weight configuration

Type guard

public static boolean isProgramReadyForSignatures(Program program) {
    return program != null &&
        program.getFunctionManager().getFunctionCount() > 0 &&
        program.getLanguage() != null;
}

Try / catch

try {
    updateRepo.process(program, monitor);
} catch (IOException e) {
    if (e.getMessage().contains("Program signature generation failure")) {
        // Log the program that failed and continue with remaining programs
        Msg.error(this, "Skipping " + program.getName() + ": " + e.getMessage());
        continue; // in a repository iteration loop
    }
    throw e;
}

Prevention

When it happens

Trigger: GenSignatures.openProgram or scanFunctionsMetadata fails with an LSHException — the program may have an unsupported processor/language, missing analysis, or the vector factory configuration may be incompatible. The UpdateRepository is iterating over programs in a Ghidra repository and generating metadata files.

Common situations: A program in the repository has an unsupported processor or was not fully analyzed; the BSim configuration's weight vector or language setting doesn't match the program's architecture; the program file is corrupted; the decompiler or function body extraction failed for all functions.

Related errors


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