{"record":{"id":"e0a96f8e819f9428","repo":"oracle/graal","slug":"unexpected-os-name-s","errorCode":null,"errorMessage":"Unexpected OS name: %s","messagePattern":"Unexpected OS name: (.+?)","errorType":"exception","errorClass":"JVMCIError","httpStatus":null,"severity":"error","filePath":"compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/hotspot/Platform.java","lineNumber":78,"sourceCode":"     */\n    private static String getCurrentOSName() {\n        String value = getSavedProperty(\"os.name\");\n        switch (value) {\n            case \"Linux\":\n                value = \"linux\";\n                break;\n            case \"SunOS\":\n                value = \"solaris\";\n                break;\n            case \"Mac OS X\":\n                value = \"darwin\";\n                break;\n            default:\n                // Windows names contain the OS version.\n                if (value.startsWith(\"Windows\")) {\n                    value = \"windows\";\n                } else {\n                    throw new JVMCIError(\"Unexpected OS name: \" + value);\n                }\n        }\n        return value;\n    }\n\n    /**\n     * Returns the name of the host architecture.\n     */\n    private static String getCurrentArchName() {\n        String arch = getSavedProperty(\"os.arch\");\n        if (arch.equals(\"x86_64\")) {\n            arch = \"amd64\";\n        }\n        return arch;\n    }\n}\n","sourceCodeStart":60,"sourceCodeEnd":95,"githubUrl":"https://github.com/oracle/graal/blob/a66e9ccd1d7bf2552883939aa0788dfd0e294aab/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/hotspot/Platform.java#L60-L95","documentation":"JVMCIError thrown by Platform while normalizing the os.name system property into an internal OS identifier. It recognizes Linux, SunOS, Mac OS X (mapped to solaris/darwin) and any name starting with 'Windows'; anything else means Graal does not know how to classify the host operating system and refuses to continue.","triggerScenarios":"Executing Graal on a JVM whose os.name property reports something other than Linux/SunOS/Mac OS X/Windows*, e.g. an exotic or sandboxed JVM, a JVM with os.name overridden via -Dos.name=..., or an unsupported OS port.","commonSituations":"Tests that force -Dos.name for simulation and then accidentally trigger Graal compilation; running on a niche Unix (AIX, FreeBSD) where os.name is not in the switch; JVMCI code paths reaching Platform on an unported platform.","solutions":["Run on a supported OS (Linux, macOS, Windows).","Remove any -Dos.name=... override that corrupts the real value.","If porting, extend the switch in Platform.java to map your os.name to an internal identifier."],"exampleFix":"# before\njava -Dos.name=MyOS -XX:+UseJVMCICompiler ...\n\n# after\njava -XX:+UseJVMCICompiler ...","handlingStrategy":"validation","validationCode":"String os = System.getProperty(\"os.name\", \"\");\nboolean supported = os.equals(\"Linux\") || os.equals(\"SunOS\") || os.equals(\"Mac OS X\") || os.startsWith(\"Windows\");\nif (!supported) {\n    throw new IllegalStateException(\"Unsupported os.name for Graal: \" + os);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never override -Dos.name in JVMs that will run JVMCI/Graal code.","Gate Graal-enabled runs on the supported-OS check above."],"tags":["graalvm","platform","environment","jvmci"],"backgroundTag":null,"analyzedSha":"a66e9ccd1d7bf2552883939aa0788dfd0e294aab","analyzedAt":"2026-08-14T13:58:47.161Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}