NationalSecurityAgency/ghidra · error · LSHException

Duplicate {type} entry specified: {name}

Error message

Duplicate {type} entry specified: {name}

What it means

Thrown by checkStrings when a duplicate entry is detected within the same list passed to it (function tags or categories). A HashSet is used to detect repeated names; the first duplicate triggers the error with the offending name. This prevents ambiguity in bitmask assignment and SQL column creation.

Source

Thrown at Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/client/AbstractSQLFunctionDatabase.java:2170

			config.info.execats = query.info.execats;
		}
		generate(config);
		response.info = config.info;
	}

	private static void checkStrings(List<String> list, String type, int limit)
			throws LSHException {
		if (limit > 0 && list.size() > limit) {
			throw new LSHException("Too many " + type + " specified (limit=" +
				FunctionTagBSimFilterType.MAX_TAG_COUNT + "): " + list.size());
		}
		Set<String> names = new HashSet<>();
		for (String name : list) {
			if (!CategoryRecord.enforceTypeCharacters(name)) {
				throw new LSHException("Bad characters in one or more proposed " + type);
			}
			if (!names.add(name)) {
				throw new LSHException("Duplicate " + type + " entry specified: " + name);
			}
		}
	}

	/**
	 * Entry point for the InstallCategoryRequest command
	 * @param query the query to execute
	 * @throws LSHException if the category is invalid or already exists
	 * @throws SQLException if there is an error issuing the query
	 */
	private void fdbInstallCategory(InstallCategoryRequest query)
			throws LSHException, SQLException {
		ResponseInfo response = query.installresponse;
		if (!CategoryRecord.enforceTypeCharacters(query.type_name)) {
			throw new LSHException("Bad characters in proposed category type");
		}
		if (query.isdatecolumn) {
			info.dateColumnName = query.type_name;

View on GitHub (pinned to d5f144c24d)

Solutions

  1. De-duplicate the list before submission: new ArrayList<>(new LinkedHashSet<>(list)).
  2. Check for duplicates programmatically and warn the user before the query is built.
  3. Validate uniqueness at the data-entry layer.

Example fix

// before
query.info.functionTags = Arrays.asList("libc", "libc", "stdlib");
// after
query.info.functionTags = new ArrayList<>(new LinkedHashSet<>(Arrays.asList("libc", "libc", "stdlib")));
Defensive patterns

Strategy: validation

Validate before calling

Set<String> seen = new HashSet<>();
for (String s : list) {
    if (!seen.add(s)) throw new IllegalArgumentException("Duplicate: " + s);
}

Prevention

When it happens

Trigger: Supplying query.info.functionTags or query.info.execats containing the same name more than once (case-sensitive) during database creation or category/tag installation.

Common situations: Merging tag lists from multiple sources without de-duplication; case variations that look different but are exact string duplicates; concatenating config fragments that overlap.

Related errors


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