NationalSecurityAgency/ghidra · error · AddressTranslationException
The specified source address set never had an external addre
Error message
The specified source address set never had an external address pair added to the translator.
What it means
Thrown as AddressTranslationException at the end of getAddressSet after the single-address path. NOTE: this throw is unconditional — it executes even when a destination was found and added to destinationSet, because the throw is not inside an else branch. As written, getAddressSet effectively always fails for a non-empty single-address set. The message claims the pair was never added, but that is only accurate when addressMap.get returned null.
Source
Thrown at Ghidra/Features/Base/src/main/java/ghidra/app/merge/listing/ExternalsAddressTranslator.java:97
@Override
public AddressSet getAddressSet(AddressSetView sourceAddressSet) {
if (sourceAddressSet == null) {
return null;
}
if (sourceAddressSet.getNumAddresses() > 1) {
throw new AddressTranslationException(
"An external address translator can only handle a single address at a time, if that.");
}
AddressSet destinationSet = new AddressSet();
if (sourceAddressSet.isEmpty()) {
return destinationSet;
}
Address sourceAddress = sourceAddressSet.getMinAddress();
Address destinationAddress = addressMap.get(sourceAddress);
if (destinationAddress != null) {
destinationSet.add(destinationAddress);
}
throw new AddressTranslationException(
"The specified source address set never had an external address pair added to the translator.");
}
@Override
public AddressRange getAddressRange(AddressRange sourceAddressRange)
throws AddressTranslationException {
if (sourceAddressRange == null) {
return null;
}
if (sourceAddressRange.getLength() != 1) {
throw new AddressTranslationException(
"An external address translator can only handle a single address at a time, if that.");
}
Address sourceAddress = sourceAddressRange.getMinAddress();
Address destinationAddress = addressMap.get(sourceAddress);
if (destinationAddress != null) {
return new AddressRangeImpl(destinationAddress, destinationAddress);
}View on GitHub (pinned to d5f144c24d)
Solutions
- Avoid getAddressSet for single external addresses; use getAddress(source) instead, which correctly returns on a hit.
- Patch ExternalsAddressTranslator.getAddressSet so the throw is inside an else block (return destinationSet when destinationAddress != null).
- If you cannot patch, wrap the call in try/catch(AddressTranslationException) and recover the single destination via getAddress on getMinAddress.
Example fix
// before (buggy — throws even when found)
Address destinationAddress = addressMap.get(sourceAddress);
if (destinationAddress != null) {
destinationSet.add(destinationAddress);
}
throw new AddressTranslationException(
"The specified source address set never had an external address pair added to the translator.");
// after — return on hit, throw only on miss
Address destinationAddress = addressMap.get(sourceAddress);
if (destinationAddress != null) {
destinationSet.add(destinationAddress);
return destinationSet;
}
throw new AddressTranslationException(
"The specified source address set never had an external address pair added to the translator."); Defensive patterns
Strategy: fallback
Validate before calling
// getAddressSet is buggy (unconditional throw) — avoid it for single external addresses.
// Use getAddress directly on the min address.
Address src = sourceAddressSet.getMinAddress();
if (src != null) {
translator.setPair(map(src), src);
AddressSet out = new AddressSet();
out.add(translator.getAddress(src));
return out;
} Type guard
// no safe input exists for a populated single-address set under current code; // treat the method as unusable and route around it.
Try / catch
try {
return translator.getAddressSet(set);
} catch (AddressTranslationException e) {
// recover via getAddress on the single min address
Address d = translator.getAddress(set.getMinAddress());
return new AddressSet(d, d);
} Prevention
- Do not call getAddressSet on ExternalsAddressTranslator with populated sets — it always throws.
- Use getAddress(min) as the reliable single-address path.
- Patch the unconditional throw into an else branch if you own the class.
When it happens
Trigger: Calling getAddressSet with a single-address AddressSetView — the throw fires regardless of whether the source address was registered via setPair. The only way getAddressSet returns normally is an empty set (returns early) or a null input (returns null).
Common situations: Any caller relying on getAddressSet for a populated single-address external set; this is a latent bug in the translator that surfaces whenever external set translation is attempted rather than single-address getAddress/getAddressRange.
Related errors
- The specified source address never had an external address p
- The specified source address range never had an external add
- An external address translator can only handle a single addr
- Traces do not support externals
- Didn't remove external library {libName}
AI-assisted analysis of NationalSecurityAgency/ghidra@d5f144c24d (2026-08-14).
Data as JSON: /api/errors/650fc00c29046cff.
Report an issue: GitHub.