{"record":{"id":"b004625a6b348405","repo":"NationalSecurityAgency/ghidra","slug":"can-t-find-data-file-filename","errorCode":null,"errorMessage":"can't find data file: \" + fileName","messagePattern":"can't find data file: \" \\+ fileName","errorType":"exception","errorClass":"FileNotFoundException","httpStatus":null,"severity":"error","filePath":"Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/analysis/NonReturningFunctionNames.java:105","lineNumber":105,"sourceCode":"\tprivate static ResourceFile getDataFile(List<ResourceFile> dataDirs, String fileName)\n\t\t\tthrows FileNotFoundException {\n\t\tfor (ResourceFile dir : dataDirs) {\n\t\t\tResourceFile file = new ResourceFile(dir, fileName);\n\t\t\tif (file.exists()) {\n\t\t\t\treturn file;\n\t\t\t}\n\t\t}\n\t\tthrow new FileNotFoundException(\"can't find data file: \" + fileName);\n\t}","sourceCodeStart":null,"sourceCodeEnd":null,"githubUrl":"https://github.com/NationalSecurityAgency/ghidra/blob/d5f144c24d6bc53c9cbf4448c6d11143e7696206/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/analysis/NonReturnFunctionNames.java#L105","documentation":"Thrown when NonReturnFunctionNames cannot locate a bundled data file (fileName) it needs — the analyzer loads a resource listing known non-returning function names (e.g. library functions like exit/_assert) and the resource lookup failed. The exception signals a missing classpath/data resource rather than a problem with the analyzed binary.","triggerScenarios":"The analyzer calls a resource/file loader for fileName (a packaged data file such as a non-returning-names list) and the lookup returns null or throws — e.g. the data file was not packaged into the module's data directory, the module is partially installed, or the resource path is wrong for the running Ghidra version.","commonSituations":"A Ghidra installation missing module data files (incomplete install, manual copy); running against a different Ghidra version where the data file was renamed or moved; a custom build that did not copy the data resource; classpath/resource-loader misconfiguration in a test or headless environment.","solutions":["Verify the data file exists under the module's data directory in your Ghidra installation and reinstall the module if missing.","Pin to a Ghidra version known to ship the expected fileName, or update the analyzer to the new resource path.","For custom builds, ensure the data resource is included in the build/module packaging step.","Catch the exception and degrade gracefully (treat the names list as empty) if non-return detection is non-critical."],"exampleFix":"// before\nResourceFile f = ApplicationModule.locateDataFile(fileName);\nif (f == null) {\n    throw new IOException(\"can't find data file: \" + fileName);\n}\n\n// after — search standard data dirs and degrade gracefully\nResourceFile f = ApplicationModule.locateDataFile(fileName);\nif (f == null) {\n    Msg.warn(this, \"can't find data file: \" + fileName + \" — non-return list disabled\");\n    return Collections.emptyList();\n}","handlingStrategy":"validation","validationCode":"ResourceFile f = ApplicationModule.locateDataFile(fileName);\nif (f == null || !f.exists()) {\n    // resource missing — disable non-return detection rather than throw\n    return Collections.emptyList();\n}","typeGuard":"boolean dataFilePresent = ApplicationModule.locateDataFile(fileName) != null && ApplicationModule.locateDataFile(fileName).exists();","tryCatchPattern":"try {\n    loadNonReturnNames(fileName);\n} catch (IOException e) {\n    Msg.warn(this, \"can't find data file: \" + fileName + \" — disabling non-return list\");\n    nonReturnNames = Collections.emptySet();\n}","preventionTips":["Reinstall the module so its data files ship with the install.","Pin to a Ghidra version that packages fileName at the expected path.","Degrade gracefully when the data file is absent in non-critical paths."],"tags":["ghidra","analysis","resource","data-file","io"],"backgroundTag":null,"analyzedSha":"d5f144c24d6bc53c9cbf4448c6d11143e7696206","analyzedAt":"2026-08-14T01:00:57.564Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}