{"record":{"id":"5924567fa3f28acd","repo":"NationalSecurityAgency/ghidra","slug":"old-xml-layout-is-no-longer-supported","errorCode":null,"errorMessage":"Old XML layout is no longer supported","messagePattern":"Old XML layout is no longer supported","errorType":"exception","errorClass":"LSHException","httpStatus":null,"severity":"error","filePath":"Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/description/DescriptionManager.java","lineNumber":672,"sourceCode":"\n\t/**\n\t * Reconstruct a container by deserializing an XML stream\n\t * @param parser is the XML parser\n\t * @param vectorFactory is the factory to use for building feature vectors\n\t * @throws LSHException if there are inconsistencies in the XML\n\t */\n\tpublic void restoreXml(XmlPullParser parser, LSHVectorFactory vectorFactory)\n\t\t\tthrows LSHException {\n\t\tmajor = 0;\n\t\tminor = 0;\n\t\tsettings = 0;\n\t\tint layout_version = 0;\n\t\tXmlElement el = parser.start(\"description\");\n\t\tif (el.hasAttribute(\"layout_version\")) {\n\t\t\tlayout_version = SpecXmlUtils.decodeInt(el.getAttribute(\"layout_version\"));\n\t\t}\n\t\tif (layout_version < LAYOUT_VERSION) {\n\t\t\tthrow new LSHException(\"Old XML layout is no longer supported\");\n\t\t}\n\t\tif (layout_version > LAYOUT_VERSION) {\n\t\t\tthrow new LSHException(\"XML layout for newer version of BSIM\");\n\t\t}\n\t\tif (el.hasAttribute(\"major\")) {\n\t\t\tmajor = (short) SpecXmlUtils.decodeInt(el.getAttribute(\"major\"));\n\t\t\tminor = (short) SpecXmlUtils.decodeInt(el.getAttribute(\"minor\"));\n\t\t}\n\t\tif (el.hasAttribute(\"settings\")) {\n\t\t\tsettings = SpecXmlUtils.decodeInt(el.getAttribute(\"settings\"));\n\t\t}\n\t\twhile (parser.peek().isStart()) {\n\t\t\tparser.start(\"execlist\");\n\t\t\tExecutableRecord erec = ExecutableRecord.restoreXml(parser, this);\n\t\t\twhile (parser.peek().isStart()) {\n\t\t\t\tFunctionDescription.restoreXml(parser, vectorFactory, this, erec);\n\t\t\t}\n\t\t\tparser.end();","sourceCodeStart":654,"sourceCodeEnd":690,"githubUrl":"https://github.com/NationalSecurityAgency/ghidra/blob/d5f144c24d6bc53c9cbf4448c6d11143e7696206/Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/description/DescriptionManager.java#L654-L690","documentation":"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.","triggerScenarios":"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.","commonSituations":"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).","solutions":["Re-export the BSim data with the current Ghidra version so it carries the new layout_version.","Upgrade the source Ghidra installation to a version whose layout_version matches, then re-export.","Locate an intermediate Ghidra version that supports both layouts to migrate the data.","If the data is expendable, regenerate the BSim database from the original binaries."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"int docLayout = readLayoutVersionFromXml(xmlFile);\nif (docLayout < DescriptionManager.LAYOUT_VERSION) {\n    // migrate/re-export with current version; do not call restoreXml\n}","typeGuard":null,"tryCatchPattern":"try {\n    man.restoreXml(parser, factory);\n} catch (LSHException e) {\n    if (e.getMessage().contains(\"Old XML layout\")) {\n        // prompt user to re-export with current Ghidra\n    } else throw e;\n}","preventionTips":["Keep producer and consumer Ghidra versions aligned.","Re-export BSim data after major Ghidra upgrades.","Discard or archive old layout documents and regenerate from binaries."],"tags":["bsim","xml","version-mismatch","serialization","java"],"backgroundTag":null,"analyzedSha":"d5f144c24d6bc53c9cbf4448c6d11143e7696206","analyzedAt":"2026-08-14T01:00:57.564Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}