NationalSecurityAgency/ghidra · error · IllegalArgumentException
Given platform has been deleted
Error message
Given platform has been deleted
What it means
After the manager-identity check, assertMine tests dbPlatform.isDeleted(); if true it throws IllegalArgumentException("Given platform has been deleted"). The platform row was removed (via deleteGuestPlatform) but a stale reference is still being used.
Source
Thrown at Ghidra/Debug/Framework-TraceModeling/src/main/java/ghidra/trace/database/guest/DBTracePlatformManager.java:383
@Override
public Collection<TraceGuestPlatform> getGuestPlatforms() {
return platformView;
}
@Internal
public InternalTracePlatform assertMine(TracePlatform platform) {
if (platform == hostPlatform) {
return hostPlatform;
}
if (!(platform instanceof DBTraceGuestPlatform)) {
throw new IllegalArgumentException("Given platform does not belong to this trace");
}
DBTraceGuestPlatform dbPlatform = (DBTraceGuestPlatform) platform;
if (dbPlatform.manager != this) {
throw new IllegalArgumentException("Given platform does not belong to this trace");
}
if (dbPlatform.isDeleted()) {
throw new IllegalArgumentException("Given platform has been deleted");
}
return dbPlatform;
}
protected Address computeNextRegisterMin() {
AddressRange hostRegsRange = hostPlatform.getRegistersRange();
Address next = hostRegsRange == null
? hostPlatform.getAddressFactory().getRegisterSpace().getAddress(0)
: hostRegsRange.getMaxAddress().add(1);
for (DBTraceGuestPlatform guest : platformStore.asMap().values()) {
Address candidateNext = guest.computeNextRegisterMin();
if (candidateNext != null && next.compareTo(candidateNext) < 0) {
next = candidateNext;
}
}
return next;
}
}View on GitHub (pinned to d5f144c24d)
Solutions
- Discard platform references on PLATFORM_DELETED change events.
- Check platform.isDeleted() (liveness) before calling manager APIs.
- Re-fetch the platform from the manager; a deleted one will no longer resolve.
Example fix
// before
mgr.someOp(stalePlatform);
// after
if (((DBTraceGuestPlatform) stalePlatform).isDeleted()) {
return; // or re-resolve
}
mgr.someOp(stalePlatform); Defensive patterns
Strategy: validation
Validate before calling
if (((DBTraceGuestPlatform) platform).isDeleted()) {
// discard reference; do not call manager APIs on it
} Type guard
static boolean isLivePlatform(TracePlatform p) {
return !(p instanceof DBTraceGuestPlatform g && g.isDeleted());
} Prevention
- Listen for PLATFORM_DELETED events and clear cached references.
- Check isDeleted() before invoking platform APIs.
- Re-fetch platforms from the manager rather than caching long-term.
When it happens
Trigger: Using a TraceGuestPlatform handle after deleteGuestPlatform was called on it; UI components or caches still holding the reference after deletion.
Common situations: Emulation or views retaining platform refs past a PLATFORM_DELETED event; delete-then-use sequences; caches not invalidated on deletion.
Related errors
- Trace is not opened in this tool
- Inferiors[{infnum}] does not exist
- Emulation requires a Sleigh language
- This mapper cannot handle Harvard guests
- Cannot emulate a trace unless it's opened in the tool.
AI-assisted analysis of NationalSecurityAgency/ghidra@d5f144c24d (2026-08-14).
Data as JSON: /api/errors/a569ed0972fd6af6.
Report an issue: GitHub.