{"record":{"id":"59b6d83b50a6504f","repo":"NationalSecurityAgency/ghidra","slug":"invalid-mingw-relocation-list-location","errorCode":null,"errorMessage":"Invalid MinGW relocation list location: {}","messagePattern":"Invalid MinGW relocation list location: (.+?)","errorType":"exception","errorClass":"InvalidDataException","httpStatus":null,"severity":"warning","filePath":"Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/analysis/MingwRelocationAnalyzer.java","lineNumber":146,"sourceCode":"\t\tthis.program = program;\n\t\tif (!findLabeledPseudoRelocList()) {\n\t\t\tif (program.getDefaultPointerSize() == 8) {\n\t\t\t\tfindUnlabeledPseudoRelocList64Bit(monitor);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tfindUnlabeledPseudoRelocList32Bit(monitor);\n\t\t\t}\n\t\t}\n\t\tif (getDataBlock(pdwListStartAddr) != getDataBlock(pdwListEndAddr)) {\n\t\t\tthrow new InvalidDataException(\"Mismatched MinGW relocation list start/end: \" +\n\t\t\t\tpdwListStartAddr + \" / \" + pdwListEndAddr);\n\t\t}\n\t}\n\n\tprivate MemoryBlock getDataBlock(Address addr) throws InvalidDataException {\n\t\tMemoryBlock block = program.getMemory().getBlock(addr);\n\t\tif (block == null || !block.isInitialized()) {\n\t\t\tthrow new InvalidDataException(\"Invalid MinGW relocation list location: \" + addr);\n\t\t}\n\t\treturn block;\n\t}\n\n\tboolean listLabelsFound() {\n\t\treturn listLabelsFound;\n\t}\n\n\tprivate void findUnlabeledPseudoRelocList64Bit(TaskMonitor monitor)\n\t\t\tthrows InvalidDataException, CancelledException {\n\n\t\tfindUnlabeledPseudoRelocList(monitor);\n\n\t}\n\n\tprivate void findUnlabeledPseudoRelocList32Bit(TaskMonitor monitor)\n\t\t\tthrows InvalidDataException, CancelledException {\n","sourceCodeStart":128,"sourceCodeEnd":164,"githubUrl":"https://github.com/NationalSecurityAgency/ghidra/blob/d5f144c24d6bc53c9cbf4448c6d11143e7696206/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/analysis/MingwRelocationAnalyzer.java#L128-L164","documentation":"Thrown as InvalidDataException by MinGWPseudoRelocList.getDataBlock when the address passed in has no memory block, or its block is not initialized. The pseudo-relocation list must live in initialized memory; an address outside memory or in an uninitialized block makes the data unreadable and the analysis invalid.","triggerScenarios":"getMemory().getBlock(addr) returns null (address outside any block), or block.isInitialized() is false (e.g. address in a .bss-like uninitialized block), for either the list start or end address.","commonSituations":"The pseudo-reloc pointer resolves to an external/import address rather than a real list address; a malformed PE with bad relocation metadata; the binary's memory layout changed between import versions; analyzing a partially-loaded program where the relevant block was not loaded.","solutions":["Confirm the program was fully imported with all sections loaded into initialized memory.","Check that the resolved address is within an initialized block before constructing MinGWPseudoRelocList.","Disable the analyzer for binaries known to lack a valid pseudo-reloc list.","Catch InvalidDataException and skip pseudo-reloc processing for that binary."],"exampleFix":"// before\nMemoryBlock b = getDataBlock(addr); // throws if addr not in initialized memory\n\n// after — validate block presence first\nMemoryBlock b = program.getMemory().getBlock(addr);\nif (b == null || !b.isInitialized()) {\n    throw new InvalidDataException(\"Invalid MinGW relocation list location: \" + addr);\n}","handlingStrategy":"validation","validationCode":"MemoryBlock b = program.getMemory().getBlock(addr);\nif (b == null || !b.isInitialized()) {\n    // address not usable; skip pseudo-reloc construction\n}","typeGuard":"boolean inInitBlock = program.getMemory().getBlock(addr) != null && program.getMemory().getBlock(addr).isInitialized();","tryCatchPattern":"try {\n    new MinGWPseudoRelocList(program, monitor);\n} catch (InvalidDataException e) {\n    log.appendMsg(\"MinGW pseudo-reloc list unusable: \" + e.getMessage());\n}","preventionTips":["Ensure full PE import with all sections loaded into initialized memory.","Validate block presence before constructing the list.","Disable the analyzer when the address space is incomplete."],"tags":["ghidra","analysis","mingw","memory","invalid-data"],"backgroundTag":null,"analyzedSha":"d5f144c24d6bc53c9cbf4448c6d11143e7696206","analyzedAt":"2026-08-14T01:00:57.564Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}