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
- De-duplicate the list before submission: new ArrayList<>(new LinkedHashSet<>(list)).
- Check for duplicates programmatically and warn the user before the query is built.
- 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
- De-duplicate all name lists with a LinkedHashSet before passing to BSim.
- Treat duplicates as a data-quality issue at the source, not a runtime surprise.
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
- Executable
- Expecting privilege option (admin or user)
- host required
- Non-empty dbName required
- Invalid {} dbName: {}
AI-assisted analysis of NationalSecurityAgency/ghidra@d5f144c24d (2026-08-14).
Data as JSON: /api/errors/3c8593fbf6be1778.
Report an issue: GitHub.