{"record":{"id":"391c590ecaaf1deb","repo":"NationalSecurityAgency/ghidra","slug":"must-specify-an-output-directory","errorCode":null,"errorMessage":"Must specify an output directory","messagePattern":"Must specify an output directory","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/ingest/BSimLaunchable.java","lineNumber":990,"sourceCode":"\t\t}\n\n\t\tString functionTag = params.get(0);\n\n\t\ttry (BulkSignatures bsim = getBulkSignatures()) {\n\t\t\tbsim.installTags(functionTag);\n\t\t}\n\t}\n\n\t/**\n\t * Exports exe signature to local folder in XML format.\n\t * \n\t * @param params the command-line params\n\t * @throws IOException if there's an error establishing the database connection\n\t * @throws LSHException if there's an error issuing the query\n\t */\n\tprivate void doDumpSigs(List<String> params) throws IOException, LSHException {\n\t\tif (params.size() < 1) {\n\t\t\tthrow new IllegalArgumentException(\"Must specify an output directory\");\n\t\t}\n\t\tFile resultFolder = new File(params.get(0));\n\n\t\tQueryName query = new QueryName();\n\t\tfillinSingleExeSpecifier(query.spec);\n\t\tquery.maxfunc = 0; // all functions\n\n\t\ttry (BulkSignatures bsim = getBulkSignatures()) {\n\t\t\tbsim.doDumpSigs(resultFolder, query);\n\t\t}\n\t}\n\n\tprivate static void printMaxMemory() {\n\t\t// division is used since default case may not use even multiples of 1024\n\t\tlong maxMemoryBytes = Runtime.getRuntime().maxMemory();\n\t\tfloat maxMem = maxMemoryBytes / (1024 * 1024); // MBytes\n\t\tString units = \" MBytes\";\n\t\tif (maxMem >= 1024) {","sourceCodeStart":972,"sourceCodeEnd":1008,"githubUrl":"https://github.com/NationalSecurityAgency/ghidra/blob/d5f144c24d6bc53c9cbf4448c6d11143e7696206/Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/ingest/BSimLaunchable.java#L972-L1008","documentation":"Thrown by BSimLaunchable.doDumpSigs when the command-line params list is empty. 'dumpsigs' exports an executable's function signatures to XML in a local folder, and that destination folder is the one mandatory positional argument, so the call is rejected before any work begins. It is a plain IllegalArgumentException (not an IOException/LSHException) because it fails input validation, not I/O or a query error.","triggerScenarios":"Running the headless BSim 'dumpsigs' command with no directory argument (params.size() < 1). Also reached if a calling layer invokes doDumpSigs(List) with an empty list.","commonSituations":"Typo or omission in a bsim command line (e.g. 'bsim dumpsigs' with the path missing), a shell script variable that expanded to empty ($OUT unset), or programmatic dispatch that forgets to push the output path into the params list.","solutions":["Re-run the command supplying exactly one output directory as the first positional argument, e.g. 'bsim dumpsigs /path/to/outdir'.","If scripting, verify the params list is non-empty before calling doDumpSigs and pass the directory as params.get(0).","Check that any shell variable used for the directory is exported and non-empty."],"exampleFix":"// before\nlauncher.doDumpSigs(params);  // params is []\n\n// after\nparams.add(outputDir.getAbsolutePath());\nlauncher.doDumpSigs(params);","handlingStrategy":"validation","validationCode":"// before calling doDumpSigs\nif (params == null || params.isEmpty() || StringUtils.isBlank(params.get(0))) {\n    throw new IllegalArgumentException(\"Output directory required for dumpsigs\");\n}\nFile outDir = new File(params.get(0));","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always pass the output directory as the first positional param to dumpsigs.","In scripts, assert the output-dir variable is non-empty before launching.","Treat doDumpSigs as requiring params.size() >= 1."],"tags":["bsim","cli","argument-validation","illegalargumentexception"],"backgroundTag":null,"analyzedSha":"d5f144c24d6bc53c9cbf4448c6d11143e7696206","analyzedAt":"2026-08-14T01:00:57.564Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}