{"record":{"id":"20e984aca99ebead","repo":"NationalSecurityAgency/ghidra","slug":"xml-layout-for-newer-version-of-bsim","errorCode":null,"errorMessage":"XML layout for newer version of BSIM","messagePattern":"XML layout for newer version of BSIM","errorType":"exception","errorClass":"LSHException","httpStatus":null,"severity":"error","filePath":"Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/description/DescriptionManager.java","lineNumber":675,"sourceCode":"\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();\n\t\t}\n\t\tparser.end();\n\t}","sourceCodeStart":657,"sourceCodeEnd":693,"githubUrl":"https://github.com/NationalSecurityAgency/ghidra/blob/d5f144c24d6bc53c9cbf4448c6d11143e7696206/Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/description/DescriptionManager.java#L657-L693","documentation":"Thrown by DescriptionManager.restoreXml when the document's layout_version attribute is greater than the running code's LAYOUT_VERSION. This is the forward-incompatibility guard: the newer layout may use fields or semantics this code cannot safely read.","triggerScenarios":"Calling restoreXml on a 'description' document whose layout_version attribute exceeds the value compiled into the current DescriptionManager.LAYOUT_VERSION. Happens when opening data produced by a newer Ghidra/BSim release on an older install.","commonSituations":"Downgrading Ghidra and trying to read a database/XML exported by a newer version; sharing BSim data across teams with mismatched Ghidra versions; the document was partially migrated.","solutions":["Upgrade this Ghidra installation to the version that produced the document.","Re-export the data from the newer Ghidra using an export path compatible with this version if available.","Confirm the file actually came from a newer version (check the layout_version value) and align versions across producers/consumers."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"int docLayout = readLayoutVersionFromXml(xmlFile);\nif (docLayout > DescriptionManager.LAYOUT_VERSION) {\n    // upgrade Ghidra before loading\n}","typeGuard":null,"tryCatchPattern":"try {\n    man.restoreXml(parser, factory);\n} catch (LSHException e) {\n    if (e.getMessage().contains(\"newer version of BSIM\")) {\n        // upgrade Ghidra to the producing version\n    } else throw e;\n}","preventionTips":["Upgrade the consumer Ghidra to at least the version that produced the document.","Avoid downgrading Ghidra below the data's layout version.","Standardize the Ghidra version across teams that share BSim data."],"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"}