{"record":{"id":"2b830a187d0e16be","repo":"NationalSecurityAgency/ghidra","slug":"unable-to-find-executable","errorCode":null,"errorMessage":"Unable to find executable","messagePattern":"Unable to find executable","errorType":"exception","errorClass":"LSHException","httpStatus":null,"severity":"error","filePath":"Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/description/DescriptionManager.java","lineNumber":392,"sourceCode":"\t * @param lhash is a hash indicating where in -src- the call to -dest- is made\n\t */\n\tpublic void makeCallgraphLink(FunctionDescription src, FunctionDescription dest, int lhash) {\n\t\tsrc.insertCall(dest, lhash);\n\t}\n\n\t/**\n\t * Lookup an executable in the container via md5\n\t * @param md5 is the md5 to search for\n\t * @return return the matching ExecutableRecord\n\t * @throws LSHException if the executable cannot be found\n\t */\n\tpublic ExecutableRecord findExecutable(String md5) throws LSHException {\n\t\tExecutableRecord templ = new ExecutableRecord(md5);\n\t\tExecutableRecord res = exerec.floor(templ);\n\t\tif (res != null && res.getMd5().equals(md5)) {\n\t\t\treturn res;\n\t\t}\n\t\tthrow new LSHException(\"Unable to find executable\");\n\t}\n\n\t/**\n\t * Search for executable based an name, and possibly other qualifying information.\n\t * This is relatively inefficient as it just iterates through the list.\n\t * @param name is the name that the executable must match\n\t * @param arch is null or must match the executable's architecture string\n\t * @param comp is null or must match the executable's compiler string\n\t * @return the matching executable\n\t * @throws LSHException if a matching executable doesn't exist\n\t */\n\tpublic ExecutableRecord findExecutable(String name, String arch, String comp)\n\t\t\tthrows LSHException {\n\t\tif (StringUtils.isEmpty(arch)) {\n\t\t\tarch = null;\n\t\t}\n\t\tif (StringUtils.isEmpty(comp)) {\n\t\t\tcomp = null;","sourceCodeStart":374,"sourceCodeEnd":410,"githubUrl":"https://github.com/NationalSecurityAgency/ghidra/blob/d5f144c24d6bc53c9cbf4448c6d11143e7696206/Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/description/DescriptionManager.java#L374-L410","documentation":"Thrown by DescriptionManager.findExecutable(String md5) when no ExecutableRecord in the container has an md5 equal to the requested value. The lookup builds a template record from the md5 and uses TreeSet.floor(); if the floor element is null or its md5 does not match, the executable is considered absent.","triggerScenarios":"Calling findExecutable(md5) with an md5 that is not present in the in-memory DescriptionManager container. Reached during query resolution, transfer, or XML restore when a referenced executable has not been loaded/created yet.","commonSituations":"Looking up a function before its parent executable was inserted; md5 casing/format mismatch (uppercase vs lowercase hex); referencing an executable from a different BSim database; ordering bug where functions are added before their executables.","solutions":["Ensure the ExecutableRecord for the md5 is created (newExecutableRecord/newExecutableLibrary) before calling findExecutable.","Validate the md5 string format and case against the md5Matcher convention used when storing.","Catch LSHException and create the missing executable record on demand if that is the intended workflow.","Confirm the md5 came from the same container/database instance."],"exampleFix":"// before\nExecutableRecord exe = man.findExecutable(md5); // throws if absent\n\n// after\nExecutableRecord exe;\ntry {\n    exe = man.findExecutable(md5);\n} catch (LSHException e) {\n    exe = man.newExecutableRecord(md5, name, compiler, arch, date, repo, path, null);\n}","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"ExecutableRecord exe;\ntry {\n    exe = man.findExecutable(md5);\n} catch (LSHException e) {\n    exe = man.newExecutableRecord(md5, name, compiler, arch, date, repo, path, null);\n}","preventionTips":["Insert the ExecutableRecord before any function that references it.","Keep md5 strings in a consistent (lowercase hex) format.","Ensure executables and functions are loaded from the same container instance."],"tags":["bsim","lookup","missing-data","java"],"backgroundTag":null,"analyzedSha":"d5f144c24d6bc53c9cbf4448c6d11143e7696206","analyzedAt":"2026-08-14T01:00:57.564Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}