NationalSecurityAgency/ghidra · error · LSHException

Cannot allocate new function tag: {tag_name} - Column space

Error message

Cannot allocate new function tag: {tag_name} - Column space is full

What it means

Thrown by fdbInstallTag when the number of existing function tags has reached FunctionTagBSimFilterType.MAX_TAG_COUNT (29). Tags are stored as bits in a 32-bit integer (3 bits reserved), so no further tags can be allocated. This is a hard structural limit, not a tunable parameter.

Source

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

	 * @throws SQLException if there is an error issuing the query
	 */
	private void fdbInstallTag(InstallTagRequest query) throws LSHException, SQLException {
		ResponseInfo response = query.installresponse;
		if (!CategoryRecord.enforceTypeCharacters(query.tag_name)) {
			throw new LSHException("Bad characters in proposed function tag");
		}
		// Check for existing tag
		if (info.functionTags != null) {
			if (info.functionTags.contains(query.tag_name)) {
				throw new LSHException("Function tag already exists");
			}
		}
		if (info.functionTags == null) {
			info.functionTags = new ArrayList<>();
		}
		// There are only 32-bits of space in the function record reserved for storing the presence of tags
		if (info.functionTags.size() >= FunctionTagBSimFilterType.MAX_TAG_COUNT) {
			throw new LSHException(
				"Cannot allocate new function tag: " + query.tag_name + " - Column space is full");
		}
		info.functionTags.add(query.tag_name);
		keyValueTable.writeFunctionTags(info);
		response.info = info;
	}

	/**
	 * Entry point for the InstallMetadataRequest command
	 * @param query the query to execute
	 * @throws SQLException if basic info can't be written to the table
	 */
	private void fdbInstallMetadata(InstallMetadataRequest query) throws SQLException {
		ResponseInfo response = query.installresponse;
		if (query.dbname != null) {
			info.databasename = query.dbname;
		}
		if (query.owner != null) {

View on GitHub (pinned to d5f144c24d)

Solutions

  1. Check info.functionTags.size() against MAX_TAG_COUNT before attempting installation; remove or repurpose an unused tag if possible.
  2. Audit existing tags and consolidate redundant ones to free bitmask slots.
  3. This limit cannot be raised without schema changes — plan tag taxonomy carefully at database design time.

Example fix

// before
db.execute(installTagReq); // 29 tags already
// after
if (info.functionTags != null && info.functionTags.size() >= FunctionTagBSimFilterType.MAX_TAG_COUNT) {
    // free a slot or abort
    throw new IllegalStateException("Function tag column space is full (max " + FunctionTagBSimFilterType.MAX_TAG_COUNT + ")");
}
Defensive patterns

Strategy: validation

Validate before calling

int max = FunctionTagBSimFilterType.MAX_TAG_COUNT;
int current = info.functionTags == null ? 0 : info.functionTags.size();
if (current >= max) {
    throw new IllegalStateException("Tag column space full: " + current + "/" + max);
}

Try / catch

catch (LSHException e) { if (e.getMessage().contains("Column space is full")) { /* cannot allocate; surface to user or free a tag */ } }

Prevention

When it happens

Trigger: Issuing an InstallTagRequest when info.functionTags.size() >= 29. The existing tags already fill all available bitmask bits.

Common situations: Long-lived BSim databases that accumulated many tags over time; bulk tag importation after the limit is near; attempting to extend a mature taxonomy.

Related errors


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