skylot/jadx · error · JadxOverflowException

Type inference error: updates count limit reached with updat

Error message

Type inference error: updates count limit reached with updateSeq = {}. Try increasing type updates limit count.

What it means

Thrown by TypeUpdateInfo.requestUpdate when the running type-inference sequence number exceeds updatesLimitCount (= mth.getInsnsCount() * args.getTypeUpdatesLimitCount(), default multiplier 10). It bounds the work spent propagating types for one method so inference cannot loop forever. Unlike most errors here, this limit is user-tunable via JadxArgs.setTypeUpdatesLimitCount (CLI flag, GUI preference, or API setter).

Source

Thrown at jadx-core/src/main/java/jadx/core/dex/visitors/typeinference/TypeUpdateInfo.java:61

	}

	public @Nullable TypeUpdateRequest pollNextRequest() {
		return ListUtils.removeLast(queue);
	}

	public @Nullable TypeUpdateRequest pollNextCallback() {
		return ListUtils.removeLast(callbackQueue);
	}

	public void requestUpdate(InsnArg arg, ArgType changeType) {
		TypeUpdateEntry prev = updateMap.put(arg, new TypeUpdateEntry(updateSeq++, arg, changeType));
		if (prev != null) {
			throw new JadxRuntimeException("Unexpected type update override for arg: " + arg
					+ " types: prev=" + prev.getType() + ", new=" + changeType
					+ ", insn: " + arg.getParentInsn());
		}
		if (updateSeq > updatesLimitCount) {
			throw new JadxOverflowException("Type inference error: updates count limit reached"
					+ " with updateSeq = " + updateSeq + ". Try increasing type updates limit count.");
		}
		if (updateSeq % 100 == 0) {
			// check for interruption sometimes (every update is too often)
			Utils.checkThreadInterrupt();
		}
	}

	public void rollbackUpdate(InsnArg arg) {
		TypeUpdateEntry removed = updateMap.remove(arg);
		if (removed != null) {
			int seq = removed.getSeq();
			updateMap.values().removeIf(upd -> upd.getSeq() > seq);
		}
	}

	public void applyUpdates() {
		updateMap.values().stream().sorted()

View on GitHub (pinned to e738a26571)

Solutions

  1. Increase the multiplier: args.setTypeUpdatesLimitCount(20) (or higher) in the API, set typeUpdatesCountLimit in GUI preferences, or the matching CLI option.
  2. Ensure you did not accidentally set the multiplier to a tiny value; default is 10 and Math.max(1, value) is enforced.
  3. If it still overflows at very high values, report the method - it indicates oscillating type propagation that should be fixed upstream.
  4. Catch JadxOverflowException per method so inference failure degrades gracefully (the method gets a warn comment, the run continues).

Example fix

// before
JadxArgs args = new JadxArgs();
args.setInputFiles(files);
// after
JadxArgs args = new JadxArgs();
args.setInputFiles(files);
args.setTypeUpdatesLimitCount(50); // raise from default 10
Defensive patterns

Strategy: validation

Validate before calling

// raise the limit up front if you decompile type-heavy code
JadxArgs args = new JadxArgs();
args.setInputFiles(files);
args.setTypeUpdatesLimitCount(50); // default 10

Try / catch

try {
    typeUpdate.apply(mth, ssaVar, candidate);
} catch (JadxOverflowException e) {
    if (e.getMessage().contains("updates count limit reached")) {
        mth.addWarnComment("type inference hit updates limit for " + ssaVar);
    } else { throw e; }
}

Prevention

When it happens

Trigger: Type inference for a method needs more than (insnCount * typeUpdatesLimitCount) ArgType update requests, which happens when a candidate type fans out through many related args (generics, casts, ternary merges, overloaded method resolution). The message explicitly suggests raising the limit.

Common situations: Methods that use generics heavily, reflection/MethodHandle code, complex ternary chains, or code that mixes primitive/object arithmetic. Lowering typeUpdatesLimitCount below 10 (e.g. for speed) makes this much more likely; the default 10 is enough for normal code.

Related errors


AI-assisted analysis of skylot/jadx@e738a26571 (2026-08-14). Data as JSON: /api/errors/b780e46cd39b38f8. Report an issue: GitHub.