NationalSecurityAgency/ghidra · error · LSHException

No thresholds have been established

Error message

No thresholds have been established

What it means

Thrown by ExecutableComparison.performScoring when scorer.simThreshold is negative (< 0.0), meaning no similarity threshold was configured before scoring began. The scorer requires a positive similarity threshold to build and evaluate clusters; without it, scoring is undefined.

Source

Thrown at Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/client/ExecutableComparison.java:424

	 * Perform scoring between all registered executables.
	 * @throws LSHException for any connection issues during the process
	 * @throws CancelledException if the monitor reports cancellation
	 */
	public void performScoring() throws LSHException, CancelledException {
		maxHitCount = 0;
		exceedCount = 0;
		scorer.populateExecutableIndex();
		if (singleMd5 != null) {
			scorer.setSingleExecutable(singleMd5);
		}
		pullVectorsForScoringSet();
		scorer.initializeScores();

		monitor.setMessage("Processing similar functions");
		int maxSize = baseIds.size();
		monitor.initialize(maxSize);
		if (scorer.simThreshold < 0.0) {
			throw new LSHException("No thresholds have been established");
		}
		while (!baseIds.isEmpty()) {
			List<VectorResult> vectors = new ArrayList<VectorResult>();
			int hitcount = buildCluster(vectors, scorer.simThreshold, scorer.sigThreshold);
			if (hitcount == 0) {	// Zero is possible, if all vectors in cluster are below sig threshold
				continue;
			}
			else if (hitcount > maxHitCount) {		// Keep track of biggest hitcount
				maxHitCount = hitcount;
			}
			if (!scorer.checkPreliminaryPairThreshold(hitcount, hitCountThreshold)) {		// Cluster is too big
				exceedCount += 1;					// Count the occurrence
				continue;							// Don't score with this cluster
			}
			List<DescriptionManager> vec2Functions = vectorToFunctions(vectors);
			if (!scorer.scoreCluster(vectorFactory, vec2Functions, vectors, hitcount,
				hitCountThreshold)) {
				exceedCount += 1;

View on GitHub (pinned to d5f144c24d)

Solutions

  1. Configure the scorer with a valid positive similarity threshold before calling performScoring (e.g., via the comparison API that sets thresholds from DatabaseInformation).
  2. Call isConfigured() / check scorer.simThreshold > 0 before performing scoring.
  3. Ensure pullConnectionInfo() succeeded, as it informs the scorer of settings.

Example fix

// before
cmp.performScoring(); // simThreshold < 0
// after
if (cmp.getScorer().simThreshold <= 0.0) {
    cmp.getScorer().setThresholds(0.7, 0.0); // set similarity + signature thresholds
}
cmp.performScoring();
Defensive patterns

Strategy: validation

Validate before calling

if (!comparison.isConfigured()) { // simThreshold <= 0.0
    throw new IllegalStateException("Configure similarity threshold before scoring");
}

Try / catch

catch (LSHException e) { if (e.getMessage().contains("No thresholds")) { /* set thresholds, then retry performScoring */ } }

Prevention

When it happens

Trigger: Calling performScoring() without first establishing thresholds via the scorer (e.g., via setThresholds, configureScorer, or loading a DatabaseInformation whose settings populate the threshold). isConfigured() returns false when simThreshold <= 0.0.

Common situations: Forgetting to configure the ExecutableScorer before calling performScoring; loading a database whose metadata lacks threshold settings; programmatic use that skips the configuration step.

Related errors


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