NationalSecurityAgency/ghidra · error · LSHException

Old XML layout is no longer supported

Error message

Old XML layout is no longer supported

What it means

Thrown by DescriptionManager.restoreXml when the parsed XML 'description' element's layout_version attribute is less than the code's current LAYOUT_VERSION constant. BSim changed its XML serialization format and the loader refuses documents written by the older layout because it cannot interpret them reliably.

Source

Thrown at Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/description/DescriptionManager.java:672

	/**
	 * Reconstruct a container by deserializing an XML stream
	 * @param parser is the XML parser
	 * @param vectorFactory is the factory to use for building feature vectors
	 * @throws LSHException if there are inconsistencies in the XML
	 */
	public void restoreXml(XmlPullParser parser, LSHVectorFactory vectorFactory)
			throws LSHException {
		major = 0;
		minor = 0;
		settings = 0;
		int layout_version = 0;
		XmlElement el = parser.start("description");
		if (el.hasAttribute("layout_version")) {
			layout_version = SpecXmlUtils.decodeInt(el.getAttribute("layout_version"));
		}
		if (layout_version < LAYOUT_VERSION) {
			throw new LSHException("Old XML layout is no longer supported");
		}
		if (layout_version > LAYOUT_VERSION) {
			throw new LSHException("XML layout for newer version of BSIM");
		}
		if (el.hasAttribute("major")) {
			major = (short) SpecXmlUtils.decodeInt(el.getAttribute("major"));
			minor = (short) SpecXmlUtils.decodeInt(el.getAttribute("minor"));
		}
		if (el.hasAttribute("settings")) {
			settings = SpecXmlUtils.decodeInt(el.getAttribute("settings"));
		}
		while (parser.peek().isStart()) {
			parser.start("execlist");
			ExecutableRecord erec = ExecutableRecord.restoreXml(parser, this);
			while (parser.peek().isStart()) {
				FunctionDescription.restoreXml(parser, vectorFactory, this, erec);
			}
			parser.end();

View on GitHub (pinned to d5f144c24d)

Solutions

  1. Re-export the BSim data with the current Ghidra version so it carries the new layout_version.
  2. Upgrade the source Ghidra installation to a version whose layout_version matches, then re-export.
  3. Locate an intermediate Ghidra version that supports both layouts to migrate the data.
  4. If the data is expendable, regenerate the BSim database from the original binaries.
Defensive patterns

Strategy: validation

Validate before calling

int docLayout = readLayoutVersionFromXml(xmlFile);
if (docLayout < DescriptionManager.LAYOUT_VERSION) {
    // migrate/re-export with current version; do not call restoreXml
}

Try / catch

try {
    man.restoreXml(parser, factory);
} catch (LSHException e) {
    if (e.getMessage().contains("Old XML layout")) {
        // prompt user to re-export with current Ghidra
    } else throw e;
}

Prevention

When it happens

Trigger: Calling restoreXml(parser, vectorFactory) on a 'description' document whose layout_version attribute (or absence, defaulting to 0) is below LAYOUT_VERSION. Happens when loading BSim data exported by an older Ghidra/BSim release.

Common situations: Loading BSim XML or database dumps produced by an older Ghidra version after upgrading; using a backup file from a previous schema; the layout_version attribute was stripped or is missing (treated as 0).

Related errors


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