NationalSecurityAgency/ghidra · warning · IOException

Bad address format: {}

Error message

Bad address format: {}

What it means

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.

Source

Thrown at Ghidra/Debug/Debugger-isf/src/main/java/ghidra/program/model/data/ISF/IsfDataTypeWriter.java:578

			Msg.error(this, "TypeDef error: " + e);
		}
		clearResolve(typedefName, baseType);

		return null;
	}

	public void requestAddress(String key) throws IOException {
		if (dtm instanceof ProgramDataTypeManager pgmDtm) {
			try {
				Address address = pgmDtm.getProgram().getMinAddress().getAddress(key);
				if (address == null) {
					Msg.error(this, address + " not found");
					return;
				}
				requestedAddresses.add(address);
			}
			catch (AddressFormatException e) {
				throw new IOException("Bad address format: " + key);
			}
		}
	}

	public void requestSymbol(String symbol) {
		if (symbol == null) {
			Msg.error(this, symbol + " not found");
			return;
		}
		requestedSymbols.add(symbol);
	}

	public JsonWriter getWriter() {
		return writer;
	}

	@Override
	public String toString() {

View on GitHub (pinned to d5f144c24d)

Solutions

  1. Format the address key consistently with the program's default address space (e.g. hex with correct prefix, or segment:offset for segmented spaces).
  2. Validate/parse with AddressFactory or a known AddressSpace before calling requestAddress.
  3. Catch IOException around requestAddress and report the offending key to the operator.

Example fix

// before
writer.requestAddress(userInput); // userInput may be "1234" for a hex space

// after
Address addr;
try {
    addr = program.getAddressFactory().getDefaultAddressSpace().getAddress(userInput);
} catch (AddressFormatException e) {
    throw new IllegalArgumentException("Not a valid address: " + userInput, e);
}
writer.requestAddress(addr.toString());
Defensive patterns

Strategy: validation

Validate before calling

Address a;
try {
    a = program.getAddressFactory().getDefaultAddressSpace().getAddress(key);
} catch (AddressFormatException e) {
    // reject the key before calling requestAddress
    return;
}

Try / catch

try {
    writer.requestAddress(key);
} catch (IOException e) {
    if (e.getMessage().contains("Bad address format")) {
        // prompt for a valid address for this program's space
    }
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of NationalSecurityAgency/ghidra@d5f144c24d (2026-08-14). Data as JSON: /api/errors/c8d1ba88f133449f. Report an issue: GitHub.