NationalSecurityAgency/ghidra · error · LSHException
Problems loading score cache: {e.getMessage()}
Error message
Problems loading score cache: {e.getMessage()} What it means
Thrown by FileScoreCaching.getSimThreshold() wrapping any IOException from loadCache(). This method loads the cache to obtain the configured similarity threshold; if the cache file is corrupt, truncated, or unreadable the load fails and is re-thrown as an LSHException.
Source
Thrown at Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/client/FileScoreCaching.java:119
cacheMap.put(md5, score);
writer.write(md5);
writer.append(' ');
writer.write(Float.toString(score));
writer.newLine();
writer.close();
}
catch (IOException ex) {
throw new LSHException("Could not commit self-score: " + ex.getMessage());
}
}
@Override
public double getSimThreshold() throws LSHException {
try {
loadCache();
}
catch (IOException e) {
throw new LSHException("Problems loading score cache: " + e.getMessage());
}
return simThreshold;
}
@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 {View on GitHub (pinned to d5f144c24d)
Solutions
- Inspect the wrapped IOException message for the specific cache-load failure.
- Delete or resetStorage the corrupt cache file to regenerate it.
- If this fires at ExecutableScorerSingle construction, fix the cache file before constructing the scorer.
Example fix
// before
FileScoreCaching cache = new FileScoreCaching(corruptPath);
double sim = cache.getSimThreshold(); // throws
// after — reset cache before use if corrupt
try {
double sim = cache.getSimThreshold();
} catch (LSHException e) {
cache.resetStorage(defaultSimThresh, defaultSigThresh);
double sim = cache.getSimThreshold();
} Defensive patterns
Strategy: try-catch
Validate before calling
File cacheFile = new File(cachePath);
if (cacheFile.exists() && cacheFile.length() < 10) {
cacheFile.delete(); // likely corrupt
} Try / catch
try {
double sim = cache.getSimThreshold();
} catch (LSHException e) {
if (e.getMessage().startsWith("Problems loading")) {
cache.resetStorage(defaultSimThresh, defaultSigThresh);
double sim = cache.getSimThreshold();
} else throw e;
} Prevention
- Validate the cache file before constructing an ExecutableScorerSingle that reads thresholds.
- Reset the cache on load failures rather than leaving it corrupt.
- Log the wrapped IOException to diagnose the parse failure.
When it happens
Trigger: Calling getSimThreshold() when the cache file exists but is malformed (missing header lines, bad data lines) or unreadable. This commonly fires during ExecutableScorerSingle construction, which calls scoreCache.getSimThreshold() in its constructor.
Common situations: Constructing an ExecutableScorerSingle with a FileScoreCaching whose backing file is corrupt. A previous run crashed mid-write leaving a partial file. The cache file was manually edited or moved.
Related errors
- Problems loading score cache:
- Could not recover cached scores: {e.getMessage()}
- Could not commit self-score: {ex.getMessage()}
- Could not prefetch scores:
- Score file missing threshold lines
AI-assisted analysis of NationalSecurityAgency/ghidra@d5f144c24d (2026-08-14).
Data as JSON: /api/errors/7ea3e524897a7da0.
Report an issue: GitHub.