{"record":{"id":"784313d7a73f7823","repo":"NationalSecurityAgency/ghidra","slug":"could-not-resolve-filter-specifying-executable","errorCode":null,"errorMessage":"Could not resolve filter specifying executable: ","messagePattern":"Could not resolve filter specifying executable: ","errorType":"exception","errorClass":"LSHException","httpStatus":null,"severity":"error","filePath":"Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/client/AbstractSQLFunctionDatabase.java","lineNumber":936,"sourceCode":"\t}\n\n\t/**\n\t * Low level count decrement of a vector record from vectable, if count\n\t * reaches zero, the record is deleted\n\t * @param id vector row ID\n\t * @param countdiff the amount to subtract from count\n\t * @return 0 if decrement short of 0, return 1 if record was removed, return\n\t *         -1 if there was a problem\n\t * @throws SQLException if there is a problem creating or executing the query\n\t */\n\tprotected abstract int deleteVectors(long id, int countdiff) throws SQLException;\n\n\tlong recoverExternalFunctionId(String exename, String functionname, String reparch)\n\t\t\tthrows SQLException, LSHException {\n\t\tString md5 = ExecutableRecord.calcLibraryMd5Placeholder(exename, reparch);\n\t\tExecutableRow row = exeTable.queryMd5ExeMatch(md5);\n\t\tif (row == null) {\n\t\t\tthrow new LSHException(\"Could not resolve filter specifying executable: \" + exename);\n\t\t}\n\n\t\tDescriptionRow descRow = descTable.queryFuncNameAddr(row.rowid, functionname, -1);\n\t\tif (descRow == null) {\n\t\t\tthrow new LSHException(\n\t\t\t\t\"Could not resolve filter specifying function: [\" + exename + \"]\" + functionname);\n\t\t}\n\t\treturn descRow.rowid;\n\t}\n\n\t// Pulled-in from old FunctionDatabaseClient\n\n\t/**\n\t * Make sure the FunctionDescription has its attached SignatureRecord, if not, query for it\n\t * @param functionDescription is the FunctionDescription\n\t * @param descriptionManager is the container\n\t * @param sigmap is a container of cached SignatureRecords which is checked before querying (may be null)\n\t * @throws SQLException if there is a problem querying the vector ID","sourceCodeStart":918,"sourceCodeEnd":954,"githubUrl":"https://github.com/NationalSecurityAgency/ghidra/blob/d5f144c24d6bc53c9cbf4448c6d11143e7696206/Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/client/AbstractSQLFunctionDatabase.java#L918-L954","documentation":"`recoverExternalFunctionId` computes a placeholder MD5 for an external (library) executable from its name + arch, then queries `exeTable` for a match. If no `ExecutableRow` is returned, it throws LSHException -- the referenced external executable is not present in the database, so the filter naming it cannot be resolved.","triggerScenarios":"Issuing a query/insert whose filter references an external executable (e.g. a library like libc.so) that has not been ingested. The placeholder MD5 is derived from name + arch, so a missing library, an arch mismatch (x86 vs ARM), or a typo produces a miss.","commonSituations":"Querying functions from a library before ingesting the library; arch string mismatch between analysis and DB; renamed or version-different library; case-sensitive name differences.","solutions":["Ingest the named external executable first so its ExecutableRow exists.","Verify the exe name and architecture string exactly match how it was stored.","Re-check the filter specification passed to the query."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Before issuing a filtered query, confirm the external executable exists.\nString md5 = ExecutableRecord.calcLibraryMd5Placeholder(exename, reparch);\nExecutableRow row = exeTable.queryMd5ExeMatch(md5);\nif (row == null) {\n    throw new IllegalArgumentException(\n        \"External executable not ingested: \" + exename + \" / \" + reparch);\n}","typeGuard":null,"tryCatchPattern":"try {\n    long id = db.recoverExternalFunctionId(exename, functionname, reparch);\n} catch (LSHException e) {\n    if (e.getMessage().startsWith(\"Could not resolve filter specifying executable:\")) {\n        // suggest ingesting the missing library before retrying\n        throw new MissingDependencyException(\"Ingest library first: \" + exename, e);\n    }\n    throw e;\n}","preventionTips":["Ingest referenced libraries before executables that depend on them.","Validate filter targets (exe name + arch) against the DB before querying.","Keep the arch string consistent between analysis and ingestion."],"tags":["database","query","filter","executable","bsim"],"backgroundTag":null,"analyzedSha":"d5f144c24d6bc53c9cbf4448c6d11143e7696206","analyzedAt":"2026-08-14T01:00:57.564Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}