{"record":{"id":"0c78a130dce8e2b9","repo":"skylot/jadx","slug":"try-blocks-wrapping-queue-limit-reached-please-re","errorCode":null,"errorMessage":"Try blocks wrapping queue limit reached! Please report as an issue!","messagePattern":"Try blocks wrapping queue limit reached! Please report as an issue!","errorType":"exception","errorClass":"JadxRuntimeException","httpStatus":null,"severity":"warning","filePath":"jadx-core/src/main/java/jadx/core/dex/visitors/blocks/BlockExceptionHandler.java","lineNumber":96,"sourceCode":"\t * Wrap try blocks with top/bottom splitter and connect them to handler block.\n\t * Sometimes try block can be handler block itself and should be connected before wrapping.\n\t * Use queue for postpone try blocks not ready for wrap.\n\t */\n\tprivate static void connectExcHandlers(MethodNode mth, List<TryCatchBlockAttr> tryBlocks) {\n\t\tif (tryBlocks.isEmpty()) {\n\t\t\treturn;\n\t\t}\n\t\tint limit = tryBlocks.size() * 3;\n\t\tint count = 0;\n\t\tDeque<TryCatchBlockAttr> queue = new ArrayDeque<>(tryBlocks);\n\t\twhile (!queue.isEmpty()) {\n\t\t\tTryCatchBlockAttr tryBlock = queue.removeFirst();\n\t\t\tboolean complete = wrapBlocksWithTryCatch(mth, tryBlock);\n\t\t\tif (!complete) {\n\t\t\t\tqueue.addLast(tryBlock); // return to queue at the end\n\t\t\t}\n\t\t\tif (count++ > limit) {\n\t\t\t\tthrow new JadxRuntimeException(\"Try blocks wrapping queue limit reached! Please report as an issue!\");\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate static void processCatchAttr(MethodNode mth) {\n\t\tfor (BlockNode block : mth.getBasicBlocks()) {\n\t\t\tfor (InsnNode insn : block.getInstructions()) {\n\t\t\t\tif (insn.contains(AType.EXC_CATCH) && !insn.canThrowException()) {\n\t\t\t\t\tinsn.remove(AType.EXC_CATCH);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// if all instructions in block have same 'catch' attribute -> add this attribute for whole block.\n\t\tfor (BlockNode block : mth.getBasicBlocks()) {\n\t\t\tCatchAttr commonCatchAttr = getCommonCatchAttr(block);\n\t\t\tif (commonCatchAttr != null) {\n\t\t\t\tblock.addAttr(commonCatchAttr);\n\t\t\t\tfor (InsnNode insn : block.getInstructions()) {","sourceCodeStart":78,"sourceCodeEnd":114,"githubUrl":"https://github.com/skylot/jadx/blob/e738a26571d02919f01df40de93bc9a44dee4e18/jadx-core/src/main/java/jadx/core/dex/visitors/blocks/BlockExceptionHandler.java#L78-L114","documentation":"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.","triggerScenarios":"wrapBlocksWithTryCatch returns false (incomplete) for the same try blocks repeatedly, causing the queue to cycle more than tryBlocks.size() * 3 times without convergence.","commonSituations":"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.","solutions":["Report the APK immediately as a jadx GitHub issue — the error message explicitly requests this","Update jadx — try-catch wrapping is one of the most actively developed areas","Try with --no-debug-info to see if debug attributes are contributing to the wrapping complexity","As a workaround, decompile specific classes individually to isolate the problem class"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n    jadxDecompiler.load();\n    jadxDecompiler.save();\n} catch (JadxRuntimeException e) {\n    if (e.getMessage().contains(\"Try blocks wrapping queue limit reached\")) {\n        LOG.warn(\"Try-catch wrapping limit hit, report this APK to jadx project\");\n        // Continue with other classes, skip the problematic one\n        for (ClassNode cls : jadxDecompiler.getClasses()) {\n            try {\n                jadxDecompiler.decompileClass(cls);\n            } catch (JadxRuntimeException ignored) {\n                LOG.warn(\"Skipped class: {}\", cls.getFullName());\n            }\n        }\n    } else {\n        throw e;\n    }\n}","preventionTips":["Always report this specific error to the jadx project — it is explicitly requested in the message","Keep jadx updated — try-catch wrapping is one of the most actively developed areas","Decompile classes individually to isolate which class has unresolvable try-catch blocks","Use --no-debug-info in case debug attributes contribute to wrapping complexity"],"tags":["try-catch","block-processing","exception-handling","obfuscation","decompiler"],"backgroundTag":null,"analyzedSha":"e738a26571d02919f01df40de93bc9a44dee4e18","analyzedAt":"2026-08-14T00:10:24.238Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}