{"record":{"id":"c84bab716e61e1c4","repo":"NationalSecurityAgency/ghidra","slug":"problems-loading-score-cache","errorCode":null,"errorMessage":"Problems loading score cache: ","messagePattern":"Problems loading score cache: ","errorType":"exception","errorClass":"LSHException","httpStatus":null,"severity":"error","filePath":"Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/client/FileScoreCaching.java","lineNumber":130,"sourceCode":"\n\t@Override\n\tpublic double getSimThreshold() throws LSHException {\n\t\ttry {\n\t\t\tloadCache();\n\t\t}\n\t\tcatch (IOException e) {\n\t\t\tthrow new LSHException(\"Problems loading score cache: \" + e.getMessage());\n\t\t}\n\t\treturn simThreshold;\n\t}\n\n\t@Override\n\tpublic double getSigThreshold() throws LSHException {\n\t\ttry {\n\t\t\tloadCache();\n\t\t}\n\t\tcatch (IOException e) {\n\t\t\tthrow new LSHException(\"Problems loading score cache: \" + e.getMessage());\n\t\t}\n\t\treturn sigThreshold;\n\t}\n\n\t@Override\n\tpublic void prefetchScores(Set<ExecutableRecord> exeSet, List<ExecutableRecord> missing)\n\t\t\tthrows LSHException {\n\t\ttry {\n\t\t\tloadCache();\n\t\t}\n\t\tcatch (IOException e) {\n\t\t\tthrow new LSHException(\"Could not prefetch scores: \" + e.getMessage());\n\t\t}\n\t\tif (missing != null) {\n\t\t\tif (cacheMap == null) {\n\t\t\t\tfor (ExecutableRecord exeRec : exeSet) {\n\t\t\t\t\tmissing.add(exeRec);\t\t\t// Everything is missing\n\t\t\t\t}","sourceCodeStart":112,"sourceCodeEnd":148,"githubUrl":"https://github.com/NationalSecurityAgency/ghidra/blob/d5f144c24d6bc53c9cbf4448c6d11143e7696206/Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/client/FileScoreCaching.java#L112-L148","documentation":"Thrown by FileScoreCaching.getSigThreshold() wrapping any IOException from loadCache(). Identical mechanism to getSimThreshold() but retrieves the significance threshold. The message string is the same (\"Problems loading score cache: \") but the throw site is the sigThreshold accessor at line 130.","triggerScenarios":"Calling getSigThreshold() when the cache file is corrupt or unreadable. Like getSimThreshold, this can fire during ExecutableScorerSingle construction which reads both thresholds from the cache.","commonSituations":"Same corrupt-file scenarios as the simThreshold variant — the cache file was truncated, has bad lines, or is unreadable. Typically both threshold accessors fail together if the cache is corrupt.","solutions":["Fix or regenerate the cache file via resetStorage(simThresh, sigThresh).","Inspect the wrapped IOException message to diagnose the specific parse or I/O failure.","Validate the cache file format (two float header lines) before relying on it."],"exampleFix":"// before\ndouble sig = cache.getSigThreshold(); // throws if cache corrupt\n\n// after\ncatch (LSHException e) {\n    cache.resetStorage(defaultSimThresh, defaultSigThresh);\n    double sig = cache.getSigThreshold();\n}","handlingStrategy":"try-catch","validationCode":"File cacheFile = new File(cachePath);\nif (cacheFile.exists() && cacheFile.length() < 10) {\n    cacheFile.delete();\n}","typeGuard":null,"tryCatchPattern":"try {\n    double sig = cache.getSigThreshold();\n} catch (LSHException e) {\n    if (e.getMessage().startsWith(\"Problems loading\")) {\n        cache.resetStorage(defaultSimThresh, defaultSigThresh);\n        double sig = cache.getSigThreshold();\n    } else throw e;\n}","preventionTips":["Treat getSigThreshold failures the same as getSimThreshold — both load the same cache.","Reset the cache and reinitialize thresholds on corruption.","Validate the cache file before relying on threshold accessors."],"tags":["bsim","ghidra","score-cache","io","threshold"],"backgroundTag":null,"analyzedSha":"d5f144c24d6bc53c9cbf4448c6d11143e7696206","analyzedAt":"2026-08-14T01:00:57.564Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}