NationalSecurityAgency/ghidra · error · FileNotFoundException

can't find data file: " + fileName

Error message

can't find data file: " + fileName

What it means

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.

Solutions

  1. Verify the data file exists under the module's data directory in your Ghidra installation and reinstall the module if missing.
  2. Pin to a Ghidra version known to ship the expected fileName, or update the analyzer to the new resource path.
  3. For custom builds, ensure the data resource is included in the build/module packaging step.
  4. Catch the exception and degrade gracefully (treat the names list as empty) if non-return detection is non-critical.

Example fix

// before
ResourceFile f = ApplicationModule.locateDataFile(fileName);
if (f == null) {
    throw new IOException("can't find data file: " + fileName);
}

// after — search standard data dirs and degrade gracefully
ResourceFile f = ApplicationModule.locateDataFile(fileName);
if (f == null) {
    Msg.warn(this, "can't find data file: " + fileName + " — non-return list disabled");
    return Collections.emptyList();
}
Defensive patterns

Strategy: validation

Validate before calling

ResourceFile f = ApplicationModule.locateDataFile(fileName);
if (f == null || !f.exists()) {
    // resource missing — disable non-return detection rather than throw
    return Collections.emptyList();
}

Type guard

boolean dataFilePresent = ApplicationModule.locateDataFile(fileName) != null && ApplicationModule.locateDataFile(fileName).exists();

Try / catch

try {
    loadNonReturnNames(fileName);
} catch (IOException e) {
    Msg.warn(this, "can't find data file: " + fileName + " — disabling non-return list");
    nonReturnNames = Collections.emptySet();
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of NationalSecurityAgency/ghidra@d5f144c24d (2026-08-14). Data as JSON: /api/errors/b004625a6b348405. Report an issue: GitHub.

Appendix: source

Thrown at Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/analysis/NonReturningFunctionNames.java:105:105

	private static ResourceFile getDataFile(List<ResourceFile> dataDirs, String fileName)
			throws FileNotFoundException {
		for (ResourceFile dir : dataDirs) {
			ResourceFile file = new ResourceFile(dir, fileName);
			if (file.exists()) {
				return file;
			}
		}
		throw new FileNotFoundException("can't find data file: " + fileName);
	}

View on GitHub (pinned to d5f144c24d)