{"record":{"id":"9c2f489e72d11690","repo":"NationalSecurityAgency/ghidra","slug":"given-symbol-is-not-in-this-trace","errorCode":null,"errorMessage":"Given symbol is not in this trace","messagePattern":"Given symbol is not in this trace","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"Ghidra/Debug/Framework-TraceModeling/src/main/java/ghidra/trace/database/symbol/DBTraceSymbolManager.java","lineNumber":484,"sourceCode":"\t\t\treturn null;\n\t\t}\n\t\treturn dbSym;\n\t}\n\n\t@Internal\n\tpublic DBTraceNamespaceSymbol assertIsMine(Namespace ns) {\n\t\tDBTraceNamespaceSymbol dbns = checkIsMine(ns);\n\t\tif (dbns == null) {\n\t\t\tthrow new IllegalArgumentException(\"Given namespace is not in this trace\");\n\t\t}\n\t\treturn dbns;\n\t}\n\n\t@Internal\n\tpublic AbstractDBTraceSymbol assertIsMine(Symbol symbol) {\n\t\tAbstractDBTraceSymbol dbSym = checkIsMine(symbol);\n\t\tif (dbSym == null) {\n\t\t\tthrow new IllegalArgumentException(\"Given symbol is not in this trace\");\n\t\t}\n\t\treturn dbSym;\n\t}\n\n\tprotected static void assertValidName(String name) throws InvalidInputException {\n\t\tif (name == null || name.length() == 0 || !name.matches(\"\\\\p{Graph}+\")) {\n\t\t\tthrow new InvalidInputException(name);\n\t\t}\n\t}\n\n\t/**\n\t * Checks for duplicate names, allowing {@link SymbolType#LABEL}\n\t * \n\t * @param name the proposed name\n\t * @param parent the parent namespace\n\t * @throws DuplicateNameException if the name is a duplicate\n\t */\n\tprotected void assertUniqueName(String name, DBTraceNamespaceSymbol parent)","sourceCodeStart":466,"sourceCodeEnd":502,"githubUrl":"https://github.com/NationalSecurityAgency/ghidra/blob/d5f144c24d6bc53c9cbf4448c6d11143e7696206/Ghidra/Debug/Framework-TraceModeling/src/main/java/ghidra/trace/database/symbol/DBTraceSymbolManager.java#L466-L502","documentation":"Thrown by DBTraceSymbolManager.assertIsMine(Symbol): checkIsMine(symbol) returned null, i.e. the symbol is not an AbstractDBTraceSymbol that belongs to this trace. The trace refuses to operate on symbols from another trace or from the Program symbol table.","triggerScenarios":"Passing a Symbol obtained from a different Trace, a Program (e.g. program.getSymbolTable().getSymbols()), or a mock into a trace operation that validates symbol ownership.","commonSituations":"Symbol-moving/renaming utilities that take a Symbol from the program listing; reusing a Symbol reference after the owning trace is closed; test fakes that are not real DBTraceSymbols.","solutions":["Look the symbol up fresh in this trace by ID/address/name before operating on it.","For cross-source operations, copy the symbol's properties (name, address, type, namespace) rather than the Symbol object itself.","Guard with instanceof AbstractDBTraceSymbol and verify trace ownership before passing the symbol.","Do not hold Symbol references past the trace's lifetime."],"exampleFix":"// before\nsymMgr.removeSymbol(foreignSym);\n\n// after\nSymbol mine = symMgr.getSymbolByID(foreignSym.getID());\nif (mine instanceof AbstractDBTraceSymbol) {\n    symMgr.removeSymbol(mine);\n}","handlingStrategy":"validation","validationCode":"Symbol mine = symMgr.getSymbolByID(foreignSym.getID());\nif (mine instanceof AbstractDBTraceSymbol) { /* safe */ }","typeGuard":"static boolean isMineSym(Trace trace, Symbol s) {\n    return s instanceof AbstractDBTraceSymbol dbs && dbs.getTrace() == trace;\n}","tryCatchPattern":null,"preventionTips":["Look symbols up fresh in the target trace by ID/address rather than passing foreign Symbol objects.","Copy symbol properties across sources instead of the Symbol instance."],"tags":["ghidra","trace-modeling","symbol","ownership","illegal-argument"],"backgroundTag":null,"analyzedSha":"d5f144c24d6bc53c9cbf4448c6d11143e7696206","analyzedAt":"2026-08-14T01:00:57.564Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}