oracle/graal · error · IllegalArgumentException

Unsupported OS:

Error message

Unsupported OS: 

What it means

The HotSpotDisassembler constructor throws this when os.name starts with "Windows". The implementation funnels hsdis output through fmemopen (a POSIX function) via the Panama/FFM binding, which does not exist on Windows, so the library refuses to construct rather than fail at native-link time. It is a platform limitation, not a configuration problem.

Source

Thrown at compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/disassembler/HotSpotDisassembler.java:73

    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", "");
        if (osName.startsWith("Windows")) {
            // The current implementation relies on fmemopen which is not available on Windows
            throw new IllegalArgumentException("Unsupported OS: " + osName);
        }
        this.architecture = arch;
        if (arch.equals(Architecture.AMD64)) {
            // Use Intel syntax
            mach = "i386:x86-64";
            options = "intel";
            branchInstruction = Pattern.compile(
                            "^(jmp|ret|je|jne|ja|jae|jb|jbe|jc|jcxz|jecxz|jg|jge|jl|jle|jna|jnae|jnb|jnbe|jnc|jne|jng|jnge|jnl|jnle|jno|jnp|jns|jnz|jo|jp|jpe|jpo|js|jz)\\b");
        } else if (arch.equals(Architecture.AArch64)) {
            mach = "aarch64";
            options = "";
            /*
             * Don't treat bl as a branch since it's a call. Uninitialized call sites look like self
             * calls.
             */
            branchInstruction = Pattern.compile("^b[. \t]");
        } else {
            throw new IllegalArgumentException("Unsupported ISA: " + arch);

View on GitHub (pinned to a66e9ccd1d)

Solutions

  1. Run the disassembler inside WSL, a Linux container, or on a Linux/macOS machine.
  2. Skip disassembly-dependent tests/tooling on Windows via an os.name guard or JUnit assumption.
  3. If Windows support is required, replace the fmemopen dependency with a Windows-compatible memory-stream approach and contribute it upstream.
  4. Detect early: check System.getProperty("os.name") before touching the class so users see a clear message.

Example fix

// before
Assume.assumeTrue(true); // test then fails with Unsupported OS on Windows
// after
Assume.assumeFalse(System.getProperty("os.name", "").startsWith("Windows"));
Defensive patterns

Strategy: validation

Validate before calling

if (System.getProperty("os.name", "").startsWith("Windows")) {
    throw new UnsupportedOperationException("hsdis disassembly requires fmemopen; use WSL or Linux"); }

Try / catch

try { new HotSpotDisassembler(arch); } catch (IllegalArgumentException e) { if (e.getMessage().startsWith("Unsupported OS")) { /* route to WSL/container or disable feature */ } else throw e; }

Prevention

When it happens

Trigger: Constructing HotSpotDisassembler (including indirectly through DisassemblerTool or MachCode on an hs_err file) on any Windows host, regardless of ISA. The check runs after the architecture check, so a Windows/AMD64 machine passes the ISA gate and then hits this one.

Common situations: Developers running GraalVM disassembler tooling or compiler tests natively on Windows; CI pipelines that build on windows-latest runners; WSL avoids it because os.name reports Linux.

Related errors


AI-assisted analysis of oracle/graal@a66e9ccd1d (2026-08-14). Data as JSON: /api/errors/8b50db3f57c1b72c. Report an issue: GitHub.