NationalSecurityAgency/ghidra · error · InvalidInputException

Function tag does not exist: {}

Error message

Function tag does not exist: {}

What it means

FunctionTagBSimFilterType constructor checks info.functionTags from the database's DatabaseInformation; if the list is null it throws InvalidInputException because the tag cannot be validated. A null functionTags list means the database was not configured to track function tags (the metadata field was never populated during database creation/ingestion). Note the check is for null specifically — an empty list would pass this guard but the subsequent loop would not find the tag.

Source

Thrown at Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/gui/filters/FunctionTagBSimFilterType.java:79

	 * function tag is. If that's the case, this will figure it out from the
	 * given queryService object. 
	 * 
	 * @param tagName the name of the tag
	 * @param queryService query service used to retrieve tag big position
	 * @throws InvalidInputException thrown if tag does not exist
	 */
	public FunctionTagBSimFilterType(String tagName, SimilarFunctionQueryService queryService)
		throws InvalidInputException {
		super("Function tagged as " + tagName, XML_VALUE, "function tag");
		this.tagName = tagName;

		DatabaseInformation info = queryService.getDatabaseInformation();
		if (info == null) {
			throw new IllegalStateException("queryService has not been initialized");
		}
		List<String> functionTags = info.functionTags;
		if (functionTags == null) {
			throw new InvalidInputException("Function tag does not exist: " + tagName);
		}

		flag = 8;
		for (String tag : functionTags) {
			if (tag.endsWith(tagName)) {
				break;
			}
			flag = flag * 2;
		}
	}

	public int getFlag() {
		return flag;
	}

	@Override
	public int hashCode() {
		final int prime = 31;

View on GitHub (pinned to d5f144c24d)

Solutions

  1. Recreate or upgrade the BSim database with a configuration template that includes function tag tracking.
  2. Re-ingest executables into the database using a current GenSignatures configuration that records function tags.
  3. Verify info.functionTags is populated by checking DatabaseInformation after database initialization — if null, the DB predates tag support.
  4. Update the database metadata (if the DB schema supports it) to initialize the functionTags list before constructing this filter.
Defensive patterns

Strategy: validation

Validate before calling

DatabaseInformation info = queryService.getDatabaseInformation();
if (info == null || info.functionTags == null) {
    // Database does not support function tags — do not offer this filter
    throw new IllegalStateException(
        "BSim database '" + info.name + "' has no function tag metadata. " +
        "Re-ingest with tag support enabled.");
}

Try / catch

try {
    new FunctionTagBSimFilterType(tagName, queryService);
} catch (InvalidInputException e) {
    if (e.getMessage().startsWith("Function tag does not exist")) {
        // hide/disable the tag filter UI element
    } else {
        throw e;
    }
}

Prevention

When it happens

Trigger: Constructing a new FunctionTagBSimFilterType(tagName, queryService) where queryService.getDatabaseInformation().functionTags is null. This happens when the BSim database was created without function tag support enabled.

Common situations: The BSim database was created with an older configuration template that doesn't include function tags; the database was created before function tag support was added to BSim; the database's metadata was never updated to include functionTags after adding tags to executables; the user is querying a database that was populated by a GenSignatures run that didn't emit tag metadata.

Related errors


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