{"record":{"id":"dc3e6b420b2cee69","repo":"oracle/graal","slug":"unsupported-isa-dc3e6b","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/PanamaDisassemblerVisitor.java","lineNumber":57,"sourceCode":"\n/**\n * A Panama-based visitor for hsdis decode_instructions_virtual using the stable Panama API (JDK\n * 25).\n */\n@SuppressWarnings(\"restricted\")\npublic class PanamaDisassemblerVisitor extends HotSpotDisassembler.Visitor {\n    /**\n     * The path to the copy of the hsdis library for this platform. If this is unset then the\n     * library is looked up from the platform library path.\n     */\n    private static final String DISASSEMBLER_PROPERTY = \"test.jdk.graal.compiler.disassembler.path\";\n\n    private static SymbolLookup getHsDisLookup() {\n        String arch = System.getProperty(\"os.arch\");\n        String hsdisLib = switch (arch) {\n            case \"x86_64\", \"amd64\" -> \"hsdis-amd64\";\n            case \"aarch64\", \"arm64\" -> \"hsdis-aarch64\";\n            default -> throw new IllegalArgumentException(\"Unsupported ISA: \" + arch);\n        };\n        // hsdis uses a non-standard naming so drop the leading lib part of the name\n        String libraryName = System.mapLibraryName(hsdisLib);\n        if (libraryName.startsWith(\"lib\")) {\n            libraryName = libraryName.substring(3);\n        }\n\n        String libpath = System.getProperty(DISASSEMBLER_PROPERTY);\n        if (libpath != null) {\n            // Load from an explicitly specified path\n            Path lib = Path.of(libpath);\n            if (Files.isDirectory(lib)) {\n                lib = lib.resolve(libraryName);\n            }\n            return SymbolLookup.libraryLookup(lib, Arena.global());\n        } else {\n            /*\n             * Try to load the normal hsdis library from the library path. This will find hsdis that","sourceCodeStart":39,"sourceCodeEnd":75,"githubUrl":"https://github.com/oracle/graal/blob/a66e9ccd1d7bf2552883939aa0788dfd0e294aab/compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/disassembler/PanamaDisassemblerVisitor.java#L39-L75","documentation":"PanamaDisassemblerVisitor.getHsDisLookup derives the hsdis library name from os.arch and throws for anything outside x86_64/amd64 (hsdis-amd64) and aarch64/arm64 (hsdis-aarch64). This runs when the visitor class first needs the native symbol lookup, so unsupported platforms fail at native-library resolution time with a clear message naming the os.arch value.","triggerScenarios":"Any disassembly attempt on a JVM reporting os.arch of riscv64, ppc64le, s390x, arm, etc. The switch in getHsDisLookup has no matching case and the default arm throws before System.mapLibraryName is consulted.","commonSituations":"Running GraalVM disassembler tests on non-x86/arm hardware, or under a JDK whose os.arch normalization differs (e.g. 32-bit 'arm'). Frequently co-occurs with error 386's static initializer failure, but this one fires at library-load time.","solutions":["Run on AMD64 or AArch64 — the only ISAs with shipped hsdis libraries.","If arch detection is wrong (e.g. QEMU/32-bit corner cases), force os.arch or use an explicit library path only after confirming the binary matches the real CPU.","Skip disassembler tests on unsupported platforms with an os.arch-based assumption.","Contribute an hsdis port if you need a new ISA — the library-name map must be extended alongside it."],"exampleFix":"// before: test unconditionally uses disassembler\n// after\nAssume.assumeTrue(Arrays.asList(\"amd64\",\"x86_64\",\"aarch64\",\"arm64\").contains(System.getProperty(\"os.arch\")));","handlingStrategy":"validation","validationCode":"static final Set<String> HSDIS_ARCHES = Set.of(\"amd64\", \"x86_64\", \"aarch64\", \"arm64\");\nstatic boolean hsdisAvailable() { return HSDIS_ARCHES.contains(System.getProperty(\"os.arch\")); }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Skip disassembler tests via os.arch assumptions on non-x86/arm hosts.","Library names are exactly hsdis-amd64 / hsdis-aarch64 — provide the matching one.","Verify the os.arch value under QEMU/cross environments before relying on detection."],"tags":["graalvm","hsdis","native-library","platform-support"],"backgroundTag":null,"analyzedSha":"a66e9ccd1d7bf2552883939aa0788dfd0e294aab","analyzedAt":"2026-08-14T13:58:47.161Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}