{"record":{"id":"b5bd38d36abe3210","repo":"NationalSecurityAgency/ghidra","slug":"cannot-allocate-new-function-tag-tag-name-col","errorCode":null,"errorMessage":"Cannot allocate new function tag: {tag_name} - Column space is full","messagePattern":"Cannot allocate new function tag: (.+?) - Column space is full","errorType":"validation","errorClass":"LSHException","httpStatus":null,"severity":"error","filePath":"Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/client/AbstractSQLFunctionDatabase.java","lineNumber":2240,"sourceCode":"\t * @throws SQLException if there is an error issuing the query\n\t */\n\tprivate void fdbInstallTag(InstallTagRequest query) throws LSHException, SQLException {\n\t\tResponseInfo response = query.installresponse;\n\t\tif (!CategoryRecord.enforceTypeCharacters(query.tag_name)) {\n\t\t\tthrow new LSHException(\"Bad characters in proposed function tag\");\n\t\t}\n\t\t// Check for existing tag\n\t\tif (info.functionTags != null) {\n\t\t\tif (info.functionTags.contains(query.tag_name)) {\n\t\t\t\tthrow new LSHException(\"Function tag already exists\");\n\t\t\t}\n\t\t}\n\t\tif (info.functionTags == null) {\n\t\t\tinfo.functionTags = new ArrayList<>();\n\t\t}\n\t\t// There are only 32-bits of space in the function record reserved for storing the presence of tags\n\t\tif (info.functionTags.size() >= FunctionTagBSimFilterType.MAX_TAG_COUNT) {\n\t\t\tthrow new LSHException(\n\t\t\t\t\"Cannot allocate new function tag: \" + query.tag_name + \" - Column space is full\");\n\t\t}\n\t\tinfo.functionTags.add(query.tag_name);\n\t\tkeyValueTable.writeFunctionTags(info);\n\t\tresponse.info = info;\n\t}\n\n\t/**\n\t * Entry point for the InstallMetadataRequest command\n\t * @param query the query to execute\n\t * @throws SQLException if basic info can't be written to the table\n\t */\n\tprivate void fdbInstallMetadata(InstallMetadataRequest query) throws SQLException {\n\t\tResponseInfo response = query.installresponse;\n\t\tif (query.dbname != null) {\n\t\t\tinfo.databasename = query.dbname;\n\t\t}\n\t\tif (query.owner != null) {","sourceCodeStart":2222,"sourceCodeEnd":2258,"githubUrl":"https://github.com/NationalSecurityAgency/ghidra/blob/d5f144c24d6bc53c9cbf4448c6d11143e7696206/Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/client/AbstractSQLFunctionDatabase.java#L2222-L2258","documentation":"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.","triggerScenarios":"Issuing an InstallTagRequest when info.functionTags.size() >= 29. The existing tags already fill all available bitmask bits.","commonSituations":"Long-lived BSim databases that accumulated many tags over time; bulk tag importation after the limit is near; attempting to extend a mature taxonomy.","solutions":["Check info.functionTags.size() against MAX_TAG_COUNT before attempting installation; remove or repurpose an unused tag if possible.","Audit existing tags and consolidate redundant ones to free bitmask slots.","This limit cannot be raised without schema changes — plan tag taxonomy carefully at database design time."],"exampleFix":"// before\ndb.execute(installTagReq); // 29 tags already\n// after\nif (info.functionTags != null && info.functionTags.size() >= FunctionTagBSimFilterType.MAX_TAG_COUNT) {\n    // free a slot or abort\n    throw new IllegalStateException(\"Function tag column space is full (max \" + FunctionTagBSimFilterType.MAX_TAG_COUNT + \")\");\n}","handlingStrategy":"validation","validationCode":"int max = FunctionTagBSimFilterType.MAX_TAG_COUNT;\nint current = info.functionTags == null ? 0 : info.functionTags.size();\nif (current >= max) {\n    throw new IllegalStateException(\"Tag column space full: \" + current + \"/\" + max);\n}","typeGuard":null,"tryCatchPattern":"catch (LSHException e) { if (e.getMessage().contains(\"Column space is full\")) { /* cannot allocate; surface to user or free a tag */ } }","preventionTips":["Design the tag taxonomy to stay well under 29 tags from the start.","Monitor functionTags.size() as the database evolves.","Treat tag slot allocation as a scarce resource."],"tags":["bsim","limits","configuration"],"backgroundTag":null,"analyzedSha":"d5f144c24d6bc53c9cbf4448c6d11143e7696206","analyzedAt":"2026-08-14T01:00:57.564Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}