{"record":{"id":"2722149c4dbacaa3","repo":"oracle/graal","slug":"invalid-option","errorCode":null,"errorMessage":"Invalid option ","messagePattern":"Invalid option ","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/truffle/TruffleCompilerImpl.java","lineNumber":273,"sourceCode":"        Long engineId = compilable.engineId();\n        return cachedOptions.computeIfAbsent(engineId, (id) -> {\n            OptionValues graalOptions = getGraalOptions();\n            Map<String, String> options = compilable.getCompilerOptions();\n            EconomicMap<OptionKey<?>, Object> map = parseOptions(options);\n            graalOptions = TruffleCompilerOptions.updateValues(graalOptions, map);\n            map.putAll(graalOptions.getMap());\n            return new OptionValues(map);\n        });\n    }\n\n    private static EconomicMap<OptionKey<?>, Object> parseOptions(Map<String, String> options) {\n        EconomicMap<OptionKey<?>, Object> map = EconomicMap.create();\n        for (var entry : options.entrySet()) {\n            String key = entry.getKey();\n            String uncheckedValue = entry.getValue();\n            OptionDescriptor descriptor = OPTION_DESCRIPTORS.get(key);\n            if (descriptor == null) {\n                throw new IllegalArgumentException(\"Invalid option \" + key);\n            }\n            Object value = TruffleCompilerOptions.parseCustom(descriptor, uncheckedValue);\n            if (value == null) {\n                value = OptionsParser.parseOptionValue(descriptor, uncheckedValue);\n            }\n            map.put(descriptor.getOptionKey(), value);\n        }\n        return map;\n    }\n\n    @SuppressWarnings(\"static-method\")\n    public final TruffleCompilation openCompilation(TruffleCompilationTask task, TruffleCompilable compilable) {\n        TruffleCompilation compilation = new TruffleCompilation(config.runtime(), task, compilable);\n        compilation.setCompilationId(createCompilationIdentifier(task, compilable));\n        return compilation;\n    }\n\n    private DebugContext openDebugContext(OptionValues compilerOptions, TruffleCompilation compilation) {","sourceCodeStart":255,"sourceCodeEnd":291,"githubUrl":"https://github.com/oracle/graal/blob/a66e9ccd1d7bf2552883939aa0788dfd0e294aab/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/truffle/TruffleCompilerImpl.java#L255-L291","documentation":"TruffleCompilerImpl.parseOptions converts a Map<String,String> of option overrides into OptionValues. Every key must exist in OPTION_DESCRIPTORS (the known Graal/Truffle option keys); an unknown key throws IllegalArgumentException('Invalid option <key>').","triggerScenarios":"Passing an option map containing a typo'd key, a non-existent option, or an option removed in the current release (e.g. via Truffle runtime compilation-configuration APIs or embedder option plumbing).","commonSituations":"Upgrading GraalVM/Truffle and reusing option names from an older release; copying option names from docs with typos or wrong casing; embedder code forwarding arbitrary user flags into the compiler options map.","solutions":["Correct or remove the offending key; the exception message names the exact invalid key.","List valid keys via the compiler's option printing (e.g. -Dgraal.PrintFlags=true family / option dump) and use exact names/casing.","After a version upgrade, diff your option map against the new release's option set."],"exampleFix":"// before\noptions.put(\"graal.TruffleInliningLinietski\", \"true\"); // typo'd key\n\n// after\noptions.put(\"graal.TruffleInliningLirietskiy\".toLowerCase(), \"true\"); // use the exact documented key","handlingStrategy":"validation","validationCode":"// Validate option keys against the compiler's descriptors before parsing\nfor (String key : options.keySet()) {\n    if (OPTION_DESCRIPTORS.get(key) == null) {\n        throw new IllegalArgumentException(\"Invalid option \" + key + \"; valid keys: \"\n                + OPTION_DESCRIPTORS.keySet());\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never forward arbitrary user strings into the compiler option map; filter through the known-key set first.","Re-validate your option map after every GraalVM upgrade — options get renamed or removed between releases."],"tags":["graal","truffle","options","configuration","typo"],"backgroundTag":null,"analyzedSha":"a66e9ccd1d7bf2552883939aa0788dfd0e294aab","analyzedAt":"2026-08-14T13:58:47.161Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}