{"record":{"id":"3d8d99bbad9ea0cf","repo":"NationalSecurityAgency/ghidra","slug":"there-must-be-a-root-object-in-the-objectmanager-b","errorCode":null,"errorMessage":"There must be a root object in the ObjectManager before setting the TimeRadix","messagePattern":"There must be a root object in the ObjectManager before setting the TimeRadix","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"Ghidra/Debug/Framework-TraceModeling/src/main/java/ghidra/trace/database/time/DBTraceTimeManager.java","lineNumber":333,"sourceCode":"\t\treturn snapshotStore.getRecordCount();\n\t}\n\n\tpublic void deleteSnapshot(DBTraceSnapshot snapshot) {\n\t\ttry (LockHold hold = LockHold.lock(lock.writeLock())) {\n\t\t\tDBTraceFork foundFork = forksBySnap.getOne(snapshot.getKey());\n\t\t\tsnapshotStore.delete(snapshot);\n\t\t\tif (foundFork != null) {\n\t\t\t\tforkStore.delete(foundFork);\n\t\t\t}\n\t\t\tnotifySnapshotDeleted(snapshot);\n\t\t}\n\t}\n\n\t@Override\n\tpublic void setTimeRadix(TimeRadix radix) {\n\t\tDBTraceObject root = trace.getObjectManager().getRootObject();\n\t\tif (root == null) {\n\t\t\tthrow new IllegalStateException(\n\t\t\t\t\"There must be a root object in the ObjectManager before setting the TimeRadix\");\n\t\t}\n\t\troot.setAttribute(Lifespan.ALL, KEY_TIME_RADIX, switch (radix) {\n\t\t\tcase DEC -> \"dec\";\n\t\t\tcase HEX_UPPER -> \"HEX\";\n\t\t\tcase HEX_LOWER -> \"hex\";\n\t\t});\n\t}\n\n\t@Override\n\tpublic TimeRadix getTimeRadix() {\n\t\tDBTraceObject root = trace.getObjectManager().getRootObject();\n\t\tif (root == null) {\n\t\t\treturn TimeRadix.DEFAULT;\n\t\t}\n\t\tTraceObjectValue attribute = root.getAttribute(0, KEY_TIME_RADIX);\n\t\tif (attribute == null) {\n\t\t\treturn TimeRadix.DEFAULT;","sourceCodeStart":315,"sourceCodeEnd":351,"githubUrl":"https://github.com/NationalSecurityAgency/ghidra/blob/d5f144c24d6bc53c9cbf4448c6d11143e7696206/Ghidra/Debug/Framework-TraceModeling/src/main/java/ghidra/trace/database/time/DBTraceTimeManager.java#L315-L351","documentation":"Thrown by DBTraceTimeManager.setTimeRadix as IllegalStateException: the TimeRadix (dec/HEX/hex display format for snapshot keys) is stored as an attribute on the trace's root object. If ObjectManager.getRootObject() is null there is nowhere to store it, so the call is rejected. This implies the trace is not an object-oriented/fully-initialised trace.","triggerScenarios":"Calling setTimeRadix(...) on a trace that has no root object yet, e.g. immediately after creating/opening a trace before its object schema is populated, or on a legacy trace without objects.","commonSituations":"Calling setTimeRadix too early in the import/initialisation pipeline; opening an old trace that predates the object model; headless tooling that builds a trace and sets preferences before creating the root object.","solutions":["Ensure the trace's object manager has a root object before calling setTimeRadix (create the root object / complete object-schema initialisation first).","Guard: call getRootObject() and only setTimeRadix when non-null.","If the trace legitimately has no object model, do not set the TimeRadix (it is object-backed only)."],"exampleFix":"// before\ntrace.getTimeManager().setTimeRadix(TimeRadix.HEX_LOWER);\n\n// after\nif (trace.getObjectManager().getRootObject() != null) {\n    trace.getTimeManager().setTimeRadix(TimeRadix.HEX_LOWER);\n}","handlingStrategy":"validation","validationCode":"if (trace.getObjectManager().getRootObject() != null) {\n    trace.getTimeManager().setTimeRadix(TimeRadix.HEX_LOWER);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Create/confirm the trace root object before setting TimeRadix.","Defer preference setting until after object-schema initialisation completes.","Do not set TimeRadix on traces that intentionally have no object model."],"tags":["ghidra","trace-modeling","time","object-model","init-order","illegal-state"],"backgroundTag":null,"analyzedSha":"d5f144c24d6bc53c9cbf4448c6d11143e7696206","analyzedAt":"2026-08-14T01:00:57.564Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}