{"record":{"id":"e46ffd3cb87be72a","repo":"NationalSecurityAgency/ghidra","slug":"schema-doesn-t-provide-a-unique-for","errorCode":null,"errorMessage":"Schema doesn't provide a unique {} for {}","messagePattern":"Schema doesn't provide a unique (.+?) for (.+?)","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"critical","filePath":"Ghidra/Debug/Framework-TraceModeling/src/main/java/ghidra/trace/database/stack/DBTraceStackManager.java","lineNumber":73,"sourceCode":"\t\tthis.threadManager = threadManager;\n\t\tthis.overlayAdapter = overlayAdapter;\n\t}\n\n\t@Override\n\tpublic void dbError(IOException e) {\n\t\ttrace.dbError(e);\n\t}\n\n\t@Override\n\tpublic void invalidateCache(boolean all) {\n\t\t// NOTE: This is only a wrapper around the object manager\n\t}\n\n\tpublic static PathFilter single(TraceObject seed,\n\t\t\tClass<? extends TraceObjectInterface> targetIf) {\n\t\tPathFilter stackFilter = seed.getSchema().searchFor(targetIf, false);\n\t\tif (stackFilter.getSingletonPath() == null) {\n\t\t\tthrow new IllegalStateException(\"Schema doesn't provide a unique \" +\n\t\t\t\ttargetIf.getSimpleName() + \" for \" + seed.getCanonicalPath());\n\t\t}\n\t\treturn stackFilter.getSingletonPattern();\n\t}\n\n\tprotected TraceStack doGetOrAddObjectStack(TraceThread thread, long snap,\n\t\t\tboolean createIfAbsent) {\n\t\tTraceObject obj = thread.getObject();\n\t\tPathFilter filter = single(obj, TraceStack.class);\n\t\tif (createIfAbsent) {\n\t\t\ttry (LockHold hold = trace.lockWrite()) {\n\t\t\t\tTraceStack stack =\n\t\t\t\t\ttrace.getObjectManager().getSuccessor(obj, filter, snap, TraceStack.class);\n\t\t\t\tif (stack != null) {\n\t\t\t\t\treturn stack;\n\t\t\t\t}\n\t\t\t\tKeyPath path = obj.getCanonicalPath().extend(filter.getSingletonPath());\n\t\t\t\treturn trace.getObjectManager().addStack(path, snap);","sourceCodeStart":55,"sourceCodeEnd":91,"githubUrl":"https://github.com/NationalSecurityAgency/ghidra/blob/d5f144c24d6bc53c9cbf4448c6d11143e7696206/Ghidra/Debug/Framework-TraceModeling/src/main/java/ghidra/trace/database/stack/DBTraceStackManager.java#L55-L91","documentation":"Thrown as IllegalStateException by DBTraceStackManager.single when the given seed object's schema does not provide a unique (singleton) path to the requested target interface (e.g. TraceStack). searchFor(targetIf, false) must return a filter whose getSingletonPath() is non-null. If the schema allows zero or multiple candidate locations, the manager cannot deterministically locate the stack (or stack frame) and refuses to proceed.","triggerScenarios":"Calling getOrAddObjectStack on a thread whose schema defines no unique TraceStack, or defines multiple alternative paths to one. Custom schemas with branching elements for stacks/frames.","commonSituations":"Trace created with a non-standard or partial object schema; mixing schema versions; a connector that builds an ambiguous object tree.","solutions":["Ensure the schema pins exactly one path from the thread object to TraceStack (and to TraceStackFrame).","Recreate the trace with the canonical framework schema.","Use a lower-level object API to navigate explicitly when the schema is intentionally ambiguous."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"PathFilter f = seed.getSchema().searchFor(TraceStack.class, false);\nif (f.getSingletonPath() == null) { /* schema ambiguous/absent */ }","typeGuard":null,"tryCatchPattern":"try { stack = mgr.getOrAddObjectStack(thread, snap, true); }\ncatch (IllegalStateException e) { /* schema cannot locate stack uniquely */ }","preventionTips":["Ensure schema defines a unique path to TraceStack/TraceStackFrame.","Use canonical framework schemas; avoid ambiguous custom ones."],"tags":["stack","schema","object-model","illegal-state"],"backgroundTag":null,"analyzedSha":"d5f144c24d6bc53c9cbf4448c6d11143e7696206","analyzedAt":"2026-08-14T01:00:57.564Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}