oracle/graal · error · IllegalArgumentException
Unsupported ISA:
Error message
Unsupported ISA:
What it means
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.
Source
Thrown at compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/disassembler/HotSpotDisassembler.java:52
* A disassembler based on the {@code hsdis} library.
*/
public class HotSpotDisassembler implements Disassembler {
/**
* The hsdis assembler only supports the architecture it's compiled for so only the current
* architecture can be disassembled.
*/
static final Architecture currentArchitecture;
static {
currentArchitecture = lookupArchitecture(System.getProperty("os.arch"));
}
static Architecture lookupArchitecture(String arch) {
return switch (arch) {
case "x86_64", "amd64" -> Architecture.AMD64;
case "arm64", "aarch64" -> Architecture.AArch64;
default -> throw new IllegalArgumentException("Unsupported ISA: " + arch);
};
}
private final Architecture architecture;
final String mach;
final String options;
final Pattern branchInstruction;
public HotSpotDisassembler(Architecture arch) {
/*
* hsdis contains all assemblers but the mechanism for selecting alternative disassemblers
* using "mach=" is currently broken. So throw an exception when trying to disassemble a
* different architecture.
*/
if (!currentArchitecture.equals(arch)) {
throw new IllegalArgumentException("Unsupported ISA: " + arch);
}
String osName = System.getProperty("os.name", "");View on GitHub (pinned to a66e9ccd1d)
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.
Example fix
// before
Disassembler dis = new HotSpotDisassembler(Disassembler.Architecture.AMD64); // fails on riscv64 in <clinit>
// after
String arch = System.getProperty("os.arch");
if (!(arch.equals("amd64") || arch.equals("x86_64") || arch.equals("aarch64") || arch.equals("arm64"))) {
throw new UnsupportedOperationException("disassembly unsupported on " + arch);
}
Disassembler dis = new HotSpotDisassembler(Disassembler.Architecture.AMD64); Defensive patterns
Strategy: validation
Validate before calling
static final Set<String> SUPPORTED_ARCH = Set.of("amd64", "x86_64", "aarch64", "arm64");
static boolean disassemblySupported() { return SUPPORTED_ARCH.contains(System.getProperty("os.arch")); } Try / catch
// remember: failure is ExceptionInInitializerError wrapping this IAE
catch (Throwable t) { if (t instanceof ExceptionInInitializerError e && e.getCause() instanceof IllegalArgumentException c && c.getMessage().startsWith("Unsupported ISA")) { /* graceful degradation */ } } Prevention
- 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.
When it happens
Trigger: 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.
Common situations: 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).
Related errors
- Unsupported OS:
- Unsupported ISA:
- Malformed HexCodeFile in
- Unable to decode some instructions in
- Malformed HexCodeFile in
AI-assisted analysis of oracle/graal@a66e9ccd1d (2026-08-14).
Data as JSON: /api/errors/5f76b0c42b2ff4d0.
Report an issue: GitHub.