{"record":{"id":"bb1f1096ba98cc75","repo":"NationalSecurityAgency/ghidra","slug":"input-s-conflicts-0x-s-0x-s","errorCode":null,"errorMessage":"Input %s conflicts: 0x%s != 0x%s","messagePattern":"Input (.+?) conflicts: 0x(.+?) != 0x(.+?)","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/emulation/DebuggerEmulateFunctionDialog.java","lineNumber":1114,"sourceCode":"\t\t\tdoInitialize(input);\n\t\t}\n\n\t\tpublic void initializeDependencies(InputRow input) {\n\t\t\tfor (String dep : input.depsByName) {\n\t\t\t\tinitializeDependency(dep);\n\t\t\t}\n\t\t}\n\n\t\tpublic String toHex(byte[] value, int length) {\n\t\t\treturn Utils.bytesToBigInteger(value, length, language.isBigEndian(), false)\n\t\t\t\t\t.toString(16);\n\t\t}\n\n\t\tpublic void checkConflicts() {\n\t\t\tfor (InputRow r : inputs) {\n\t\t\t\tLocAndVal value = eval.readVariable(r.storage);\n\t\t\t\tif (!(Arrays.equals(value.value(), r.value))) {\n\t\t\t\t\tthrow new IllegalStateException(\"Input %s conflicts: 0x%s != 0x%s\".formatted(\n\t\t\t\t\t\tr.storage, toHex(r.value, r.length), toHex(value.value(), r.length)));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected void initializeInputs(Eval eval) {\n\t\tInputInitializer initializer = new InputInitializer(eval, inputsTableModel.getModelData());\n\t\tinitializer.initializeInputs();\n\t\tinitializer.checkConflicts();\n\t\teval.commit();\n\t}\n\n\tprotected void captureOutputs(Eval eval, List<ProbeOut> probesOut) {\n\t\tfor (OutputRow r : outputsTableModel.copyModelData()) {\n\t\t\tif (r.name.startsWith(PREFIX_PROBE)) {\n\t\t\t\toutputsTableModel.delete(r);\n\t\t\t}","sourceCodeStart":1096,"sourceCodeEnd":1132,"githubUrl":"https://github.com/NationalSecurityAgency/ghidra/blob/d5f144c24d6bc53c9cbf4448c6d11143e7696206/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/emulation/DebuggerEmulateFunctionDialog.java#L1096-L1132","documentation":"Thrown by InputInitializer.checkConflicts after input initialization when an emulator read-back of an input's storage disagrees with the value the row claims it set. A conflict means two or more inputs map to overlapping storage (registers or stack offsets), so assigning one clobbered another.","triggerScenarios":"initializeInputs() followed by checkConflicts(): for each InputRow, eval.readVariable(r.storage) returns bytes that differ from r.value, indicating overlapping/conflicting input storage assignments within the function signature or user-edited inputs.","commonSituations":"Functions where a struct passed in registers overlaps individual field inputs; ABI collisions (e.g., a varargs area overlapping named arguments); user-edited emulator inputs that alias the same register; compiler quirks mapping multiple parameters to one storage location.","solutions":["Inspect the function's calling convention / parameter storage assignments for overlaps using the Decompiler or the Function signature editor.","Remove or merge the conflicting input rows so no two inputs share storage.","Re-derive inputs from the function signature rather than manual entry so VarStorage is computed consistently.","Check that a custom calling convention does not assign the same register to two parameters."],"exampleFix":"// before\ninitializer.initializeInputs();\ninitializer.checkConflicts(); // IllegalStateException on overlap\n\n// after - detect overlaps before initializing\nSet<VarStorage> seen = new HashSet<>();\nfor (InputRow r : inputs) {\n    if (!seen.add(r.storage)) {\n        Msg.warn(this, \"Overlapping input storage: \" + r.storage);\n    }\n}","handlingStrategy":"validation","validationCode":"Set<VarStorage> seen = new HashSet<>();\nfor (InputRow r : inputs) if (!seen.add(r.storage)) { /* overlap */ }","typeGuard":"static boolean inputsOverlap(List<InputRow> rows) {\n    Set<VarStorage> s = new HashSet<>();\n    for (InputRow r : rows) if (!s.add(r.storage)) return true;\n    return false;\n}","tryCatchPattern":"try {\n    initializer.checkConflicts();\n} catch (IllegalStateException e) {\n    Msg.showError(this, null, \"Input Conflict\", e.getMessage());\n}","preventionTips":["Derive inputs from the function signature, not manual entry.","Inspect calling-convention parameter storage for overlaps."],"tags":["emulation","input","conflict","storage-overlap","calling-convention"],"backgroundTag":null,"analyzedSha":"d5f144c24d6bc53c9cbf4448c6d11143e7696206","analyzedAt":"2026-08-14T01:00:57.564Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}