NationalSecurityAgency/ghidra · error · IllegalArgumentException
name cannot be null
Error message
name cannot be null
What it means
Thrown by TraceEquateManager.validateName: an equate name must be a non-null, non-empty, whitespace-free string. A null name is the first failure point and is rejected before emptiness or whitespace checks. Equates name scalar constants, so an absent name has no meaning.
Source
Thrown at Ghidra/Debug/Framework-TraceModeling/src/main/java/ghidra/trace/model/symbol/TraceEquateManager.java:33
*/
package ghidra.trace.model.symbol;
import java.util.Collection;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import ghidra.program.model.address.AddressSpace;
import ghidra.trace.model.stack.TraceStackFrame;
import ghidra.trace.model.thread.TraceThread;
import ghidra.util.exception.DuplicateNameException;
/**
* TODO: Document me
*/
public interface TraceEquateManager extends TraceEquateOperations {
static void validateName(String name) throws IllegalArgumentException {
if (name == null) {
throw new IllegalArgumentException("name cannot be null");
}
if (name.length() == 0) {
throw new IllegalArgumentException("name cannot be empty string");
}
Pattern whitespace = Pattern.compile("\\s+");
Matcher matcher = whitespace.matcher(name);
if (matcher.find()) {
throw new IllegalArgumentException("name cannot contain whitespace");
}
}
TraceEquateSpace getEquateSpace(AddressSpace space, boolean createIfAbsent);
TraceEquateSpace getEquateRegisterSpace(TraceThread thread, boolean createIfAbsent);
TraceEquateSpace getEquateRegisterSpace(TraceStackFrame frame, boolean createIfAbsent);
TraceEquate create(String name, long value)View on GitHub (pinned to d5f144c24d)
Solutions
- Supply a non-null name (typically the constant's textual form, e.g. "0x10" or "MAX_INT").
- Null-check at the source: if (name == null) return/skip; do not forward null into create.
- Default to a derived name when none is provided.
Example fix
// before equateMgr.create(equateName /* null */, value); // after String name = equateName != null ? equateName : "0x" + Long.toHexString(value); equateMgr.create(name, value);
Defensive patterns
Strategy: validation
Validate before calling
TraceEquateManager.validateName(name); // throws early, or:
if (name == null) { name = "0x" + Long.toHexString(value); }
equateMgr.create(name, value); Type guard
static boolean validName(String name) { return name != null && !name.isEmpty() && !name.matches(".*\\s.*"); } Prevention
- Never forward a possibly-null name into create; derive a fallback.
- Call validateName at the boundary where external names enter.
When it happens
Trigger: Calling TraceEquateManager.create(name, value), addEquateReference, or any operation that validates a name with name == null.
Common situations: Uninitialized name fields; a lookup/import that returns null when an equate is absent and that null is forwarded into a create call; UI text field left empty returning null.
Related errors
- name cannot be empty string
- name cannot contain whitespace
- operandIndex
- Memory addresses cannot be associated with a thread
- Given namespace is not in this trace
AI-assisted analysis of NationalSecurityAgency/ghidra@d5f144c24d (2026-08-14).
Data as JSON: /api/errors/b036f08bf603ddb0.
Report an issue: GitHub.