NationalSecurityAgency/ghidra · error · IllegalArgumentException
Given platform does not belong to this trace
Error message
Given platform does not belong to this trace
What it means
assertMine validates that a TracePlatform belongs to this trace's platform manager. This variant fires when platform is neither the host platform nor an instance of DBTraceGuestPlatform (e.g. a mock or a platform from a different trace implementation). IllegalArgumentException("Given platform does not belong to this trace").
Source
Thrown at Ghidra/Debug/Framework-TraceModeling/src/main/java/ghidra/trace/database/guest/DBTracePlatformManager.java:376
}
platform = doAddGuestPlatform(compilerSpec);
}
trace.setChanged(new TraceChangeRecord<>(TraceEvents.PLATFORM_ADDED, null, platform));
return platform;
}
@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();View on GitHub (pinned to d5f144c24d)
Solutions
- Obtain platforms only from the same trace's getPlatform / getGuestPlatforms.
- Verify platform instanceof DBTraceGuestPlatform (or is the host) before passing.
- Do not share platform objects across traces; re-fetch per trace.
Example fix
// before
mgr.someOp(platformFromOtherTrace);
// after
if (!(platform instanceof DBTraceGuestPlatform) && platform != mgr.getHostPlatform()) {
throw new IllegalArgumentException("foreign platform");
}
mgr.someOp(platform); Defensive patterns
Strategy: type-guard
Validate before calling
if (!(platform instanceof DBTraceGuestPlatform) && platform != mgr.getHostPlatform()) {
// foreign/non-DB platform; do not pass to this manager
} Type guard
static boolean isMinePlatform(DBTracePlatformManager mgr, TracePlatform p) {
return p == mgr.getHostPlatform() || p instanceof DBTraceGuestPlatform;
} Prevention
- Source platforms only from the owning trace's manager.
- Do not pass mock platforms into production manager APIs.
- Type-check at integration boundaries before calling assertMine.
When it happens
Trigger: Passing a platform obtained from a different DBTrace, a mock platform used in tests, or any non-DBTraceGuestPlatform into an API that internally calls assertMine.
Common situations: Multi-trace tooling mixing platform references; stale references after reopening a trace; test code using fake platform objects against real manager APIs.
Related errors
- Platform is not in this trace
- Address '{}' is not in this space: '{}'
- Address Range '{}' is not in this space: '{}'
- Given reference is not in this trace
- Invalid number of elements specified: {}
AI-assisted analysis of NationalSecurityAgency/ghidra@d5f144c24d (2026-08-14).
Data as JSON: /api/errors/a11a8ba8a61af015.
Report an issue: GitHub.