NationalSecurityAgency/ghidra · error · InvalidInputException

Parameter name conflict, likely due to concurrent operation

Error message

Parameter name conflict, likely due to concurrent operation

What it means

Thrown by ApplyFunctionSignatureCmd.setSignature after it catches a DuplicateNameException from func.updateFunction(...). The command pre-adjusts parameter names via adjustParameterNamesToAvoidConflicts, so a DuplicateNameException at the update call is unexpected and is attributed to a concurrent modification of the function's parameters. It is rethrown as InvalidInputException with this message.

Source

Thrown at Ghidra/Features/Base/src/main/java/ghidra/app/cmd/function/ApplyFunctionSignatureCmd.java:213

			List<Parameter> params =
				createParameters(compilerSpec, conventionName, args, returnParam);

			SymbolTable symbolTable = program.getSymbolTable();

			adjustParameterNamesToAvoidConflicts(symbolTable, func, params);

			func.updateFunction(conventionName, returnParam, params,
				FunctionUpdateType.DYNAMIC_STORAGE_FORMAL_PARAMS, false, source);
			func.setVarArgs(signature.hasVarArgs());

			// Only apply noreturn if signature has it set
			if (signature.hasNoReturn()) {
				func.setNoReturn(signature.hasNoReturn());
			}
		}
		catch (DuplicateNameException e) {
			// should not happen unless caused by a concurrent operation
			throw new InvalidInputException(
				"Parameter name conflict, likely due to concurrent operation");
		}
		finally {
			if (dtCleaner != null) {
				dtCleaner.close();
			}
		}

		updateStackPurgeSize(func, program);

		return true;
	}

	private List<Parameter> createParameters(CompilerSpec compilerSpec, String conventionName,
			ParameterDefinition[] args, Parameter returnParam) throws InvalidInputException {

		DataType returnDt = returnParam.getDataType();

View on GitHub (pinned to d5f144c24d)

Solutions

  1. Perform function-signature updates inside a single program transaction and avoid concurrent modification of the same function.
  2. Retry the command once after a brief yield - the conflict may be transient.
  3. Disable or suspend auto-analysis while bulk-applying signatures.
  4. Ensure only one worker mutates a given function at a time.

Example fix

// before
new ApplyFunctionSignatureCmd(entry, sig, source).applyTo(program);
// concurrent modification -> InvalidInputException

// after - serialize updates and retry once
int tx = program.startTransaction("apply sig");
try {
    new ApplyFunctionSignatureCmd(entry, sig, source).applyTo(program);
} catch (InvalidInputException e) {
    Thread.sleep(50); // yield to the other worker
    new ApplyFunctionSignatureCmd(entry, sig, source).applyTo(program);
} finally {
    program.endTransaction(tx, true);
}
Defensive patterns

Strategy: retry

Validate before calling

// No pure pre-check; serialize function mutations to avoid the race.
// Acquire a per-function lock before applying signatures.

Try / catch

try {
    cmd.applyTo(program);
} catch (Exception e) { // applyTo wraps InvalidInputException via status
    if (e.getMessage().contains("Parameter name conflict")) {
        // yield and retry once
        Thread.sleep(50);
        cmd.applyTo(program);
    } else throw e;
}

Prevention

When it happens

Trigger: Applying a function signature while another thread/analysis worker renames or adds parameters to the same function. The transaction model normally serializes this, but a race between two updaters (or re-entrant analysis) can surface it.

Common situations: Multi-threaded scripting that mutates the same function from parallel workers. Running ApplyFunctionSignatureCmd concurrently with auto-analysis that touches function parameters. Re-entrant command application without a stable transaction.

Related errors


AI-assisted analysis of NationalSecurityAgency/ghidra@d5f144c24d (2026-08-14). Data as JSON: /api/errors/4b44e95413210ddf. Report an issue: GitHub.