{"record":{"id":"528640272dd20b04","repo":"NationalSecurityAgency/ghidra","slug":"unrecognized-address-space-in","errorCode":null,"errorMessage":"Unrecognized address space in {}","messagePattern":"Unrecognized address space in (.+?)","errorType":"exception","errorClass":"PcodeExecutionException","httpStatus":null,"severity":"error","filePath":"Ghidra/Debug/ProposedUtils/src/main/java/ghidra/pcode/eval/AbstractVarnodeEvaluator.java","lineNumber":135,"sourceCode":"\tprotected T evaluateLeaf(Program program, Varnode vn) {\n\t\tAddress address = vn.getAddress();\n\t\tif (address.isConstantAddress()) {\n\t\t\treturn evaluateConstant(vn.getOffset(), vn.getSize());\n\t\t}\n\t\telse if (address.isRegisterAddress()) {\n\t\t\treturn evaluateRegister(address, vn.getSize());\n\t\t}\n\t\telse if (address.isStackAddress()) {\n\t\t\treturn evaluateStack(address.getOffset(), vn.getSize());\n\t\t}\n\t\telse if (address.isMemoryAddress()) {\n\t\t\treturn evaluateMemory(translateMemory(program, address), vn.getSize());\n\t\t}\n\t\telse if (address.isUniqueAddress()) {\n\t\t\treturn evaluateUnique(vn.getOffset(), vn.getSize());\n\t\t}\n\t\telse {\n\t\t\tthrow new PcodeExecutionException(\"Unrecognized address space in \" + vn);\n\t\t}\n\t}\n\n\t/**\n\t * Evaluate a varnode, which could be either a leaf or a branch\n\t * \n\t * <p>\n\t * This method is invoked by {@link #evaluateVarnode(Program, Varnode, Map)} when the value has\n\t * not already been computed. Only that method should invoke this one directly.\n\t * \n\t * @param program the program defining the static context\n\t * @param vn the varnode\n\t * @param already a cache of already-evaluated varnodes and their values\n\t * @return the value\n\t */\n\tprotected T doEvaluateVarnode(Program program, Varnode vn, Map<Varnode, T> already) {\n\t\tif (isLeaf(vn)) {\n\t\t\treturn evaluateLeaf(program, vn);","sourceCodeStart":117,"sourceCodeEnd":153,"githubUrl":"https://github.com/NationalSecurityAgency/ghidra/blob/d5f144c24d6bc53c9cbf4448c6d11143e7696206/Ghidra/Debug/ProposedUtils/src/main/java/ghidra/pcode/eval/AbstractVarnodeEvaluator.java#L117-L153","documentation":"Thrown (unchecked PcodeExecutionException) by AbstractVarnodeEvaluator when a varnode's address belongs to none of the four recognized address spaces — register, stack, memory, or unique. The evaluator dispatches on address-space type (isRegisterAddress/isStackAddress/isMemoryAddress/isUniqueAddress); anything else (e.g. join, hash, external, fsk constants, or a custom space) falls through to this catch-all.","triggerScenarios":"Evaluating p-code/varnodes that reference a special address space the evaluator doesn't model — for example a JOIN space (multi-register combined operand), a HASH space, EXTERNAL space, or a processor-specific custom space. Triggered when the evaluator is driven over p-code containing such a varnode.","commonSituations":"Emulating/symbolically-executing p-code that includes combined-register operands (JOIN) common in some architectures; analyzing binaries whose decompiler emits varnodes in non-standard spaces; using a subclass that overrode some evaluate* methods but not the space dispatcher.","solutions":["Subclass AbstractVarnodeEvaluator and override the leaf-evaluation entry to handle the extra address space (e.g. add an else-if for address.isJoinAddress() and decompose it).","Filter the varnodes/ops passed to the evaluator so unsupported address spaces are never evaluated.","Upgrade/patch the evaluator's dispatch to recognise the space your target architecture uses.","Report the offending varnode (printed in the message) to confirm which space type is involved before deciding."],"exampleFix":"// before: default dispatcher throws on JOIN space\nprotected T evaluateLeaf(Program p, Varnode vn, Map<Varnode,T> cache) {\n    return super.evaluateLeaf(p, vn, cache); // throws PcodeExecutionException\n}\n\n// after: handle the extra space before delegating\nprotected T evaluateLeaf(Program p, Varnode vn, Map<Varnode,T> cache) {\n    Address a = vn.getAddress();\n    if (a.getAddressSpace().getType() == AddressSpace.TYPE_JOIN) {\n        return evaluateJoin(vn);\n    }\n    return super.evaluateLeaf(p, vn, cache);\n}","handlingStrategy":"try-catch","validationCode":"// Pre-check the address space before evaluation\nAddress a = vn.getAddress();\nif (!a.isRegisterAddress() && !a.isStackAddress() && !a.isMemoryAddress() && !a.isUniqueAddress()) {\n    // unsupported space; handle or skip instead of evaluating\n}","typeGuard":null,"tryCatchPattern":"try {\n    T val = evaluator.evaluateVarnode(program, vn, cache);\n} catch (PcodeExecutionException e) {\n    if (e.getMessage().startsWith(\"Unrecognized address space\")) { /* handle/skip */ }\n    else throw e;\n}","preventionTips":["Subclass the evaluator and extend the space dispatcher for your architecture's spaces (JOIN, HASH, etc.).","Filter varnodes by address-space type before evaluation.","Print the offending varnode to identify the space when debugging."],"tags":["pcode","emulation","address-space","varnode","unchecked-exception"],"backgroundTag":null,"analyzedSha":"d5f144c24d6bc53c9cbf4448c6d11143e7696206","analyzedAt":"2026-08-14T01:00:57.564Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}