{"record":{"id":"2f58470508f1b0be","repo":"NationalSecurityAgency/ghidra","slug":"platform-table-is-corrupt-missing-language-lang","errorCode":null,"errorMessage":"Platform table is corrupt. Missing language ${langKey}","messagePattern":"Platform table is corrupt\\. Missing language (.+?)","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"critical","filePath":"Ghidra/Debug/Framework-TraceModeling/src/main/java/ghidra/trace/database/guest/DBTraceGuestPlatform.java","lineNumber":188,"sourceCode":"\t}\n\n\tvoid set(CompilerSpec compilerSpec) {\n\t\tthis.languageEntry = manager.getOrCreateLanguage(compilerSpec.getLanguage());\n\t\tthis.langKey = (int) (languageEntry == null ? -1 : languageEntry.getKey());\n\t\tthis.cSpecID = compilerSpec.getCompilerSpecID();\n\t\tupdate(LANGKEY_COLUMN, CSPECID_COLUMN);\n\t\tthis.compilerSpec = compilerSpec;\n\t}\n\n\t@Override\n\tprotected void fresh(boolean created) throws IOException {\n\t\tsuper.fresh(created);\n\t\tif (created) {\n\t\t\treturn;\n\t\t}\n\t\tthis.languageEntry = manager.getLanguageByKey(langKey);\n\t\tif (languageEntry == null && langKey != -1) {\n\t\t\tthrow new IOException(\"Platform table is corrupt. Missing language \" + langKey);\n\t\t}\n\t\tcompilerSpec = getLanguage().getCompilerSpecByID(cSpecID);\n\t\tif (compilerSpec == null) {\n\t\t\tthrow new IOException(\n\t\t\t\t\"Platform table is corrupt. Invalid compiler spec \" + compilerSpec);\n\t\t}\n\t}\n\n\tprotected void loadDataTypeManager(OpenMode openMode, TaskMonitor monitor)\n\t\t\tthrows CancelledException, VersionException, IOException {\n\t\tthis.dataTypeManager = new DBTraceDataTypeManager(manager.dbh, openMode, manager.lock,\n\t\t\tmonitor, manager.trace, this);\n\t}\n\n\t@Override\n\tpublic Trace getTrace() {\n\t\treturn manager.trace;\n\t}","sourceCodeStart":170,"sourceCodeEnd":206,"githubUrl":"https://github.com/NationalSecurityAgency/ghidra/blob/d5f144c24d6bc53c9cbf4448c6d11143e7696206/Ghidra/Debug/Framework-TraceModeling/src/main/java/ghidra/trace/database/guest/DBTraceGuestPlatform.java#L170-L206","documentation":"During fresh() load of a stored guest-platform row, the manager resolves the language by its stored key. If getLanguageByKey(langKey) returns null and langKey != -1 (the -1 sentinel marks the host), it throws IOException(\"Platform table is corrupt. Missing language\"). The processor language referenced by this guest platform is not registered with the language provider, so the row cannot be rehydrated.","triggerScenarios":"Opening a trace whose guest platform was built on a processor language that is no longer installed/registered; corrupt or hand-edited DB with an orphaned langKey.","commonSituations":"Sharing traces across installs with different processor modules; uninstalling/moving a processor language pack after a trace was saved; version drift in language definitions.","solutions":["Install/register the missing processor language module.","Re-open the trace on the original Ghidra + processor configuration that created it.","If unrecoverable, treat the trace as corrupt and rebuild the guest platform."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// preflight: ensure the language is registered before opening\nif (languageService.getLanguage(new LanguageID(langId)) == null) {\n    // install/locate the processor language first\n}","typeGuard":null,"tryCatchPattern":"try { trace.open(...); }\ncatch (IOException e) {\n    if (e.getMessage().contains(\"Missing language\")) { /* require language module */ }\n    else throw e;\n}","preventionTips":["Bundle or document the required processor language module with shared traces.","Pin the Ghidra/processor version used to create traces.","Preflight language availability before attempting to open."],"tags":["corruption","database","language","guest-platform"],"backgroundTag":null,"analyzedSha":"d5f144c24d6bc53c9cbf4448c6d11143e7696206","analyzedAt":"2026-08-14T01:00:57.564Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}