skylot/jadx · warning · JadxRuntimeException

Try blocks wrapping queue limit reached! Please report as an

Error message

Try blocks wrapping queue limit reached! Please report as an issue!

What it means

Thrown during try-catch block wrapping when the iterative queue processing exceeds a safety limit of 3 times the number of try blocks. Each iteration that fails to fully wrap a try-catch block re-queues it. This limit prevents infinite loops from unresolvable wrapping dependencies — a known pattern the jadx team explicitly asks users to report.

Source

Thrown at jadx-core/src/main/java/jadx/core/dex/visitors/blocks/BlockExceptionHandler.java:96

	 * Wrap try blocks with top/bottom splitter and connect them to handler block.
	 * Sometimes try block can be handler block itself and should be connected before wrapping.
	 * Use queue for postpone try blocks not ready for wrap.
	 */
	private static void connectExcHandlers(MethodNode mth, List<TryCatchBlockAttr> tryBlocks) {
		if (tryBlocks.isEmpty()) {
			return;
		}
		int limit = tryBlocks.size() * 3;
		int count = 0;
		Deque<TryCatchBlockAttr> queue = new ArrayDeque<>(tryBlocks);
		while (!queue.isEmpty()) {
			TryCatchBlockAttr tryBlock = queue.removeFirst();
			boolean complete = wrapBlocksWithTryCatch(mth, tryBlock);
			if (!complete) {
				queue.addLast(tryBlock); // return to queue at the end
			}
			if (count++ > limit) {
				throw new JadxRuntimeException("Try blocks wrapping queue limit reached! Please report as an issue!");
			}
		}
	}

	private static void processCatchAttr(MethodNode mth) {
		for (BlockNode block : mth.getBasicBlocks()) {
			for (InsnNode insn : block.getInstructions()) {
				if (insn.contains(AType.EXC_CATCH) && !insn.canThrowException()) {
					insn.remove(AType.EXC_CATCH);
				}
			}
		}
		// if all instructions in block have same 'catch' attribute -> add this attribute for whole block.
		for (BlockNode block : mth.getBasicBlocks()) {
			CatchAttr commonCatchAttr = getCommonCatchAttr(block);
			if (commonCatchAttr != null) {
				block.addAttr(commonCatchAttr);
				for (InsnNode insn : block.getInstructions()) {

View on GitHub (pinned to e738a26571)

Solutions

  1. Report the APK immediately as a jadx GitHub issue — the error message explicitly requests this
  2. Update jadx — try-catch wrapping is one of the most actively developed areas
  3. Try with --no-debug-info to see if debug attributes are contributing to the wrapping complexity
  4. As a workaround, decompile specific classes individually to isolate the problem class
Defensive patterns

Strategy: try-catch

Try / catch

try {
    jadxDecompiler.load();
    jadxDecompiler.save();
} catch (JadxRuntimeException e) {
    if (e.getMessage().contains("Try blocks wrapping queue limit reached")) {
        LOG.warn("Try-catch wrapping limit hit, report this APK to jadx project");
        // Continue with other classes, skip the problematic one
        for (ClassNode cls : jadxDecompiler.getClasses()) {
            try {
                jadxDecompiler.decompileClass(cls);
            } catch (JadxRuntimeException ignored) {
                LOG.warn("Skipped class: {}", cls.getFullName());
            }
        }
    } else {
        throw e;
    }
}

Prevention

When it happens

Trigger: wrapBlocksWithTryCatch returns false (incomplete) for the same try blocks repeatedly, causing the queue to cycle more than tryBlocks.size() * 3 times without convergence.

Common situations: Deeply nested or overlapping try-catch-finally blocks from obfuscators that inject synthetic exception handlers; bytecode with exception ranges that overlap in ways the wrapping algorithm cannot resolve; highly complex finally-block duplication patterns.

Related errors


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