NationalSecurityAgency/ghidra · error · LSHException
Could not prefetch scores:
Error message
Could not prefetch scores:
What it means
Thrown by FileScoreCaching.prefetchScores() wrapping any IOException from loadCache(). Prefetch loads the entire cache to check which executables in a set have scores; if the cache file is corrupt or unreadable the load fails and the prefetch cannot proceed.
Source
Thrown at Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/client/FileScoreCaching.java:142
@Override
public double getSigThreshold() throws LSHException {
try {
loadCache();
}
catch (IOException e) {
throw new LSHException("Problems loading score cache: " + e.getMessage());
}
return sigThreshold;
}
@Override
public void prefetchScores(Set<ExecutableRecord> exeSet, List<ExecutableRecord> missing)
throws LSHException {
try {
loadCache();
}
catch (IOException e) {
throw new LSHException("Could not prefetch scores: " + e.getMessage());
}
if (missing != null) {
if (cacheMap == null) {
for (ExecutableRecord exeRec : exeSet) {
missing.add(exeRec); // Everything is missing
}
}
else {
for (ExecutableRecord exeRec : exeSet) {
if (!cacheMap.containsKey(exeRec.getMd5())) {
missing.add(exeRec);
}
}
}
}
}
@OverrideView on GitHub (pinned to d5f144c24d)
Solutions
- Regenerate the cache file via resetStorage or by deleting and re-running the scoring workflow.
- Inspect the wrapped IOException message for the specific failure.
- Verify the cache file path and permissions.
Example fix
// before
scorer.prefetchSelfScores(missing); // throws "Could not prefetch scores"
// after — reset cache and retry
catch (LSHException e) {
cache.resetStorage(simThresh, sigThresh);
scorer.prefetchSelfScores(missing);
} Defensive patterns
Strategy: try-catch
Validate before calling
File cacheFile = new File(cachePath);
if (cacheFile.exists() && cacheFile.length() < 10) {
cacheFile.delete();
} Try / catch
try {
scorer.prefetchSelfScores(missing);
} catch (LSHException e) {
if (e.getMessage().startsWith("Could not prefetch")) {
cache.resetStorage(simThresh, sigThresh);
scorer.prefetchSelfScores(missing);
} else throw e;
} Prevention
- Validate cache integrity before prefetching.
- Reset the cache on load failures and retry.
- Log the wrapped IOException to diagnose the underlying file issue.
When it happens
Trigger: Calling prefetchScores(exeSet, missing) when the backing cache file is malformed, truncated, or unreadable. This is the entry point used by ExecutableScorerSingle.prefetchSelfScores() to bulk-load scores.
Common situations: Running a one-to-many comparison that calls prefetchSelfScores, but the cache file was left in a corrupt state by a previous failed run. Permissions or path issues preventing the file read.
Related errors
- Could not recover cached scores: {e.getMessage()}
- Could not commit self-score: {ex.getMessage()}
- Problems loading score cache: {e.getMessage()}
- Problems loading score cache:
- Score file missing threshold lines
AI-assisted analysis of NationalSecurityAgency/ghidra@d5f144c24d (2026-08-14).
Data as JSON: /api/errors/8f6396e319b61d27.
Report an issue: GitHub.