NationalSecurityAgency/ghidra · error · MalformedURLException

{}

Error message

{}

What it means

This wraps an UnsupportedEncodingException from URLDecoder.decode(path, "UTF-8") during ghidra URL derivation. UTF-8 is a mandatory charset on every compliant JVM (per the Java specification), so this exception is effectively unreachable. It exists only as a compiler-satisfying catch for a checked exception that cannot occur in practice.

Source

Thrown at Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/ingest/BSimLaunchable.java:271

		if (ghidraURLString != null) {
			setupGhidraURL(ghidraURLString);
		}

		if (bsimURLString != null) {
			bsimURL = BSimClientFactory.deriveBSimURL(bsimURLString);
			if (ghidraURL == null) {
				if ("file".equals(bsimURL.getProtocol())) {
					throw new IllegalArgumentException(
						"Unable to infer ghidra URL from BSim file DB URL");
				}

				// Derive Ghidra URL from BSim DB host and dbName
				String path = bsimURL.getPath();
				try {
					path = URLDecoder.decode(path, "UTF-8");
				}
				catch (UnsupportedEncodingException e) {
					throw new MalformedURLException(e.getMessage());
				}
				String dbName = path.substring(path.lastIndexOf('/') + 1);

				ghidraURL = GhidraURL.makeURL(bsimURL.getHost(), -1, dbName);
			}
		}
		else if (ghidraURLString != null) {
			bsimURL = BSimClientFactory.deriveBSimURL(ghidraURLString);
		}
	}

	/**
	 * Read in any optional parameters, strip them from the parameter stream
	 * @param command command name
	 * @param params is the original array of command line parameters
	 * @param discard number of params already consumed
	 * @return an array of parameters with optional ones stripped
	 */

View on GitHub (pinned to d5f144c24d)

Solutions

  1. Ensure you are running a standard, spec-compliant JVM (OpenJDK, Oracle JDK, or equivalent).
  2. If using a minimal/embedded JVM, verify that java.nio.charset.StandardCharsets.UTF_8 is available.
  3. Upgrade to a full JDK distribution if using a stripped-down runtime.
Defensive patterns

Strategy: try-catch

Try / catch

try {
    launchable.setupURLs(ghidraURLString, bsimURLString);
} catch (MalformedURLException e) {
    // In practice unreachable (UTF-8 is always supported)
    // If hit, the JVM environment is fundamentally broken
    throw new RuntimeException("JVM does not support UTF-8 charset — environment is non-compliant", e);
}

Prevention

When it happens

Trigger: Running on a non-spec-compliant JVM that does not register the UTF-8 CharsetProvider. This would indicate a severely broken runtime environment, not a normal user error.

Common situations: Effectively never seen in practice. Could theoretically occur on a minimal custom JVM build that strips standard charset providers.

Related errors


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