{"record":{"id":"c8d1ba88f133449f","repo":"NationalSecurityAgency/ghidra","slug":"bad-address-format","errorCode":null,"errorMessage":"Bad address format: {}","messagePattern":"Bad address format: (.+?)","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"warning","filePath":"Ghidra/Debug/Debugger-isf/src/main/java/ghidra/program/model/data/ISF/IsfDataTypeWriter.java","lineNumber":578,"sourceCode":"\t\t\tMsg.error(this, \"TypeDef error: \" + e);\n\t\t}\n\t\tclearResolve(typedefName, baseType);\n\n\t\treturn null;\n\t}\n\n\tpublic void requestAddress(String key) throws IOException {\n\t\tif (dtm instanceof ProgramDataTypeManager pgmDtm) {\n\t\t\ttry {\n\t\t\t\tAddress address = pgmDtm.getProgram().getMinAddress().getAddress(key);\n\t\t\t\tif (address == null) {\n\t\t\t\t\tMsg.error(this, address + \" not found\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\trequestedAddresses.add(address);\n\t\t\t}\n\t\t\tcatch (AddressFormatException e) {\n\t\t\t\tthrow new IOException(\"Bad address format: \" + key);\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic void requestSymbol(String symbol) {\n\t\tif (symbol == null) {\n\t\t\tMsg.error(this, symbol + \" not found\");\n\t\t\treturn;\n\t\t}\n\t\trequestedSymbols.add(symbol);\n\t}\n\n\tpublic JsonWriter getWriter() {\n\t\treturn writer;\n\t}\n\n\t@Override\n\tpublic String toString() {","sourceCodeStart":560,"sourceCodeEnd":596,"githubUrl":"https://github.com/NationalSecurityAgency/ghidra/blob/d5f144c24d6bc53c9cbf4448c6d11143e7696206/Ghidra/Debug/Debugger-isf/src/main/java/ghidra/program/model/data/ISF/IsfDataTypeWriter.java#L560-L596","documentation":"IOException('Bad address format: ' + key) thrown by IsfDataTypeWriter.requestAddress when parsing the key string into an Address fails. It uses the program's min address (getMinAddress().getAddress(key)) and catches AddressFormatException, re-throwing as IOException. A separate earlier branch logs and returns silently if the parsed address is null.","triggerScenarios":"requestAddress(key) is called with a string that the program's address space cannot parse, e.g. wrong radix, missing segment prefix for segmented spaces, or a format inconsistent with the program's default address space.","commonSituations":"Passing a decimal or unprefixed string to a space expecting hex; segmented (x86 real-mode) address given as a flat value; symbol/address copied with extra characters or wrong case for the space.","solutions":["Format the address key consistently with the program's default address space (e.g. hex with correct prefix, or segment:offset for segmented spaces).","Validate/parse with AddressFactory or a known AddressSpace before calling requestAddress.","Catch IOException around requestAddress and report the offending key to the operator."],"exampleFix":"// before\nwriter.requestAddress(userInput); // userInput may be \"1234\" for a hex space\n\n// after\nAddress addr;\ntry {\n    addr = program.getAddressFactory().getDefaultAddressSpace().getAddress(userInput);\n} catch (AddressFormatException e) {\n    throw new IllegalArgumentException(\"Not a valid address: \" + userInput, e);\n}\nwriter.requestAddress(addr.toString());","handlingStrategy":"validation","validationCode":"Address a;\ntry {\n    a = program.getAddressFactory().getDefaultAddressSpace().getAddress(key);\n} catch (AddressFormatException e) {\n    // reject the key before calling requestAddress\n    return;\n}","typeGuard":null,"tryCatchPattern":"try {\n    writer.requestAddress(key);\n} catch (IOException e) {\n    if (e.getMessage().contains(\"Bad address format\")) {\n        // prompt for a valid address for this program's space\n    }\n}","preventionTips":["Format address keys to match the program's default address space (hex prefix, segment:offset, etc.).","Validate with AddressFactory/AddressSpace before requesting.","Catch IOException and surface the offending key."],"tags":["ghidra","isf","address","data-type","parse-error"],"backgroundTag":null,"analyzedSha":"d5f144c24d6bc53c9cbf4448c6d11143e7696206","analyzedAt":"2026-08-14T01:00:57.564Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}