{"record":{"id":"47fd6a9f6470a8c5","repo":"NationalSecurityAgency/ghidra","slug":"platform-table-is-corrupt-invalid-compiler-spec","errorCode":null,"errorMessage":"Platform table is corrupt. Invalid compiler spec ${compilerSpec}","messagePattern":"Platform table is corrupt\\. Invalid compiler spec (.+?)","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"critical","filePath":"Ghidra/Debug/Framework-TraceModeling/src/main/java/ghidra/trace/database/guest/DBTraceGuestPlatform.java","lineNumber":192,"sourceCode":"\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}\n\n\t@Override\n\tpublic int getIntKey() {\n\t\treturn (int) key;","sourceCodeStart":174,"sourceCodeEnd":210,"githubUrl":"https://github.com/NationalSecurityAgency/ghidra/blob/d5f144c24d6bc53c9cbf4448c6d11143e7696206/Ghidra/Debug/Framework-TraceModeling/src/main/java/ghidra/trace/database/guest/DBTraceGuestPlatform.java#L174-L210","documentation":"After resolving the language in fresh(), the code fetches the compiler spec by stored ID via getLanguage().getCompilerSpecByID(cSpecID); if null it throws IOException(\"Platform table is corrupt. Invalid compiler spec\"). The stored cspec ID does not exist in the resolved language's compiler-spec set.","triggerScenarios":"Opening a trace with a language version whose compiler spec was removed or renamed, leaving cSpecID orphaned; corrupt row holding an invalid spec ID.","commonSituations":"Language pack version drift; cross-version trace sharing where cspec identifiers changed; partially upgraded DB.","solutions":["Use the language version that still defines that compiler spec.","Re-install the matching processor module version.","Rebuild the trace/platform if the cspec is genuinely unavailable."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// ensure the compiler spec exists in the resolved language\nif (language.getCompilerSpecByID(new CompilerSpecID(cspecId)) == null) {\n    // use a language version that still defines this cspec\n}","typeGuard":null,"tryCatchPattern":"try { trace.open(...); }\ncatch (IOException e) {\n    if (e.getMessage().contains(\"Invalid compiler spec\")) { /* require matching language version */ }\n    else throw e;\n}","preventionTips":["Keep language and compiler-spec definitions version-aligned with saved traces.","Avoid partial processor-module upgrades.","Preflight compiler-spec availability for each guest platform before open."],"tags":["corruption","database","compiler-spec","guest-platform"],"backgroundTag":null,"analyzedSha":"d5f144c24d6bc53c9cbf4448c6d11143e7696206","analyzedAt":"2026-08-14T01:00:57.564Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}