{"record":{"id":"5f76b0c42b2ff4d0","repo":"oracle/graal","slug":"unsupported-isa","errorCode":null,"errorMessage":"Unsupported ISA: ","messagePattern":"Unsupported ISA: ","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/disassembler/HotSpotDisassembler.java","lineNumber":52,"sourceCode":" * A disassembler based on the {@code hsdis} library.\n */\npublic class HotSpotDisassembler implements Disassembler {\n\n    /**\n     * The hsdis assembler only supports the architecture it's compiled for so only the current\n     * architecture can be disassembled.\n     */\n    static final Architecture currentArchitecture;\n\n    static {\n        currentArchitecture = lookupArchitecture(System.getProperty(\"os.arch\"));\n    }\n\n    static Architecture lookupArchitecture(String arch) {\n        return switch (arch) {\n            case \"x86_64\", \"amd64\" -> Architecture.AMD64;\n            case \"arm64\", \"aarch64\" -> Architecture.AArch64;\n            default -> throw new IllegalArgumentException(\"Unsupported ISA: \" + arch);\n        };\n    }\n\n    private final Architecture architecture;\n    final String mach;\n    final String options;\n    final Pattern branchInstruction;\n\n    public HotSpotDisassembler(Architecture arch) {\n        /*\n         * hsdis contains all assemblers but the mechanism for selecting alternative disassemblers\n         * using \"mach=\" is currently broken. So throw an exception when trying to disassemble a\n         * different architecture.\n         */\n        if (!currentArchitecture.equals(arch)) {\n            throw new IllegalArgumentException(\"Unsupported ISA: \" + arch);\n        }\n        String osName = System.getProperty(\"os.name\", \"\");","sourceCodeStart":34,"sourceCodeEnd":70,"githubUrl":"https://github.com/oracle/graal/blob/a66e9ccd1d7bf2552883939aa0788dfd0e294aab/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/disassembler/HotSpotDisassembler.java#L34-L70","documentation":"HotSpotDisassembler's static initializer maps os.arch to a Disassembler.Architecture and throws this IllegalArgumentException for anything other than x86_64/amd64 or arm64/aarch64. Because it runs in a static block, the exception surfaces as ExceptionInInitializerError on first class use, followed by NoClassDefFoundError on subsequent uses. It is the library's hard platform gate: the hsdis-backed disassembler only exists for AMD64 and AArch64.","triggerScenarios":"Loading/using HotSpotDisassembler (directly or via DisassemblerTool/MachCode) on a JVM whose os.arch is riscv64, ppc64le, s390x, arm (32-bit), or any unrecognized value. The static block runs lookupArchitecture(System.getProperty(\"os.arch\")) and throws before any instance is created.","commonSituations":"Running GraalVM compiler tests or the disassembler tool on non-x86/arm hardware or under cross-compilation QEMU where os.arch reports an exotic value; also unusual JDK builds reporting nonstandard arch names (e.g. 'x86' for 32-bit).","solutions":["Run on, or target, an AMD64 or AArch64 host — these are the only supported ISAs for hsdis-based disassembly.","If you only need parsing (not live disassembly), use HexCodeFile paths that do not load HotSpotDisassembler.","Guard class usage behind an explicit os.arch check so callers get your own error message instead of ExceptionInInitializerError.","Note the distinction: ExceptionInInitializerError at first use with this message means the static arch lookup failed, not that your code passed a bad arch."],"exampleFix":"// before\nDisassembler dis = new HotSpotDisassembler(Disassembler.Architecture.AMD64); // fails on riscv64 in <clinit>\n// after\nString arch = System.getProperty(\"os.arch\");\nif (!(arch.equals(\"amd64\") || arch.equals(\"x86_64\") || arch.equals(\"aarch64\") || arch.equals(\"arm64\"))) {\n    throw new UnsupportedOperationException(\"disassembly unsupported on \" + arch);\n}\nDisassembler dis = new HotSpotDisassembler(Disassembler.Architecture.AMD64);","handlingStrategy":"validation","validationCode":"static final Set<String> SUPPORTED_ARCH = Set.of(\"amd64\", \"x86_64\", \"aarch64\", \"arm64\");\nstatic boolean disassemblySupported() { return SUPPORTED_ARCH.contains(System.getProperty(\"os.arch\")); }","typeGuard":null,"tryCatchPattern":"// remember: failure is ExceptionInInitializerError wrapping this IAE\ncatch (Throwable t) { if (t instanceof ExceptionInInitializerError e && e.getCause() instanceof IllegalArgumentException c && c.getMessage().startsWith(\"Unsupported ISA\")) { /* graceful degradation */ } }","preventionTips":["Check os.arch before first touching HotSpotDisassembler.","Use JUnit assumptions to skip disassembler tests on unsupported platforms.","Remember the static initializer wraps the throw in ExceptionInInitializerError."],"tags":["graalvm","disassembler","platform-support","hsdis"],"backgroundTag":null,"analyzedSha":"a66e9ccd1d7bf2552883939aa0788dfd0e294aab","analyzedAt":"2026-08-14T13:58:47.161Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}