{"record":{"id":"589461bfdd6946bf","repo":"oracle/graal","slug":"can-not-duplicate-block-with-jsr-data","errorCode":null,"errorMessage":"Can not duplicate block with JSR data","messagePattern":"Can not duplicate block with JSR data","errorType":"exception","errorClass":"PermanentBailoutException","httpStatus":null,"severity":"warning","filePath":"compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/java/BciBlockMapping.java","lineNumber":436,"sourceCode":"                if (block.jsrData != null) {\n                    block.jsrData = block.jsrData.copy();\n                }\n                block.successors = new ArrayList<>();\n                for (var sux : successors) {\n                    block.addSuccessor(sux);\n                }\n                block.loops = (BitSet) block.loops.clone();\n                return block;\n            } catch (CloneNotSupportedException e) {\n                throw new RuntimeException(e);\n            }\n        }\n\n        public BciBlock duplicate() {\n            try {\n                BciBlock block = (BciBlock) super.clone();\n                if (block.jsrData != null) {\n                    throw new PermanentBailoutException(\"Can not duplicate block with JSR data\");\n                }\n                block.successors = new ArrayList<>();\n                for (var sux : successors) {\n                    block.addSuccessor(sux);\n                }\n                block.loops = new BitSet();\n                block.loopId = 0;\n                block.id = UNASSIGNED_ID;\n                block.isLoopHeader = false;\n                block.visited = false;\n                block.active = false;\n                block.predecessorCount = 0;\n                block.loopIdChain = null;\n                block.duplicate = true;\n                return block;\n            } catch (CloneNotSupportedException e) {\n                throw new RuntimeException(e);\n            }","sourceCodeStart":418,"sourceCodeEnd":454,"githubUrl":"https://github.com/oracle/graal/blob/a66e9ccd1d7bf2552883939aa0788dfd0e294aab/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/java/BciBlockMapping.java#L418-L454","documentation":"Thrown by BciBlock.duplicate() when the bytecode block mapping tries to duplicate a BciBlock that carries JSR (subroutine) data. Block duplication is used to make irreducible loops reducible; JSR/RET subroutine state cannot be safely cloned (the jsrData tracks subroutine-specific return addresses), so such duplication permanently bails out the compilation.","triggerScenarios":"Compiling (or parsing for graph building) a method that combines old-style JSR/RET subroutines with an irreducible control-flow graph, forcing BciBlockMapping's duplication pass (MaxDuplicationFactor > 1.0) to clone a block whose jsrData is non-null.","commonSituations":"Methods produced by old bytecode generators, bytecode-instrumentation tools, or obfuscators that still emit JSR/RET plus unstructured jumps; extremely rare in modern javac output (JSR deprecated since Java 6).","solutions":["Recompile the offending class with a modern compiler (javac >= Java 6 target) so JSR/RET subroutines are inlined into bytecode.","If the bytecode comes from an instrumentation/obfuscation tool, update or configure it to not emit JSR/RET.","Accept that Graal permanently bails out on this method — HotSpot falls back to C2/interpreter; no Graal flag fixes JSR duplication."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"// PermanentBailoutException is handled by HotSpot: Graal stops, C2/interpreter takes over.\n// No caller-level catch is useful; fix the bytecode instead.","preventionTips":["Compile classes with javac targeting Java 6+ so JSR/RET is inlined away.","Avoid bytecode tools that emit JSR/RET in code that will be hot-compiled."],"tags":["graalvm","bytecode-parsing","jsr-ret","bailout"],"backgroundTag":null,"analyzedSha":"a66e9ccd1d7bf2552883939aa0788dfd0e294aab","analyzedAt":"2026-08-14T13:58:47.161Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}